Data processing method and device, medium, equipment and product
By generating SQL code to reference configured metrics, the problem of high metric calculation complexity is solved, and metric configuration is simplified and utilization is improved.
Patent Information
- Application Number
- CN202511786688.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-27
AI Technical Summary
Existing technologies cannot effectively meet the diverse indicator processing needs of the business side, and the indicator calculation methods are complex and the development efficiency is low.
By obtaining the configuration information of the target metric, SQL code is generated to obtain the metric data. It allows referencing pre-configured metrics, reduces the amount of code and the complexity of nested logic, and supports direct configuration of grouping dimensions.
It reduces the complexity of indicator configuration, improves the utilization rate of configured indicators, and meets the data statistics needs of the business side.
Smart Images

Figure CN121579564A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, in particular, to a data processing method, device, medium, equipment and product. BACKGROUND
[0002] With the increase of data volume, more and more indicators need to be calculated. The indicators can be variables related to business that need to be counted, such as sales volume, completion rate, etc. The statistical requirements of the business side are various, and the indicators need to be changed or added according to the changes of the statistical requirements of the business side. For example, the business side needs to count new data such as sales, and needs to set corresponding indicators to obtain the data of sales. The indicator processing method in the related art cannot usually meet the requirements of the business side. SUMMARY
[0003] This summary is provided to introduce a selection of concepts, which are further described below in the detailed description. This summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be used in limiting the scope of the claimed subject matter.
[0004] In a first aspect, the present disclosure provides a data processing method, comprising: obtaining first configuration information and second configuration information of a target indicator, the first configuration information of an indicator being used to indicate the calculation logic and / or data retrieval logic of the indicator, and the second configuration information of the indicator including the dimension for grouping the data of the indicator; if the first configuration information of the target indicator indicates a first indicator other than the target indicator, generating target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator; obtaining the data of the target indicator through the target SQL code.
[0005] In a second aspect, the present disclosure provides a data processing device, comprising: a first obtaining module, configured to obtain first configuration information and second configuration information of a target indicator, the first configuration information of an indicator being used to indicate the calculation logic and / or data retrieval logic of the indicator, and the second configuration information of the indicator including the dimension for grouping the data of the indicator; a first code generating module, configured to, if the first configuration information of the target indicator indicates a first indicator other than the target indicator, generate target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first other indicator; An obtaining module is configured to obtain data of the target indicator through the target SQL code.
[0006] In a third aspect, the present disclosure provides a computer readable medium, having stored thereon a computer program, which, when executed by a processing apparatus, implements the steps of the data processing method according to the first aspect of the present disclosure.
[0007] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device having stored thereon a computer program; a processing apparatus configured to execute the computer program in the storage device to implement the steps of the data processing method according to the first aspect of the present disclosure.
[0008] In a fifth aspect, the present disclosure provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the data processing method according to the first aspect of the present disclosure.
[0009] According to the above technical solution, when configuring the calculation logic of the target indicator, the first indicator that has been configured can be referenced, and the calculation logic and / or the data obtaining logic of the referenced first indicator do not need to be given again, the amount of code required is less, the user does not need to write complex nested logic, the complexity of indicator configuration is reduced, and the utilization rate of the configured indicator is improved. The second configuration information of the indicator includes a dimension for grouping data of the indicator, so that the user can directly configure the dimension for grouping the data of the indicator, without the user needing to additionally write a GROUP BY statement, further reducing the complexity of indicator configuration, to meet the needs of the business side for data statistics.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0011] The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings in which: Figure 1 is a schematic diagram of an exemplary provided indicator configuration page.
[0012] Figure 2 is a flowchart of a data processing method according to an exemplary embodiment.
[0013] Figure 3 is a block diagram of a data processing apparatus according to an exemplary embodiment.
[0014] Figure 4 A structural diagram of an electronic device suitable for implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail with reference to the drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be thorough and complete, and fully convey the scope of the present disclosure to those skilled in the art.
[0016] It should be understood that each step recited in the method embodiments of the present disclosure can be executed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the execution of the steps shown. The scope of the present disclosure is not limited in this respect.
[0017] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related definitions will be given in the description below.
[0018] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.
[0019] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that "one or more" should be understood unless otherwise explicitly indicated in the context.
[0020] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are merely for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0021] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type of personal information involved in the present disclosure, the scope of use, the use scenario, etc. should be informed to the user and the authorization of the user should be obtained in accordance with relevant laws and regulations.
[0022] For example, in response to receiving an active request of a user, a prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed by the user will need to acquire and use personal information of the user. Thus, the user can autonomously select whether to provide the personal information to the software or hardware, such as an electronic device, an application program, a server or a storage medium, performing the operation of the technical solution of the present disclosure according to the prompt information.
[0023] As an optional but non-limiting implementation, in response to receiving an active request of a user, the prompt information can be sent to the user in the form of a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to select "agree" or "disagree" to provide the personal information to the electronic device.
[0024] It can be understood that the above notification and acquisition of user authorization process is only illustrative and does not limit the implementation of the present disclosure, and other ways that meet the relevant laws and regulations can also be applied to the implementation of the present disclosure.
[0025] At the same time, it can be understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and the relevant provisions.
[0026] The reason why the index processing method in the related art cannot meet the needs of the business side is explained. The calculation method of some indexes is relatively complex, involving complex nested logic, and the complexity of index development and index definition is high. Index definition can be understood as the definition of the calculation logic or calculation method of the index. Moreover, taking the completion rate as an example, the completion rate needs to be obtained according to the ratio of the actual total amount to the target expected quantity. Even if the actual total amount has been defined as an index, in the related art, the complete calculation method of the actual total amount needs to be given when defining the completion rate, which brings complexity to the definition of the completion rate index, and the efficiency of index development is low.
[0027] The present disclosure provides a data processing method, device, medium, equipment and product, which reduces the complexity of index configuration, improves the utilization rate of indexes, and meets the needs of the business side for data statistics.
[0028] First, an embodiment of the data processing method of the present disclosure is introduced.
[0029] Figure 1 is a schematic diagram of an example provided index configuration page. As Figure 1 shown, the index configuration page 11 can include a region 101, a region 102, a region 103 and a region 104.
[0030] Firstly, the regions 101 to 103 are introduced. The region 101 can be used for the user to configure the basic information of the index, which can include the index name, and the basic information can also include index description information, index type and other information not shown in the figure.
[0031] The region 102 can be used for the user to configure the index formula, which can be used to indicate the calculation logic and / or data retrieval logic of the index, and the index formula can be in the form of code.
[0032] The region 103 can be used for the user to configure the dimensions associated with the index. For example, the dimensions associated with the index can include the date dimension and the dimension for grouping the data of the index. The date dimension can represent the logic of filtering the data by time, for example, if the date dimension selects the current day, the data filtering by time is performed by the date of the current day, and if the user selects a specific date, the data filtering is performed by the date. The grouping dimension can represent the dimension for grouping the data in SQL (Structured Query Language), such as the aggregation dimension for GROUP BY. As shown in the figure, in the present disclosure, the recommended dimensions such as dim1, dim2, dim3 and dim4 can be provided to the user in the region 103, and the user can select the dimension to be grouped from the recommended dimensions, without the need for the user to write the GROUP BY statement in the index formula. Figure 1
[0033] The index configuration page is a page displayed by the terminal, and the user configures the index on the index configuration page through the terminal. The index management platform in the back end can receive the configuration information of the index.
[0034] Taking the index with the name "Live Advertising Consumption of the Day" as an example, the configured index formula (hereinafter referred to as code 1) can be: CAST(cost AS decimal(38,15)) AS cost Wherein, CAST() is a type conversion function in SQL, and decimal() is a data type in SQL for storing precise fixed-point number values. AS is a keyword AS in SQL. The first cost can represent the cost field in the data table db.table_cost. Hereinafter, the "name" represents the corresponding index.
[0035] For "Live Advertising Consumption of the Day", the date dimension configured by the user can be the current day. The recommended dimensions in the region 103 can include the dimensions in the data table db.table_cost that support grouping, and the user can select the grouping dimension from the recommended dimensions, for example, the grouping dimension selected by the user can include dim1, dim2 and dim3.
[0036] Since SQL statements are required to retrieve or calculate indicator data from data tables, the indicator management platform can convert indicator formulas and associated dimensions into SQL code for the indicators. This SQL code is then used to query the indicator data from the data tables.
[0037] For "Daily Live Streaming Ad Spending", the metric management platform can generate the corresponding SQL code (hereinafter referred to as SQL code 1) based on code 1, the date dimension and grouping dimension of the metric. SQL code 1 can be shown as follows: SELECT CAST(cost AS decimal(38,15)) AS cost, -- Daily live stream advertising cost diml AS dim1, dim2 AS dim2, dim3 AS dim3 FROM db.table_cost WHERE date ='XX' Where XX represents an omitted date.
[0038] SQL code 1 can be used to retrieve the "Daily Live Streaming Ad Consumption" data from the table db.table_cost. This data includes daily live streaming ad consumption statistics grouped by dimensions dim1, dim2, and dim3. Since retrieving the "Daily Live Streaming Ad Consumption" data does not involve aggregation calculations (such as summation, counting, etc.), SQL code 1 does not include a GROUP BY clause according to SQL syntax. The grouping dimensions dim1, dim2, and dim3 can be selected by the user to retrieve data from the db.table_cost table, as well as the data grouped according to these dimensions.
[0039] The generation of SQL code 1 can be achieved using a syntax parser from relevant technologies. This parser analyzes code 1, along with the date and grouping dimensions of the metric, and converts the parser into SQL code that conforms to SQL syntax rules. The generation of SQL code corresponding to the metric levels described below follows the same principle. For example, an Antlr4 (Another Tool for Language Recognition) can be used as the syntax parser.
[0040] Taking the metric named "Whether the live stream was valid on the current day" as an example, the configured metric formula (hereinafter referred to as Code 2) can be: IF(ROUND([Daily Live Ad Spending],2)>=1000,1,0) ROUND() is a numerical rounding function in SQL, which is used to round the specified numerical value according to the set number of decimal places. IF is a logical operator in SQL for conditional judgment.
[0041] In the code 2, the square brackets [Daily live broadcast ad consumption] represent the reference to the index "Daily live broadcast ad consumption" which has been configured. In this way, in the present disclosure, when setting the index formula, the other index which has been configured can be referenced, and the complete calculation logic and / or data retrieval logic of the referenced index do not need to be given, thereby reducing the amount of code required, reducing the complexity of index configuration, and improving the utilization rate of the configured index.
[0042] It should be noted that the square brackets in the embodiments of the present disclosure represent the reference to the index, and the reference to the index is performed by the index name, which is only exemplary. The symbol of the reference to the index is not limited, and the reference to the index can also be performed by the index ID. When the reference is performed by the index name, the index name can be used as the identification information of the index.
[0043] In addition, the area 102 can also display supported aggregation functions and logical operators. The aggregation functions include, for example, SUM (sum), COUNT (count), COUNT DISTINCT (de-duplication count), AVG (average), NVL (null replacement), etc. The logical operators include, for example, IF, CASE WHEN (for conditional judgment), etc.
[0044] For "whether the current day is a valid live broadcast", the date dimension configured by the user can be the current day. Since "whether the current day is a valid live broadcast" references "Daily live broadcast ad consumption", the recommended dimensions in the area 103 can include the grouping dimensions of the referenced "Daily live broadcast ad consumption". The user can select the grouping dimensions from the recommended dimensions. For example, the grouping dimensions selected by the user include dim1, dim2 and dim3.
[0045] For "whether the current day is a valid live broadcast", the index management platform can generate the SQL code 2 corresponding to "whether the current day is a valid live broadcast" according to the code 2, the date dimension and the grouping dimension of "whether the current day is a valid live broadcast", and the date dimension and the grouping dimension of the code 1 and "Daily live broadcast ad consumption". The SQL code 2 can be as follows: SELECT CAST(IF((ROUND(cost,2))>=(1000),1,0) AS bigint) AS is_valid live,--whether the current day is a valid live broadcast diml AS diml, dim2 AS dim2, dim3 AS dim3 FROM (SELECT CAST(cost As decimal(38,15)) AS cost, -- Daily live stream advertising cost diml AS dim1, dim2 AS dim2, dim3 AS dim3 FROM db.table_cost WHERE date ='XX' AS extend_111_view Here, `bigint` is an integer type in SQL. `111` represents the metric ID for "Daily Live Streaming Ad Consumption". `extend_111_view` represents the query view for the metric "Daily Live Streaming Ad Consumption".
[0046] Since obtaining the data on "whether the day is a valid live stream" does not involve aggregation calculations, there is no GROUP BY statement in SQL code 2. The grouping dimensions dim1, dim2, and dim3 can be used as the user's selection of which dimensions of data to obtain and how the data is grouped according to these dimensions.
[0047] SQL code 2 can be used to retrieve data on "whether the live stream was valid on the current day" from the data table db.table_cost. This data includes statistics on whether the live stream was valid on the current day, grouped by dimensions dim1, dim2, and dim3.
[0048] This section describes how SQL code 2 is generated. "Whether the day was a valid live stream" directly references "Daily live stream ad spending." As shown in code 1, "Daily live stream ad spending" does not reference other metrics; therefore, "Whether the day was a valid live stream" is the highest-level metric, and "Daily live stream ad spending" is the next-level metric. "Daily live stream ad spending" is also the lowest-level metric. Code 1 indicates that "Daily live stream ad spending" depends on the field `cost`, and the data table associated with this `cost` field is `db.table_cost`.
[0049] Based on Code 1 and the date and group dimensions of "Daily Live Streaming Ad Consumption", the corresponding SQL code for the metric level of "Daily Live Streaming Ad Consumption" can be generated, as shown in SQL Code 1.
[0050] The following code snippet in SQL Code 2 is obtained based on the data retrieval logic for "whether the day is a valid live stream" (i.e., Code 2) and the grouping dimension: SELECT CAST(IF((ROUND(cost,2))>=(1000),1,0) AS bigint) AS is_valid live,--Whether the day is a valid live stream diml AS diml, dim2 AS dim2, dim3 AS dim3 FROM The SQL code corresponding to the "whether the day is a valid live broadcast" indicator (i.e., SQL code 2) is obtained by concatenating SQL code 1.
[0051] It should be noted that although SQL code 2 contains the complete SQL code 1, SQL code 1 here is also generated based on the metric formula of "daily live broadcast advertising consumption" and related dimensions.
[0052] In this disclosure, the indicator management platform can store the configuration information of each indicator. In response to receiving a calculation request for an indicator, it generates the corresponding SQL code based on the indicator's configuration information to obtain the indicator's data through the SQL code. That is, the indicator's SQL code can be generated in real time when a calculation request is received, without the need to pre-store the indicator's SQL code. This is because, for example, if the information in the data table or the information in the fields change, the SQL code needs to be updated accordingly, and pre-storing the SQL code would increase the overhead of the update.
[0053] In related technologies, the required configuration code for the metric "Daily Live Streaming Ad Consumption" is shown in SQL code 1. In this disclosure, the required configuration code for the metric "Daily Live Streaming Ad Consumption" is also shown in code 1. Similarly, in related technologies, the required configuration code for the metric "Whether the Day is a Valid Live Stream" is shown in SQL code 2, requiring a complete data retrieval logic for "Daily Live Streaming Ad Consumption." In this disclosure, the required configuration code for the metric "Whether the Day is a Valid Live Stream" is shown in code 2, allowing for the referencing of "Daily Live Streaming Ad Consumption." This demonstrates that this disclosure requires less code for metric configuration, has a higher utilization rate of the configured metrics, and only requires selecting the grouping dimension on the metric configuration page, eliminating the need to write statements for dimension selection (such as the statement `dim1 AS dim1` for selecting dim1 and grouping data by dim1).
[0054] Taking the indicator named "Performance Attribution Date" as an example, the configured indicator formula (hereinafter referred to as Code 3) can be: attribution_date where attribution_date is a field in the data table db.table_date. Code 3 can represent the data retrieval logic of "Performance Attribution Date", i.e., selecting the data of field attribution_date from the data table db.table_date.
[0055] For "Performance Attribution Date", the recommended dimensions in the area 103 can include the dimensions in the data table db.table_date that support grouping without selecting the date dimension, and the user can select the grouping dimensions from the recommended dimensions, e.g., the user-selected grouping dimensions can include dim1, dim2, dim3 and dim4.
[0056] For "Performance Attribution Date", the index management platform can generate the SQL code (hereinafter referred to as SQL code 3) corresponding to "Performance Attribution Date" according to code 3 and the grouping dimensions of the index, and the SQL code 3 can be as follows: SELECT attribution_date AS attribution_date,--Performance Attribution Date diml AS dim1, dim2 AS dim2, dim3 AS dim3, dim4AS dim4 FROM db.table_date The SQL code 3 can be used to obtain the data of "Performance Attribution Date" from the data table db.table_date, which includes the data of "Performance Attribution Date" grouped by dim1 dimension, dim2 dimension, dim3 dimension and dim4 dimension.
[0057] Taking the index with the name "Number of Valid Live Broadcast Days in the Current Month" as an example, the configured index formula (hereinafter referred to as code 4) can be: COUNT DISTINCT (IF([Is the current day a valid live broadcast day]=1,[Performance Attribution Date],NULL)) where [Is the current day a valid live broadcast day] in code 4 represents the reference to the already configured index "Is the current day a valid live broadcast day", and [Performance Attribution Date] in code 4 represents the reference to the already configured index "Performance Attribution Date".
[0058] Since "Number of valid live streaming days in the current month" references "whether the current day is a valid live stream" and "performance attribution date", the recommended dimensions in region 103 can include the grouping dimensions of the referenced "whether the current day is a valid live stream" and "performance attribution date". Users can select the grouping dimensions from the recommended dimensions. For example, the grouping dimensions selected by the user include dim1, dim2, dim3 and dim4.
[0059] The division of indicator levels is explained as follows: "Number of valid live streaming days in the current month" is the highest level indicator. "Number of valid live streaming days in the current month" directly refers to the two indicators "whether the day was a valid live stream" and "performance attribution date". Therefore, "whether the day was a valid live stream" and "performance attribution date" are the next level indicators of "Number of valid live streaming days in the current month".
[0060] Since "Whether the day's live stream was effective" directly references "Daily live stream ad consumption", "Daily live stream ad consumption" serves as the next level of indicator for "Whether the day's live stream was effective".
[0061] "Performance Attribution Date" and "Daily Live Streaming Ad Consumption" are the lowest-level metrics, and their formulas both indicate field information in the dependent data table. Furthermore, for "Number of Valid Live Streaming Days in the Month," the indirectly referenced metric is "Daily Live Streaming Ad Consumption."
[0062] In this way, for each metric level, it can be converted into SQL code that conforms to SQL syntax rules through syntax parsing. The SQL code of the metric at the next higher level is obtained by concatenating the SQL code of the metric at the next lower level. The generated SQL code 4 corresponding to "valid live broadcast days in the current month" can be shown below: SELECT CAST(COUNT(DISTINCT IF((is_valid_live)=(1),attribution date, NULL))AS bigint) AS month_valid_live_days, --number of valid live streaming days in the current month basic_222_view.diml AS dim1, basic_222_view.dim2 AS dim2, basic_222_view.dim3 AS dim3, basic_222_view.dim4 AS dim4 FROM (SQL code 3) AS basic_222_view LEFT JOIN ( (SQL code 2) AS extend_111_view) AS extend_333_view ON basic_222_view.dim1 = extend_333_view.dim1 AND basic_222_view.dim2 = extend_333_view.dim2 AND basic_222_view.dim3 = extend_333_view.dim3 GROUP BY basic_222_view.dim1, basic_222_view.dim2, basic_222_view.dim3, basic_222_view.dim4 Wherein, 222 represents the index ID of “performance attribution date”. 333 represents the index ID of “whether the day is a valid live broadcast”. basic_222_view represents the query view of “performance attribution date”, and extend_333_view represents the query view of “whether the day is a valid live broadcast”. As can be understood from SQL code 2, the query view extend_111_view containing “live broadcast advertisement consumption on the day” is included, so each index involved corresponds to an index level, and each index corresponds to a query view.
[0063] Referring to SQL code 4, the JOIN operation contained therein is explained. Both “whether the day is a valid live broadcast” and “performance attribution date” are indexes directly referenced by “number of valid live broadcast days in the month”, so both of them are indexes of the next level of “number of valid live broadcast days in the month”, and both of them are at the same index level. For the index level containing these two indexes, the data table relied on by “whether the day is a valid live broadcast” is db.table_cost, and the data table relied on by “performance attribution date” is db.table_date, which involves multiple data tables, so the SQL code corresponding to this index level needs to contain JOIN operation. For the JOIN operation, it needs to select which data table as the main table. In the present disclosure, among multiple data tables, the data table whose dimension can cover the data of other data tables can be selected as the main table. For example, among data table db.table_date and data table db.table_cost, data table db.table_date is selected as the main table. The fragment of the SQL code corresponding to this index level in SQL code 4 is as follows: (SQL code 3) AS basic_222_view LEFT JOIN( (SQL code 2) AS extend_111_view) AS extend_333_view ON basic_222_view.dim1 = extend_333_view.dim1 AND basic_222_view.dim2 = extend_333_view.dim2 AND basic_222_view.dim3 = extend_333_view.dim3 In addition, since the data of the "number of valid live broadcast days in the month" involves aggregate calculation, that is, COUNT calculation, the SQL code 4 includes a GROUP BY statement. In the present disclosure, when configuring the index, the user does not need to additionally write the GROUP BY statement, thereby reducing the complexity of index configuration.
[0064] It should be noted that, in order to reduce the code length, in the SQL code 4, the SQL code 2 refers to the entire content of the SQL code 2 corresponding to "whether the day is a valid live broadcast", and the SQL code 3 refers to the entire content of the SQL code 3 corresponding to "performance attribution date". However, as explained above, in the SQL code 4, although the entire content of the SQL code 2 and the SQL code 3 is included, the SQL code 2 here is also generated according to the index formula and the associated dimensions of "whether the day is a valid live broadcast", and the SQL code 3 is also generated according to the index formula and the associated dimensions of "performance attribution date".
[0065] In the related art, when configuring the index "number of valid live broadcast days in the month", the code required to be configured is shown in the SQL code 4. In the present disclosure, when configuring the index "number of valid live broadcast days in the month", the code required to be configured is shown in the code 4.
[0066] Therefore, the present disclosure requires less code amount for index configuration, has lower complexity of index configuration, has higher utilization rate of the configured index, and can select the grouping dimension in the index configuration page without writing the GROUP BY statement, thereby further reducing the complexity of index configuration.
[0067] In the above embodiments, the "performance attribution date" can be regarded as a basic index, and data of the basic index can be directly obtained from a data table. The "number of valid live broadcast days in the current month", "whether the current day is a valid live broadcast day", and "live broadcast ad consumption in the current day" can be regarded as extended indexes, and data of the extended indexes needs to be obtained through aggregation calculation or type conversion based on data in the data table.
[0068] The SQL code of an index can be used to obtain data of the index. The data can be data obtained through aggregation calculation (such as data of the "number of valid live broadcast days in the current month"), that is, a calculation result of the index. The data can also be data directly obtained from a data table (such as data of the "performance attribution date"), that is, a data obtaining result of the index.
[0069] For example, in response to a calculation request for an index, SQL code corresponding to the index can be generated to obtain data of the index through the SQL code. The calculation request can be a calculation request for a data node corresponding to the index in a data link. After obtaining the data of the index, the data of the index can be synchronized to a database. In response to a query request for the index, a query result of the index can be obtained based on data of the index in the database according to a query condition. The query request can be, for example, that a user opens a query page or a board data page related to the index. Therefore, data obtaining or aggregation calculation of an index and query of the index can be regarded as two aspects.
[0070] The following describes the area 104 in the data query interface 100. Figure 1 The area 104 can be used for a user to configure query information of an index. For example, the user can set a query type of the index and a query condition corresponding to the query type in the area 104 to meet a data query requirement of the index. The supported query types include, for example, point query of a specified dimension value and aggregation query of multi-dimensional analysis.
[0071] The point query of the specified dimension value can be understood as that a query result can be directly obtained from a calculation result of an index. For example, for the "whether the current day is a valid live broadcast day", if a query condition of the user is dim1=a, dim2=b, and dim3=c, data of dim1=a, dim2=b, and dim3=c can be queried from the calculation result of the "whether the current day is a valid live broadcast day".
[0072] The poly-dimensional analysis aggregation query can be understood as a query result that needs to be aggregated from the data of the index. The user can define a query condition on the basis of a grouping dimension, for example, the query condition is SUM(f1) GROUP BY dim1, dim2, or SUM(f1) GROUP BY dim1, dim2, dim3, or a filtering condition can be combined, for example, the query condition is SUM(f1) GROUP BY dim1, dim2 WHERE dim3=c. For example, for "whether it is a valid live broadcast on the day", taking the query condition SUM(f1) GROUP BY dim1, dim2 as an example, the sum of the f1 column is calculated on the basis of the calculation result of the index, and the dim1 dimension and the dim2 dimension are grouped and counted.
[0073] The user can also set a point query of a specified dimension value and a multi-dimensional analysis aggregation query for one index according to a query requirement, so that different query results can be obtained from the data of one index, that is, one index can meet different query requirements, and the data of the index is fully utilized. Moreover, if the user needs to change the query requirement, the query type or the query condition can be adjusted to achieve the change, without the need to additionally define a new index.
[0074] In addition to reducing the complexity of index configuration, the data synchronization of the calculation result of the index can be performed according to the query performance requirement corresponding to the query type in the present disclosure. The data synchronization refers to storing the calculation result of the index into a database.
[0075] The query performance requirement can include a response time (RT) and a query per second (QPS). The higher the query performance requirement is, the shorter the response time is and the higher the query per second is.
[0076] The above introduces two query types. The point query of a specified dimension value corresponds to a query result that can be directly obtained from the calculation result of the index, and therefore the query performance requirement is higher, the RT is usually guaranteed within tens or hundreds of milliseconds, and the QPS is usually required to be above 100. In order to meet the query performance requirement, the calculation result of the index needs to be synchronized to a database with low delay and fast read-write speed, for example, a key-value database. When data query is needed, the query result of the index can be obtained from the key-value database on the basis of the data of the index.
[0077] The query result corresponding to the multi-dimensional analysis aggregation query needs to be aggregated from the calculation result of the index, and thus the requirement for query performance is relatively low, the RT can be within 10 seconds, and the QPS requirement is less than 100. In order to meet the requirement for data aggregation, the calculation result of the index needs to be synchronized to a database facing an analysis scenario, that is, an analysis database, for example, an OLAP (Online Analytical Processing) database. When data query is needed, the query result of the index can be obtained from the analysis database based on the data of the index.
[0078] In this way, the data synchronization can be automatically completed according to the query type configured by the user for querying the index, so as to meet the requirement for query performance.
[0079] According to the technical solution, when the calculation logic of the index is configured, the other index that has been configured can be referenced, and the calculation logic and / or data acquisition logic of the other index referenced need not be given again, the amount of code required is less, the index management platform can directly call the index formula and associated dimensions of the other index referenced to complete the conversion of the SQL code. In addition, the user can select the grouping dimension of the index on the index configuration page, and need not additionally write a GROUP BY statement, further reducing the configuration complexity of the index. In addition, the user can configure the query type of the index, the query of the index is based on the data of the index, different query types have different requirements for query performance, and the data of the index can be synchronized to a database meeting the requirement for query performance according to the query type configured by the user.
[0080] Figure 2 is a flowchart of a data processing method according to an example embodiment. The data processing method can be applied to an electronic device, such as a server, for example, the index management platform mentioned in the above embodiments, for example, Figure 2 As shown, the data processing method can include steps 21 to 23.
[0081] Step 21, obtaining first configuration information and second configuration information of a target index.
[0082] The first configuration information of the index is used to indicate the calculation logic and / or data acquisition logic of the index, and the second configuration information of the index includes the dimension for grouping the data of the index.
[0083] The user can configure the target index on the index configuration page, such as the index configuration page 11 shown in Figure 1 The first configuration information can be the index formula in the area 102, and the second configuration information can include the date dimension and the grouping dimension in the area 103.
[0084] Some of the data of the indicators can be the data of the fields in the data table, and the data of these indicators does not need to be calculated, but can be directly obtained from the data table, and can be used as a basic indicator. The indicator formula of these indicators can be used to indicate the data obtaining logic of the indicator, that is, to indicate which field or fields in which data table the indicator depends on. For example, the indicator "performance attribution date" in the above embodiment. The data of some indicators is obtained by converting the data in the data table, such as "whether the current day is a valid live broadcast" and "live broadcast ad consumption of the current day". The data obtaining logic of the indicator can indicate which field or fields in which data table the indicator depends on and the data conversion method.
[0085] The data of some indicators needs to be calculated, such as "the number of valid live broadcast days in the current month" in the above embodiment. The indicator formula can be used to indicate the calculation logic of the indicator, and the calculation logic can also be regarded as the calculation expression of the indicator. If the data of the indicator needs to be calculated and obtained from the data table, the indicator formula can be used to indicate the calculation logic and the data obtaining logic of the indicator.
[0086] In step 22, if the first configuration information of the target indicator indicates that the first indicator referenced is not the target indicator, the target SQL code corresponding to the target indicator is generated according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator.
[0087] Taking the target indicator "whether the current day is a valid live broadcast" in the above embodiment as an example, the first configuration information of "whether the current day is a valid live broadcast" is shown in code 2, indicating that the first indicator referenced includes "live broadcast ad consumption of the current day", and the target SQL code is shown in SQL code 2. In the present disclosure, referencing a certain indicator can also be regarded as depending on the indicator.
[0088] Taking the target indicator "the number of valid live broadcast days in the current month" in the above embodiment as an example, the first configuration information of "the number of valid live broadcast days in the current month" is shown in code 4, indicating that the first indicator referenced includes "whether the current day is a valid live broadcast" and "performance attribution date". Here, the reference can be regarded as a direct reference, that is, the reference to which indicator is directly embodied in the first configuration information. The target SQL code is shown in SQL code 4.
[0089] As shown in SQL code 4, in the related art, when a user configures the indicator "the number of valid live broadcast days in the current month", the code required to be configured by the user is shown in SQL code 4, and the user needs to write complex nested logic such as JOIN logic. However, when the indicator configuration method of the present disclosure is adopted, the user needs to write complex nested logic.
[0090] In step 23, the data of the target indicator is obtained through the target SQL code.
[0091] The target SQL code can be used to query the data table to obtain the data of the target index.
[0092] In an embodiment, steps 21 to 23 can be performed in response to receiving a calculation request for the target index to obtain the data of the target index.
[0093] According to the technical solution described above, when configuring the calculation logic of the target index, the first other index that has been configured can be referenced, and the calculation logic and / or data obtaining logic of the referenced first index do not need to be given again, the amount of code required is less, the user does not need to write complex nested logic, the complexity of index configuration is reduced, and the utilization rate of the configured index is improved. The second configuration information of the index includes the dimension for grouping the data of the index, so that the user can directly configure the dimension for grouping the data of the index, without the need for the user to additionally write a GROUP BY statement, further reducing the complexity of index configuration, to meet the needs of the business side for data statistics.
[0094] In the present disclosure, the data processing method can further include: If the first configuration information of the target index indicates that no index other than the target index is referenced, the target SQL code is generated according to the first configuration information and the second configuration information of the target index; wherein, in the case where the first configuration information of the target index indicates that no index other than the target index is referenced, the first configuration information of the target index indicates the field information in the data table on which the target index depends.
[0095] Taking the target index "performance attribution date" in the above embodiment as an example, the first configuration information of the "performance attribution date" is shown in code 3, indicating that no other index is referenced, and the first configuration information indicates that the field information on which the "performance attribution date" depends is attribution_date, and the data table associated with the field information attribution_date is db.table_date.
[0096] It should be noted that in the present disclosure, when configuring the index, the associated data table can not need to be indicated additionally, because the configured index is either a basic index, the data of the basic index can be the data of the field in the data table, the field is associated with the corresponding data table, or the configured index is derived from the basic index, and these indexes directly or indirectly depend on the basic index, and the corresponding data table is the data table associated with the directly or indirectly dependent basic index.
[0097] In this way, the target SQL code is generated according to the first configuration information and the second configuration information of the target index, without the need for the user to write complex SQL code, reducing the complexity of code configuration.
[0098] In an embodiment, the dimensions for grouping the data of the indicator include the dimensions selected by the user from the candidate dimensions corresponding to the indicator.
[0099] In a case where the first configuration information of the indicator indicates an indicator other than the referenced indicator, the candidate dimensions include the dimensions for grouping the data of the referenced indicator.
[0100] For example, taking the “number of valid live days in the current month” as an example, the candidate dimensions can include the grouping dimensions of the referenced “whether the current day is a valid live day” and “performance attribution date”, and since the “whether the current day is a valid live day” and “performance attribution date” have been configured, the grouping dimensions of the two are known.
[0101] In a case where the first configuration information of the indicator indicates an indicator other than the referenced indicator, the candidate dimensions include the dimensions for grouping the data of the referenced indicator.
[0102] For example, taking the “performance attribution date” as an example, the candidate dimensions can include the dimensions supported for grouping in the data table db.table_date.
[0103] The candidate dimensions can be the recommended dimensions in the above embodiments. That is, the user can select from the candidate dimensions corresponding to the indicator, without the user additionally writing a GROUP BY statement.
[0104] In an embodiment, the generating, in step 12, of the target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator, can include: dividing a plurality of indicator levels according to the first configuration information of the first indicator; wherein the indicator of a next level is directly referenced by the indicator of a previous level, and the first configuration information of the indicator of a lowest level indicates field information in a data table on which the indicator depends; generating an SQL code corresponding to each indicator level respectively to obtain the target SQL code, wherein the SQL code corresponding to the indicator level is generated according to the first configuration information and the second configuration information of the indicator of the indicator level, and the SQL code of the indicator of the previous level is obtained by splicing the SQL code of the indicator of the next level.
[0105] The division of the indicator levels can refer to the explanations in the above embodiments. Since the indicator of the previous level references the indicator of the next level, the SQL code of the indicator of the next level is obtained by splicing the SQL code of the indicator of the next level.
[0106] wherein the dividing a plurality of indicator levels according to the first configuration information of the first indicator can include: If the first configuration information of the first indicator indicates that the indicator other than the first indicator is referenced, the multiple indicator levels are divided according to the target indicator, the first indicator, and the second indicator; the second indicator includes the indicator directly referenced by the first indicator, or the second indicator includes the indicator directly referenced by the first indicator and the indicator indirectly referenced.
[0107] Taking the target indicator as “the number of valid live broadcast days in the current month” as an example, the first indicator includes the directly referenced “whether the current day is a valid live broadcast” and “performance attribution date”, wherein the first indicator “whether the current day is a valid live broadcast” directly references “the live broadcast ad consumption of the current day”, that is, the second indicator includes “the live broadcast ad consumption of the current day”.
[0108] In this example, assuming that “the live broadcast ad consumption of the current day” depends on the indicator “AAA”, “AAA” is an indicator indirectly referenced by the first indicator “whether the current day is a valid live broadcast”.
[0109] That is, in the present disclosure, when dividing the indicator levels, recursion is performed until the indicator whose first configuration information indicates the dependent data table and field information is reached, that is, the lowest level indicator is reached, and when the lowest level indicator is reached, it is also obtained that which data tables the target indicator depends on.
[0110] If the first configuration information of the first indicator indicates that the indicator other than the first indicator is not referenced, the indicator levels are divided according to the target indicator and the first indicator.
[0111] Taking the target indicator as “whether the current day is a valid live broadcast” as an example, the first indicator “the live broadcast ad consumption of the current day” does not reference other indicators, so when dividing the indicator levels, the levels including “whether the current day is a valid live broadcast” and “the live broadcast ad consumption of the current day” are included.
[0112] Through the above technical solution, without the user writing complex nested logic, according to the calculation logic and grouping dimension of the indicator configured by the user, the corresponding SQL code can be generated, and the complexity of the indicator configuration is low.
[0113] In an embodiment, in the case where the number of data tables corresponding to the indicator levels is multiple, the SQL code corresponding to the indicator levels includes a JOIN operation, and the multiple data tables include the data tables on which at least one indicator corresponding to the indicator levels respectively depends.
[0114] The type of the JOIN operation is not limited, for example, it can be an inner join, a left join, a right join, etc.
[0115] The embodiment can refer to the JOIN operation in the SQL code 4 introduced above. The at least one indicator corresponding to the indicator level can be at least one indicator at the same indicator level, the main table of the JOIN operation can be one of the plurality of data tables, and the main table of the JOIN operation can be a data table of the plurality of data tables, for example, the data table of which the dimension can cover other data tables.
[0116] In this way, the corresponding target SQL code can be accurately generated using the JOIN operation without the user writing complex JOIN logic.
[0117] In an embodiment, the data processing method can further include: obtaining third configuration information of the target indicator, the third configuration information being used to indicate a query type and a query condition of the target indicator; synchronizing data of the target indicator to a first database corresponding to the query type of the target indicator; wherein different query types correspond to different query performance requirements and different types of databases; obtaining a query result of the target indicator based on the data of the target indicator in the first database according to the query condition in response to a query request for the target indicator.
[0118] The step of obtaining the third configuration information of the target indicator can be executed in parallel with step 11, or can be executed after obtaining the data of the target indicator, without limitation.
[0119] The third configuration information can be as shown in the query information in the region 104 in the above embodiment, and is used to indicate the query type and the query condition of the target indicator. The data of the target indicator can be synchronized to the first database corresponding to the query type of the target indicator, and the data of the indicator can be synchronized to the database meeting the query performance requirement according to the query type configured by the user.
[0120] For example, in the case where the query type of the target indicator is a first query type, the first database is a key-value database, and the query result of the indicator of the first query type can be directly obtained from the data of the indicator. The first query type can refer to the point query of the specified dimension value introduced in the above embodiment.
[0121] In the case where the query type of the target indicator is a second query type, the first database is an analytical database, the query result of the indicator of the second query type is obtained based on the aggregation of the data of the indicator, and the query performance requirement corresponding to the first query type is higher than the query performance requirement corresponding to the second query type. The first query type can refer to the aggregation query of the multi-dimensional analysis introduced in the above embodiment.
[0122] In this way, the data synchronization of the calculation result of the index can be performed according to the query performance requirement corresponding to the query type, and the data synchronization refers to storing the calculation result of the index into the database. If the query type of the target index is the first query type, when data query is needed, the query result of the target index can be obtained from the key-value database based on the data of the target index, so as to meet the requirement of low delay and short response time. If the query type of the target index is the second query type, when data query is needed, the query result of the target index can be obtained from the analytical database based on the data of the target index, so as to meet the requirement of data analysis and aggregation.
[0123] Based on the same inventive concept, the disclosure further provides a data processing apparatus, Figure 3 is a block diagram of a data processing apparatus according to an example embodiment, as Figure 3 As shown in the figure, the data processing apparatus 30 can include: The first acquisition module 31 is configured to acquire first configuration information and second configuration information of a target index, the first configuration information of the index being used to indicate the calculation logic and / or the data acquisition logic of the index, and the second configuration information of the index including a dimension for grouping data of the index; The first code generation module 32 is configured to, if the first configuration information of the target index indicates that a first index other than the target index is referenced, generate target SQL code corresponding to the target index according to the first configuration information and the second configuration information of the target index, and the first configuration information and the second configuration information of the first index. The obtaining module 33 is configured to obtain data of the target index through the target SQL code.
[0124] Optionally, the apparatus 30 further includes: The second code generation module is configured to, if the first configuration information of the target index indicates that no index other than the target index is referenced, generate the target SQL code according to the first configuration information and the second configuration information of the target index; and in the case where the first configuration information of the target index indicates that no index other than the target index is referenced, the first configuration information of the target index indicates field information in a data table on which the target index depends.
[0125] Optionally, the dimension for grouping the data of the index includes a dimension selected by a user from candidate dimensions corresponding to the index; In the case where the first configuration information of the index indicates that other indexes other than the index are referenced, the candidate dimensions include dimensions for grouping data of the indexes other than the referenced indexes. In a case where the first configuration information of the indicator indicates that no indicator other than the indicator is referenced, the candidate dimension includes a dimension supporting grouping in a data table on which the indicator depends.
[0126] Optionally, the first code generation module 32 comprises: a dividing sub-module, configured to divide a plurality of indicator levels according to first configuration information of the first indicator; wherein an indicator of a next level is directly referenced by an indicator of a previous level, and the first configuration information of an indicator of a lowest level indicates field information in a data table on which the indicator depends; a first generating sub-module, configured to generate SQL code corresponding to each indicator level respectively to obtain the target SQL code; wherein the SQL code corresponding to the indicator level is generated according to the first configuration information and the second configuration information of the indicator corresponding to the indicator level, and the SQL code of the indicator of the previous level is obtained by splicing the SQL code of the indicator of the next level.
[0127] Optionally, the dividing sub-module is configured to: if the first configuration information of the first indicator indicates that an indicator other than the first indicator is referenced, divide the plurality of indicator levels according to the target indicator, the first indicator and a second indicator; wherein the second indicator includes an indicator directly referenced by the first indicator, or the second indicator includes an indicator directly referenced by the first indicator and an indicator indirectly referenced by the first indicator; if the first configuration information of the first indicator indicates that no indicator other than the first indicator is referenced, divide the plurality of indicator levels according to the target indicator and the first indicator.
[0128] Optionally, in a case where the number of data tables corresponding to the indicator level is a plurality, the SQL code corresponding to the indicator level includes a JOIN operation, and the plurality of data tables include at least one data table on which each indicator corresponding to the indicator level depends.
[0129] Optionally, the apparatus 30 further comprises: a second obtaining module, configured to obtain third configuration information of the target indicator, the third configuration information being used to indicate a query type and a query condition of the target indicator; a data synchronization module, configured to synchronize data of the target indicator to a first database corresponding to the query type of the target indicator; wherein different query types correspond to different query performance requirements and different types of databases; a querying module, configured to, in response to a query request for the target indicator, obtain a query result of the target indicator based on the data of the target indicator in the first database according to the query condition.
[0130] Optionally, in a case where the query type of the target indicator is a first query type, wherein the first database is a key-value database, a query result of the indicator of the first query type can be directly obtained from data of the indicator; In a case where the query type of the target indicator is a second query type, the first database is an analytical database, wherein a query result of the indicator of the second query type is obtained by aggregation based on data of the indicator, and a query performance requirement corresponding to the first query type is higher than a query performance requirement corresponding to the second query type.
[0131] Reference will be made to the following description Figure 4 , which illustrates a structural schematic diagram of an electronic device 600 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure can include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a vehicle terminal (e.g., a car navigation terminal), and the like, as well as a fixed terminal such as a digital TV, a desktop computer, and the like. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present disclosure.
[0132] As shown in Figure 4 , the electronic device 600 can include a processing device (e.g., a central processor, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 602 or loaded into a random access memory (RAM) 603 from a storage device 608. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0133] Generally, the following devices can be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, and the like; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, and the like; a storage device 608 including, for example, a magnetic tape, a hard disk, and the like; and a communication device 609. The communication device 609 can allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 600 is shown with various devices, but it should be understood that all of the shown devices are not required to be implemented or present. More or fewer devices can alternatively be implemented or present.
[0134] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program in accordance with embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program comprising program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0135] It should be noted that the computer-readable medium described above in the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium can be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program used by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer-readable program code is carried. Such a propagated data signal can take a variety of forms, including but not limited to, an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can be used to carry or store a program for use by or in connection with an instruction execution system, apparatus, or device, other than the computer-readable storage medium. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to, wire, cable, RF (radio frequency), or the like, or any suitable combination thereof.
[0136] In some embodiments, the server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communications (e.g., communications networks) of any form or medium, including the Internet. Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), internetworks (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
[0137] The computer-readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled into the electronic device.
[0138] The computer-readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to: acquire first configuration information and second configuration information of a target indicator, the first configuration information of the indicator being used to indicate the calculation logic and / or the data acquisition logic of the indicator, and the second configuration information of the indicator including dimensions for grouping data of the indicator; If the first configuration information of the target indicator indicates a first other indicator other than the target indicator, the target SQL code corresponding to the target indicator is generated according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first other indicator; Data of the target indicator is obtained through the target SQL code.
[0139] Computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network ("LAN") or a wide area network ("WAN"), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0140] The flow and block diagrams in the drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow and block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flowchart illustrations, and combinations thereof, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0141] The modules involved in the embodiments of the present disclosure can be implemented in the form of software or in the form of hardware. In some cases, the name of the module does not constitute a limitation on the module itself, for example, the first obtaining module can also be described as a "module for obtaining configuration information".
[0142] The functions described above in the present document can be performed, at least in part, by one or more hardware logic components. For example, non-limiting examples of exemplary types of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0143] In the context of the present disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable 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. 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.
[0144] According to one or more embodiments of the present disclosure, example 1 provides a data processing method, the method comprising: obtaining first configuration information and second configuration information of a target indicator, the first configuration information of the indicator being used to indicate calculation logic and / or data obtaining logic of the indicator, and the second configuration information of the indicator including dimensions for grouping data of the indicator; if the first configuration information of the target indicator indicates that a first indicator other than the target indicator is referenced, generating target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator; obtaining data of the target indicator through the target SQL code.
[0145] According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, and the method further comprises: if the first configuration information of the target indicator indicates that no indicator other than the target indicator is referenced, generating the target SQL code according to the first configuration information and the second configuration information of the target indicator; wherein in the case that the first configuration information of the target indicator indicates that no indicator other than the target indicator is referenced, the first configuration information of the target indicator indicates field information in a data table on which the target indicator depends.
[0146] According to one or more embodiments of the present disclosure, example 3 provides the method of example 1, and the dimensions for grouping data of the indicator include dimensions selected by a user from candidate dimensions corresponding to the indicator; wherein in the case that the first configuration information of the indicator indicates that an indicator other than the indicator is referenced, the candidate dimensions include dimensions for grouping data of the referenced indicator; in the case that the first configuration information of the indicator indicates that no indicator other than the indicator is referenced, the candidate dimensions include dimensions in a data table on which the indicator depends and which support grouping.
[0147] According to one or more embodiments of the present disclosure, example 4 provides the method of example 1, and the generating of the target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator comprises: dividing a plurality of indicator levels according to the first configuration information of the first indicator; wherein an indicator at a next level is directly referenced by an indicator at a previous level, and the first configuration information of an indicator at a lowest level indicates field information in a data table on which the indicator depends; generate the SQL code corresponding to each indicator level respectively to obtain the target SQL code, wherein the SQL code corresponding to the indicator level is generated according to the first configuration information and the second configuration information of the indicator corresponding to the indicator level, and the SQL code of the indicator of the previous level is obtained by splicing the SQL code of the indicator of the next level.
[0148] According to one or more embodiments of the present disclosure, example 5 provides the method of example 4, wherein the dividing a plurality of indicator levels according to the first configuration information of the first indicator comprises: if the first configuration information of the first indicator indicates that the indicator other than the first indicator is referenced, then the plurality of indicator levels are divided according to the target indicator, the first indicator and a second indicator, wherein the second indicator comprises the indicator directly referenced by the first indicator, or the second indicator comprises the indicator directly referenced by the first indicator and the indicator indirectly referenced by the first indicator; if the first configuration information of the first indicator indicates that the indicator other than the first indicator is not referenced, then the plurality of indicator levels are divided according to the target indicator and the first indicator.
[0149] According to one or more embodiments of the present disclosure, example 6 provides the method of example 4, wherein in the case that the number of the data tables corresponding to the indicator level is multiple, the SQL code corresponding to the indicator level comprises a JOIN operation, and the multiple data tables comprise at least one data table relied on by each indicator corresponding to the indicator level.
[0150] According to one or more embodiments of the present disclosure, example 7 provides the method of example 1, wherein the method further comprises: obtaining third configuration information of the target indicator, wherein the third configuration information is used to indicate a query type and a query condition of the target indicator; synchronizing the data of the target indicator to a first database corresponding to the query type of the target indicator; wherein different query types correspond to different query performance requirements and different types of databases; in response to a query request for the target indicator, obtaining a query result of the target indicator based on the data of the target indicator in the first database according to the query condition.
[0151] According to one or more embodiments of the present disclosure, example 8 provides the method of example 7, wherein in the case that the query type of the target indicator is a first query type, the first database is a key-value database, and the query result of the indicator of the first query type can be directly obtained from the data of the indicator. In a case where the query type of the target index is a second query type, the first database is an analytical database, and a query result of an index of the second query type is obtained based on aggregation of data of the index.
[0152] According to one or more embodiments of the present disclosure, example 9 provides a data processing apparatus, the apparatus comprising: a first obtaining module configured to obtain first configuration information and second configuration information of a target index, the first configuration information of an index being used to indicate calculation logic and / or data obtaining logic of the index, and the second configuration information of the index including dimensions for grouping data of the index; a first code generating module configured to, if the first configuration information of the target index indicates a first index other than the target index, generate target SQL code corresponding to the target index according to the first configuration information and the second configuration information of the target index, and the first configuration information and the second configuration information of the first index; an obtaining module configured to obtain data of the target index through the target SQL code.
[0153] According to one or more embodiments of the present disclosure, example 10 provides a computer readable medium having stored thereon a computer program, which, when executed by a processing apparatus, implements the steps of the method of any one of examples 1-8.
[0154] According to one or more embodiments of the present disclosure, example 11 provides an electronic device, comprising: a storage device having stored thereon a computer program; a processing apparatus configured to execute the computer program in the storage device to implement the steps of the method of any one of examples 1-8.
[0155] According to one or more embodiments of the present disclosure, example 12 provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method of any one of examples 1-8.
[0156] The above description is merely preferred embodiments of the present disclosure and a description of principles of applied technologies. It should be understood by those skilled in the art that the disclosed scope of the present disclosure is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by the combinations of the above technical features or equivalent features without departing from the above disclosed concept. For example, the above technical features can be replaced with other technical features disclosed in the present disclosure (but not limited to) having similar functions to form technical solutions.
[0157] Moreover, while operations are depicted in a particular order, this should not be understood as requiring the operations to be performed in the particular order shown or in sequential order, at all. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, while several specific implementation details have been discussed, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable sub-combination.
[0158] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With respect to the devices in the above-described embodiments, in which various modules perform operations, the specific manner in which the operations are performed by the various modules has been described in detail in the embodiments relating to the method. Here, no detailed explanation will be given.
Claims
1. A data processing method, characterized by, The method comprises: obtaining first configuration information and second configuration information of a target index, the first configuration information of the index being used to indicate the calculation logic and / or the data acquisition logic of the index, and the second configuration information of the index comprising dimensions for grouping data of the index; if the first configuration information of the target index indicates a first index other than the target index, generating target SQL code corresponding to the target index according to the first configuration information and the second configuration information of the target index and the first configuration information and the second configuration information of the first index; obtaining data of the target index through the target SQL code.
2. The method of claim 1, wherein, The method further comprises: if the first configuration information of the target index indicates that no index other than the target index is referenced, generating the target SQL code according to the first configuration information and the second configuration information of the target index; wherein, in the case that the first configuration information of the target index indicates that no index other than the target index is referenced, the first configuration information of the target index indicates field information in a data table on which the target index depends.
3. The method of claim 1, wherein, The dimensions for grouping data of the index comprise dimensions selected by a user from candidate dimensions corresponding to the index; wherein, in the case that the first configuration information of the index indicates an index other than the index, the candidate dimensions comprise dimensions for grouping data of the referenced index; in the case that the first configuration information of the index indicates that no index other than the index is referenced, the candidate dimensions comprise dimensions in a data table on which the index depends and which support grouping.
4. The method of claim 1, wherein, The generating of the target SQL code corresponding to the target index according to the first configuration information and the second configuration information of the target index and the first configuration information and the second configuration information of the first index comprises: dividing a plurality of index levels according to the first configuration information of the first index; wherein, an index at a next level is directly referenced by an index at a previous level, and the first configuration information of an index at a lowest level indicates field information in a data table on which the index depends; generating SQL code corresponding to each index level respectively to obtain the target SQL code, wherein the SQL code corresponding to the index level is generated according to the first configuration information and the second configuration information of the index corresponding to the index level, and the SQL code of the index at the previous level is obtained by splicing the SQL code of the index at the next level.
5. The method of claim 4, wherein, The dividing of the plurality of index levels according to the first configuration information of the first index comprises: if the first configuration information of the first index indicates an index other than the first index, dividing the plurality of index levels according to the target index, the first index and a second index; wherein, the second index comprises an index directly referenced by the first index, or the second index comprises an index directly referenced by the first index and an index indirectly referenced by the first index; if the first configuration information of the first index indicates that no index other than the first index is referenced, dividing the plurality of index levels according to the target index and the first index.
6. The method of claim 4, wherein, in a case where a number of data tables corresponding to the indicator level is more than one, the SQL code corresponding to the indicator level comprises a JOIN operation, and the more than one data tables comprise data tables on which each of the at least one indicator corresponding to the indicator level depends.
7. The method of claim 1, wherein, The method further comprises: obtaining third configuration information of the target indicator, the third configuration information being used to indicate a query type and a query condition of the target indicator; synchronizing data of the target indicator into a first database corresponding to the query type of the target indicator; wherein different query types correspond to different query performance requirements and different types of databases; in response to a query request for the target indicator, obtaining a query result of the target indicator based on the data of the target indicator in the first database according to the query condition.
8. The method of claim 7, wherein, in a case where the query type of the target indicator is a first query type, the first database is a key-value database, wherein a query result of an indicator of the first query type can be directly obtained from data of the indicator; in a case where the query type of the target indicator is a second query type, the first database is an analytical database, wherein a query result of an indicator of the second query type is obtained based on aggregation of data of the indicator, and a query performance requirement corresponding to the first query type is higher than a query performance requirement corresponding to the second query type.
9. A data processing apparatus, characterized by, The apparatus comprises: a first obtaining module configured to obtain first configuration information and second configuration information of a target indicator, the first configuration information of an indicator being used to indicate a calculation logic and / or a data obtaining logic of the indicator, and the second configuration information of the indicator comprising a dimension for grouping data of the indicator; a first code generating module configured to, if the first configuration information of the target indicator indicates a reference to a first indicator other than the target indicator, generate a target SQL code corresponding to the target indicator according to the first configuration information and the second configuration information of the target indicator, and the first configuration information and the second configuration information of the first indicator; an obtaining module configured to obtain data of the target indicator through the target SQL code.
10. A computer readable medium having stored thereon a computer program, characterized in that, The computer program, when executed by a processing apparatus, implements the steps of the method of any one of claims 1-8.
11. An electronic device, comprising: comprises: a storage device having a computer program stored thereon; a processing apparatus configured to execute the computer program in the storage device to implement the steps of the method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the steps of the method of any one of claims 1-8.