A data processing method, device and electronic equipment

By constructing horizontally scalable intermediate and aggregate tables, the data processing flow was optimized, the problem of high resource consumption during the shuffle stage was solved, and computing efficiency and user experience were improved.

CN117591536BActive Publication Date: 2026-11-24ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311633378.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2026-11-24
Estimated Expiration
2043-11-30

AI Technical Summary

Technical Problem

Existing data processing frameworks consume a lot of resources during the shuffle phase, affecting the performance and cost of computing clusters, especially in multi-metric calculations where the amount of data exchange is large, leading to inefficiency.

Method used

By matching the raw data with preset indicator conditions and performing measurement operations, a horizontally expanded intermediate table is constructed, and the first aggregation operation is performed to reduce the amount of data in the shuffle stage. The data processing flow is optimized by using aggregation tables and roll-up tables.

Benefits of technology

It improves the performance of multi-indicator calculation and reduces computational costs, thereby enhancing the accuracy of query results and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117591536B_ABST
    Figure CN117591536B_ABST
Patent Text Reader

Abstract

The one or more embodiments of the specification disclose a data processing method, device and electronic equipment. The method comprises: matching each piece of original data in a group of original data sets with a preset index condition, determining an index condition matched with each piece of original data, and the group of original data sets comprising at least one original data set; performing a measurement operation on the original data using a measurement method corresponding to each index condition matched with the original data, to obtain a measurement value of the original data under each index condition matched with the original data; constructing an intermediate table corresponding to each original data set according to the measurement value of the original data under each index condition matched with the original data; and performing a first aggregation operation on record rows corresponding to the same type of original data in the intermediate table corresponding to each original data set, to obtain an aggregation table corresponding to the group of original data sets.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of data processing technology, and in particular to a data processing method, apparatus, and electronic device. Background Technology

[0002] In big data computing frameworks, whether it is the original MapReduce (a distributed parallel computing framework) or the currently popular Spark (a streaming computing framework) and Flink (a distributed computing framework), most of them adopt the divide-and-conquer approach: when the computing power of a single computing node is limited, the task that needs to be computed is divided into several subtasks to be executed in parallel, and finally, the results of the subtasks are merged to obtain the final result.

[0003] During the merging process, the aforementioned computing frameworks typically employ a shuffle mechanism. The shuffle process involves reorganizing and sorting data across the entire cluster, a highly resource-intensive process involving disk I / O (input / output), data serialization and deserialization, and network I / O (input / output). Therefore, the data processing speed during the shuffle phase directly impacts the performance and computational cost of the entire computing cluster. Consequently, there is an urgent need to provide a superior data processing solution. Summary of the Invention

[0004] This specification provides a data processing method, apparatus, and electronic device to improve the data processing speed during the shuffle stage.

[0005] In a first aspect, one or more embodiments of this specification provide a data processing method, comprising: matching each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data, wherein the set of raw datasets includes at least one raw dataset; performing a measurement operation on the raw data using a measurement method corresponding to each indicator condition that matches the raw data to obtain a measurement value of the raw data under each indicator condition that matches the raw data; constructing an intermediate table corresponding to each raw dataset based on the measurement values ​​of the raw data under each indicator condition that matches the raw data, wherein each record row in the intermediate table is used to indicate the measurement value of each piece of raw data under each indicator condition that matches the raw data; performing a first aggregation operation on the record rows corresponding to the same type of raw data in the intermediate table corresponding to each raw dataset to obtain an aggregation table corresponding to the set of raw datasets, wherein each record row in the aggregation table is used to indicate the first aggregation value of each type of raw data in each raw dataset under each matched indicator condition.

[0006] Secondly, embodiments of this application provide a data processing apparatus, comprising: matching each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data, wherein the set of raw datasets includes at least one raw dataset; performing a measurement operation on the raw data using a measurement method corresponding to each indicator condition that matches the raw data to obtain a measurement value of the raw data under each indicator condition that matches the raw data; constructing an intermediate table corresponding to each raw dataset based on the measurement values ​​of the raw data under each indicator condition that matches the raw data, wherein each record row in the intermediate table is used to indicate the measurement value of each piece of raw data under each indicator condition that matches the raw data; performing a first aggregation operation on the record rows corresponding to the same type of raw data in the intermediate table corresponding to each raw dataset to obtain an aggregation table corresponding to the set of raw datasets, wherein each record row in the aggregation table is used to indicate the first aggregation value of each type of raw data in each raw dataset under each matched indicator condition.

[0007] Thirdly, embodiments of this application provide an electronic device, comprising: a processor, and a memory arranged to store computer-executable instructions, wherein when the executable instructions are executed, the processor is enabled to: match each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data, wherein the set of raw datasets includes at least one raw dataset; perform a measurement operation on the raw data using a measurement method corresponding to each indicator condition that matches the raw data, to obtain a measurement value of the raw data under each indicator condition that matches the raw data; construct an intermediate table corresponding to each raw dataset based on the measurement values ​​of the raw data under each indicator condition that matches the raw data, wherein each record row in the intermediate table indicates the measurement value of each piece of raw data under each indicator condition that matches the raw data; and perform a first aggregation operation on the record rows of the same type of raw data in the intermediate table corresponding to each raw dataset to obtain an aggregation table corresponding to the set of raw datasets, wherein each record row in the aggregation table indicates a first aggregation value of each type of raw data in each raw dataset under each matched indicator condition.

[0008] Fourthly, embodiments of this specification provide a storage medium for storing a computer program that can be executed by a processor to implement the following process: matching each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data, wherein the set of raw datasets includes at least one raw dataset; performing a measurement operation on the raw data using a measurement method corresponding to each indicator condition that matches the raw data to obtain a measurement value of the raw data under each indicator condition that matches the raw data; constructing an intermediate table corresponding to each raw dataset based on the measurement values ​​of the raw data under each indicator condition that matches the raw data, wherein each record row in the intermediate table is used to indicate the measurement value of each piece of raw data under each indicator condition that matches the raw data; performing a first aggregation operation on the record rows corresponding to the same type of raw data in the intermediate table corresponding to each raw dataset to obtain an aggregation table corresponding to the set of raw datasets, wherein each record row in the aggregation table is used to indicate the first aggregation value of each type of raw data in each raw dataset under each matched indicator condition. Attached Figure Description

[0009] To more clearly illustrate the technical solutions in one or more embodiments of this specification or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is a schematic flowchart of a data processing method according to an embodiment of this specification.

[0011] Figure 2 This is a schematic diagram of a method for constructing an intermediate table in related technologies.

[0012] Figure 3 This is a schematic diagram illustrating the construction of an intermediate table according to an embodiment of this specification.

[0013] Figure 4 This is a schematic diagram illustrating an application scenario of a data processing method according to an embodiment of this specification.

[0014] Figure 5 This diagram illustrates a process for obtaining an aggregation table according to an embodiment of this specification.

[0015] Figure 6 This diagram illustrates a process for obtaining the upper roll table according to an embodiment of this specification.

[0016] Figure 7 This is a schematic flowchart illustrating a data processing method according to an embodiment of this specification.

[0017] Figure 8 This is a schematic diagram of a data processing apparatus according to an embodiment of this specification.

[0018] Figure 9 This is a schematic diagram of the structure of an electronic device according to an embodiment of this specification. Detailed Implementation

[0019] The technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this application.

[0020] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this specification can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0021] The data processing methods, apparatus, and electronic devices provided in this specification will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.

[0022] In various scenarios such as risk control and anti-fraud, a large number of indicators are required. These indicators can serve as input variables for relevant models and participate in the comprehensive judgment of business risks. In order to make risk assessments of business events in real time, real-time multi-indicator calculation is usually required. That is, on the real-time data stream, with real-time / near real-time calculation timeliness, data statistics are performed according to indicator logic.

[0023] However, in metric calculations, there are many scenarios involving grouped statistics. When using a divide-and-conquer approach for grouped statistics, to ensure the correctness of calculation results such as deduplication, the computing framework typically schedules records with the same group to the same computing node for global aggregation calculation. This process is generally called shuffling. Each row in a database table is called a record (row). Since the shuffle phase involves data exchange throughout the cluster, including network I / O, disk I / O, and data serialization / deserialization, the amount of data exchanged during the shuffle phase directly affects its efficiency, thus impacting the performance and computational cost of the entire computing cluster.

[0024] Figure 1 This illustration shows a data processing method provided by an embodiment of the present invention. The method can be executed by an electronic device, which may include a server and / or a terminal device, wherein the terminal device may be, for example, an in-vehicle terminal or a mobile phone terminal. In other words, the method can be executed by software or hardware installed in the aforementioned electronic device, and the method includes the following steps:

[0025] S102: Match each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data.

[0026] Each set of original datasets contains at least one original dataset. Original datasets can be imported at different time points. Specifically, fixed time points can be set, and at each time point, the original data between that time point and the previous time point is imported as a single original dataset, achieving batch import of original data. To distinguish the original data at different time points, each new import can be considered a new version, and the original data imported at the same time point is considered to belong to the same version of the original dataset. In one example, a time range can be preset, and the original datasets (i.e., a set of original datasets) within that time range can be aggregated for data with the same metrics, so that the aggregated data can be quickly provided to the user when needed. A version threshold can also be set; when the number of versions of the original dataset reaches the threshold, these original datasets are grouped together for data aggregation. The time range can be set to 1 minute. In this specification, the original data in the original dataset is represented in the form of key-value pairs (key, value).

[0027] Indicator conditions are conditions set based on existing indicators in the original data. Specifically, indicator conditions can be zero or one indicator, or a combination of two or more indicators. For example, if the existing indicators include indicator a and indicator b, the indicator conditions can be (), (a), (b), or (a, b).

[0028] After obtaining the raw dataset, each piece of raw data in the dataset can be matched against preset metric conditions. For example, when the preset metric conditions are:

[0029] Indicator ln1: select count(*) from table(count number of rows in the table);

[0030] Indicator ln2: select count(*) from table where amount>10 group by a (groups the data by field 'a' and counts the number of rows in the table whose amount is greater than 10);

[0031] Indicator ln3: select count(*) from table where amount<20 group by b (groups the rows in the table whose amount is less than 20 according to field b);

[0032] When using the indicator ln4: `select count(*) from table where amount>14 group by a,b` (which counts the number of rows in the table whose amount is greater than 14 by grouping by the field (a,b);), the original data (a1,b1,10) matches the indicator conditions ln1 and ln3 from the preset indicator conditions.

[0033] S104: Use the measurement method corresponding to each indicator condition that matches the original data to perform measurement operations on the original data, and obtain the measurement value of the original data under each indicator condition that matches the original data.

[0034] The measurement methods can utilize functions such as COUNT, SUM, MIN, MAX, and AVERAGE. By using these measurement methods, the measurement value for each piece of data in the original dataset under the matched indicator conditions can be extracted. Furthermore, the measurement values ​​corresponding to different original data can be aggregated to obtain the aggregated value corresponding to each preset indicator condition. This allows the user to quickly receive the aggregated value when querying the original dataset using one of the preset indicator conditions. For example, the indicator condition ln1: select count(*) from table corresponds to the measurement method count. When the indicator condition ln1 is used to measure the original data (a1, b1, 10), the resulting measurement value is 1.

[0035] S106: Based on the measure values ​​of the original data under each indicator condition that matches the original data, construct an intermediate table corresponding to each original dataset.

[0036] In this table, each record row indicates the measurement value of each piece of original data under various indicator conditions that match the original data. When the intermediate table is expressed in a two-dimensional table structure, a record row in the intermediate table is a row in the two-dimensional table, that is, a record row in the intermediate table is a combination of the values ​​of the indicators of each dimension in the intermediate table.

[0037] In existing multi-indicator calculation schemes, in order to build a unified intermediate table for calculation, the data needs to be vertically expanded along the indicator dimension according to the grouping key (i.e., indicator) and whether the indicator is matched or not. In special cases, the amount of data can expand to m times (where m is the number of indicators). Figure 2 This diagram illustrates the construction of an intermediate table in a prior art multi-index calculation scheme. Figure 2 In this context, 'a' represents the dataset input to a certain node. Figure 2 In the table 'b', an intermediate table is constructed based on preset indicator conditions from the input dataset. Figure 2 As can be seen from b, the intermediate table in the existing multi-indicator calculation scheme is a two-dimensional table with vertical expansion, that is, new metric-related data is added by adding rows, with each row representing one data point. It can be inferred that when the number of indicators increases, the amount of data in the intermediate table will increase dramatically, thus causing the data record rows to bloat during the intermediate table construction phase.

[0038] Figure 3 This is a schematic diagram illustrating the construction of an intermediate table using the multi-index calculation scheme described in this manual. Figure 3 In this context, 'a' represents the dataset input to a certain node. Figure 3 In the table 'b', an intermediate table is constructed from the input dataset based on preset metrics. Figure 3 As can be seen from b, the intermediate table in this specification is a two-dimensional table in the form of horizontal expansion, that is, new measurement-related data are added by adding columns.

[0039] right Figure 2 and Figure 3 By comparison, it can be seen that the data in the intermediate table constructed in step S106 always maintains the same number of original data in the original dataset. When the number of indicators increases, the amount of data in the intermediate table will not increase sharply, thus avoiding the expansion of data record rows during the intermediate table construction stage.

[0040] S108: Perform the first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain a set of aggregate tables corresponding to the original datasets.

[0041] Each record row in the aggregation table indicates the first aggregated value of each class of raw data in each original dataset under each matched metric condition.

[0042] After obtaining the intermediate tables corresponding to the original dataset for each version, the data in each intermediate table can be subjected to a first aggregation operation to obtain an aggregate table for user querying. The aggregation function used in the first aggregation operation can be determined according to the actual situation, and this manual does not impose specific restrictions on it. Specifically, aggregation functions can be COUNT (counting function), SUM (summation function), MIN (minimum value function), MAX (maximum value function), AVERAGE (average value function), REPLACE (replacement function), etc.

[0043] In one example, the aggregation operation can be the separate aggregation of raw data of different categories in a set of original datasets. The classification of the raw data categories can be referred to in subsequent embodiments, and will not be repeated here. For example, when the aggregation function is COUNT, for the data (a1,b2,ln1:1,ln2:1,ln3:1,) in intermediate table 1 and the data (a1,b2,ln1:1,ln2:1,,ln4:1) in intermediate table 2, since the key values ​​of the two data are both (a1,b2), they can be regarded as the same type of data. Aggregating the two data will result in the data (a1,b2,ln1:2,ln2:2,ln3:1,ln4:1).

[0044] In the embodiments of this specification, the measurement value is determined by the measurement method corresponding to the indicator conditions matched by each original data. Then, a horizontally expanded intermediate table is constructed based on the measurement value. Subsequently, an aggregate table is obtained by performing a first aggregation operation on the data in the intermediate table corresponding to each original dataset. Through the above process, the aggregation process of multiple original datasets is transformed into the aggregation process of each record row in the intermediate table with the same data volume as the original datasets. This greatly reduces the data volume of the first aggregation process (shuffle stage), thereby improving the performance of multi-indicator calculation while reducing computational costs.

[0045] In one implementation, the data processing method further includes:

[0046] Retrieve a query request for the aggregated value corresponding to the target indicator condition in the aggregate table. The query request includes a query time range identifier.

[0047] A third aggregation operation is performed on the aggregation table corresponding to each set of original datasets within the query time range to obtain the query aggregation table. Each record row in the query aggregation table is used to indicate the third aggregation value of each type of original data in each set of original datasets within the query time range under each matching indicator condition.

[0048] The third aggregate value that matches the target metric condition is determined from the query aggregate table and used as the query result corresponding to the query request.

[0049] Specifically, since the first aggregation operation of the original datasets from different groups is performed asynchronously in the background, a third aggregation operation can be performed on the first aggregation values ​​within the query time range prior to the query time when the user queries the target metric. The data in the resulting third aggregation values ​​that match the user's query request is then returned to the user. The target metric condition can be a condition that includes multiple metrics.

[0050] When using versions to represent each raw dataset, a set of raw data can be set to 10 versions of the raw dataset. Within the query timeframe prior to the user's query, if three sets of raw datasets corresponding to versions 0-10, 11-20, and 21-30 are aggregated respectively, to ensure the accuracy of the query results, when the user queries the data, the first aggregated values ​​corresponding to the raw datasets of versions 0-30 can be read and a third aggregated operation performed to obtain a query aggregate table. Finally, the third aggregated value matching the pre-target indicator conditions obtained from the query aggregate table is returned to the user.

[0051] Furthermore, a third aggregation operation can be performed on the first aggregation value that matches the user's input query request, reducing data operations during the third aggregation operation and improving query speed.

[0052] In the embodiments of this specification, when a user queries the aggregated value corresponding to the target indicator condition, a third aggregation operation is performed on the first aggregated value within the query time range, and the third aggregated value corresponding to the target indicator condition is provided to the user, ensuring the accuracy of the user's query results. At the same time, the first aggregation operation on multiple sets of original datasets before the query request improves the efficiency of the query user in obtaining query results, thereby improving the user's experience.

[0053] Figure 4 A diagram illustrating an application scenario for a data processing method is provided, such as... Figure 4 As shown, server 401 uses the data processing method described in this manual to obtain aggregate tables corresponding to multiple sets of original datasets. Users send query requests for multiple indicators to server 402 via mobile phones or other terminals. After receiving the query request, server 402 sends a request to server 401 to obtain the aggregate table within the target time range. After receiving the command, server 401 sends the aggregate tables corresponding to the multiple sets of original datasets within the target time range to server 402, so that server 402 can perform a third aggregation operation on the aggregate tables to obtain the query aggregate table. After completing the third aggregation operation, server 402 sends the third aggregation values ​​that match the aforementioned multiple indicators as the query results to the user for reference.

[0054] In one possible implementation, each metric condition is constructed based on the same metric dimension. An intermediate table corresponding to each original dataset is constructed based on the metric values ​​of the original data under each metric condition that matches the original data. This intermediate table includes:

[0055] From the original data, determine the value of each indicator dimension corresponding to the indicator conditions that match the original data;

[0056] The intermediate table for each original dataset is constructed by using the indicator dimension values ​​corresponding to the original data as dimension columns and the measure values ​​of the original data under each indicator condition that matches the original data as indicator columns.

[0057] Here, the indicator dimension is the indicator selected when constructing the indicator conditions. For example, when the indicator dimensions include dimension a and dimension b, the indicator conditions cannot include indicators other than dimension a and dimension b. In one example, when the original dataset is represented using a two-dimensional table, the dimension in the indicator dimension can be a dimension column from the existing original dataset.

[0058] Specifically, the metrics corresponding to each dimension column of a two-dimensional table describe a characteristic attribute of the entity or event represented by the original data, such as time or region. The metrics corresponding to each indicator column in a two-dimensional table correspond to measurable data possessed by a specified combination of dimension values, such as clicks or spending. For example, in a data model used to describe product instances, the "quantity" of "BBB" type products belonging to company "AAA" is a metric corresponding to the combination of the two dimension values ​​"AAA" and "BBB".

[0059] After obtaining a set of original datasets, the corresponding indicator dimension values ​​for the original data in the original dataset can be determined. For example, when the indicator dimensions are dimension a and dimension b, the indicator dimension values ​​corresponding to the original data (a1, b1, 10) are a1 and b1. Then, an intermediate table can be constructed based on the indicator dimension values ​​and the measure values, where the dimension column represents the indicator dimension values, and the indicator column represents the measure values ​​of the original data under each indicator condition. Figure 3 As can be seen from b, the columns corresponding to a and b are dimension columns, and the columns corresponding to metric1, metric2, metric3 and metric4 are indicator columns.

[0060] To avoid data redundancy, intermediate tables often place the measure values ​​corresponding to the same metric dimension or combination of metric dimensions in the same column. However, different measurement methods may be used for the same metric dimension or combination of metric dimensions, which may result in a single metric column in the intermediate table containing measure values ​​corresponding to multiple measurement methods. One implementation constructs an intermediate table corresponding to each version of the original dataset by using the metric dimension values ​​as dimension columns and the measure values ​​of the original data under each metric condition as metric columns, including:

[0061] The preset indicator conditions are encoded to obtain the coded value corresponding to each indicator condition;

[0062] The coded values ​​corresponding to the indicator conditions that match the original data and the measurement values ​​of the original data under the indicator conditions that match the original data are combined to obtain the condition measurement combination of the original data under the indicator conditions that match the original data.

[0063] By using the indicator dimension values ​​corresponding to the original data as dimension columns and the conditional measure combinations corresponding to the original data as indicator columns, an intermediate table is constructed for each original dataset.

[0064] Specifically, preset indicator conditions can be encoded using numbers. For example, when the indicator condition is (), (a), (b), or (a,b), the codes corresponding to each indicator condition can be 1, 2, 3, and 4. After obtaining the codes corresponding to the indicator conditions, the encoded values ​​of the indicator conditions corresponding to each metric can be combined to obtain a condition metric combination. This specification does not specify a particular method for combining metric values ​​and encoded values; it can be determined according to the actual situation. Furthermore, the combined condition metric combination can be used as an indicator column, and the indicator dimension values ​​as dimension columns to construct an intermediate table. Representing the values ​​corresponding to the indicator columns in the intermediate table as combinations of indicator conditions and metric values ​​can improve the accuracy of subsequent aggregation based on the intermediate table. The method for constructing indicator conditions can include:

[0065] Obtain at least one metric dimension for grouping the raw data;

[0066] Use the indicator dimensions and / or combinations of at least two indicator dimensions as the indicator criteria for grouping the original data.

[0067] Specifically, possible combinations of existing indicator dimensions can be used as indicator conditions. For example, when the indicator dimensions include dimension a and dimension b, the combination of indicator dimensions can include (), (a), (b), or (a, b), and the indicator conditions can be consistent with the combination of indicator dimensions.

[0068] In the embodiments of this specification, the indicator dimension values ​​of the original data are used as dimension columns, and the measurement values ​​of the original data under various indicator conditions are used as indicator columns to construct intermediate tables corresponding to the original datasets of each version. This ensures that the number of record rows in the intermediate tables is consistent with the number of original data, thereby avoiding the expansion of data record rows during the intermediate table construction stage.

[0069] In one implementation, the record rows of the same type of original data in the intermediate table corresponding to each original dataset are subjected to a first aggregation operation to obtain a set of aggregation tables corresponding to the original datasets, including:

[0070] Based on the indicator dimension values, the record rows in the intermediate table corresponding to a set of original datasets are classified. The indicator dimension values ​​corresponding to each indicator dimension of each record row in the same type are the same.

[0071] Based on the preset aggregation function, the first aggregation operation is performed on the metric values ​​corresponding to each record row of the same type to obtain the first aggregate value corresponding to the original data of each type;

[0072] Construct an aggregation table by using the indicator dimension value corresponding to each type of raw data as the dimension column and the first aggregated value corresponding to each type of raw data as the indicator column.

[0073] Since the intermediate tables already show the metric values ​​corresponding to the combinations of metric dimension values ​​for each metric condition, in one example, the data in the intermediate tables can be combined based on different combinations of metric dimension values. Specifically, rows with the same combination of metric dimension values ​​in the corresponding rows of the intermediate tables can be classified as the same type. Further, the metric values ​​corresponding to the same type of rows in the intermediate tables can be subjected to a first aggregation operation to obtain a first aggregated value. In one implementation, based on a preset aggregation function, the metric values ​​corresponding to each row of records in the same type are subjected to a first aggregation operation to obtain the first aggregated value corresponding to the original data of each type, including:

[0074] Get the aggregate function corresponding to each indicator condition;

[0075] Based on the aggregation function corresponding to the indicator conditions, the measure values ​​corresponding to each record row in the same type are aggregated according to the indicator conditions to obtain the first aggregated value of the original data of each type under different indicator conditions.

[0076] The aggregation functions corresponding to each indicator condition can be the same or different; this specification does not impose specific limitations on this. After obtaining the aggregation function corresponding to each indicator condition, the measure values ​​corresponding to the same indicator condition in each record row of the same type can be subjected to a first aggregation operation to obtain the first aggregated value of the original data of the same type under different indicator conditions. Furthermore, the coded value corresponding to the indicator condition and the first aggregated value can be combined in the aggregation table to improve the accuracy of subsequent operations on the first aggregated value.

[0077] Figure 5 The flowchart illustrating the process of obtaining the aggregate table using the method described in this specification is shown. Specifically, the datasets input at the two nodes are matched using the aforementioned indicator conditions ln1, ln2, ln3, and ln4, respectively. Each data point is then measured using the metric method (function count) corresponding to the matched indicator condition. The metric values ​​and indicator conditions are assembled to construct an intermediate table corresponding to the datasets at each node. The intermediate table is then subjected to the first aggregation operation using the aggregation function count to obtain the aggregate table.

[0078] In the embodiments of this specification, after classifying the record rows in the intermediate table based on the indicator dimension values, an aggregation function is used to perform a first aggregation operation on record rows of the same type, thereby constructing a fine-grained aggregation table that can characterize the metric value of each type of original data under each indicator condition. Since the number of record rows in the intermediate table is consistent with the number of data in the original dataset, data bloat during the first aggregation process (shuffle stage) is avoided, improving the speed of obtaining the aggregation table and thus improving the speed at which users obtain indicator calculation results.

[0079] In one implementation, the method also includes:

[0080] Based on the indicator dimensions corresponding to the indicator conditions, extract the indicator dimension value group corresponding to each indicator condition and the first aggregate value corresponding to the indicator dimension value group from each record row in different aggregation tables.

[0081] Based on a preset aggregation function, the first aggregated value corresponding to the same indicator dimension value group is subjected to a second aggregation operation to obtain the second aggregated value corresponding to each indicator dimension value group.

[0082] Construct a roll-up table corresponding to the indicator conditions by using the indicator dimension values ​​in the indicator dimension value group corresponding to the indicator conditions as dimension columns and the second aggregate value corresponding to the indicator dimension value group as indicator columns. Each record row in the roll-up table is used to indicate the second aggregate value corresponding to each indicator dimension value group under the indicator conditions.

[0083] Since aggregation represents the fine-grained measurement values ​​of each category of raw data under each metric condition, to further improve the efficiency of users' queries at the coarse-grained level, in one example, the data under each preset metric condition can be aggregated again based on the aggregation table. Specifically, the first aggregated values ​​corresponding to the various metric dimension value groups for each metric condition can be subjected to a second aggregation operation to obtain a second aggregated value. Furthermore, based on the second aggregated value, a roll-up table corresponding to each metric condition can be constructed.

[0084] Since the data in the aggregation table is obtained through the first aggregation operation, the amount of data in the aggregation table is further reduced compared to the amount of data in the intermediate table. Therefore, the aforementioned method of setting up the intermediate table also achieves the effect of further reducing the amount of data participating in the second aggregation operation, i.e., the second shuffle stage.

[0085] During a user query, the system can automatically match the required roll-up table from existing roll-up tables based on the dimension columns and aggregation methods needed in the user's query. For example, when a user queries the aggregated value corresponding to multiple metrics (metric dimension value groups), the system can match the roll-up table corresponding to the target metric condition based on the metric dimension value group, and then match the aggregated value corresponding to the metric dimension value group in the roll-up table.

[0086] Figure 6 A flowchart illustrating the process of obtaining the upper volume table using the methods described in this specification is shown. Figure 6 As shown, the indicator dimension value group corresponding to each indicator condition and the second aggregate value corresponding to the indicator dimension value group are extracted from each record row in different aggregate tables. Then, based on the indicator dimension value group and the second aggregate value corresponding to the same indicator condition, the roll-up table corresponding to each indicator condition is constructed.

[0087] In the embodiments of this specification, the aggregated values ​​in the aggregated table are aggregated according to the indicator condition dimension to obtain a roll-up table corresponding to each indicator condition. This improves the query efficiency for users at the coarse-grained level (i.e., the indicator condition dimension) based on the fine-grained aggregated table. Simultaneously, this scheme avoids repeated data shuffling during the calculation of different classification indicators by first aggregating indicators on the fine-grained grouping scheme, and then performing a secondary aggregation on each grouping scheme in the obtained aggregated table through a roll-up operation. This improves the performance of multi-indicator calculations while reducing computational costs.

[0088] Figure 7 This is a schematic flowchart illustrating a data processing method according to an embodiment of this specification. Figure 7 As shown, this method can be performed as follows:

[0089] Step 1: Indicator Coding. Specifically, for the pre-defined indicators with groupable dimension columns, calculate the possible grouping combinations, encode them, and store them in the indicator repository. If the pre-defined groupable dimension columns are (a, b), then the possible grouping combinations are: no grouping, encoded as 1; grouped by dimension column a, encoded as 2; grouped by dimension column b, encoded as 3; grouped by both dimension columns a and b, encoded as 4.

[0090] The second step is indicator matching. Specifically, based on the filtering conditions of each indicator, each piece of raw data to be calculated is matched one by one with the indicators in the indicator repository.

[0091] The third step is the construction of the intermediate table. Specifically, based on the metric and grouping configurations, the metric values ​​and matching grouping combination codes are calculated. The metric values ​​for each dimension combination are then assembled into a record row and inserted into the intermediate table. The intermediate table structure is as follows: (a, b, metric1, metric2, metric3, metric4), where a and b are dimension columns, and metric1, metric2, metric3, and metric4 contain the metric values ​​for each dimension combination. Metrics without grouping are listed in column metric1; metrics grouped by dimension column a are listed in column metric2; metrics grouped by dimension column b are listed in column metric3; and metrics grouped by both dimensions a and b are listed in column metric4.

[0092] The fourth step is to generate the aggregation table. Specifically, aggregation is performed on the granular combination (a, b) within the aggregateable dimension combinations on the intermediate table to obtain the aggregation table. The process of generating the aggregation table can be found in [reference needed]. Figure 5 .

[0093] Step 5: Generating the roll-up table. Specifically, on the fine-grained aggregation table, perform a roll-up operation on other possible dimension combinations. This includes: aggregating the metric1 column to obtain the aggregated values ​​of the metrics that satisfy the grouping condition; aggregating the metric2 column to obtain the aggregated values ​​of the metrics that satisfy the grouping condition; aggregating the metric3 column to obtain the aggregated values ​​of the metrics that satisfy the grouping condition; since the pre-aggregated table is statistically analyzed according to the grouping pattern of the metric4 column, a direct query can be executed. The process of generating the roll-up table can be found in [reference needed]. Figure 6 .

[0094] It should be noted that the data processing method provided in the embodiments of this specification can be executed by a data processing apparatus or a control module within that data processing apparatus for executing the data processing method. This specification describes the data processing apparatus provided in the embodiments of this specification by using the data processing apparatus executing the data processing method as an example.

[0095] Figure 8 This is a schematic diagram of the structure of a data processing apparatus according to an embodiment of the present invention. Figure 8 As shown, the data processing apparatus 800 includes:

[0096] The condition determination module 810 is used to match each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data. The set of raw datasets contains at least one raw dataset.

[0097] The measurement value determination module 820 is used to perform measurement operations on the original data using the measurement method corresponding to each indicator condition that matches the original data, so as to obtain the measurement value of the original data under each indicator condition that matches the original data.

[0098] The intermediate table construction module 830 is used to construct an intermediate table corresponding to each original dataset based on the measure value of the original data under each indicator condition that matches the original data. Each record row in the intermediate table is used to indicate the measure value of each piece of original data under each indicator condition that matches the original data.

[0099] The first aggregation module 840 is used to perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain a set of aggregation tables corresponding to the original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matching indicator condition.

[0100] In one embodiment, each metric condition is constructed based on the same metric dimension, and the intermediate table construction module 830 includes:

[0101] The dimension value determination unit is used to determine the indicator dimension value corresponding to each indicator dimension in the indicator conditions that match the original data from the original data.

[0102] The intermediate table construction unit is used to construct an intermediate table corresponding to each original dataset by taking the indicator dimension values ​​corresponding to the original data as dimension columns and the measure values ​​of the original data under each indicator condition that matches the original data as indicator columns.

[0103] In one embodiment, the intermediate table construction unit is used for:

[0104] The preset indicator conditions are encoded to obtain the coded value corresponding to each indicator condition;

[0105] The coded values ​​corresponding to the indicator conditions that match the original data and the measurement values ​​of the original data under the indicator conditions that match the original data are combined to obtain the condition measurement combination of the original data under the indicator conditions that match the original data.

[0106] By using the indicator dimension values ​​corresponding to the original data as dimension columns and the conditional measure combinations corresponding to the original data as indicator columns, an intermediate table is constructed for each original dataset.

[0107] In one embodiment, the first aggregation module 840 includes:

[0108] The classification unit is used to classify the record rows in the intermediate table corresponding to a set of original datasets according to the indicator dimension values. The indicator dimension values ​​corresponding to each indicator dimension of each record row in the same type are the same.

[0109] The aggregation unit is used to perform a first aggregation operation on the measure values ​​corresponding to each record row of the same type based on a preset aggregation function, so as to obtain the first aggregated value corresponding to the original data of each type.

[0110] The aggregation table construction unit is used to construct an aggregation table by taking the indicator dimension value corresponding to each type of original data as the dimension column and the first aggregation value corresponding to each type of original data as the indicator column.

[0111] In one embodiment, the aggregation unit is used for:

[0112] Get the aggregate function corresponding to each indicator condition;

[0113] Based on the aggregation function corresponding to the indicator conditions, the measure values ​​corresponding to each record row in the same type are aggregated according to the indicator conditions to obtain the first aggregated value of the original data of each type under different indicator conditions.

[0114] In one embodiment, the data processing apparatus 800 further includes:

[0115] The extraction module is used to extract the indicator dimension value group corresponding to each indicator condition and the first aggregate value corresponding to the indicator dimension value group from each record row in different aggregation tables based on the indicator dimension corresponding to the indicator condition.

[0116] The second aggregation module is used to perform a second aggregation operation on the first aggregation value corresponding to the same indicator dimension value group based on a preset aggregation function, so as to obtain the second aggregation value corresponding to each indicator dimension value group.

[0117] The roll-up table construction module is used to construct the roll-up table corresponding to the indicator conditions by taking the indicator dimension values ​​in the indicator dimension value group corresponding to the indicator conditions as dimension columns and the second aggregate value corresponding to the indicator dimension value group as indicator columns. Each record row in the roll-up table is used to indicate the second aggregate value corresponding to each indicator dimension value group under the indicator conditions.

[0118] In one embodiment, the method for constructing indicator conditions includes:

[0119] Obtain at least one metric dimension for grouping the raw data;

[0120] Use the indicator dimensions and / or combinations of at least two indicator dimensions as the indicator criteria for grouping the original data.

[0121] In one embodiment, the data processing apparatus 800 further includes:

[0122] The request retrieval module is used to retrieve query requests for the aggregated values ​​corresponding to the target indicator conditions in the aggregate table. The query request includes a query time range identifier.

[0123] The third aggregation module is used to perform a third aggregation operation on the aggregation table corresponding to each set of original datasets within the query time range to obtain a query aggregation table. Each record row in the query aggregation table is used to indicate the third aggregation value of each type of original data in each set of original datasets within the query time range under each matching indicator condition.

[0124] The query result retrieval module is used to determine the third aggregate value that matches the target indicator condition from the query aggregate table, and use it as the query result corresponding to the query request.

[0125] The data processing apparatus in the embodiments of this specification can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. The embodiments in this specification do not impose specific limitations.

[0126] The data processing apparatus in the embodiments of this specification can be an apparatus with an operating system. This operating system can be Android, iOS, or other possible operating systems; the embodiments in this specification do not specifically limit it.

[0127] The data processing apparatus provided in the embodiments of this specification can achieve... Figure 1 The various processes implemented in the method embodiments are not described in detail here to avoid repetition.

[0128] Based on the same idea, one or more embodiments of this specification also provide an electronic device, such as... Figure 9 As shown. Electronic devices can vary considerably due to differences in configuration or performance, and may include one or more processors 901 and memory 902. Memory 902 may store one or more application programs or data. Memory 902 may be temporary or persistent storage. The application programs stored in memory 902 may include one or more modules (not shown), each module may include a series of computer-executable instructions for the electronic device. Furthermore, processor 901 may be configured to communicate with memory 902 and execute the series of computer-executable instructions in memory 902 on the electronic device. The electronic device may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input / output interfaces 905, and one or more keyboards 906.

[0129] Specifically, in this embodiment, the electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for use in the electronic device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0130] Each piece of raw data in a set of raw datasets is matched with preset indicator conditions to determine the indicator conditions that match each piece of raw data. A set of raw datasets contains at least one raw dataset.

[0131] Using the measurement method corresponding to each indicator condition that matches the original data, the original data is measured to obtain the measurement value of the original data under each indicator condition that matches the original data.

[0132] Based on the measure values ​​of the original data under each indicator condition that matches the original data, an intermediate table is constructed for each original dataset. Each record row in the intermediate table is used to indicate the measure value of each piece of original data under each indicator condition that matches the original data.

[0133] Perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain a set of aggregation tables corresponding to the original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matching indicator condition.

[0134] One or more embodiments of this specification also provide a storage medium storing one or more computer programs, the one or more computer programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform various processes of the above-described data processing method embodiments, and specifically for performing:

[0135] Each piece of raw data in a set of raw datasets is matched with preset indicator conditions to determine the indicator conditions that match each piece of raw data. A set of raw datasets contains at least one raw dataset.

[0136] Using the measurement method corresponding to each indicator condition that matches the original data, the original data is measured to obtain the measurement value of the original data under each indicator condition that matches the original data.

[0137] Based on the measure values ​​of the original data under each indicator condition that matches the original data, an intermediate table is constructed for each original dataset. Each record row in the intermediate table is used to indicate the measure value of each piece of original data under each indicator condition that matches the original data.

[0138] Perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain a set of aggregation tables corresponding to the original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matching indicator condition.

[0139] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the above-described storage medium embodiment is basically similar to the method embodiment, so the description is relatively simple; relevant parts can be referred to the description of the method embodiment.

[0140] The methods, apparatus, modules, or units described in the above embodiments can be implemented by a computer chip or entity, or by a product with a certain function. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0141] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.

[0142] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0143] This specification describes one or more embodiments of methods, apparatus (systems), and computer program products according to embodiments of this specification with reference to flowchart illustrations and / or block diagrams. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, produce a machine for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0144] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0145] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0146] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0147] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0148] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0149] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0150] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. This specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0151] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0152] The above description is merely one or more embodiments of this specification and is not intended to limit this application. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of one or more embodiments of this specification.

Claims

1. A data processing method, comprising: Each piece of raw data in a set of raw datasets is matched with preset indicator conditions to determine the indicator conditions that match each piece of raw data. The set of raw datasets contains at least one raw dataset. The original data is measured using the measurement method corresponding to each indicator condition that matches the original data, to obtain the measurement value of the original data under each indicator condition that matches the original data. Based on the measurement value of the original data under each indicator condition that matches the original data, an intermediate table is constructed for each original dataset. Each record row in the intermediate table is used to indicate the measurement value of each piece of original data under each indicator condition that matches the original data. Perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain an aggregation table corresponding to the set of original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matched indicator condition.

2. The method according to claim 1, wherein each indicator condition is constructed based on the same indicator dimension, and the step of constructing an intermediate table corresponding to each original dataset based on the metric value of the original data under each indicator condition matching the original data includes: From the original data, determine the indicator dimension value corresponding to each indicator dimension in the indicator conditions that match the original data; By using the indicator dimension values ​​corresponding to the original data as dimension columns and the measurement values ​​of the original data under each indicator condition that matches the original data as indicator columns, an intermediate table corresponding to each original dataset is constructed.

3. The method according to claim 2, wherein constructing an intermediate table corresponding to each original dataset by using the indicator dimension values ​​corresponding to the original data as dimension columns and the measurement values ​​of the original data under each indicator condition matching the original data as indicator columns, comprises: The preset indicator conditions are encoded to obtain the encoded value corresponding to each indicator condition; The encoded value corresponding to the indicator condition that matches the original data and the measurement value of the original data under the indicator condition that matches the original data are combined to obtain the condition measurement combination of the original data under the indicator condition that matches the original data. By using the indicator dimension values ​​corresponding to the original data as dimension columns and the conditional measure combinations corresponding to the original data as indicator columns, an intermediate table is constructed for each original dataset.

4. The method according to claim 2, wherein performing a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain the aggregate table corresponding to the set of original datasets includes: Based on the indicator dimension values, the record rows in the intermediate table corresponding to a set of original datasets are classified, and the indicator dimension values ​​corresponding to each indicator dimension of each record row in the same type are the same. Based on a preset aggregation function, the metric values ​​corresponding to each record row of the same type are subjected to a first aggregation operation to obtain the first aggregated value corresponding to the original data of each type; The aggregation table is constructed by using the indicator dimension value corresponding to the original data of each type as the dimension column and the first aggregate value corresponding to the original data of each type as the indicator column.

5. The method according to claim 4, wherein the first aggregation operation is performed on the metric values ​​corresponding to each record row of the same type based on a preset aggregation function to obtain the first aggregated value corresponding to the original data of each type, comprising: Obtain the aggregation function corresponding to each of the aforementioned indicator conditions; Based on the aggregation function corresponding to the indicator conditions, the metric values ​​corresponding to each record row in the same type are subjected to the first aggregation operation according to the indicator conditions, so as to obtain the first aggregated value of the original data of each type under different indicator conditions.

6. The method according to claim 4, further comprising: Based on the indicator dimension corresponding to the indicator condition, extract the indicator dimension value group corresponding to each indicator condition and the first aggregate value corresponding to the indicator dimension value group from each record row in different aggregation tables; Based on a preset aggregation function, the first aggregated value corresponding to the same group of indicator dimension values ​​is subjected to a second aggregation operation to obtain the second aggregated value corresponding to each group of indicator dimension values. The index dimension values ​​in the index dimension value group corresponding to the index condition are used as dimension columns, and the second aggregate value corresponding to the index dimension value group is used as index column to construct the roll-up table corresponding to the index condition. Each record row in the roll-up table is used to indicate the second aggregate value corresponding to each index dimension value group under the index condition.

7. The method according to claim 2, wherein the method for constructing the indicator conditions comprises: Obtain at least one indicator dimension for grouping the raw data; The indicator dimension and / or a combination of at least two of the indicator dimensions are used as the indicator criteria for grouping the original data.

8. The method according to claim 1, further comprising: Obtain a query request for the aggregated value corresponding to the target indicator condition in the aggregate table, wherein the query request includes a query time range identifier; A third aggregation operation is performed on the aggregation table corresponding to each set of original datasets within the query time range to obtain a query aggregation table. Each record row in the query aggregation table is used to indicate the third aggregation value of each type of original data in each set of original datasets within the query time range under each matching indicator condition. The third aggregate value that matches the target indicator condition is determined from the query aggregate table and used as the query result corresponding to the query request.

9. A data processing apparatus, comprising: The condition determination module is used to match each piece of raw data in a set of raw datasets with preset indicator conditions to determine the indicator conditions that match each piece of raw data. The set of raw datasets includes at least one raw dataset. The measurement value determination module is used to perform measurement operations on the original data using the measurement method corresponding to each indicator condition that matches the original data, so as to obtain the measurement value of the original data under each indicator condition that matches the original data. The intermediate table construction module is used to construct an intermediate table corresponding to each original dataset based on the measurement value of the original data under each indicator condition that matches the original data. Each record row in the intermediate table is used to indicate the measurement value of each piece of original data under each indicator condition that matches the original data. The first aggregation module is used to perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain an aggregation table corresponding to the set of original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matching indicator condition.

10. An electronic device, comprising: processor, and A memory configured to store computer-executable instructions, which, when executed, enable the processor to: Each piece of raw data in a set of raw datasets is matched with preset indicator conditions to determine the indicator conditions that match each piece of raw data. The set of raw datasets contains at least one raw dataset. The original data is measured using the measurement method corresponding to each indicator condition that matches the original data, to obtain the measurement value of the original data under each indicator condition that matches the original data. Based on the measurement value of the original data under each indicator condition that matches the original data, an intermediate table is constructed for each original dataset. Each record row in the intermediate table is used to indicate the measurement value of each piece of original data under each indicator condition that matches the original data. Perform a first aggregation operation on the record rows of the same type of original data in the intermediate table corresponding to each original dataset to obtain an aggregation table corresponding to the set of original datasets. Each record row in the aggregation table is used to indicate the first aggregation value of each type of original data in each original dataset under each matched indicator condition.

Citation Information

Patent Citations

  • Indicator calculating method and system based on dimension combinations

    CN105354272A

  • Data processing method and device, electronic equipment and storage medium

    CN116150200A