Data aggregation method, apparatus, device, and medium
By acquiring the dimensions and metrics of user input, the data model DM metadata is used to determine the set of data source tables from the candidate data source tables, and the data is aggregated to generate the target dataset. This solves the problem of fixed association methods in existing technologies, and enables flexible generation of target datasets and improves human-computer interaction efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2021-08-04
- Publication Date
- 2026-05-19
AI Technical Summary
In existing technologies, the association methods and conditions between data source tables are relatively fixed and cannot be flexibly adjusted according to the dimensions and indicators input by the user, resulting in the inability to flexibly generate the target dataset.
By acquiring the dimensions and metrics input by the user, the data model DM metadata is used to determine the set of data source tables from the candidate data source tables, and the data is aggregated to generate the target dataset, including splitting composite metrics, merging basic metrics, generating database query statements, and executing query operations.
It enables the flexible generation of various target datasets according to user needs, simplifies operation steps, improves human-computer interaction efficiency, and reduces database engine load and computation time.
Smart Images

Figure CN115705347B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of databases, and in particular to a data aggregation method, apparatus, device, and medium. Background Technology
[0002] A data source table is a way to store data. There may be related data between multiple data source tables. In this case, it is necessary to link the data between multiple data source tables for easy management.
[0003] When there is related data between two data source tables, the relevant technology requires the user to first determine the association method between the two data source tables, then determine the association conditions between the two data source tables, and finally generate a fixed query SQL (Structured Query Language) scheme based on the above association method and association conditions, and perform the association query in the data storage engine.
[0004] The methods for generating association methods and conditions in related technologies are relatively fixed, and it is impossible to flexibly adjust the association strategy rules according to the dimensions and indicators input by users. Summary of the Invention
[0005] This application provides a data aggregation method, apparatus, device, and medium. This method can flexibly generate different types of target datasets based on user-input dimensions and indicators. The technical solution is as follows:
[0006] According to one aspect of this application, a data aggregation method is provided, the method being applied in a computer device storing data model metadata (DM), the DM metadata representing the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables, the candidate dimensions representing data types, and the input metrics representing parameters for measuring data, the method comprising:
[0007] The input dimension and input metric are obtained from the graphical user interface, wherein the input dimension belongs to the candidate dimension and the input metric belongs to the candidate metric;
[0008] Based on the DM metadata, a set of data source tables corresponding to the input dimension and the input metric are determined from the candidate data source table. The set of data source tables includes data source tables with the input dimension as the dimension and the input metric as the metric.
[0009] Aggregate the data from the data source table set and output the target dataset corresponding to the input dimension and the input metric.
[0010] According to one aspect of this application, a data aggregation apparatus is provided. The apparatus stores data model metadata (DM metadata), the DM metadata representing the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables, the candidate dimensions representing data types, and the input metrics representing parameters for measuring data. The apparatus includes:
[0011] An acquisition module is used to acquire input dimensions and input metrics from a graphical user interface, wherein the input dimensions belong to the candidate dimensions and the input metrics belong to the candidate metrics;
[0012] The mapping module is used to determine, based on the DM metadata, a set of data source tables corresponding to the input dimension and the input metric from the candidate data source table. The set of data source tables includes data source tables with the input dimension as the dimension and the input metric as the metric.
[0013] The aggregation module is used to aggregate the data in the data source table set and output the target dataset corresponding to the input dimension and the input metric.
[0014] In an optional design of this application, the input metrics include input basic metrics and input composite metrics. The input basic metrics are indivisible metrics, and the input composite metrics are metrics obtained by mathematical operations on at least two basic metrics. The mapping module is further configured to: split the input composite metrics into split basic metrics; merge the input basic metrics and the split basic metrics to obtain target basic metrics; determine the target data source table corresponding to the input dimension and the target basic metrics from the candidate data source table based on the DM metadata; and merge the target data source tables to obtain the data source table set.
[0015] In an optional design of this application, the target basic indicator includes the i-th target basic indicator, where i is a positive integer. The mapping module is further configured to determine, based on the DM metadata, n target candidate data source tables corresponding to the input dimension and the i-th target basic indicator from the candidate data source tables, where n is an integer greater than 1; preferentially, the data source table belonging to the pre-aggregated data source table in the n target candidate data source tables is determined as the target data source table, where the pre-aggregated data source table is used to represent a data source table that only includes the basic indicator; or, preferentially, the data source table with the smallest amount of stored data in the n target candidate data source tables is determined as the target data source table.
[0016] In an optional design of this application, the target basic indicators include the a-th target basic indicator and the b-th target basic indicator, where a and b are positive integers; the mapping module is further configured to determine j target candidate data source tables corresponding to the input dimension and the a-th target basic indicator from the candidate data source tables based on the DM metadata, where j is a positive integer; determine k target candidate data source tables corresponding to the input dimension and the b-th target basic indicator from the candidate data source tables based on the DM metadata, where k is a positive integer; and if there is an identical data source table in the j-th target candidate data source tables and the k-th target candidate data source tables, determine the identical data source table as the target data source table.
[0017] In an optional design of this application, the aggregation module is further configured to generate a database query statement based on the data source table set and the DM metadata; execute the data query statement to query an intermediate query result set from the candidate data source table, wherein the intermediate query result set is a set of datasets composed of input dimensions and target basic indicators; aggregate the data in the intermediate query result set, and output the target dataset corresponding to the input dimensions and the input indicators.
[0018] In an optional design of this application, the aggregation module is further configured to determine the database query statement generation rules corresponding to the data source table set and the DM metadata; and to substitute the input dimensions and target basic indicators of each data source table in the data source table set into the database query statement generation rules to generate the database query statement.
[0019] In an optional design of this application, the aggregation module is further configured to aggregate the intermediate query result set and output the basic indicator dataset corresponding to the input basic indicator; calculate the composite indicator dataset according to the intermediate query result set and the calculation formula of the input composite indicator; merge the data in the composite indicator dataset into the basic indicator dataset and output the target dataset corresponding to the input dimension and the input indicator.
[0020] In an optional design of this application, the apparatus further includes: a preprocessing module;
[0021] The preprocessing module is used to obtain forward DM metadata, which represents the mapping relationship between the candidate data source table and the candidate dimension and the candidate indicator; convert the forward DM metadata into inverted DM metadata through inverted index operation; and store the inverted DM metadata in the computer device.
[0022] In an optional design of this application, the acquisition module is further configured to acquire the input dimension and the input metric in response to an input operation on the graphical user interface; or, in response to a first selection operation on the graphical user interface, determine the input dimension from the candidate dimensions; and in response to a second selection operation on the graphical user interface, determine the input metric from the candidate metric.
[0023] According to another aspect of this application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the data aggregation method as described above.
[0024] According to another aspect of this application, a computer storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the program code being loaded and executed by a processor to implement the data aggregation method as described above.
[0025] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data aggregation method described above.
[0026] The beneficial effects of the technical solutions provided in this application include at least the following:
[0027] After obtaining the user's input dimensions and input metrics from the graphical user interface, the computer device determines the set of data source tables from the candidate data source table based on the input dimensions and input metrics. Then, the computer device aggregates the set of data source tables to obtain the target dataset corresponding to the input dimensions and input metrics. This method can not only flexibly generate multiple target datasets according to the user's needs, but also greatly simplify the user's operation steps. The user only needs to provide the input dimensions and input metrics, which improves the efficiency of human-computer interaction. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1This is a schematic diagram of a computer system provided in an exemplary embodiment of this application;
[0030] Figure 2 This is a flowchart illustrating a data aggregation method provided in an exemplary embodiment of this application;
[0031] Figure 3 This is a schematic diagram of the interface of a data aggregation method provided in an exemplary embodiment of this application;
[0032] Figure 4 This is a schematic diagram of the data model metadata provided in an exemplary embodiment of this application;
[0033] Figure 5 This is a flowchart illustrating a method for determining a set of data source tables provided in an exemplary embodiment of this application;
[0034] Figure 6 This is a schematic diagram of a data aggregation method provided in an exemplary embodiment of this application;
[0035] Figure 7 This is a flowchart illustrating a data aggregation method provided in an exemplary embodiment of this application;
[0036] Figure 8 This is a flowchart illustrating a method for storing DM metadata provided in an exemplary embodiment of this application;
[0037] Figure 9 This is a schematic diagram of an interface for a method of storing DM metadata provided in an exemplary embodiment of this application;
[0038] Figure 10 This is a flowchart illustrating a data aggregation method provided in an exemplary embodiment of this application;
[0039] Figure 11 This is a schematic diagram of a data aggregation apparatus provided in an exemplary embodiment of this application;
[0040] Figure 12 This is a structural block diagram of a computer device provided in another exemplary embodiment of this application. Detailed Implementation
[0041] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0042] First, let's introduce the terms used in the embodiments of this application:
[0043] Data source table: refers to the table in the database used to store and provide data.
[0044] DM (Data Model): Metadata describing the organization of multiple predefined data source tables, similar to a large wide table in a data warehouse. It consists of one or more data source tables and provides a unified, analyzable view of dimensions and metrics. DM metadata includes at least one of the following: mapping relationships between multiple data source tables and analyzable dimensions and metrics; the value representation of dimensions and metrics; and their Chinese display names. The content of DM metadata can be more extensive, and this application does not limit this scope.
[0045] Dim (Dimension): Refers to the perspective from which data is observed, that is, the angle from which data is analyzed or viewed. It can also be considered a way of classifying data; for example, gender or region are dimensions. Optionally, a dimension is category data in the data source table.
[0046] Metrics (Metrics): Also known as a measure, it's about evaluating data values based on dimensions. Examples include new user count and order volume. Optionally, metrics are numerical data from a data source table. Optionally, metrics can be converted into dimensions. For instance, assuming the metric is order amount, it can be categorized into three types based on the order amount: 0-30 yuan, 30-60 yuan, and 30-90 yuan. 0-30 yuan is assigned to dimension 1, 30-60 yuan to dimension 2, and 30-90 yuan to dimension 3, thus achieving the conversion from metric to dimension.
[0047] Figure 1 A schematic diagram of the structure of a computer system provided in an exemplary embodiment of this application is shown. The computer system 100 includes a terminal 120 and a server 140.
[0048] Terminal 120 runs an application related to data aggregation. This application can be a small program within an app, a dedicated application, or a web client. Optionally, the user performs data aggregation-related operations on terminal 120; for example, the user... Terminal 120 is at least one of a smartphone, tablet, e-book reader, MP3 player, MP4 player, laptop, and desktop computer.
[0049] Terminal 120 is connected to server 140 via a wireless network or a wired network.
[0050] Server 140 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 140 provides background services for data aggregation applications and sends the results of data aggregation to terminal 120. Optionally, server 140 undertakes the main computing work, and terminal 120 undertakes the secondary computing work; or, server 140 undertakes the secondary computing work, and terminal 120 undertakes the main computing work; or, server 140 and terminal 120 jointly perform computing using a distributed computing architecture.
[0051] Figure 2 A flowchart illustrating a data aggregation method provided in an exemplary embodiment of this application is shown. This method can be... Figure 1 The method is executed by the terminal 120, server 140, or other computer device shown. The computer device executing the method stores data model (DM) metadata, which represents the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables. Candidate dimensions represent data types, and input metrics represent parameters for measuring data. The method includes the following steps:
[0052] Step 202: Obtain the input dimensions and input metrics from the graphical user interface. The input dimensions are candidate dimensions, and the input metrics are candidate metrics.
[0053] Input dimensions refer to field-type data, while input metrics refer to value-type data. For example, if the input dimension is "student gender" and the input metric is "student age", then fields such as "male" or "female" are needed to describe the dimension "student gender", and values such as "16" or "18" are needed to describe the metric "student age".
[0054] Users can define the input dimensions and input metrics themselves. In one optional implementation, the input dimensions and input metrics are obtained in response to input operations on the graphical user interface. Optionally, the input operation is to press one or more preset physical keys to input the input dimension or input metric, or the input operation can be performed by signals generated by long-pressing, clicking, double-clicking, and / or swiping on a designated area of the touchscreen. For example, if a user enters the text "student age" in the graphical user interface using the keyboard, the computer device directly obtains the input metric "student age" based on the entered "student age".
[0055] Users can also select the desired input dimension and input metric from candidate dimensions and candidate metrics. Optionally, in response to a first selection operation on the graphical user interface, the input dimension is determined from the candidate dimensions; in response to a second selection operation on the graphical user interface, the input metric is determined from the candidate metrics. The first selection operation is to press one or more preset physical buttons to determine the target dimension from the candidate dimensions, or the first selection operation can be performed by signals generated by long-pressing, clicking, double-clicking, and / or swiping on a designated area of the touchscreen. The second selection operation is to press one or more preset physical buttons to determine the target metric from the candidate metrics, or the second selection operation can be performed by signals generated by long-pressing, clicking, double-clicking, and / or swiping on a designated area of the touchscreen. The first selection operation can be the same as the second selection operation, or the first selection operation can be different from the second selection operation.
[0056] For example, such as Figure 3 As shown, candidate dimensions 301 and candidate metrics 302 are displayed on the left side of the graphical user interface. When the user clicks on "Student ID" in candidate dimension 301, "Student ID" will be displayed as the target dimension 303 in the "Dimension" column of the graphical user interface to inform the user that the dimension "Student ID" has been successfully selected as the target dimension. When the user clicks on "Student Age" and "Student Score" in candidate metrics 302, "Student Age" and "Student Score" will be displayed as the target metrics 304 in the "Metrics" column of the graphical user interface to inform the user that the metrics "Student Age" and "Student Score" have been successfully selected as the target metrics.
[0057] Optionally, in response to a first search operation on the graphical user interface, a dimension button corresponding to the input dimension is displayed; in response to a dimension confirmation operation, the input dimension is obtained; in response to a second search operation on the graphical user interface, an indicator button corresponding to the input indicator is displayed; in response to an indicator confirmation operation, the input indicator is obtained. For example, after entering the text "student age" in the search bar of the graphical user interface, an indicator button is displayed on the graphical user interface, displaying the text "student age". When the user clicks the indicator button, "student age" is used as the target indicator.
[0058] Step 204: Based on the DM metadata, determine the set of data source tables corresponding to the input dimensions and input metrics from the candidate data source tables. The set of data source tables includes data source tables with input dimensions as dimensions and input metrics as metrics.
[0059] When the input dimensions include multiple dimensions, the data source tables in the data source table set include all input dimensions and at least one input metric. For example, suppose the input dimensions include "Student Name" and "Class Name," and the input metrics include "Student Age" and "Course Score." Suppose data source table 1 has the dimension "Student Name" and the metrics "Student Age" and "Course Score"; data source table 2 has the dimension "Student Name" and "Class Name," and the metric "Grade." Since data source table 1 does not include all input dimensions, it is not a data source table in the data source table set. While data source table 2 includes all input dimensions, it does not include at least one input metric; therefore, it is also not a data source table in the data source table set.
[0060] To ensure that the data source tables are available, optionally, the data source tables in the data source table collection should be in an active state.
[0061] For example, such as Figure 4 As shown, there are four candidate data source tables: Table1, Table2, Table3, and Table4. Candidate dimensions include p_date (date), platform (computer device system), city (city), and sex (gender). Candidate metrics include dau (daily active user), exp (exposure), pv (page view), vv (visit view), clk_uv (clickunique visitor), play_time (playtime), real_exp (real exposure), real_pv (real page view), real_vv (real visit view), and play_uv (playunique visitor). The DM metadata represents the mapping relationship between candidate dimensions and metrics and the candidate data source tables. Figure 4 The table shown can also be considered an implementation of DM metadata. Therefore, assuming the input dimensions include "p_date" and "platform", and the input metrics include "clk_uv" and "play_uv", then from... Figure 4 The data source tables that meet the requirements are Table2 and Table4, so the data source table set includes Table2 and Table4.
[0062] Step 206: Aggregate the data in the data source table collection and output the target dataset corresponding to the input dimensions and input metrics.
[0063] The target dataset is a dataset with input dimensions as its dimensions and input metrics as its metrics.
[0064] In summary, after obtaining the user's input dimensions and input metrics from the graphical user interface, the computer device determines the data source table set from the candidate data source table based on the input dimensions and input metrics. Then, the computer device aggregates the data source table set to obtain the target dataset corresponding to the input dimensions and input metrics. This method can not only flexibly generate multiple target datasets according to the user's needs, but also greatly simplify the user's operation steps. The user only needs to provide the input dimensions and input metrics, which improves the efficiency of human-computer interaction.
[0065] In the following embodiments, the input metrics are split into basic metrics. Since the number of basic metrics is finite, this reduces the number of input metrics and saves computation time. Furthermore, in some cases, each input metric may correspond to multiple data source tables in the candidate data source table; therefore, a method for determining the set of data source tables is provided, which improves query efficiency and reduces the database engine load.
[0066] Figure 5 A flowchart illustrating a method for determining a set of data source tables according to an exemplary embodiment of this application is shown. This method can be... Figure 1 The method is executed by the terminal 120, server 140, or other computer device shown. The computer device executing the method stores data model (DM) metadata, which represents the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables. Candidate dimensions represent data types, and input metrics represent parameters for measuring data. The method includes the following steps:
[0067] Step 501: Analyze the input dimensions and input metrics.
[0068] Optionally, the input indicators can be analyzed to determine the basic input indicators and composite input indicators.
[0069] Input indicators include basic input indicators and composite input indicators. Basic input indicators are indivisible indicators, while composite input indicators are indicators obtained by mathematical operations from at least two basic indicators.
[0070] For example, such as Figure 6As shown, the input dimensions and input metrics 601 obtained from the graphical user interface are p_date and platform, and dau, exp, pv, vv, clk_uv, average vv per user, average pv per user, average exp per user, ctr (clickthrough rate), and utr (unique through rate). Among these, average vv per user = vv / dau, average pv per user = pv / dau, average exp per user = exp / dau, ctr = pv / dau, and utr = clk_uv / dau. Therefore, Figure 6 Among the input metrics shown, dau, exp, pv, vv, and clk_uv are the basic input metrics, while per capita vv, per capita pv, per capita exp, ctr, and utr are the composite input metrics.
[0071] In this embodiment of the application, the input dimension refers to field type data, and the input indicator refers to value type data. For example, if the input dimension is "student gender" and the input indicator is "student age", then fields such as "male" or "female" are needed to describe the dimension "student gender", and values such as "16" or "18" are needed to describe the indicator "student age".
[0072] Step 502: Break down the input composite indicator into the split basic indicator.
[0073] Since the input composite indicator can be obtained through mathematical operations from at least two basic indicators, and the breakdown of basic indicators is obtained by breaking down the input composite indicator, the breakdown of basic indicators refers to the basic indicators required to calculate the input composite indicator. For example, such as... Figure 6 As shown, the per capita VV is split into basic indicators to obtain VV and DAU; the per capita PV is split into basic indicators to obtain PV and DAU; the CTR is split into basic indicators to obtain PV and DAU; and the UTR is split into basic indicators to obtain clk_uv and DAU.
[0074] Step 503: Merge the input basic indicators and split the basic indicators to obtain the target basic indicators.
[0075] Because after obtaining the basic indicators for splitting, duplicate basic indicators may appear, for example, such as... Figure 6 As shown, the average PV per person is split into split basic indicators to obtain PV and DAU. However, DAU is already present in the input indicators. Therefore, it is necessary to merge the input basic indicators and the split basic indicators, remove the common basic indicators in the input basic indicators and the split basic indicators, and obtain the target basic indicators DAU, exp, PV, VV and clk_uv.
[0076] Step 504: Based on the DM metadata, determine the target data source table corresponding to the input dimension and target basic metric from the candidate data source table.
[0077] When the input dimensions include multiple dimensions, the data source tables in the data source table set include all input dimensions and at least one input metric.
[0078] To ensure that the data source tables are available, optionally, the data source tables in the data source table collection should be in an active state.
[0079] In one optional embodiment of this application, the target basic indicator includes the i-th target basic indicator, where i is a positive integer. The following provides a method for determining the target data source table:
[0080] 1. Based on the DM metadata, determine n target candidate data source tables corresponding to the input dimension and the i-th target basic indicator from the candidate data source table, where n is an integer greater than 1.
[0081] In some cases, a target basic metric may have n corresponding target candidate data source tables. In this situation, it is necessary to determine the target data source table from these n candidate data source tables. For example, ... Figure 4 and Figure 6 As shown, the target basic metric DAU can be queried from either Table 1 or Table 4. To ensure query efficiency, it is necessary to determine which data source table to obtain the data from.
[0082] 2. Prioritize identifying the data source table that belongs to the pre-aggregated data source table among the n target candidate data source tables as the target data source table. The pre-aggregated data source table is used to represent the data source table that only includes basic indicators; or, prioritize identifying the data source table with the smallest amount of stored data among the n target candidate data source tables as the target data source table.
[0083] On the one hand, the data stored in the pre-aggregated data source table (cube) is already aggregated. When querying, the computer does not need to aggregate the data in the pre-aggregated data source table again, which can effectively improve aggregation efficiency and human-computer interaction efficiency.
[0084] On the other hand, when the target data source table is the smallest data source table mentioned above, subsequent processes need to query data from the target data source table in the database. If the target data source table has a large amount of stored data, it is not conducive to data retrieval, resulting in low efficiency for subsequent data queries. Therefore, choosing the data source table with the smallest stored data as the target data source table improves query efficiency.
[0085] In one optional embodiment of this application, the target basic indicators include the a-th target basic indicator and the b-th target basic indicator, where a and b are positive integers. The following provides a method for determining the target data source table:
[0086] 1. Based on the DM metadata, determine the j target candidate data source tables corresponding to the input dimension and the a-th target basic indicator from the candidate data source table, where j is a positive integer.
[0087] 2. Based on the DM metadata, determine the k target candidate data source tables corresponding to the input dimension and the b-th target basic indicator from the candidate data source table, where k is a positive integer.
[0088] 3. If there is a common data source table among j target candidate data source tables and k target candidate data source tables, the common data source table shall be determined as the target data source table.
[0089] In some cases, two different target basic indicators may correspond to the same data source table. In this case, the aforementioned same data source table can be used as the data source table corresponding to these two target basic indicators.
[0090] For example, such as Figure 4 and Figure 6 As shown, both the target basic metric dau and the target basic metric exp correspond to Table1. Therefore, Table1 is used as the target data source table for the target basic metric dau and the target basic metric exp.
[0091] It should be noted that from step 504 to step 505, the mapping process from DM metadata to data source table metadata is implemented. Both DM metadata and data source table metadata are metadata, and both DM metadata and data source table metadata are stored in computer devices.
[0092] Step 505: Merge the target data source tables to obtain a set of data source tables.
[0093] For example, such as Figure 4 and Figure 6 As shown, based on the input dimensions and target basic metrics dau, exp, pv, vv and clk_uv, the data source table set is {Table1(dau, exp), Table2(pv, vv), Table2(clk_uv)}.
[0094] Step 506: Process ends.
[0095] In summary, this embodiment provides a method for determining the set of data source tables. On one hand, this embodiment decomposes the input metrics to obtain target basic metrics, and associates all input metrics with the target basic metrics. As long as the DM metadata stores the basic metrics related to the composite metric, the data of that composite metric can be obtained. On the other hand, it provides multiple rules for determining the set of data source tables, which can not only improve query efficiency but also reduce the database engine load.
[0096] Figure 7 A flowchart illustrating a data aggregation method provided in an exemplary embodiment of this application is shown. This method can be... Figure 1 The method is executed by the terminal 120, server 140, or other computer device shown. The computer device executing the method stores data model (DM) metadata, which represents the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables. Candidate dimensions represent data types, and input metrics represent parameters for measuring data. The method includes the following steps:
[0097] Step 701: Obtain the input dimensions and input metrics from the graphical user interface.
[0098] In this embodiment of the application, a dimension refers to field-type data, and an indicator refers to numeric-type data. For example, if the dimension is "student gender" and the indicator is "student age", then fields such as "male" or "female" are needed to describe the dimension "student gender", and numbers such as "16" or "18" are needed to describe the indicator "student age".
[0099] Optionally, in response to input operations on the graphical user interface, input dimensions and input metrics are obtained.
[0100] Optionally, in response to a first selection operation on the graphical user interface, an input dimension is determined from candidate dimensions; in response to a second selection operation on the graphical user interface, an input metric is determined from candidate metrics.
[0101] Optionally, in response to a first search operation on the graphical user interface, a dimension button corresponding to the input dimension is displayed; in response to a dimension confirmation operation, the input dimension is obtained; in response to a second search operation on the graphical user interface, an indicator button corresponding to the input indicator is displayed; and in response to an indicator confirmation operation, the input indicator is obtained.
[0102] For example, such as Figure 6As shown, the input dimensions and input metrics 601 obtained from the graphical user interface are p_date and platform, as well as dau, exp, pv, vv, clk_uv, average vv per user, average pv per user, average exp per user, ctr (clickthrough rate), and utr (unique through rate).
[0103] Step 702: Based on the DM metadata, determine the set of data source tables corresponding to the input dimensions and input metrics from the candidate data source tables.
[0104] When the input dimensions include multiple dimensions, the data source tables in the data source table set include all input dimensions and at least one input metric.
[0105] To ensure that the data source tables are available, optionally, the data source tables in the data source table collection should be in an active state.
[0106] Optionally, the input composite metric is split into split basic metrics; the input basic metrics and split basic metrics are merged to obtain the target basic metrics; based on the DM metadata, the target data source table corresponding to the input dimension and the target basic metrics is determined from the candidate data source table; the target data source tables are merged to obtain a set of data source tables.
[0107] For example, such as Figure 6 As shown, the data source table is obtained by combining the input dimension and input metric 601 with the DM metadata 602.
[0108] Step 703: Generate a database query statement based on the data source table set and DM metadata.
[0109] Database query statements are used to retrieve data from a collection of data source tables in a database. Optionally, database query statements are written in SQL (Structured Query Language).
[0110] Optionally, determine the database query statement generation rules corresponding to the data source table set and DM metadata; substitute the input dimensions and target basic indicators of each data source table in the data source table set into the database query statement generation rules to generate the database query statement.
[0111] For example, when the database query statement is in SQL, since the computer needs to retrieve the input dimensions and target basic metrics data for each data source table in the data source table set, it is necessary to determine at least one of the following when generating the database query statement: the query address of each data source table in the data source table set, the value format of the input dimensions, the value format of the target basic metrics, the name of the input dimensions, and the name of the target basic metrics. On the other hand, since DM metadata provides candidate dimensions and candidate metrics from the candidate data source tables, it makes it easier for the computer to query the required data source table set. Therefore, the data source tables in the data source table set can be quickly determined through DM metadata.
[0112] Optionally, an SQL auto-generation tool can be invoked to generate database query statements based on the data source table set and DM metadata. The SQL auto-generation tool is used to automatically generate the database query statements.
[0113] Taking the database query statement generation rule as an example, where a database query statement template is used, the computer device stores at least one database query statement template. Each database query statement template corresponds to a combination of dimensions and metrics. For example, dimension 1 and metric 1 correspond to database query statement template 1, dimension 1 and metric 2 correspond to database query statement template 2, and dimension 2 and metric 1 correspond to database query statement template 3. Optionally, the database query statement template is determined based on the data source table set and DM metadata. The input dimensions and target basic metrics of each data source table in the data source table set are then input into the database query statement template to generate the database query statement. For example, the database query statement template is determined as follows based on the data source table set and DM metadata:
[0114] SELECT(A) / / Declare input dimension
[0115] SUM(B)B / / Declare the value of the target basic indicator
[0116] FROM(C) / / Declare the name of the data source table
[0117] GROUP BY(D) / / Group by input dimension
[0118] In this database query template, A, B, C, and D are used to fill in the input dimensions or target basic metrics for each data source table in the data source table set. For example, to query data from data source table Table2, we would enter the input dimension in field A, the target basic metric in field B, the name of the data source table in field C, and the input dimension in field D. The generated database query statement would look like this:
[0119] SELECT p_date, platform / / Declare input dimension
[0120] SUM(pv)pv, SUM(vv)vv / / Declare the value of the target basic indicator
[0121] FROM Table2 / / Declare the name of the data source table
[0122] GROUP BY p_date, platform / / Group according to input dimension.
[0123] Step 704: Execute the database query statement to obtain the intermediate query result set from the candidate data source table.
[0124] The intermediate query result set is used to represent the dataset set corresponding to the data source table set.
[0125] Optionally, a data query statement is executed and sent to the query intermediate layer in the computer device via an asynchronous call to obtain an intermediate query result set from the candidate data source table.
[0126] For example, such as Figure 6 As shown, after executing database query statement 603, an intermediate query result set 604 in tabular form will be obtained.
[0127] Step 705: Aggregate the intermediate query result set and output the basic indicator dataset corresponding to the input basic indicators.
[0128] The basic metric dataset is a dataset with the input dimension as the dimension and the input basic metric as the metric. Since the intermediate query result set includes datasets with the input dimension as the dimension and the target basic metric as the metric, the basic metric datasets corresponding to the input basic metric are pre-aggregated.
[0129] Optionally, the intermediate query result sets can be correlated; the basic indicator dataset corresponding to the input basic indicator can be output based on the correlated intermediate query result sets. For example, such as... Figure 4 and Figure 6 As shown, the intermediate query result set 604 is joined using a FULL JOIN method, with the join conditions being a.p_date = b.p_date and a.platform = b.platform (assuming there is only one input dimension, p_date, then the join condition between intermediate result sets would be a.p_date = b.p_date, and so on, with the join condition dynamically adjusted according to the input dimension). The joined intermediate query result sets are then integrated together in memory using a hash join method to obtain the basic indicator dataset.
[0130] Step 706: Calculate the composite index dataset based on the intermediate query result set and the calculation formula of the input composite index.
[0131] Since the intermediate query results do not include datasets with input dimensions as dimensions and input composite indicators as indicators, the composite indicator dataset is calculated using the calculation formula of the input composite indicator. Because this embodiment does not rely on composite indicators for querying, it can be found that the DM metadata does not contain matching data. For example, such as... Figure 4 and Figure 6 As shown, the input composite index ctr is not present in the DM metadata. However, the metadata of the input composite index ctr can be derived from the calculation formula of the input composite index ctr in this embodiment of the application.
[0132] Step 707: Merge the data in the composite indicator dataset into the basic indicator dataset, and output the target dataset corresponding to the input dimensions and input indicators.
[0133] For example, such as Figure 6 As shown, the data in the composite indicator dataset is merged into the basic indicator dataset to obtain the target dataset 605.
[0134] In summary, after obtaining the user's input dimensions and input metrics from the graphical user interface, the computer device determines the data source table set from the candidate data source table based on the input dimensions and input metrics. Then, the computer device aggregates the data source table set to obtain the target dataset corresponding to the input dimensions and input metrics. This method can not only flexibly generate multiple target datasets according to the user's needs, but also greatly simplify the user's operation steps. The user only needs to provide the input dimensions and input metrics, which improves the efficiency of human-computer interaction.
[0135] Furthermore, it provides a method for generating database query statements, eliminating the need for users to manually input database query statements, thus simplifying operations and improving human-computer interaction efficiency. Moreover, it can retrieve data not stored in the DM metadata, which not only facilitates user operations but also reduces storage space.
[0136] In the following embodiments, a method for storing DM metadata is provided, which can directly convert existing forward DM metadata into inverted DM metadata. Furthermore, the inverted DM metadata is directly stored in a computer device, facilitating subsequent data aggregation and improving the efficiency of data aggregation.
[0137] Figure 8 This illustration shows a flowchart of a method for storing DM metadata provided in an exemplary embodiment of this application. The method can be... Figure 1The method, executed by the terminal 120, server 140, or other computer device, using inverted DM metadata stored in the computer device, includes the following steps:
[0138] Step 801: Obtain the metadata of the forward DM.
[0139] Forward-indexed DM metadata represents the mapping relationship from candidate data source tables to candidate dimensions and candidate metrics. Inverted-indexed DM metadata represents the mapping relationship from candidate dimensions and candidate metrics to candidate data source tables.
[0140] For example, such as Figure 9 As shown in the figure, the black box on the left represents the mapping relationship 901 from data source tables "table_a" and "table_b" to the candidate dimension "Student ID". The black box on the right represents the value selection method 902 for candidate dimensions and candidate metrics. The default value selection method for candidate dimensions is the field name of the data source table, and the default value selection method for candidate metrics is summation. For example, the candidate metric "Course Score" is selected by summation.
[0141] Step 802: Convert the forward DM metadata into inverted DM metadata through inverted index operations.
[0142] The inverted index operation is used to reverse the mapping relationship of the forward DM metadata.
[0143] Step 803: Store the inverted DM metadata in a computer device.
[0144] Optionally, the forward DM metadata and the inverted DM metadata can be stored in a computer device.
[0145] In summary, this embodiment provides a method for storing DM metadata. This method can directly convert existing forward DM metadata into inverted DM metadata. The operation process is simple, and pre-storing the inverted DM metadata in a computer device can reduce the amount of computation during data aggregation.
[0146] Figure 10 This illustration shows a flowchart of a data aggregation method provided in an exemplary embodiment of this application. The method can be... Figure 1 The terminal 120, server 140, or other computer device shown executes the method. The computer device executing the method stores data model (DM) metadata. The DM metadata is used to represent the mapping relationship between candidate dimensions and candidate indicators to candidate data source tables. Candidate dimensions are used to represent data types, and input indicators are used to represent parameters for measuring data.
[0147] Step 1001: Obtain the metadata of the forward DM.
[0148] The metadata of the forward-row DM is used to represent the mapping relationship between the candidate data source table and the candidate dimensions and candidate metrics.
[0149] For example, in Figure 10 In the table, the dimensions and metrics corresponding to table_a are student_id, class_name, student_name, and student_age, while the dimensions and metrics corresponding to table_b are student_id, cuorse_id, and course_score.
[0150] Step 1002: Generate inverted DM metadata based on the forward DM metadata.
[0151] Optionally, forward DM metadata can be converted into inverted DM metadata through an inverted index operation.
[0152] For example, inverted DM metadata is obtained through inverted index operations, such as in... Figure 10 In the table, student_age corresponds to table_a, student_id and student_age both correspond to table_a, and course_id and course_score both correspond to table_b.
[0153] Step 1003: Organize the inverted DM metadata.
[0154] After obtaining the inverted DM metadata, there may be duplicate or redundant data in the inverted DM metadata, so it is necessary to organize the inverted DM metadata.
[0155] Step 1004: Store the inverted DM metadata and cache the inverted DM metadata in memory.
[0156] Optionally, forward DM metadata and inverted DM metadata are stored, and the inverted DM metadata is cached in memory.
[0157] Step 1005: Smart Routing.
[0158] Intelligent routing refers to determining the set of data source tables corresponding to the input dimensions and input metrics from the candidate data source tables based on DM metadata. The input dimensions and input metrics are obtained from the graphical user interface (GUI). Optionally, the input dimensions and input metrics are obtained in response to an input operation on the GUI. Alternatively, in response to a first selection operation on the GUI, the input dimension is determined from the candidate dimensions; in response to a second selection operation on the GUI, the input metric is determined from the candidate metrics. Alternatively, in response to a first search operation on the GUI, the dimension button corresponding to the input dimension is displayed; in response to a dimension confirmation operation, the input dimension is obtained; in response to a second search operation on the GUI, the metric button corresponding to the input metric is displayed; in response to a metric confirmation operation, the input metric is obtained.
[0159] When the input dimensions include multiple dimensions, the data source tables in the data source table set include all input dimensions and at least one input metric.
[0160] To ensure that the data source tables are available, optionally, the data source tables in the data source table collection should be in an active state.
[0161] Step 1006: Generate SQL.
[0162] Generating SQL refers to generating a database query statement based on the data source table set and DM metadata. This database query statement is an SQL statement.
[0163] Optionally, determine the database query statement generation rules corresponding to the data source table set and DM metadata; substitute the dimensions and metrics of each data source table in the data source table set into the database query statement generation rules to generate the database query statement.
[0164] Step 1007: Execute SQL.
[0165] Executing SQL refers to executing a database query statement to retrieve an intermediate query result set from the candidate data source table.
[0166] The intermediate query result set is used to represent the dataset set corresponding to the data source table set.
[0167] Optionally, a data query statement is executed and sent to the query intermediate layer in the computer device via an asynchronous call to obtain an intermediate query result set from the candidate data source table.
[0168] Step 1008: Results integration.
[0169] Result integration refers to aggregating data from intermediate query result sets and outputting a target dataset corresponding to the input dimensions and input metrics. The target dataset is a dataset with the input dimensions as its dimensions and the input metrics as its metrics.
[0170] In summary, after obtaining the user's input dimensions and input metrics from the graphical user interface, the computer device determines the data source table set from the candidate data source table based on the input dimensions and input metrics. Then, the computer device aggregates the data source table set to obtain the target dataset corresponding to the input dimensions and input metrics. This method can not only flexibly generate multiple target datasets according to the user's needs, but also greatly simplify the user's operation steps. The user only needs to provide the input dimensions and input metrics, which improves the efficiency of human-computer interaction.
[0171] It greatly simplifies the implementation steps of multi-data source association and also significantly lowers the threshold for data association, allowing people without technical background to easily perform multi-data source association analysis.
[0172] The following are device embodiments of this application. For details not described in detail in the device embodiments, please refer to the corresponding descriptions in the above method embodiments. They will not be repeated here.
[0173] Figure 11 A schematic diagram of a data aggregation apparatus provided in an exemplary embodiment of this application is shown. This apparatus can be implemented as all or part of a computer device through software, hardware, or a combination of both. The apparatus stores data model metadata (DM metadata), which represents the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables. The candidate dimensions represent data types, and the input metrics represent parameters for measuring data. The apparatus 1100 includes:
[0174] The acquisition module 1101 is used to acquire input dimensions and input metrics from the graphical user interface, wherein the input dimensions belong to the candidate dimensions and the input metrics belong to the candidate metrics;
[0175] Mapping module 1102 is used to determine, based on the DM metadata, a set of data source tables corresponding to the input dimension and the input metric from the candidate data source table, wherein the set of data source tables includes data source tables with the input dimension as the dimension and the input metric as the metric;
[0176] The aggregation module 1103 is used to aggregate the data in the data source table set and output the target dataset corresponding to the input dimension and the input metric.
[0177] In an optional design of this application, the input metrics include input basic metrics and input composite metrics. The input basic metrics are indivisible metrics, and the input composite metrics are metrics obtained by mathematical operations on at least two basic metrics. The mapping module 1102 is further configured to split the input composite metrics into split basic metrics; merge the input basic metrics and the split basic metrics to obtain target basic metrics; determine the target data source table corresponding to the input dimension and the target basic metrics from the candidate data source table based on the DM metadata; and merge the target data source tables to obtain the data source table set.
[0178] In an optional design of this application, the target basic indicator includes the i-th target basic indicator, where i is a positive integer. The mapping module 1102 is further configured to determine, based on the DM metadata, n target candidate data source tables corresponding to the input dimension and the i-th target basic indicator from the candidate data source tables, where n is an integer greater than 1; preferentially determine the data source table belonging to the pre-aggregated data source table in the n target candidate data source tables as the target data source table, where the pre-aggregated data source table is used to represent the data source table that only includes the basic indicator; or, preferentially determine the data source table with the smallest amount of stored data in the n target candidate data source tables as the target data source table.
[0179] In an optional design of this application, the target basic indicators include the a-th target basic indicator and the b-th target basic indicator, where a and b are positive integers. The mapping module 1102 is further configured to: determine j target candidate data source tables corresponding to the input dimension and the a-th target basic indicator from the candidate data source tables based on the DM metadata, where j is a positive integer; determine k target candidate data source tables corresponding to the input dimension and the b-th target basic indicator from the candidate data source tables based on the DM metadata, where k is a positive integer; and, if the j-th and k-th target candidate data source tables contain the same data source table, determine the same data source table as the target data source table.
[0180] In an optional design of this application, the aggregation module 1103 is further configured to generate a database query statement based on the data source table set and the DM metadata; execute the data query statement to query an intermediate query result set from the candidate data source table, wherein the intermediate query result set is a set of datasets composed of input dimensions and target basic indicators; aggregate the data in the intermediate query result set and output the target dataset corresponding to the input dimensions and the input indicators.
[0181] In an optional design of this application, the aggregation module 1103 is further configured to determine the database query statement generation rules corresponding to the data source table set and the DM metadata; and to substitute the input dimensions and target basic indicators of each data source table in the data source table set into the database query statement generation rules to generate the database query statement.
[0182] In an optional design of this application, the aggregation module 1103 is further configured to aggregate the intermediate query result set and output the basic indicator dataset corresponding to the target basic indicator; calculate the composite indicator dataset according to the intermediate query result set and the calculation formula of the input composite indicator; merge the data in the composite indicator dataset into the basic indicator dataset and output the target dataset corresponding to the input dimension and the input indicator.
[0183] In an optional design of this application, the apparatus further includes: a preprocessing module 1104;
[0184] The preprocessing module 1104 is used to obtain forward DM metadata, which represents the mapping relationship between the candidate data source table and the candidate dimension and the candidate indicator; convert the forward DM metadata into inverted DM metadata through inverted index operation; and store the inverted DM metadata in the computer device.
[0185] In an optional design of this application, the acquisition module 1101 is further configured to acquire the input dimension and the input index in response to an input operation on the graphical user interface; or, in response to a first selection operation on the graphical user interface, determine the input dimension from the candidate dimensions; and in response to a second selection operation on the graphical user interface, determine the input index from the candidate indicators.
[0186] In summary, after obtaining the user's input dimensions and input metrics from the graphical user interface, the computer device determines the data source table set from the candidate data source table based on the input dimensions and input metrics. Then, the computer device aggregates the data source table set to obtain the target dataset corresponding to the input dimensions and input metrics. This method can not only flexibly generate multiple target datasets according to the user's needs, but also greatly simplify the user's operation steps. The user only needs to provide the input dimensions and input metrics, which improves the efficiency of human-computer interaction.
[0187] Figure 12This is a schematic diagram illustrating the structure of a computer device according to an exemplary embodiment. The computer device 1200 includes a Central Processing Unit (CPU) 1201, a system memory 1204 including Random Access Memory (RAM) 1202 and Read-Only Memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the CPU 1201. The computer device 1200 also includes a Basic Input / Output System (I / O System) 1206 to facilitate information transfer between various devices within the computer device, and a mass storage device 1207 for storing an operating system 1213, application programs 1214, and other program modules 1215.
[0188] The basic input / output system 1206 includes a display 1208 for displaying information and an input device 1209 for user input, such as a mouse or keyboard. Both the display 1208 and the input device 1209 are connected to the central processing unit 1201 via an input / output controller 1210 connected to the system bus 1205. The basic input / output system 1206 may also include the input / output controller 1210 for receiving and processing input from multiple other devices such as a keyboard, mouse, or electronic stylus. Similarly, the input / output controller 1210 also provides output to a display screen, printer, or other types of output devices.
[0189] The mass storage device 1207 is connected to the central processing unit 1201 via a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1207 and its associated computer device-readable media provide non-volatile storage for the computer device 1200. That is, the mass storage device 1207 may include computer device-readable media (not shown), such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0190] Without loss of generality, the computer device readable medium may include computer device storage media and communication media. Computer device storage media include volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer device readable instructions, data structures, program modules, or other data. Computer device storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer device storage media are not limited to the above-mentioned types. The system memory 1204 and mass storage device 1207 described above can be collectively referred to as memory.
[0191] According to various embodiments of this disclosure, the computer device 1200 can also be connected to a remote computer device on a network, such as the Internet. That is, the computer device 1200 can be connected to the network 1211 via a network interface unit 1212 connected to the system bus 1205, or the network interface unit 1212 can be used to connect to other types of networks or remote computer device systems (not shown).
[0192] The memory also includes one or more programs, which are stored in the memory. The central processing unit 1201 implements the above-mentioned data aggregation method by executing the one or more programs.
[0193] In an exemplary embodiment, a computer-readable storage medium is also provided, which stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the data aggregation method provided in the above-described method embodiments.
[0194] This application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the data aggregation method provided in the above method embodiments.
[0195] Optionally, this application also provides a computer program product containing instructions that, when run on a computer device, cause the computer device to perform the data aggregation methods described in the above aspects.
[0196] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0197] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.
[0198] The above description is merely an optional embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A data aggregation method, characterized in that, Applied in computer equipment, the computer equipment stores data model metadata, the DM metadata including the mapping relationship between candidate dimensions and candidate indicators to candidate data source tables; The candidate dimension is used to represent the data type, the candidate metric is used to represent the parameter for measuring the data, and the method includes: The input dimensions and input metrics are obtained from the graphical user interface. The input dimensions belong to the candidate dimensions, and the input metrics belong to the candidate metrics. The input metrics include basic input metrics and composite input metrics. The basic input metrics are indivisible metrics, and the composite input metrics are metrics obtained by mathematical operations on at least two basic metrics. The input composite index is split into split basic indices; the input basic indices and the split basic indices are combined to obtain the target basic index. Based on the DM metadata, a target data source table corresponding to the input dimension and the target basic indicator is determined from the candidate data source table; wherein... When a single target basic indicator corresponds to at least two target candidate data source tables in the candidate data source table, the data source table that only includes the basic indicator or the data source table with the smallest amount of stored data in the at least two target candidate data source tables shall be preferentially determined as the target data source table. When at least two target basic indicators have the same target candidate data source table in the candidate data source table, the same data source table is determined as the target data source table corresponding to the at least two target basic indicators. Merge the target data source tables to obtain the data source table set, which includes data source tables with the input dimension as the dimension and the input metric as the metric; The data in the data source table set is aggregated, and a target dataset corresponding to the input dimension and the input metric is output. The target dataset includes data corresponding to the input composite metric.
2. The method according to claim 1, characterized in that, The target basic indicators include the i-th target basic indicator, where i is a positive integer; The step of determining the target data source table corresponding to the input dimension and the target basic indicator from the candidate data source table based on the DM metadata includes: Based on the DM metadata, n target candidate data source tables corresponding to the input dimension and the i-th target basic indicator are determined from the candidate data source tables, where n is an integer greater than 1; The target data source table is preferentially determined from the n target candidate data source tables that belong to the pre-aggregated data source table, where the pre-aggregated data source table represents a data source table that only includes the basic indicators; or, the target data source table is preferentially determined from the n target candidate data source tables that has the smallest amount of stored data.
3. The method according to claim 1, characterized in that, The target basic indicators include the a-th target basic indicator and the b-th target basic indicator, where a and b are positive integers; The step of determining the target data source table corresponding to the input dimension and the target basic indicator from the candidate data source table based on the DM metadata includes: Based on the DM metadata, determine j target candidate data source tables corresponding to the input dimension and the a-th target basic indicator from the candidate data source tables, where j is a positive integer; Based on the DM metadata, determine k target candidate data source tables corresponding to the input dimension and the b-th target basic indicator from the candidate data source tables, where k is a positive integer; If there is an identical data source table among the j target candidate data source tables and the k target candidate data source tables, the identical data source table is determined as the target data source table.
4. The method according to any one of claims 1 to 3, characterized in that, The aggregation of data from the data source table set, and the output of the target dataset corresponding to the input dimension and the input metric, includes: Generate a database query statement based on the data source table set and the DM metadata; Execute the database query statement to obtain an intermediate query result set from the candidate data source table. The intermediate query result set is a collection of datasets with input dimensions as dimensions and target basic indicators as indicators. Aggregate the data in the intermediate query result set and output the target dataset corresponding to the input dimension and the input metric.
5. The method according to claim 4, characterized in that, The step of generating a database query statement based on the data source table set and the DM metadata includes: Determine the database query statement generation rules corresponding to the data source table set and the DM metadata; The input dimensions and target basic metrics of each data source table in the data source table set are substituted into the database query statement generation rule to generate the database query statement.
6. The method according to claim 4, characterized in that, The aggregation of data from the intermediate query result set, and the output of the target dataset corresponding to the input dimension and the input metric, includes: Aggregate the intermediate query result set and output the basic indicator dataset corresponding to the input basic indicators; Based on the intermediate query result set and the calculation formula of the input composite index, the composite index dataset is calculated. The data in the composite indicator dataset is merged into the basic indicator dataset, and the target dataset corresponding to the input dimension and the input indicator is output.
7. The method according to any one of claims 1 to 3, characterized in that, The DM metadata includes inverted DM metadata; The method further includes: Obtain the forward DM metadata, which represents the mapping relationship between the candidate data source table and the candidate dimension and the candidate metric; The forward DM metadata is converted into the inverted DM metadata through an inverted index operation; The inverted DM metadata is stored in the computer device.
8. The method according to any one of claims 1 to 3, characterized in that, The process of obtaining input dimensions and input metrics from the graphical user interface includes: In response to an input operation on the graphical user interface, the input dimension and the input metric are obtained; or, In response to a first selection operation on the graphical user interface, the input dimension is determined from the candidate dimensions; in response to a second selection operation on the graphical user interface, the input metric is determined from the candidate metrics.
9. A data aggregation device, characterized in that, The device stores data model metadata, which includes the mapping relationship between candidate dimensions and candidate metrics to candidate data source tables. The candidate dimension is used to represent data type, the candidate metric is used to represent parameters for measuring data, and the device includes: The acquisition module is used to acquire input dimensions and input metrics from the graphical user interface. The input dimensions belong to the candidate dimensions, and the input metrics belong to the candidate metrics. The input metrics include basic input metrics and composite input metrics. The basic input metrics are indivisible metrics, and the composite input metrics are metrics obtained by mathematical operations on at least two basic metrics. A mapping module is used to split the input composite indicator into split basic indicators; merge the input basic indicators and the split basic indicators to obtain target basic indicators; determine the target data source table corresponding to the input dimension and the target basic indicator from the candidate data source table according to the DM metadata; wherein, when a single target basic indicator corresponds to at least two target candidate data source tables in the candidate data source table, the data source table that only includes the basic indicator or the data source table with the smallest stored data in the at least two target candidate data source tables is preferentially determined as the target data source table; when at least two target basic indicators have the same data source table in the candidate data source table, the same data source table is determined as the target data source table corresponding to the at least two target basic indicators; merge the target data source tables to obtain the data source table set, the data source table set including data source tables with the input dimension as the dimension and the input indicator as the indicator; The mapping module is used to merge the target data source tables to obtain the data source table set, which includes data source tables with the input dimension as the dimension and the input metric as the metric. The aggregation module is used to aggregate the data in the data source table set and output a target dataset corresponding to the input dimension and the input metric. The target dataset includes data corresponding to the input composite metric.
10. The apparatus according to claim 9, characterized in that, The target basic indicators include the i-th target basic indicator, where i is a positive integer; The mapping module is further configured to determine, based on the DM metadata, n target candidate data source tables corresponding to the input dimension and the i-th target basic indicator from the candidate data source table, where n is an integer greater than 1; and preferentially determine the data source table belonging to the pre-aggregated data source table in the n target candidate data source tables as the target data source table, wherein the pre-aggregated data source table is used to represent the data source table that only includes the basic indicator; Alternatively, the data source table with the smallest amount of stored data among the n target candidate data source tables may be preferentially determined as the target data source table.
11. The apparatus according to claim 9, characterized in that, The target basic indicators include the a-th target basic indicator and the b-th target basic indicator, where a and b are positive integers; The mapping module is further configured to determine, based on the DM metadata, j target candidate data source tables corresponding to the input dimension and the a-th target basic indicator from the candidate data source tables, where j is a positive integer; Based on the DM metadata, determine k target candidate data source tables corresponding to the input dimension and the b-th target basic indicator from the candidate data source tables, where k is a positive integer; If there is an identical data source table among the j target candidate data source tables and the k target candidate data source tables, the identical data source table is determined as the target data source table.
12. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one program, the at least one program being loaded and executed by the processor to implement the data aggregation method as described in any one of claims 1 to 8.
13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the data aggregation method as described in any one of claims 1 to 8.