Interactive data analysis method, system and equipment based on fields, indexes and labels, medium and product
By introducing interactive data analysis methods based on fields, indicators and labels in the data analysis system, the problems of complexity and efficiency of data analysis query in the prior art are solved, and a more efficient data analysis and query process is realized.
Patent Information
- Application Number
- CN202411973809.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-22
AI Technical Summary
In the prior art, when conducting data analysis and query, it is necessary to frequently switch independent systems of business subject fields, indicators and labels, resulting in defects in query convenience, complexity and efficiency.
By providing an interactive data analysis method and system based on fields, indicators and labels, the front-end acquires the source table and generates corresponding indicators and labels, determines the items to be configured and generates configuration information, and sends it to the back-end for parsing and querying statement generation, so as to determine the query result of the source table.
This method and system improve the convenience and efficiency of data analysis query, reduce the complexity of analysis query, and enable operators to complete data analysis and business query without frequent switching of the system.
Smart Images

Figure CN119862183A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data analysis technology, and in particular to an interactive data analysis method, system, device, medium and product based on fields, indicators and labels. Background Art
[0002] In daily operations, operators can use more convenient and quicker business query methods to query business data, which can greatly improve work efficiency and more quickly formulate strategies that are in line with corporate operations.
[0003] However, in general, business subject fields, indicators and labels are often independent systems. When performing data analysis and query, it is necessary to switch systems multiple times, and then generate isolated subject tables, label tables and indicator data accordingly. This method has certain defects in query convenience, complexity and efficiency. Summary of the invention
[0004] The present invention provides an interactive data analysis method, system, device, medium and product based on fields, indicators and tags, which improves the convenience and efficiency of data analysis query and reduces the complexity of analysis query.
[0005] In a first aspect, an embodiment of the present disclosure provides an interactive data analysis method based on fields, indicators and labels, which is applied to an interactive data analysis system based on fields, indicators and labels, wherein the system includes a front end and a back end, wherein the front end is connected to the back end, and the method includes:
[0006] Obtaining, through the front end, a source table consisting of at least one field, generating corresponding indicators and labels based on the source table, determining at least one of the field, the indicator and the label as a to-be-configured item, generating configuration information in response to selecting and editing the to-be-configured item, and sending the configuration information to the back end;
[0007] The configuration information is obtained through a backend, the configuration information is parsed and a query statement is generated, and a query result for the source table is determined based on the query statement.
[0008] In a second aspect, an embodiment of the present disclosure provides an interactive data analysis system based on fields, indicators, and tags, including: a front end and a back end, the front end being connected to the back end;
[0009] The front end is used to obtain a source table consisting of at least one field, generate corresponding indicators and labels based on the source table, determine at least one of the field, indicator and label as a to-be-configured item, generate configuration information in response to selection and editing of the to-be-configured item, and send the configuration information to the back end;
[0010] The backend is used to obtain the configuration information, parse the configuration information and generate a query statement, and determine a query result for the source table based on the query statement.
[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0012] at least one processor; and
[0013] a memory communicatively connected to at least one processor; wherein,
[0014] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute an interactive data analysis method based on fields, indicators and labels provided in the above-mentioned first aspect embodiment.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement an interactive data analysis method based on fields, indicators and labels provided in the embodiment of the first aspect mentioned above when executed.
[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements an interactive data analysis method based on fields, indicators and labels provided in the embodiment of the first aspect.
[0017] An interactive data analysis method, system, device, medium and product based on fields, indicators and labels of an embodiment of the present invention obtains a source table consisting of at least one field through the front end, generates corresponding indicators and labels based on the source table, determines at least one of the fields, indicators and labels as a to-be-configured item, generates configuration information in response to the selection and editing of the to-be-configured item, and sends the configuration information to the back end; obtains the configuration information through the back end, parses the configuration information and generates a query statement, and determines the query result for the source table based on the query statement. The above technical solution improves the convenience and efficiency of data analysis queries and reduces the complexity of analysis queries.
[0018] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0020] Figure 1 is a flow chart of an interactive data analysis method based on fields, indicators and labels provided in the first embodiment of the present invention;
[0021] Figure 2 is a flow chart of an interactive data analysis method based on fields, indicators and labels provided in the second embodiment of the present invention;
[0022] Figure 3 This is a creation structure diagram of a subject, an indicator and a label provided in the second embodiment of the present invention;
[0023] Figure 4 This is an application architecture diagram of an interactive data analysis system based on fields, indicators and tags provided in the second embodiment of the present invention;
[0024] Figure 5a This is an example diagram of the correspondence between the items to be configured and the target function items provided in the second embodiment of the present invention;
[0025] Figure 5b is another example diagram of the correspondence between the items to be configured and the target function items provided in the second embodiment of the present invention;
[0026] Figure 6 It is a structural diagram of an interactive data analysis system based on fields, indicators and tags provided in Embodiment 3 of the present invention;
[0027] Figure 7 It is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second" and "target" in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 It is a flowchart of an interactive data analysis method based on fields, indicators and labels provided in Example 1 of the present invention. This embodiment is applicable to the situation where unified interactive data analysis and query are performed based on fields, indicators and labels. The method can be executed by an interactive data analysis system based on fields, indicators and labels. The interactive data analysis system based on fields, indicators and labels can be implemented in the form of hardware and / or software.
[0032] like Figure 1 As shown, the method includes:
[0033] S101. Obtain, through the front end, a source table consisting of at least one field, generate corresponding indicators and labels based on the source table, determine at least one of the fields, indicators and labels as an item to be configured, generate configuration information in response to selection and editing of the item to be configured, and send the configuration information to the back end.
[0034] In this embodiment, the front end can be understood as a software / hardware module that interacts with the user through a visual interface. The source table can be understood as the original business table stored in the database, which is composed of multiple fields. The fields can represent the name, identification, time, region, business type, business content, etc. This embodiment does not limit this. The items to be configured can be understood as the information of the content to be configured at the front end, that is, the analysis basis when performing data analysis later and the query basis when querying the business. The items to be configured include at least one of the fields, indicators and labels. Configuration information can be understood as the analysis basis formed based on the items to be configured and their corresponding target function items. The back end can be understood as a software / hardware module for processing operations. A field is a basic unit of data, which is used to store a single piece of information about a specific entity. An indicator is a measurement value used to measure a specific aspect or property of data. A label is an identifier for classifying and describing a data entity.
[0035] Specifically, the front end receives a call operation for the source table, obtains the source table from the relational database based on the call operation, and generates a business subject corresponding to the target field and a subject view of the business subject in response to the selection of certain target fields in the source table, and generates corresponding indicators and labels based on the business subject. In response to selecting and dragging at least one of the fields, indicators and labels as the items to be configured, the items to be configured are correspondingly filled into each target function item in the configuration interface (query box) on the visualization interface. The fields, indicators and labels are reflected in the query box in a structured form. The target function items at least include dimensions, metrics and filters. Each target function item supports any filling of the three fields, indicators and labels, which can be a single filling or a combined filling. It can be understood that the filling of the target function item can be empty, for example, there is no filling of the items to be configured on the metric function item, but, in order to ensure the realization of data analysis and business query, the filling of at least one target function item is not empty. At this time, for the items to be configured that are selected and dragged to each target function item, content configuration is performed to form configuration information on each target function item, and the configuration information is sent to the back end. It can be understood that each target function item has its corresponding configuration parameters. The items to be configured that are selected and dragged onto the target function item must be configured based on the configuration parameters of the corresponding target function item. The configuration parameters of the measurement include at least the aggregation function, and the configuration parameters of the screening correspond to the field type. For example, when the field type is a time type, the configuration parameter is the time filter.
[0036] S102: Obtain configuration information through the backend, parse the configuration information and generate a query statement, and determine a query result for the source table based on the query statement.
[0037] In this embodiment, the query statement can be understood as a statement formed by combining the configuration information and a specific language template for querying business information based on the configuration information, and the language type of the query statement is Structured Query Language (SQL). The query result can be understood as the result obtained by querying the business based on the configuration information, and the query result is reflected in the form of a chart, such as an indicator card (the indicator card displays the value corresponding to the indicator in the configuration information), a trend chart, a bar chart, a dual-axis chart, a pie chart, a two-dimensional table, a scatter plot, and a heat map.
[0038] Specifically, the backend establishes a query object, obtains the configuration information sent by the frontend based on the query object, and parses and fills the configuration information based on the attributes of the query object, and then maps the query object again with a specific language template to form a query statement corresponding to the configuration information, executes the query statement, and generates a query result for the source table that corresponds to the configuration information.
[0039] An interactive data analysis method based on fields, indicators and labels provided by an embodiment of the present invention includes obtaining a source table consisting of at least one field through a front end, generating corresponding indicators and labels based on the source table, determining at least one of the fields, indicators and labels as a to-be-configured item, generating configuration information in response to the selection and editing of the to-be-configured item, and sending the configuration information to a back end; obtaining the configuration information through the back end, parsing the configuration information and generating a query statement, and determining the query result for the source table based on the query statement. The above technical solution enables independent fields, indicators and labels to be uniformly configured on one interface, and the corresponding data analysis and further business query can be completed without switching systems, thereby improving the convenience and efficiency of data analysis queries and reducing the complexity of analysis queries.
[0040] Embodiment 2
[0041] Figure 2 It is a flowchart of an interactive data analysis method based on fields, indicators and labels provided in Example 2 of the present invention. This embodiment is a further optimization of any of the above embodiments and is applicable to situations where unified interactive data analysis and query are performed based on fields, indicators and labels. The method can be executed by an interactive data analysis system based on fields, indicators and labels, and the interactive data analysis system based on fields, indicators and labels can be implemented in the form of hardware and / or software.
[0042] like Figure 2 As shown, the method includes:
[0043] S201. Obtain a source table consisting of at least one field through a front end.
[0044] S202: In response to selecting at least one target field in a source table, a business subject is formed, and a subject view corresponding to the business subject is determined.
[0045] In this embodiment, the target field can be understood as a field corresponding to the user's data analysis and business query needs. The source table (original business table) contains multiple fields, and there may be only three fields, namely, identification, time, and region, as target fields. The business subject can be understood as an object that integrates the target fields, and is a unified representation of the business information represented by these target fields. The subject view is a product of the business subject, and can be understood as a visual chart composed of the target fields and business information corresponding to the subject.
[0046] Specifically, the source table source_table includes multiple fields. In response to the selection of at least one target field, the business information corresponding to these target fields is determined, a business subject subject corresponding to these target fields and the business information is formed, and a subject view subject_view is formed based on these target fields and the business information. The first row of columns in the subject view is the selected target fields column1, column2, column3, etc. It can be understood that in the process of forming the business subject, the editing operation of the Chinese name and description information of the target field can also be included.
[0047] For example, Figure 3 This is a structure diagram of creating a subject, an indicator, and a label provided by the second embodiment of the present invention, such as Figure 3 As shown, the source table includes four fields, namely, identification (T_ID), interaction volume (T_VOLUME), time (T_TIME) and region (AREA). The identification (T_ID), time (T_TIME) and region (AREA) are taken from the source table as target fields, and the business information corresponding to these target fields in the source table is determined, which includes four business information in total. Based on the target fields and their corresponding business information, a business subject subject1 is formed, and a subject view corresponding to subject1 is formed. It can be understood that the above are all exemplary descriptions, and the source table may contain a large number of fields, and there may be multiple target fields, and there may also be multiple business information volumes corresponding to the target fields, which are not limited to the above example descriptions.
[0048] Optionally, in response to selecting at least one target field in the source table, forming a business subject includes:
[0049] In response to selecting at least one target field in the source table, metadata information of the target field is determined, and a business subject is formed according to the metadata information.
[0050] In this embodiment, the metadata information includes name, field type, etc.
[0051] Specifically, first establish a connection with the relational database, then connect to the source table, collect metadata information of the source table, that is, metadata information of each field in the source table, and then, in response to the user's selection operation on at least one target field in the source table, create a business entity based on the field type in the metadata information of the target field, where the field type includes a string type, a time type, and a numeric type, for example, the identification field is a numeric type field, the time field is a time type field, and the region is a string type field.
[0052] Figure 4is an application architecture diagram of an interactive data analysis system based on fields, indicators and tags provided in the second embodiment of the present invention. Figure 4 The architecture provided can be understood as a concrete implementation of an interactive data analysis system based on fields, indicators, and tags, such as Figure 4 As shown, the business subject module, indicator module and label module belong to the front end. The business subject module is used to generate business subjects, the indicator module is used to generate indicators, the label module is used to generate labels, and the data analysis module belongs to the back end. Both the front end and the back end are connected to the data warehouse module and the business library module. The data warehouse module is the relational database accessed when obtaining the source table. The business library module is a database for storing business log information generated during data analysis and business query. After completing the creation of the business subject and forming the corresponding subject view, the above metadata information is stored in the business library. The subject view can be stored in the data warehouse or the business library in response to user needs. The above business subject processing steps can be considered as follows: Figure 4 The business subject module execution in the architecture shown specifically includes the collection of metadata, the preservation of metadata and the preservation of subject views.
[0053] S203. Generate corresponding indicators and labels according to the business subjects, and obtain an indicator query statement view corresponding to the indicator and a label result table corresponding to the label.
[0054] In this embodiment, the indicator query statement view can be understood as the product of the indicator, representing the summary of the business volume, that is, count (T_ID). The tag result table can be understood as the product of the tag, representing the filtering results obtained by filtering by tag in the business subject.
[0055] Specifically, an indicator index is generated according to the business subject, and a corresponding indicator query statement view is formed, such as Figure 3 As shown in the figure, the count (T_ID) corresponding to the business subject is 4, and the interface presented by its indicator query statement view is 4. The tag tag representing the filter subject condition is generated according to the business subject, and the tag result table t_tag_result corresponding to the filter subject condition is obtained, as shown in the figure. Figure 3 As shown in the figure, when the label is "October 10, 2024 evening", the time (T_TIME) field corresponding to the business subject shows that the business information with identification (T_ID) 1-3 does not meet the time, and its label is 0, while the business information with identification (T_ID) 4 meets the time, and its label is 1. Save the generated indicators and labels to Figure 4 In the business library shown in the figure, save the label result table to Figure 4 In the data warehouse shown.
[0056] The above processing steps for indicators can be considered as follows: Figure 4 The indicator module in the architecture shown in FIG. 1 is used to configure, save and publish indicators. The above steps of label processing can be considered as follows: Figure 4 The tag module in the illustrated architecture is used to configure tags, save tags, create and save tag result tables, and publish tags. The steps of publishing indicators and tags are based on the selection and dragging of the items to be configured in step S204.
[0057] S204. Determine at least one of the fields, indicators and labels as a to-be-configured item, and in response to the operation of selecting the to-be-configured item as a target function item on the configuration interface, determine a correspondence between the to-be-configured item and the target function item, wherein the target function item includes at least dimension, metric and filter.
[0058] In this embodiment, the target function item can be understood as the function to which the item to be configured belongs. If the item to be configured is the analyzed data, the target function item is the item to be analyzed of the analyzed data. The target function item includes at least dimension, measurement and filter. Among them, dimension is a category-type function item used to describe different aspects or attributes of data, which is the basis for classifying and grouping data in data analysis; measurement is a numerical function item used to quantify a specific aspect, which is an indicator used to measure and evaluate data in data analysis; and filter is a condition or standard used to limit the scope of data in the data analysis process.
[0059] Specifically, fields, indicators and labels are visually displayed on the configuration interface. The configuration interface also includes a query box, in which a target function item is set. In response to the operation of selecting at least one of the fields (column1, column2, column3), indicators (index) and labels (tag) on the configuration interface as the item to be configured, and dragging the item to be configured to the target function item in the query box on the configuration interface, a correspondence between the item to be configured and the target function item is obtained.
[0060] Figure 5a is an example diagram of the correspondence between the items to be configured and the target function items provided in the second embodiment of the present invention, such as Figure 5a As shown, only the fields are taken as items to be configured, the region field is selected and dragged to the dimension target function item, the identification field is selected and dragged to the measurement target function item, and the time field is selected and dragged to the filter target function item. The corresponding relationship between each target field as the item to be configured and the target function item is obtained, that is, the dimension-region field, the measurement-identification field, and the filter-time field.
[0061] Figure 5bThis is another example diagram of the correspondence between the items to be configured and the target function items provided in the second embodiment of the present invention. As shown in Figure b, the fields, indicators and labels are all selected as the items to be configured, the regional fields and indicators are selected and dragged to the dimension target function items, and the labels are selected and dragged to the screening target function items to obtain the correspondence between the target fields as the items to be configured and the target function items, that is, dimension-regional fields, dimension-indicators, and screening-labels. Figure 5a The configuration method shown is a commonly used configuration method in the industry, which only configures the target function items based on the fields. Figure 5b The method shown in the figure adds indicators and tags, and configures the target function items based on fields, indicators and tags. Compared with Figure 5a The method shown adds more diverse and richer configuration methods and can be applied to more diverse scenarios.
[0062] Among them, fields, indicators and labels are all configured in a structured format.
[0063] S205 . In response to the editing operation on the item to be configured, determine configuration information of the item to be configured based on the corresponding relationship between the item to be configured and the target function item, and send the configuration information to the backend.
[0064] In this embodiment, based on the correspondence between the items to be configured and the target function items, in response to the editing operation of the items to be configured on each target function item, the configuration information of each item to be configured on each target function item is obtained, and in response to the triggering of the "View SQL" control in the query box, the configuration information is sent to the back end via HyperText Transfer Protocol (HTTP). For each item to be configured on the dimension target function item, the field sorting setting can be performed based on the configuration parameters of the dimension target function item, for each item to be configured on the measurement target function item, the sorting setting, aggregation function setting and quantity setting can be performed based on the configuration parameters of the measurement target function item, and for each item to be configured on the screening target function item, the time function, list screening and condition screening can be performed based on the configuration parameters of the screening target function item.
[0065] Taking field 1, label 1 and metric 1 as dimensions, field 2 as metrics and field 3 as filters as an example, the configuration expressions for dimension, metric and filter are:
[0066] {
[0067] "dimensionConfig":["column1","tag1","index1"],
[0068] "metricConfig":["column2"],
[0069] "filterConfig":["column3"]
[0070] }. dimensionConfig, metricConfig and filterConfig are respectively a dimension array, a metric array and a filter array, which are used to store the configuration information of the items to be configured on each target function item. The configuration information is obtained based on the configuration parameters of the target function item. The configuration parameters of the metricConfig at least include the aggregation function. The configuration parameters of the filterConfig can be set to time filtering and conditional filtering based on different field types.
[0071] The attributes of each element (to be configured) of the dimension array include the field name code, field alias alias, type of the queried field (this type is different from the field type, indicating whether the queried field is a label, indicator or field) type, etc. Each element in the dimension array can clearly express each drag and drop element in the dimension target function item;
[0072] The attribute of each element (to be configured) of the metric array has one more aggregation attribute than the dimension array, which indicates the aggregation function used by the current field. Each element in the metric array can clearly express each dragged element in the metric target function item;
[0073] The properties of each element (to be configured) of the filter array have one more conditional property expressionModelList compared to the dimension array, which includes the filtering conditions of the field and the aggregation conditions of the field.
[0074] S206. Construct a first query object through the backend and obtain configuration information through the first query object. Map the configuration information according to the attributes of the first query object to obtain a mapped first query object, wherein the first query object is an object based on a domain specific language DSL.
[0075] In this embodiment, the first query object can be understood as a query model constructed based on a domain-specific language (DSL), such as a QueryModel object, wherein the attributes of the first query object include at least a query field, a filter condition, a maximum return number, and a sorting field.
[0076] Specifically, the backend constructs a first query object, receives the configuration information in a structured format sent by the frontend through the first query object, and then verifies the configuration information. If the verification passes, the configuration information is mapped according to the attributes of the first query object for subsequent DSL conversion.
[0077] The attributes of the first query object include query fields, filter conditions (and aggregation conditions) where, maximum return number limit, and sorting fields orders.
[0078] The query field attribute fields corresponds to the configuration information of dimensions and metrics. Dimensions are reflected in the query result interface in the form of columns, and metrics are reflected in the query result interface in the form of rows. The configuration information of dimensions and metrics includes attributes such as field type type, field alias alias, and the sorting index of the field in the row and column configuration.
[0079] The filter condition attribute where corresponds to the filter condition on the query result interface, including the filter condition fields for fields, the filter condition tags for labels, and the filter condition metrics for indicators. Fields, tags, and metrics all have the same attributes type and expression. Type is the field type of the current filter condition, which is used to distinguish between labels, indicators, and fields. Expression represents the set of expressions for the field filter condition, including the expression.type and expression.name attributes. The expression.type attribute represents the type of expression, including OPERATION and RELATION values. OPERATION represents the operation operator, such as ">", "=", and "<" in SQL filter conditions. RELATION represents the relationship between expressions, including AND or OR. Expression.name represents the name of the field, label, or indicator.
[0080] The maximum return number attribute limit corresponds to the number of items displayed on the query result interface, and is set to 1000 based on experience.
[0081] Among them, the sorting field attribute orders corresponds to the sorting result of the field in the query result interface, including type type, sorting method order and sorting weight index. Among them, type type is used to represent whether it is a field, indicator or label, sorting methods include ascending (Ascending, ASC) and descending (Descending, DESC), and sorting weight is used to represent the priority of sorting.
[0082] S207: Generate a second query object according to the first query object, where the second query object is an object based on the structured query language SQL in the domain specific language DSL.
[0083] In this embodiment, the second query object can be understood as a query model constructed based on the structured query language SQL, such as a Query object.
[0084] Specifically, based on the generated first query object QueryModel, a Query object in DSL is further generated. The Query object is the smallest object unit for generating the final SQL statement, which is more convenient for subsequent mapping of SQL-based query statements. Among them, the attributes of the second query object include at least query fields, filter conditions where, maximum return number limit (that is, the number of rows of query data) and sorting fields (sorting rules) orderFields. In addition to the first query, it also includes the tables used in the query, the association between the tables and the association conditions join, the aggregate fields groupByFields, the aggregate conditions having and the start number skip.
[0085] S208: Perform template mapping based on the attributes of the second query object to form an SQL query statement, execute the SQL query statement, and obtain a query result.
[0086] In this embodiment, mapping is performed based on the attributes of the second query object and a preset SQL statement template to form an SQL query statement corresponding to the configuration information, and the query statement is executed to obtain a query result, which is presented in the form of a chart.
[0087] Among them, for the query field fields in the second query object attribute, it identifies the query field in the final SQL, and the fields attribute is mapped based on the type of the field to be queried. First, it is determined whether the field currently queried is a main field, a label or an indicator. If it is a mapping of the main field, it is necessary to process the time type, aggregation function and field alias; if it is a label field, it is necessary to process the aggregation function and use the conditional expression case when to splice the label field; if it is an indicator type, it is necessary to process the aggregation field. The table fields in the second query object attribute are the main view of the query, and the alias of the query table is "st". The aggregation field groupByFields in the second query object attribute has the judgment condition that the target function item corresponding to the current field is a dimension, and the current field is not an indicator field or the current field is a non-aggregated indicator field. The filtering condition where in the second query object attribute is the conditional filtering field, and the aggregation condition having is the aggregation filtering field. If the indicator is used as the filtering condition, its configuration information is placed in the having field. If the indicator is not used as the filtering condition, its configuration information is placed in the where field. The skip field in the second query object attributes is the starting number of the result set, and the limit field is the total number of returned items. They are directly mapped from the first query object. According to experience, skip is 0.
[0088] Based on the above attribute information, all the attributes that are spelled into the final SQL query statement are constructed. Through the chain of responsibility, the query method query in the DSL parser (parse) is called to generate the final SQL query statement, and the query statement is executed to obtain the query result, which is presented in the form of a chart.
[0089] The above processing steps performed by the backend can be considered as Figure 4 The data analysis module (equivalent to the backend) in the architecture shown is executed, and the data analysis module is used for page configuration (that is, configuration of the query result interface based on the attributes of the first query object), DSL_model layer receiving configuration (that is, receiving and mapping the configuration information transmitted by the front end through the first query object) and DSL_parse layer converting SQL (that is, mapping SQL query statements through the attributes of the second query object).
[0090] An interactive data analysis method based on fields, indicators and labels provided by an embodiment of the present invention comprises obtaining a source table consisting of at least one field through a front end; in response to selecting at least one target field in the source table, forming a business subject and determining a subject view corresponding to the business subject; generating corresponding indicators and labels according to the business subject, and obtaining an indicator query statement view corresponding to the indicator and a label result table corresponding to the label; determining at least one of the fields, indicators and labels as a to-be-configured item, and in response to selecting the to-be-configured item as a target function item on a configuration interface, determining a corresponding relationship between the to-be-configured item and the target function item, wherein the target function item at least includes dimensions, metrics and filters; In response to the editing operation of the configuration item, the configuration information of the configuration item to be configured is determined based on the corresponding relationship between the configuration item and the target function item, and the configuration information is sent to the back end; through the back end, a first query object is constructed and the configuration information is obtained through the first query object, and the configuration information is mapped according to the attributes of the first query object to obtain the mapped first query object, wherein the first query object is an object based on the domain specific language DSL; a second query object is generated according to the first query object, and the second query object is an object based on the structured query language SQL in the domain specific language DSL; a template mapping is performed based on the attributes of the second query object to form an SQL query statement, and the SQL query statement is executed to obtain the query result. The above technical solution adopts a same binding, provides a unified data analysis method, and can effectively adapt to different data sources; integrates the main fields, indicators and labels on the page, and the operator does not need to switch to an independent system in the scenario where the operator is not familiar with the SQL language, and converts the fields, indicators and labels configured on the page into executable SQL statements, which can greatly improve the work efficiency of the operator and has good practicality; the application of indicators and labels further enriches the configuration method and usage scenarios of business data.
[0091] Embodiment 3
[0092] Figure 6 Schematic diagram of the structure of an interactive data analysis system based on fields, indicators and tags provided by the third embodiment of the present invention. Figure 6 As shown, the system includes: a front end 31 and a rear end 32, wherein the front end 31 is connected to the rear end 32;
[0093] The front end 31 is used to obtain a source table consisting of at least one field, generate corresponding indicators and labels based on the source table, determine at least one of the field, indicator and label as a to-be-configured item, generate configuration information in response to selecting and editing the to-be-configured item, and send the configuration information to the back end 32;
[0094] The backend 32 is used to obtain the configuration information, parse the configuration information and generate a query statement, and determine a query result for the source table based on the query statement.
[0095] The interactive data analysis system based on fields, indicators and tags adopted in this technical solution improves the convenience and efficiency of data analysis queries and reduces the complexity of analysis queries.
[0096] Optionally, the front end 31 includes:
[0097] A business subject determination unit, configured to form a business subject in response to selecting at least one target field in the source table, and determine a subject view corresponding to the business subject;
[0098] The indicator and label determination unit is used to generate corresponding indicators and labels according to the business subjects, and obtain an indicator query statement view corresponding to the indicator and a label result table corresponding to the label.
[0099] Optionally, the business subject determination unit is used to:
[0100] In response to selecting at least one target field in the source table, metadata information of the target field is determined, and a business subject is formed according to the metadata information.
[0101] The optional front end 31 is specifically used for:
[0102] In response to the operation of selecting the item to be configured as a target function item on the configuration interface, determining a corresponding relationship between the item to be configured and the target function item, wherein the target function item at least includes a dimension, a measure, and a filter;
[0103] In response to an editing operation on the item to be configured, configuration information of the item to be configured is determined based on a corresponding relationship between the item to be configured and the target function item.
[0104] Optionally, the back end 32 is used to:
[0105] Constructing a first query object and obtaining the configuration information through the first query object, mapping the configuration information according to the attributes of the first query object to obtain a mapped first query object, wherein the first query object is an object based on a domain specific language DSL;
[0106] Generate a second query object according to the first query object, where the second query object is an object based on a structured query language SQL in a domain specific language DSL;
[0107] Perform template mapping based on the attributes of the second query object to form an SQL query statement, execute the SQL query statement, and obtain a query result.
[0108] Optionally, the attributes of the first query object and the second query object include at least a query field, a filter condition, a maximum return number, and a sorting field.
[0109] The interactive data analysis system based on fields, indicators and labels provided in the embodiment of the present invention can execute the interactive data analysis method based on fields, indicators and labels provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] Embodiment 4
[0111] Figure 7 : is a structural schematic diagram of an electronic device provided in Embodiment 4 of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0112] like Figure 7 As shown, the electronic device 40 includes at least one processor 41, and a memory connected to the at least one processor 41, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 to the random access memory (RAM) 43. In the RAM 43, various programs and data required for the operation of the electronic device 40 can also be stored. The processor 41, the ROM 42, and the RAM 43 are connected to each other through a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0113] A number of components in the electronic device 40 are connected to the I / O interface 45, including: an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The processor 41 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special 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 41 executes the various methods and processes described above, such as an interactive data analysis method based on fields, indicators, and tags.
[0115] In some embodiments, an interactive data analysis method based on fields, indicators and tags may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 48. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 40 via the ROM 42 and / or the communication unit 49. When the computer program is loaded into the RAM 43 and executed by the processor 41, one or more steps of the interactive data analysis method based on fields, indicators and tags described above may be performed. Alternatively, in other embodiments, the processor 41 may be configured to perform an interactive data analysis method based on fields, indicators and tags by any other appropriate means (e.g., by means of firmware).
[0116] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0117] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0118] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0119] To provide interaction with a user, the systems and techniques described herein may 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 trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0120] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may 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.
[0121] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may 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 difficult management and weak business scalability in traditional physical hosts and VPS services.
[0122] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0123] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An interactive data analysis method based on fields, indicators and labels, characterized in that: Applied to an interactive data analysis system based on fields, indicators and labels, the system includes a front end and a back end, the front end is connected to the back end, and the method includes: Obtaining, through the front end, a source table consisting of at least one field, generating corresponding indicators and labels based on the source table, determining at least one of the field, the indicator and the label as a to-be-configured item, generating configuration information in response to selecting and editing the to-be-configured item, and sending the configuration information to the back end; The configuration information is obtained through a backend, the configuration information is parsed and a query statement is generated, and a query result for the source table is determined based on the query statement.
2. The method according to claim 1, characterized in that: The generating corresponding indicators and labels based on the source table includes: In response to selecting at least one target field in the source table, forming a business subject, and determining a subject view corresponding to the business subject; Corresponding indicators and labels are generated respectively according to the business subjects, and an indicator query statement view corresponding to the indicator and a label result table corresponding to the label are obtained.
3. The method according to claim 2, characterized in that The forming of a business subject in response to selecting at least one target field in the source table includes: In response to selecting at least one target field in the source table, metadata information of the target field is determined, and a business subject is formed according to the metadata information.
4. The method according to claim 1, characterized in that: The generating of configuration information in response to the selection and editing of the to-be-configured item includes: In response to the operation of selecting the item to be configured as a target function item on the configuration interface, determining a corresponding relationship between the item to be configured and the target function item, wherein the target function item at least includes a dimension, a measure, and a filter; In response to an editing operation on the item to be configured, configuration information of the item to be configured is determined based on a corresponding relationship between the item to be configured and the target function item.
5. The method according to claim 1, characterized in that The obtaining of the configuration information, parsing the configuration information and generating a query statement, and determining a query result for the source table based on the query statement, includes: Constructing a first query object and obtaining the configuration information through the first query object, mapping the configuration information according to the attributes of the first query object to obtain a mapped first query object, wherein the first query object is an object based on a domain specific language DSL; Generate a second query object according to the first query object, where the second query object is an object based on a structured query language SQL in a domain specific language DSL; Perform template mapping based on the attributes of the second query object to form an SQL query statement, execute the SQL query statement, and obtain a query result.
6. The method according to claim 5, characterized in that The attributes of the first query object and the second query object at least include a query field, a filtering condition, a maximum return number, and a sorting field.
7. An interactive data analysis system based on fields, indicators and tags, characterized in that: include: a front end and a back end, the front end being connected to the back end; The front end is used to obtain a source table consisting of at least one field, generate corresponding indicators and labels based on the source table, determine at least one of the field, indicator and label as a to-be-configured item, generate configuration information in response to selection and editing of the to-be-configured item, and send the configuration information to the back end; The backend is used to obtain the configuration information, parse the configuration information and generate a query statement, and determine a query result for the source table based on the query statement.
8. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute an interactive data analysis method based on fields, indicators and labels as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement an interactive data analysis method based on fields, indicators and labels as described in any one of claims 1-6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements an interactive data analysis method based on fields, indicators and tags according to any one of claims 1 to 6.