Data processing method and device, electronic equipment and storage medium
By obtaining the original query command and dimension roll-up configuration parameters, new query commands are generated, and data tables are processed automatically. This solves the problems of high resource investment and low efficiency in the existing technology for dimension roll-up data statistics, and realizes convenient and fast data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
- Filing Date
- 2022-11-29
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies require customized development for dimensional data statistics needs, which involves significant resource investment and is inefficient.
By obtaining the original query command and dimension roll-up configuration parameters, a new query command is generated, and the data table is automatically processed to achieve dimension roll-up data statistics without the need for customized code development.
It enables convenient and rapid dimensional roll-up data statistics, reducing manpower input and development time, and improving efficiency and flexibility.
Smart Images

Figure CN115794903B_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to the field of data processing technology, and more specifically, to a data processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] In data reporting and analysis, there is a frequent need for dimensional roll-up data statistical comparisons. For example, when viewing the data of a current company, it is necessary to simultaneously view the average data of all companies in the same industry to analyze the data quality of the current company through data comparison. This is a dimensional roll-up data statistical requirement (also known as a dimensionality reduction data statistical requirement). For such complex report statistical analysis needs, a case-by-case development approach is typically used for customized development to meet specific requirements for a particular scenario. Because customized development is required for specific needs, it involves significant resource investment. Summary of the Invention
[0003] Exemplary embodiments of this disclosure provide a data processing method, apparatus, electronic device, and storage medium that can conveniently and quickly implement dimensional roll-up data statistics based on configuration parameters without requiring customized code development.
[0004] According to a first aspect of the present disclosure, a data processing method is provided, comprising: obtaining an original query instruction and dimension roll-up configuration parameters, wherein the dimension roll-up configuration parameters are used to define a dimension roll-up method; generating a new query instruction based on the original query instruction and the dimension roll-up configuration parameters, and executing the new query instruction on a target data table to obtain a first query result and a second query result; generating a target query result based on the first query result and the second query result, wherein the first query result is a query result obtained by statistically analyzing relevant data of a target object in the target data table; the second query result is a query result obtained by statistically analyzing relevant data of a roll-up dimension in the target data table, wherein the roll-up dimension is a dimension obtained by rolling up the dimension containing the target object according to the dimension roll-up method.
[0005] Optionally, the dimension roll-up configuration parameters include: the dimension to be deleted when rolling up the dimension containing the target object, and the dimension to be added when rolling up the dimension containing the target object; wherein, the step of generating a new query instruction based on the original query instruction and the dimension roll-up configuration parameters, and executing the new query instruction on the target data table to obtain the first query result and the second query result includes: generating a first query instruction based on the original query instruction and the dimension to be added, and executing the first query instruction on the target data table to obtain the first query result and the value range of the dimension to be added; generating a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added, and executing the second query instruction on the target data table to obtain the second query result, wherein the values in the dimension to be added corresponding to the target object in the target data table constitute the value range of the dimension to be added.
[0006] Optionally, the first query result is: a query result obtained by statistically analyzing the data in the data rows of the target data table that meet the query conditions, wherein the query conditions include at least: the data row where the target object is located, wherein the step of generating the first query instruction based on the original query instruction and the required added dimension includes: adding a computer program segment to the statement in the original query instruction that is used to limit the query output fields, for limiting the output of the values of the required added dimension in the data rows of the target data table that meet the query conditions, to obtain the first query instruction.
[0007] Optionally, the step of generating a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added includes: determining the value of a specific dimension appearing in the first query result as the value range of the specific dimension, wherein the specific dimension is a dimension in the first query result other than the dimension to be deleted; modifying the original query instruction based on the dimension to be deleted, the dimension to be added, the value range of the dimension to be added, the specific dimension, and the value range of the specific dimension to obtain the second query instruction.
[0008] Optionally, the step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, the specific dimension and the value range of the specific dimension includes: deleting computer program segments containing the dimension to be deleted from the statements in the original query instruction that limit the query output fields, the statements that limit the query conditions, the statements that limit the aggregation conditions, and the statements that limit the sorting conditions; and adding to the statements in the original query instruction that limit the query conditions: computer program segments that limit the query range of the dimension to be added to the value range of the dimension to be added, and computer program segments that limit the query range of the specific dimension to the value range of the specific dimension.
[0009] Optionally, the dimension roll-up configuration parameters further include: the indicator output field name corresponding to the roll-up dimension. The step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, the specific dimension and the value range of the specific dimension further includes: modifying the indicator output field name in the original query instruction to the indicator output field name corresponding to the roll-up dimension.
[0010] Optionally, the dimension roll-up configuration parameters further include: the aggregation operation method corresponding to the roll-up dimension, wherein the step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, the specific dimension and the value range of the specific dimension further includes: modifying the aggregation operation method used to obtain the indicator output field in the original query instruction to the aggregation operation method corresponding to the roll-up dimension.
[0011] Optionally, the step of generating a target query result based on the first query result and the second query result includes: determining a related field, wherein the related field is a dimension-type field that is the same in the first query result and the second query result; for each data row in the first query result, concatenating a data row in the second query result that has the same field value of the related field as each data row to each data row; and taking the concatenation result of the first query result and the second query result as the target query result.
[0012] According to a second aspect of the present disclosure, a data processing apparatus is provided, comprising: an acquisition unit configured to acquire an original query instruction and dimension roll-up configuration parameters, wherein the dimension roll-up configuration parameters are used to define a dimension roll-up method; a query result acquisition unit configured to generate a new query instruction based on the original query instruction and the dimension roll-up configuration parameters, and execute the new query instruction on a target data table to obtain a first query result and a second query result; and a target result generation unit configured to generate a target query result based on the first query result and the second query result, wherein the first query result is a query result obtained by statistically analyzing relevant data of a target object in the target data table; and the second query result is a query result obtained by statistically analyzing relevant data of a roll-up dimension in the target data table, wherein the roll-up dimension is a dimension obtained by rolling up the dimension containing the target object according to the dimension roll-up method.
[0013] Optionally, the dimension roll-up configuration parameters include: the dimension to be deleted when rolling up the dimension where the target object is located, and the dimension to be added when rolling up the dimension where the target object is located; wherein, the query result acquisition unit includes: a first query result acquisition unit, configured to generate a first query instruction based on the original query instruction and the dimension to be added, and execute the first query instruction on the target data table to obtain the first query result and the value range of the dimension to be added; a second query result acquisition unit, configured to generate a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added, and execute the second query instruction on the target data table to obtain the second query result, wherein the values in the dimension to be added corresponding to the target object in the target data table constitute the value range of the dimension to be added.
[0014] Optionally, the first query result is: a query result obtained by statistically analyzing the data in the data rows of the target data table that meet the query conditions, wherein the query conditions include at least: the data row where the target object is located, wherein the first query result acquisition unit is configured to: add a computer program segment to the statement for limiting the query output fields in the original query instruction to limit the output of the values of the required added dimension in the data rows of the target data table that meet the query conditions, thereby obtaining the first query instruction.
[0015] Optionally, the second query result acquisition unit is configured to: determine the values appearing in a specific dimension in the first query result as the value range of the specific dimension, wherein the specific dimension is the dimension in the first query result other than the dimension to be deleted; modify the original query instruction based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, the specific dimension and the value range of the specific dimension, to obtain the second query instruction.
[0016] Optionally, the second query result acquisition unit is configured to: delete computer program segments containing the dimension to be deleted from the statements for limiting query output fields, query conditions, aggregation conditions, and sorting conditions of the original query instruction; and add to the statements for limiting query conditions in the original query instruction: computer program segments for limiting the query range of the dimension to be added to the range of values of the dimension to be added, and computer program segments for limiting the query range of the specific dimension to the range of values of the specific dimension.
[0017] Optionally, the dimension roll-up configuration parameters further include: the index-type output field name corresponding to the roll-up dimension, wherein the second query result acquisition unit is further configured to: modify the index-type output field name in the original query instruction to the index-type output field name corresponding to the roll-up dimension.
[0018] Optionally, the dimension roll-up configuration parameters further include: the aggregation operation method corresponding to the roll-up dimension, wherein the second query result acquisition unit is further configured to: modify the aggregation operation method used to obtain the indicator output field in the original query instruction to the aggregation operation method corresponding to the roll-up dimension.
[0019] Optionally, the target result generation unit is configured to: determine the associated field, wherein the associated field is the same dimension field in the first query result and the second query result; for each data row in the first query result, concatenate a data row in the second query result that has the same field value of the associated field as each data row to each data row; and take the concatenation result of the first query result and the second query result as the target query result.
[0020] According to a third aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform the data processing method as described above.
[0021] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein when instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor causes the at least one processor to perform the data processing method described above.
[0022] According to a fifth aspect of the present disclosure, a computer program product is provided, including computer instructions that, when executed by at least one processor, implement the data processing method described above.
[0023] The data processing method, apparatus, electronic device, and storage medium according to exemplary embodiments of this disclosure provide a more efficient, versatile, and flexible data processing process. Users only need to configure the dimension roll-up configuration parameters as needed to automatically and quickly complete dimension roll-up data statistics. There is no need to customize code for each application scenario; it can conveniently and quickly meet the needs of dimension roll-up data statistics with zero code development cost, reducing both manpower input and development time.
[0024] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0026] Figure 1 A flowchart illustrating a data processing method according to an exemplary embodiment of the present disclosure is shown;
[0027] Figure 2 A flowchart illustrating a method for obtaining a first query result and a second query result according to an exemplary embodiment of the present disclosure;
[0028] Figure 3 A flowchart illustrating a method for generating target query results based on a first query result and a second query result according to an exemplary embodiment of the present disclosure;
[0029] Figure 4 This diagram illustrates a structural block diagram of a data processing apparatus according to exemplary embodiments of the present disclosure.
[0030] Figure 5 A structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0032] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0033] It should be noted that the phrase "at least one of several items" in this disclosure refers to three parallel cases: "any one of the several items", "a combination of any number of the several items", and "all of the several items". For example, "including at least one of A and B" includes the following three parallel cases: (1) including A; (2) including B; (3) including A and B. As another example, "performing at least one of step one and step two" indicates the following three parallel cases: (1) performing step one; (2) performing step two; (3) performing both step one and step two.
[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0035] In data reporting and analysis, it is often necessary to compare the data of an object (e.g., a company) with the average of all objects in the same industry (or a specific dimension) to analyze the data level of that object. From a technical perspective, this actually involves rolling up the statistics of multiple dimensions (including the company and industry dimensions in the example above) to one dimension (also known as dimensionality reduction) for data statistics (in the example above, the company dimension is removed, and statistics are only performed based on the industry dimension).
[0036] A row in a data table represents a data row, and a column corresponds to a field. In other words, each data row in a data table has the field values for each field. As an example, a field in a data table can be used to describe information about one aspect (e.g., delivery system, date, industry, spending, etc.), and at least one data row in a data table can be used to describe information about multiple aspects of an object; for example, multiple data rows in a data table can be used to describe the same object. If a field is used to represent a dimension (i.e., corresponds to a dimension), then the field is a dimension field; if a field is used to represent a metric (i.e., corresponds to a metric), then the field is a metric field.
[0037] Figure 1 A flowchart illustrating a data processing method according to an exemplary embodiment of the present disclosure is shown.
[0038] Reference Figure 1 In step S101, the original query command and dimension roll-up configuration parameters are obtained.
[0039] The dimension roll-up configuration parameters are used to limit the dimension roll-up method.
[0040] The original query instruction is used only to statistically analyze the relevant data of the target object in the target data table to obtain a first query result. Specifically, the original query instruction is used to statistically analyze the field values of the fields to be analyzed in the data rows of the target data table that meet the first query conditions to obtain a first query result. The first query conditions include at least the data row where the target object is located. The relevant data of the target object may include the field values of the fields to be analyzed in the data rows of the target data table that meet the query conditions.
[0041] For example, the statistical method for performing statistics on the field values of the field to be counted can be: performing aggregation operations on the field values of the field to be counted according to aggregation conditions. For example, aggregation operations can include, but are not limited to, at least one of the following: summation (SUM), average (AVG), maximum value (MAX), minimum value (MIN), and count (COUNT).
[0042] For example, in an application scenario targeting advertising performance, the original query command is used to query a company's total spending across all advertising systems. That is, the target object is the company, and in the target data table, the fields representing the company are: `corporation_name`, the field representing the advertising system is `source_system_type`, and the field representing spending is `ad_dsp_cost`. The field to be analyzed can be `ad_dsp_cost`, and the statistical method for analyzing the values of this field can be: aggregating by advertising system and summing the company's spending across each advertising system.
[0043] As an example, the original query instruction can be a query SQL (Structured Query Language) instruction, described by an SQLStatement object, with attributes including select, from, where, groupBy, orderBy, limit, offset, etc.
[0044] In step S102, based on the original query instruction and the dimension roll-up configuration parameters, a new query instruction is generated, and the new query instruction is executed on the target data table to obtain the first query result and the second query result.
[0045] The first query result is a query result obtained by statistically analyzing the relevant data of the target object in the target data table. As an example, the first query result could be a query result obtained by statistically analyzing the data in the data rows of the target data table that meet the query conditions, where the query conditions may include at least the data row containing the target object.
[0046] The second query result is a query result obtained by statistically analyzing the relevant data of the roll-up dimension in the target data table. The roll-up dimension is the dimension obtained by rolling up the dimension of the target object according to the specified roll-up method. The relevant data of the roll-up dimension may include the field values of the fields to be statistically analyzed in the data rows of the target data table that meet the second query conditions. Here, the second query conditions include at least the data rows in which the field values of the fields representing the roll-up dimension belong to a certain value range.
[0047] As an example, a graphical interface can be provided to users for setting dimension roll-up configuration parameters, allowing users to set the required dimension roll-up configuration parameters for the original query command through the graphical interface. According to exemplary embodiments of this disclosure, translating a programming language into an interactive interface that is easy for users to understand and operate, allowing users to set parameters as needed, lowers the barrier to entry for users.
[0048] As an example, the dimension roll-up configuration parameters may include: the dimensions to be deleted when rolling up the dimension containing the target object, and the dimensions to be added when rolling up the dimension containing the target object. It should be understood that one or more dimensions may be deleted, and one or more dimensions may be added. For example, when the dimension containing the target object is the company dimension, and the dimension to be deleted when rolling up the dimension containing the target object is the company dimension, and the dimension to be added when rolling up the dimension containing the target object is the industry dimension, the rolled-up dimension obtained after rolling up the target object according to the dimension roll-up configuration parameters could be: the industry dimension.
[0049] As an example, the dimension roll-up configuration parameters may include: a set of dimensionality reduction fields including the field names of fields representing the dimensions to be deleted in the target data table, and a set of roll-up dimension fields including the field names of fields representing the dimensions to be added in the target data table. For example, in an application scenario targeting advertising performance, the dimensionality reduction field set may include: the field name representing the enterprise dimension: corporation_name; the roll-up dimension field set may include: the field name representing the industry dimension: first_industry_name.
[0050] In step S103, a target query result is generated based on the first query result and the second query result.
[0051] As an example, the first query result and the second query result can be combined together as the target query result.
[0052] According to exemplary embodiments of this disclosure, a first query result can be obtained by statistically analyzing the relevant data of the target object, and a second query result can be obtained by performing corresponding dimensional roll-up data statistics for data comparison. For example, in an application scenario targeting advertising effectiveness, the total consumption of the current enterprise in each advertising system can be queried, and the average total consumption of all companies in the same industry as the current enterprise in each advertising system can also be queried, i.e., the average total consumption of the same industry.
[0053] The following will combine Figure 2 To describe an exemplary embodiment of step S102, and in conjunction with Figure 3 An exemplary embodiment of step S103 will be described below.
[0054] Figure 2 A flowchart illustrating a method for obtaining a first query result and a second query result according to an exemplary embodiment of the present disclosure is provided. Step S102 may include steps S201 and S202.
[0055] Reference Figure 2 In step S201, based on the original query instruction and the dimension to be added, a first query instruction is generated, and the first query instruction is executed on the target data table to obtain the first query result and the value range of the dimension to be added.
[0056] The values in the required additional dimension corresponding to the target object in the target data table constitute the value range of the required additional dimension. For example, when the required additional dimension is an industry dimension, if the value in the industry dimension corresponding to the target object in the target data table is "beauty industry" and "maternal and infant industry", then the value range of the industry dimension is "beauty industry" and "maternal and infant industry"; if the only value in the industry dimension corresponding to the target object in the target data table is "gaming industry", then the value range of the industry dimension is "gaming industry".
[0057] As an example, the first query instruction can be obtained by adding a computer program segment (e.g., a code snippet) to the statement in the original query instruction that limits the query output fields to the values of the required additional dimensions appearing in the data rows of the target data table that satisfy the first query conditions.
[0058] For application scenarios targeting advertising performance, a code snippet for retrieving the industry value of the target object can be added to the original query command to obtain the first query command. The code snippet for retrieving the industry value of the target object collects the values that may appear in the upper dimension. It retrieves the industry values from all data rows that meet the first query condition (i.e., satisfy the WHERE clause), removes duplicates, and then concatenates them into a string using commas (,) and returns it. This SQL code snippet avoids performing an extra query to retrieve the industry value of the target object.
[0059] In step S202, based on the original query instruction, the dimension to be deleted, the dimension to be added and its value range (i.e., the value range of the dimension to be added), a second query instruction is generated, and the second query instruction is executed on the target data table to obtain the second query result.
[0060] As an example, the values appearing in a specific dimension in the first query result can be determined as the value range of the specific dimension. Then, based on the dimension to be deleted, the dimension to be added and its value range (i.e., the value range of the dimension to be added), and the specific dimension and its value range (i.e., the value range of the specific dimension), the original query instruction can be modified to obtain the second query instruction.
[0061] The specific dimension refers to any dimension in the first query result other than the dimension to be deleted. For example, in the application scenario of advertising performance, the specific dimension may be the advertising system dimension.
[0062] As an example, the steps for modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range may include: (a) deleting computer program segments containing the dimension to be deleted from the statements (select statement), statements (where statement), statements (group by statement), and statements (order by statement) used to limit query output fields, the query conditions, and the aggregation conditions of the original query instruction; (b) adding to the statements used to limit query conditions of the original query instruction: computer program segments for limiting the query range of the dimension to be added to its value range, and computer program segments for limiting the query range of the specific dimension to its value range, so that the original query instruction obtained after executing steps (a) and (b) for the original query instruction is used as the second query instruction.
[0063] Regarding step (a), for application scenarios of advertising performance, for example, the code snippet of the current company ID that appears when querying the industry average needs to be deleted from the original query command, so that only the data of the current company is not queried.
[0064] Regarding step (b), for application scenarios related to advertising performance, for example, code snippets regarding the first condition and the second condition need to be added to the original query command after executing step (a). The first condition, `first_industry_name`, sets the industry-specific value, and its query range comes from the output of `first_industry_name_compare_concat_alias`. The second condition, `source_system_type`, limits the output advertising systems. By setting the first and second conditions, the pagination problem can be solved. This is because if the current enterprise only has three advertising systems, it only needs to view the industry average data of these three advertising systems; the industry average data of other advertising systems will not be used even if queried.
[0065] As an example, the dimension roll-up configuration parameters may further include: the indicator-type output field name corresponding to the roll-up dimension. The step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range may further include: modifying the indicator-type output field name in the original query instruction to the indicator-type output field name corresponding to the roll-up dimension. For example, in an application scenario related to advertising performance, the output field name can be changed from cost_total to cost_total_industry.
[0066] As an example, the dimension roll-up configuration parameters may further include: the aggregation operation method corresponding to the roll-up dimension, wherein the step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range may further include: modifying the aggregation operation method used to obtain the indicator output field in the original query instruction to: the aggregation operation method corresponding to the roll-up dimension.
[0067] Considering that some aggregation operations need to be adjusted when performing statistics in Volume 1, for example, for the application scenario of advertising performance, the aggregation method of summing costs needs to be changed to summing costs / number of companies in the industry. Therefore, sum(`ad_dsp_cost`) needs to be changed to sum(`ad_dsp_cost`) / count(distinct`corporation_name`).
[0068] According to exemplary embodiments of this disclosure, automated rewriting and execution of code can be achieved based on configuration parameters.
[0069] Figure 3 A flowchart illustrating a method for generating a target query result based on a first query result and a second query result according to an exemplary embodiment of the present disclosure is shown. Step S103 may include steps S301, S302, and S303.
[0070] Reference Figure 3 In step S301, the associated fields are determined, wherein the associated fields are the same dimensional fields in both the first query result and the second query result; in other words, the associated fields appear in both the first and second query results. It should be understood that there can be multiple associated fields.
[0071] In step S302, for each data row in the first query result, a data row in the second query result that has the same field value of the associated field as that data row is concatenated to that data row.
[0072] For example, when the associated fields are field A and field B, if a data row in the first query result has field A value of a1 and field B value of b1, then the data row in the second query result with field A value of a1 and field B value of b1 will be appended to that data row in the first query result.
[0073] It should be understood that only the non-related fields of the data rows in the second query result can be concatenated to the data rows of the first query result. That is, the related fields that are repeated with the first query result do not need to be concatenated to avoid duplication.
[0074] In step S303, the concatenation result of the first query result and the second query result is taken as the target query result.
[0075] Figure 4 A structural block diagram of a data processing apparatus according to an exemplary embodiment of the present disclosure is shown.
[0076] Reference Figure 4 The data processing device 10 includes: an acquisition unit 101, a query result acquisition unit 102, and a target result generation unit 103.
[0077] Specifically, the acquisition unit 101 is configured to acquire the original query instruction and dimension roll-up configuration parameters, wherein the dimension roll-up configuration parameters are used to limit the dimension roll-up method.
[0078] The query result acquisition unit 102 is configured to generate a new query instruction based on the original query instruction and the dimension roll-up configuration parameters, and execute the new query instruction on the target data table to obtain the first query result and the second query result.
[0079] The first query result is a query result obtained by statistically analyzing the relevant data of the target object in the target data table; the second query result is a query result obtained by statistically analyzing the relevant data of the roll-up dimension in the target data table, wherein the roll-up dimension is the dimension obtained by rolling up the dimension where the target object is located according to the dimension roll-up method.
[0080] The target result generation unit 103 is configured to generate a target query result based on the first query result and the second query result.
[0081] As an example, the dimension roll-up configuration parameters may include: the dimensions to be deleted when rolling up the dimension where the target object is located, and the dimensions to be added when rolling up the dimension where the target object is located.
[0082] As an example, the query result acquisition unit 102 may include: a first query result acquisition unit (not shown) and a second query result acquisition unit (not shown). The first query result acquisition unit is configured to generate a first query instruction based on the original query instruction and the dimension to be added, and execute the first query instruction on the target data table to obtain the first query result and the value range of the dimension to be added. The second query result acquisition unit is configured to generate a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added, and execute the second query instruction on the target data table to obtain the second query result, wherein the values in the dimension to be added corresponding to the target object in the target data table constitute the value range of the dimension to be added.
[0083] As an example, the first query result is: a query result obtained by statistically analyzing the data in the data rows of the target data table that meet the query conditions. The query conditions include at least the data row where the target object is located. The first query result acquisition unit can be configured to: add a computer program segment to the statement in the original query instruction that limits the query output fields, to limit the output of the values of the required added dimensions in the data rows of the target data table that meet the query conditions, so as to obtain the first query instruction.
[0084] As an example, the second query result acquisition unit can be configured to: determine the values appearing in a specific dimension in the first query result as the value range of the specific dimension, wherein the specific dimension is the dimension in the first query result other than the dimension to be deleted; modify the original query instruction based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, the specific dimension and the value range of the specific dimension, to obtain the second query instruction.
[0085] As an example, the second query result acquisition unit may be configured to: delete computer program segments containing the dimension to be deleted from the statements for limiting query output fields, limiting query conditions, limiting aggregation conditions, and limiting sorting conditions of the original query instruction; and add to the statements for limiting query conditions of the original query instruction: computer program segments for limiting the query range of the dimension to be added to the range of values of the dimension to be added, and computer program segments for limiting the query range of the specific dimension to the range of values of the specific dimension.
[0086] As an example, the dimension roll-up configuration parameters may further include: the index-type output field name corresponding to the roll-up dimension, wherein the second query result acquisition unit may also be configured to: modify the index-type output field name in the original query instruction to the index-type output field name corresponding to the roll-up dimension.
[0087] As an example, the dimension roll-up configuration parameters may further include: the aggregation operation method corresponding to the roll-up dimension, wherein the second query result acquisition unit may also be configured to: modify the aggregation operation method used to obtain the index-type output field in the original query instruction to the aggregation operation method corresponding to the roll-up dimension.
[0088] As an example, the target result generation unit 103 can be configured to: determine the associated field, wherein the associated field is the same dimension field in the first query result and the second query result; for each data row in the first query result, concatenate a data row in the second query result that has the same field value of the associated field as each data row to each data row; and take the concatenation result of the first query result and the second query result as the target query result.
[0089] Regarding the data processing apparatus 10 in the above embodiments, the specific manner in which each unit performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0090] Furthermore, it should be understood that the various units in the data processing apparatus 10 according to exemplary embodiments of this disclosure may be implemented as hardware components and / or software components. Those skilled in the art may implement the various units, for example, using field-programmable gate arrays (FPGAs) or application-specific integrated circuits (ASICs), based on the processes performed by the defined various units.
[0091] Figure 5 A structural block diagram of an electronic device according to an exemplary embodiment of the present disclosure is shown. (Refer to...) Figure 5 The electronic device 20 includes at least one memory 201 and at least one processor 202. The at least one memory 201 stores a set of computer-executable instructions. When the set of computer-executable instructions is executed by the at least one processor 202, the data processing method as described in the exemplary embodiments above is performed.
[0092] As an example, electronic device 20 may be a PC, tablet, personal digital assistant, smartphone, or other device capable of executing the aforementioned set of instructions. Here, electronic device 20 is not necessarily a single electronic device; it may be any collection of devices or circuits capable of executing the aforementioned instructions (or instruction sets) individually or in combination. Electronic device 20 may also be part of an integrated control system or system manager, or may be configured to interconnect with a portable electronic device locally or remotely (e.g., via wireless transmission) through an interface.
[0093] In electronic device 20, processor 202 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, processor 202 may also include analog processors, digital processors, microprocessors, multi-core processors, processor arrays, network processors, etc.
[0094] The processor 202 can execute instructions or code stored in the memory 201, which can also store data. Instructions and data can also be sent and received over a network via a network interface device, which can employ any known transmission protocol.
[0095] The memory 201 may be integrated with the processor 202, for example, by placing RAM or flash memory within an integrated circuit microprocessor. Alternatively, the memory 201 may include a separate device, such as an external disk drive, a storage array, or other storage device usable by any database system. The memory 201 and the processor 202 may be operatively coupled, or may communicate with each other, for example, via I / O ports, network connections, etc., enabling the processor 202 to read files stored in the memory.
[0096] In addition, electronic device 20 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of electronic device 20 may be interconnected via a bus and / or network.
[0097] According to exemplary embodiments of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, they cause at least one processor to perform the data processing method as described in the exemplary embodiments above. Examples of computer-readable storage media herein include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disc storage, hard disk drive (HDD), solid-state drive (SSD), card storage (such as multimedia cards, secure digital (SD) cards, or ultra-fast digital (XD) cards), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid-state drive, and any other device configured to store a computer program and any associated data, data files, and data structures in a non-transitory manner and to provide the computer program and any associated data, data files, and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the aforementioned computer-readable storage medium can run in an environment deployed in computer devices such as clients, hosts, agent devices, servers, etc. Furthermore, in one example, the computer program and any associated data, data files, and data structures are distributed across a networked computer system, such that the computer program and any associated data, data files, and data structures are stored, accessed, and executed in a distributed manner through one or more processors or computers.
[0098] According to exemplary embodiments of the present disclosure, a computer program product may also be provided, wherein the instructions in the computer program product are executable by at least one processor to perform the data processing method as described in the exemplary embodiments above.
[0099] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0100] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A data processing method, characterized in that, include: Obtain the original query command and dimension roll-up configuration parameters, wherein the dimension roll-up configuration parameters are used to limit the dimension roll-up method, and the dimension roll-up configuration parameters include: the dimensions to be deleted when rolling up the dimension where the target object is located, and the dimensions to be added when rolling up the dimension where the target object is located; Based on the original query instruction and the required additional dimension, a first query instruction is generated and executed on the target data table to obtain a first query result and the value range of the required additional dimension. The first query result is a query result obtained by statistically analyzing the relevant data of the target object in the target data table. The values in the required additional dimension corresponding to the target object in the target data table constitute the value range of the required additional dimension. Based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added, a second query instruction is generated, and the second query instruction is executed on the target data table to obtain a second query result. The second query result is a query result obtained by statistically analyzing the relevant data of the roll-up dimension in the target data table. The roll-up dimension is the dimension obtained by roll-up the dimension where the target object is located according to the dimension roll-up method. The roll-up dimension includes the dimension to be added. Based on the first query result and the second query result, the target query result is generated.
2. The data processing method according to claim 1, characterized in that, The first query result is a query result obtained by statistically analyzing the data in the data rows of the target data table that meet the query conditions. The query conditions include at least the data row where the target object is located. The step of generating the first query instruction based on the original query instruction and the required additional dimensions includes: In the original query instruction, a computer program segment is added to limit the values of the required additional dimension in the data rows of the target data table that meet the query conditions, thereby obtaining the first query instruction.
3. The data processing method according to claim 1, characterized in that, The step of generating a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added includes: The values appearing in a specific dimension in the first query result are determined as the value range of the specific dimension, wherein the specific dimension is the dimension in the first query result other than the dimension to be deleted; Based on the dimension to be deleted, the dimension to be added and the value range of the dimension to be added, and the specific dimension and the value range of the specific dimension, the original query instruction is modified to obtain the second query instruction.
4. The data processing method according to claim 3, characterized in that, The step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range includes: Remove computer program segments containing the dimensions to be deleted from the original query instruction's statements for limiting query output fields, query conditions, aggregation conditions, and sorting conditions. Furthermore, the following computer program segments are added to the original query instruction's statement for limiting query conditions: a computer program segment for limiting the query range of the required added dimension to the value range of the required added dimension, and a computer program segment for limiting the query range of the specific dimension to the value range of the specific dimension.
5. The data processing method according to claim 4, characterized in that, The dimension roll-up configuration parameters also include: the name of the indicator-type output field corresponding to the roll-up dimension. The step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range further includes: Modify the index-type output field name in the original query instruction to the index-type output field name corresponding to the upper volume dimension.
6. The data processing method according to claim 4, characterized in that, The dimension roll-up configuration parameters also include: the aggregation operation method corresponding to the roll-up dimension. The step of modifying the original query instruction based on the dimension to be deleted, the dimension to be added and its value range, and the specific dimension and its value range further includes: The aggregation operation method used to obtain the index-type output field in the original query instruction is modified to the aggregation operation method corresponding to the upper volume dimension.
7. The data processing method according to claim 1, characterized in that, The step of generating the target query result based on the first query result and the second query result includes: Determine the associated fields, wherein the associated fields are the same dimension fields in the first query result and the second query result; For each data row in the first query result, a data row in the second query result that has the same field value of the associated field as each data row is concatenated to each data row; The concatenation result of the first query result and the second query result is taken as the target query result.
8. A data processing apparatus, characterized in that, include: The acquisition unit is configured to acquire the original query instruction and dimension roll-up configuration parameters, wherein the dimension roll-up configuration parameters are used to limit the dimension roll-up method, and the dimension roll-up configuration parameters include: the dimensions to be deleted when rolling up the dimension where the target object is located, and the dimensions to be added when rolling up the dimension where the target object is located; The query result acquisition unit includes a first query result acquisition unit and a second query result acquisition unit. The first query result acquisition unit is configured to generate a first query instruction based on the original query instruction and the dimension to be added, and execute the first query instruction on the target data table to obtain a first query result and the value range of the dimension to be added. The first query result is a query result obtained by statistically analyzing the relevant data of the target object in the target data table. The value in the dimension to be added corresponding to the target object in the target data table constitutes the value range of the dimension to be added. The second query result acquisition unit is configured to generate a second query instruction based on the original query instruction, the dimension to be deleted, the dimension to be added, and the value range of the dimension to be added, and execute the second query instruction on the target data table to obtain a second query result. The second query result is a query result obtained by statistically analyzing the relevant data of the roll-up dimension in the target data table. The roll-up dimension is the dimension obtained by roll-up the dimension where the target object is located according to the dimension roll-up method. The roll-up dimension includes the dimension to be added. The target result generation unit is configured to generate a target query result based on the first query result and the second query result.
9. An electronic device, characterized in that, include: At least one processor; At least one memory that stores computer-executable instructions. The computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform the data processing method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor causes the at least one processor to perform the data processing method as described in any one of claims 1 to 7.