Data aggregation query method, device, computer equipment and storage medium

By dynamically determining the minimum compatible data type in the aggregation query and performing data type conversion only when aggregation results are obtained, the efficient aggregation query problem of multi-source heterogeneous data in big data scenarios is solved, improving computing efficiency and saving resources.

CN117312412BActive Publication Date: 2025-08-29上海炎凰数据科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311308536.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-10
Publication Date
2025-08-29
Estimated Expiration
2043-10-10

AI Technical Summary

Technical Problem

In the big data scenario, multi-source and diverse data are scattered in a heterogeneous environment. The prior art requires the conversion of data types to a unified type in advance, resulting in high computing overhead and difficult to determine all data types in real-time streaming data, resulting in low computing efficiency.

Method used

By dynamically determining the minimum compatible data type during the aggregation query process, data type conversion is performed only when aggregation results are obtained, all data is avoided pre-converting, and aggregation processing is performed using the aggregation operator of the minimum compatible type in the aggregation operator set for querying the aggregation operation.

Benefits of technology

It improves the efficiency of aggregation query for patternless data, saves computing resources, and is suitable for efficient aggregation query of multi-source heterogeneous data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117312412B_ABST
    Figure CN117312412B_ABST
Patent Text Reader

Abstract

Provided are a data aggregation query method, apparatus, computer device, and storage medium. The data aggregation query method includes: obtaining a data aggregation query instruction; obtaining, according to the data aggregation query instruction, multiple pieces of to-be-processed data, each having a data type; and, according to the data aggregation query instruction, performing aggregation processing on each piece of data in at least one group of data among the multiple pieces of to-be-processed data, wherein the aggregation processing includes: querying a set of aggregation operators for a first aggregation operator corresponding to the data type of the piece of data; in response to querying the first aggregation operator in the set of aggregation operators, updating an aggregation intermediate result of the first aggregation operator based on the piece of data; in response to obtaining a data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the set of aggregation operators; and updating a data aggregation result based on at least the aggregation intermediate result, using the aggregation operator corresponding to the first minimum compatible data type among the first aggregation operator and other aggregation operators.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data aggregation query method, apparatus, computer equipment, and computer-readable storage medium. Background Art

[0002] Aggregate queries are a common data processing method for obtaining statistical information about a field in a dataset, such as average, cumulative sum, maximum, and minimum values. In everyday practice, big data scenarios involve numerous systems, generating data from multiple sources, often scattered across heterogeneous environments, and with variable data schemas, posing challenges for user data processing.

[0003] The approaches described in this section are not necessarily approaches that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any approach described in this section is prior art simply by virtue of its inclusion in this section. Similarly, unless otherwise indicated, the issues raised in this section should not be considered as having been recognized in any prior art. Summary of the Invention

[0004] The present disclosure provides a data aggregation query method, apparatus, computer equipment, computer-readable storage medium, and computer program product.

[0005] According to one aspect of the present disclosure, a data aggregation query method is provided, comprising: obtaining a data aggregation query instruction; obtaining, according to the data aggregation query instruction, a plurality of to-be-processed data, each having a data type; and, according to the data aggregation query instruction, sequentially performing aggregation processing on each piece of data in at least one group of data among the plurality of to-be-processed data, wherein the aggregation processing comprises: querying a first aggregation operator for the data type of the piece of data in an aggregation operator set; in response to querying the first aggregation operator in the aggregation operator set, updating an aggregation intermediate result of the first aggregation operator based on the piece of data; in response to obtaining a data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and updating a data aggregation result based at least on the aggregation intermediate result, using the aggregation operator for the first minimum compatible data type among the first aggregation operator and other aggregation operators.

[0006] According to another aspect of the present disclosure, a data aggregation query device is provided, including: an instruction acquisition module, configured to acquire a data aggregation query instruction; a data acquisition module, configured to acquire a plurality of to-be-processed data, each having a data type, according to the data aggregation query instruction; and a data processing module, configured to perform aggregation processing on each of at least one group of data in the plurality of to-be-processed data in turn according to the data aggregation query instruction, the aggregation processing including: querying a first aggregation operator for the data type of the data in an aggregation operator set; in response to querying the first aggregation operator in the aggregation operator set, updating an aggregation intermediate result of the first aggregation operator based on the data; in response to acquiring a data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and updating a data aggregation result based on at least the aggregation intermediate result by using the aggregation operator for the first minimum compatible data type among the first aggregation operator and other aggregation operators.

[0007] According to yet another aspect of the present disclosure, a computer device is provided, comprising: at least one processor; and at least one memory on which a computer program is stored, wherein when the computer program is executed by the at least one processor, the at least one processor executes the above method.

[0008] According to yet another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the above method.

[0009] According to yet another aspect of the present disclosure, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the processor is caused to perform the above method.

[0010] These and other aspects of the disclosure will be apparent from and elucidated with reference to the embodiments described hereinafter. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0012] Figure 1 is a schematic diagram illustrating an example system in which the various methods described herein may be implemented, according to an exemplary embodiment;

[0013] Figure 2 is a flowchart illustrating a data aggregation query method according to an exemplary embodiment;

[0014] Figure 3 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment;

[0015] Figure 4 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment;

[0016] Figure 5 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment;

[0017] Figure 6 is a flow chart illustrating performing a data aggregation query using a data aggregation query method according to an exemplary embodiment;

[0018] Figure 7 is a block diagram illustrating a data aggregation query apparatus according to an exemplary embodiment; and

[0019] Figure 8 is a block diagram illustrating an exemplary computer device that can be used with the exemplary embodiments. DETAILED DESCRIPTION

[0020] In this disclosure, unless otherwise specified, the use of terms such as "first" and "second" to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, while in some cases, based on the context of the description, they may also refer to different instances.

[0021] The terms used in the description of the various examples described in this disclosure are for the purpose of describing specific examples only and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. As used herein, the term "plurality" means two or more, and the term "based on" should be interpreted as "based at least in part on". In addition, the terms "and / or" and "at least one of..." cover any one of the listed items and all possible combinations.

[0022] As mentioned above, in big data scenarios, there are numerous systems, and the data generated comes from multiple sources and is often scattered across multiple heterogeneous environments, and the data schema is not fixed. In related technologies, in order to perform aggregate queries on this data, different data types need to be converted into a unified specific type in advance, which incurs additional computational overhead. In addition, for real-time streaming data, it is difficult to know the full range of data types in the stream. Usually, all data can only be converted into the most compatible data type (such as floating point numbers or strings), but the calculation of highly compatible data types is also relatively slow.

[0023] In view of this, the present disclosure provides a data aggregation query method, apparatus, computer device, computer-readable storage medium, and computer program product.

[0024] Before introducing exemplary embodiments of the present disclosure, several terms used herein are first explained.

[0025] 1. Schema: A clear definition of the table structure in a data table, including specific data column names and stored data types.

[0026] 2. Aggregation operator: A computing unit used to summarize or count specific types of data, which can be a mapping from function to function.

[0027] 3. Grouping operator: A computing unit used to group data of a specific type, which can be a mapping from function to function.

[0028] 4. Minimum compatible type: Minimize data conversions to cover all current data and aggregation operator input types. For example, for an accumulation operator that supports both integer and floating-point data, when the input data is integer, the minimum compatible type is integer. When the input data types include integer, floating-point, and string, because the accumulation operator and data most widely cover floating-point types, the minimum compatible type in this case is floating-point.

[0029] 5. Aggregate intermediate result: The result of the aggregation operation between the input data of the same data type (data type is not converted). The aggregate intermediate result varies depending on the instruction. For example, according to the summation instruction SUM, the aggregate intermediate result can be the sum of the input data of the same data type. For another example, according to the average instruction AVG, the aggregate intermediate result can include the sum of the input data of the same data type and the number of data. It should be noted that the aggregate intermediate result is not the final aggregation result.

[0030] 6. Grouping Intermediate Results: Grouping intermediate results are generated by dividing the input data of different grouping operators into different groups according to their data types. It should be noted that the grouping intermediate results are not the final grouping results.

[0031] 7. Data output instruction: In the scenario of streaming data processing, the data output instruction can be a data output instruction input by the user, or it can be an output instruction triggered after the currently acquired data is processed.

[0032] Exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0033] Figure 1 is a schematic diagram illustrating an example system 100 in which the various methods described herein may be implemented, according to an exemplary embodiment.

[0034] refer to Figure 1 , the system 100 includes a client device 110 , a server 120 , and a network 130 communicatively coupling the client device 110 and the server 120 .

[0035] The client device 110 includes a display 114 and a client application (APP) 112 that can be displayed via the display 114. The client application 112 can be an application that needs to be downloaded and installed before running or a small program (liteapp) that is a lightweight application. In the case where the client application 112 is an application that needs to be downloaded and installed before running, the client application 112 can be pre-installed on the client device 110 and activated. In the case where the client application 112 is a small program, the user 102 can directly run the client application 112 on the client device 110 by searching for the client application 112 in the host application (for example, by the name of the client application 112, etc.) or scanning a graphic code (for example, a barcode, a QR code, etc.) of the client application 112, without installing the client application 112. In some embodiments, the client device 110 can be any type of mobile computer device, including a mobile computer, a mobile phone, a wearable computer device (for example, a smart watch, a head-mounted device, including smart glasses, etc.) or other types of mobile devices. In some embodiments, client device 110 may alternatively be a stationary computer device, such as a desktop computer, a server computer, or other type of stationary computer device.

[0036] The server 120 is typically a server deployed by an Internet Service Provider (ISP) or an Internet Content Provider (ICP). The server 120 may represent a single server, a cluster of multiple servers, a distributed system, or a cloud server that provides basic cloud services (such as cloud databases, cloud computing, cloud storage, and cloud communications). It will be understood that although Figure 1 1. The server 120 is shown communicating with only one client device 110, but the server 120 may provide background services to multiple client devices simultaneously.

[0037] Examples of network 130 include a local area network (LAN), a wide area network (WAN), a personal area network (PAN), and / or a combination of communication networks such as the Internet. Network 130 can be a wired or wireless network. In some embodiments, data exchanged through network 130 is processed using technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc. In addition, encryption technologies such as Secure Sockets Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In some embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.

[0038] For the purpose of the embodiments of this disclosure, Figure 1 In the example, client application 112 may be a data aggregation query application that can provide various functions based on data aggregation queries, such as obtaining data aggregation query instructions input by a user and presenting data aggregation query results to the user. Accordingly, server 120 may be a server used in conjunction with the data aggregation query application. Server 120 may provide data aggregation query services to client application 112 running on client device 110.

[0039] Figure 2 2 is a flow chart illustrating a data aggregation query method 200 according to an exemplary embodiment. The method 200 may be performed on a client device (eg, Figure 1 , that is, the execution subject of each step of the method 200 may be a client device 110 shown in FIG. Figure 1 In some embodiments, the method 200 may be performed on a server (e.g., Figure 1 In some embodiments, method 200 may be performed by a combination of a client device (e.g., client device 110) and a server (e.g., server 120). Hereinafter, the steps of method 200 will be described in detail, taking server 120 as an example.

[0040] refer to Figure 2 , Figure 2 is a flowchart illustrating a data aggregation query method 200 according to an exemplary embodiment.

[0041] The method 200 includes:

[0042] Step S210: Obtain data aggregation query instructions;

[0043] Step S220: Acquire multiple pieces of to-be-processed data, each having a data type, according to the data aggregation query instruction; and

[0044] Step S230: According to the data aggregation query instruction, aggregate each piece of data in at least one group of data among the multiple pieces of data to be processed. The aggregation processing of step S230 includes:

[0045] Step S231: Query the aggregation operator set for the first aggregation operator corresponding to the data type of the data item;

[0046] Step S232: in response to finding the first aggregation operator in the aggregation operator set, updating the aggregation intermediate result of the first aggregation operator based on the data;

[0047] Step S233: In response to obtaining the data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and

[0048] Step S234: Use the first aggregation operator and the aggregation operator for the first minimum compatible data type among other aggregation operators to update the data aggregation result based on at least the data.

[0049] In step S210, a data aggregation query instruction is obtained. In the example, the data aggregation query instruction can be obtained from the client. For example, the user can input the data aggregation query instruction through a graphical user interface or other input device on the client. In order to reduce the user's learning cost and maximize the user's convenience, the data aggregation query instruction can be set to be based on the Structured Query Language (SQL). In industrial and enterprise application scenarios, most users do not need to learn a new dedicated language for this purpose, but can rely on the already mastered structured query language to input data aggregation query instructions.

[0050] For example, a user-entered SQL statement or other function call expressing an aggregate query target is obtained. For example, a data aggregate query instruction may include the instruction AVG(data) for calculating the overall average, or the instruction SUM(data) GROUP BY key1, key2 for calculating the cumulative sum of groups, where data, key1, and key2 are fields.

[0051] In step S220, according to the data aggregation query instruction, multiple pieces of data to be processed, each having a data type, are obtained. In the example, as shown in Table 1, after obtaining the instruction AVG(data) for calculating the overall average, according to the instruction, multiple pieces of data to be processed in the field data can be obtained, such as integer 2, integer 4, floating point type 6.0, integer 8 and string "10.0", each of which has a corresponding data type. In another example, continuing to refer to Table 1, after obtaining the instruction SUM(data)GROUP BY key1,key2 for calculating the grouped cumulative sum, all the data to be processed under the fields data, key1, and key2 can be obtained according to the instruction. It will be understood that the multiple pieces of data can be streaming data.

[0052]

[0053] Table 1 Sample data types

[0054] In step S230, according to the data aggregation query instruction, aggregation processing is performed on each piece of data in at least one group of the multiple pieces of data to be processed. In the example shown in Table 1, according to the AVG(data) instruction, aggregation processing is performed on each piece of data in the multiple pieces of data to be processed in the field "data". That is, aggregation processing is performed on the integer 2, the integer 4, the floating point 6.0, the integer 8, and the string "10.0" in order to calculate the average. Step S230 includes steps S231-S233.

[0055]

[0056] Table 2 Input sample data in sequence and output the results of AVG(data)

[0057] In step S231, the first aggregation operator for the data type of the data is queried in the aggregation operator set. For example, as shown in Table 2, the data numbered 1-5 in Table 1 are input sequentially. After data 1 is input, the first aggregation operator (i.e., integer aggregation operator) for the input data type (i.e., integer 2) of the field data of data 1 is queried in the aggregation operator set. For another example, after data 5 is input, the first aggregation operator (i.e., string aggregation operator) for the input data type (i.e., string "10.0") of the field data of data 5 is queried in the aggregation operator set.

[0058] In step S232, in response to finding the first aggregator in the aggregator set, the aggregation intermediate result of the first aggregator is updated based on the data. For example, as shown in Table 2, the input instruction is the AVG(data) command. After data 2 is input, the first aggregator (i.e., integer aggregator) of the input data type (i.e., integer) for the field data of data 2 (i.e., integer 4) is queried in the aggregator set. At this time, the aggregator set includes integer aggregators, and therefore, the integer aggregator is queried in the aggregator set. In response to finding the integer aggregator in the aggregator set, the aggregation intermediate result of the first aggregator (i.e., integer aggregator) is updated based on the data (i.e., integer 4). According to the AVG(data) command, the aggregation intermediate result of the integer aggregator is updated to include the sum of data 1 (i.e., integer 2) and data 2 (i.e., integer 4) (i.e., integer 6) and the number of data (i.e., 2 data). For another example, as shown in Table 2, after data 4 is input, the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer) for the field data data (i.e., integer 8) of data 4 is queried in the aggregation operator set. At this time, the aggregation operator set includes integer aggregation operators and floating-point aggregation operators. Therefore, the integer aggregation operator is queried in the aggregation operator set. In response to querying the integer aggregation operator in the aggregation operator set, the aggregation intermediate result of the first aggregation operator (i.e., the integer aggregation operator) is updated based on the data (i.e., integer 8). According to the AVG(data) command, the aggregation intermediate result of the integer aggregation operator is updated to the sum (i.e., integer 14) and number (i.e., 3 data) of data 1 (i.e., integer 2), data 2 (i.e., integer 4) and data 4 (i.e., integer 8). At this time, the aggregation intermediate result of the floating-point operator is not updated, and is still the aggregation intermediate result of the floating-point operator after inputting data 3 (i.e., sum (floating-point 6.0) and number of data (1 data)).

[0059] In step S233, in response to obtaining the data output instruction, the first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set is determined. For example, as shown in Table 2, after inputting data 2, in response to obtaining the data output instruction input by the user, the first minimum compatible data type (i.e., integer) between the first aggregation operator (i.e., integer aggregation operator) and other aggregation operators in the aggregation operator set (at this time, there are no other aggregation operators in the aggregation operator set except the integer aggregation operator) is determined. For example, as shown in Table 2, after inputting data 4, in response to obtaining the data output instruction temporarily input by the user, the first minimum compatible data type (i.e., floating-point) between the first aggregation operator (i.e., integer aggregation operator) and other aggregation operators in the aggregation operator set (floating-point aggregation operators) is determined.

[0060] In step S234, the data aggregation result is updated based on at least the intermediate aggregation result using the aggregation operator for the first minimum compatible data type among the first aggregation operator and other aggregation operators. For example, as shown in Table 2, after data 2 is input, the data aggregation result is updated based on at least the intermediate aggregation result (i.e., the sum of data 1 (i.e., integer 2) and data 2 (i.e., integer 4) and the number of data (i.e., 2 data)) among the first aggregation operator (i.e., integer aggregation operator) and other aggregation operators (at this time, there are no other aggregation operators in the aggregation operator set except the integer aggregation operator) for the first minimum compatible data type (i.e., integer aggregation operator) among the first aggregation operator (i.e., integer aggregation operator) of the field data of data 2 (i.e., integer 4) using the aggregation operator for the first minimum compatible data type (i.e., integer aggregation operator). For example, according to the AVG(data) command, the average value (i.e., integer 3) of data 1 (i.e., integer 2) and data 2 (i.e., integer 4) is calculated. For another example, after data 4 is input, the data aggregation result is updated based on at least the aggregation intermediate results (i.e., the sum of data 1 (i.e., integer 2), data 2 (i.e., integer 4), and data 4 (i.e., integer 8) (i.e., integer 14) and the number of data (i.e., 3 data) and the sum of data 3 (i.e., floating-point type 6.0) (i.e., floating-point type 6.0) and the number of data (i.e., 1 data)) using the first aggregation operator (i.e., integer aggregation operator) of the field data of data 4 (i.e., integer 8) and the aggregation operator for the first minimum compatible data type (i.e., floating-point type 5.0). For example, according to the AVG(data) command, the average value of data 1 to data 4 is calculated (i.e., floating-point type 5.0).

[0061] Therefore, in big data scenarios, there is no need to convert the data types of all data to be processed before the query. Instead, the data types of some data are converted when the aggregated results are obtained. This can improve the efficiency of aggregated queries on schema-free data (multi-source heterogeneous data) and save computing resources.

[0062] According to some embodiments, the aggregation process in step S230 may further include:

[0063] In response to not finding the first aggregation operator in the aggregation operator set, generating the first aggregation operator in the aggregation operator set; and

[0064] The intermediate aggregation result of the first aggregation operator generated based on the updated data.

[0065] In an example, as shown in Table 2, the data in Table 1 are input sequentially. After data 1 is input, the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer) for the field data data (i.e., integer 2) of data 1 is queried in the aggregation operator set. However, since data 1 is the first input data, the aggregation operator set is empty at this time. Therefore, no integer aggregation operator is found in the aggregation operator set. In response to the fact that no integer aggregation operator is found in the aggregation operator set, an integer aggregation operator is generated in the aggregation operator set, and the aggregation intermediate result (i.e., sum (i.e., integer 2) and the number of data (i.e., 1 data)) corresponding to the generated first aggregation operator (i.e., integer aggregation operator) is updated based on data 1 (i.e., integer 2). For another example, after data 3 is input, the first aggregation operator (i.e., floating-point aggregation operator) of the input data type (i.e., floating-point type) for the field data data of data 3 (i.e., floating-point type 6.0) is queried in the aggregation operator set. However, since the aggregation operator set at this time only contains integer aggregation operators, the floating-point aggregation operator cannot be queried in the aggregation operator set. In response to the fact that the floating-point aggregation operator is not queried in the aggregation operator set, a floating-point aggregation operator is generated in the aggregation operator set, and the aggregation intermediate result (i.e., the sum (i.e., floating-point type 6.0) and the number of data (i.e., 1 data)) corresponding to the generated first aggregation operator (i.e., floating-point type aggregation operator) is updated based on data 3 (i.e., floating-point type 6.0).

[0066] Figure 3 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment.

[0067] According to some embodiments, Figure 3 As shown, step S233 may also include step S310, aligning the data type of the aggregation intermediate result corresponding to each aggregation operator in the aggregation operator set to the first minimum compatible data type; and step S320, using the aggregation operator for the first minimum compatible data type to aggregate the aggregation intermediate results with aligned data types to obtain a data aggregation result.

[0068] refer to Figure 3, in step S310, the data types of the data and the data before the data are aligned to the first minimum compatible data type. For example, as shown in Table 2, when data 3 is input, the data types of the aggregation intermediate results corresponding to each aggregation operator in the aggregation operator set (i.e., the aggregation intermediate results of the integer aggregation operator: sum (i.e., integer 6) and the number of data (i.e., 2 data); and the aggregation intermediate results of the floating-point aggregation operator: sum (i.e., floating-point 6.0) and the number of data (i.e., 1 data)) are aligned to the first minimum compatible data type (i.e., floating-point). It should be noted that the data type of the aggregation intermediate result of the floating-point aggregation operator is already floating-point, so no type conversion is required, while the data types of the sum (i.e., integer 6) and the number of data (i.e., 2 data) in the aggregation intermediate result of the integer aggregation operator are integer, and need to be converted to floating-point 6.0 and floating-point 2.0 respectively.

[0069] In step S320, the aggregation operator for the first minimum compatible data type is used to aggregate the intermediate aggregation results of the aligned data types to obtain a data aggregation result. For example, as shown in Table 2, after data 3 is input, an aggregation result needs to be output. The aggregation intermediate results of the integer aggregation operator that has been aligned to floating point and the aggregation intermediate results of the floating-point aggregation operator are aggregated using the floating-point aggregation operator for the first minimum compatible data type. For example, the aggregation result is calculated using the following equation:

[0070] (6.0*2.0+6.0*1.0) / (2.0+1.0)=4.0

[0071] Get the aggregation result floating point type 4.0, which is the AVG(data) output data after inputting data 3 in Table 2.

[0072] Figure 4 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment of another exemplary embodiment.

[0073] According to some embodiments, the data aggregation query instruction may include an instruction for performing group aggregation query on multiple pieces of data to be processed. For example, the data aggregation query instruction may include a group accumulation sum instruction SUM(data)GROUP BYkey1,key2. Figure 3 As shown in the figure, after obtaining the instruction SUM(data)GROUP BY key1,key2, all the data to be processed under the fields data, key1, and key2 are obtained according to the instruction.

[0074] Furthermore, the method 200 may further include: sequentially performing group processing on each of the plurality of data to be processed to obtain a plurality of groups of data including at least one group of data. Figure 4As shown, the grouping process may include steps S410-S430.

[0075]

[0076] Table 3 Input another sample data in sequence and output the results of SUM(data) GROUP BY key1, key2

[0077] In step S410, the grouping operator set is searched for the first grouping operator for the data type of the grouping field of the data item. For example, as shown in Table 3, after data 1 is input, the input data for field key1 of data 1 is an integer 1, and the input data for field key2 of data 1 is a string "10". Then, the grouping operator set is searched for the first grouping operator "Integer-String" for the data types of the grouping fields key1 and key2 of data 1. Similarly, after data 2 is input, the grouping operator set is searched for the first grouping operator "Float-Integer" for the data types of the grouping fields key1 and key2 of data 2.

[0078] In step S420, in response to finding the first grouping operator in the grouping operator set, the intermediate grouping result of the first grouping operator is updated based on the data item. For example, after data item 3 is input, the grouping operator set now includes the "integer-string" grouping operator and the "float-integer" grouping operator. Therefore, the first grouping operator "integer-string" grouping operator for the data types of the grouping fields key1 and key2 of data item 3 is found in the grouping operator set. In response to finding the first grouping operator "integer-string" grouping operator in the grouping operator set, the intermediate grouping result of the first grouping operator is updated based on the data item, that is, the data item is grouped into the group corresponding to the "integer-string" grouping operator.

[0079] In step S430, in response to receiving the data output instruction, a second minimum compatible data type is determined between the first grouping operator and the other grouping operators in the grouping operator set. For example, as shown in Table 3, after inputting data 3, in response to receiving the data output instruction, the second minimum compatible data type "float-string" is determined between the first grouping operator "integer-string" grouping operator and the other grouping operators in the grouping operator set (i.e., the "float-integer" grouping operator).

[0080] In step S440, the data piece is grouped based on at least the intermediate result of the grouping using the first grouping operator and the grouping operator for the second smallest compatible data type among the other grouping operators. For example, as shown in Table 3, after data 3 is input, data 3 is grouped based on at least the intermediate result of the grouping using the first grouping operator "integer-string" grouping operator and the grouping operator for the second smallest compatible data type "float-string" (i.e., "float-string" grouping operator) among the other grouping operators (i.e., "float-int" grouping operator).

[0081] According to some embodiments, the method 200 may further include:

[0082] In response to not finding the first grouping operator in the grouping operator set, generating the first grouping operator in the grouping operator set; and

[0083] The intermediate grouping result of the first grouping operator generated based on the updated data.

[0084] For example, as shown in Table 3, after data 2 is input, the grouping operator set includes the "integer-string" grouping operator. Therefore, the first grouping operator "floating-integer" grouping operator of the data type of the grouping fields key1 and key2 of data 2 cannot be queried in the grouping operator set. In response to the fact that the first grouping operator "floating-integer" grouping operator is not queried in the grouping operator set, the first grouping operator "floating-integer" grouping operator is generated in the grouping operator set, and the grouping intermediate result of the first grouping operator generated based on data update 3 is generated.

[0085] Figure 5 is a flowchart illustrating a partial process of a data aggregation query method according to an exemplary embodiment.

[0086] According to some embodiments, Figure 5 As shown, step S430 may further include:

[0087] Step 510: align the data type of the grouping intermediate result corresponding to each grouping operator in the grouping operator set to the second minimum compatible data type; and

[0088] Step 520: Group the grouped intermediate results of the aligned data types using a grouping operator for the second minimum compatible data type to obtain the multiple groups of data.

[0089] At step 510, the data type of the grouping intermediate result corresponding to each grouping operator in the grouping operator set is aligned to the second minimum compatible data type. For example, as shown in Table 3, after data 2 is input, the data types of the grouping fields key1 and key2 of data 1 preceding data 2 are aligned to the second minimum compatible data type of "float-string." For another example, as shown in Table 3, after data 4 is input, the data types of the grouping fields key1 and key2 of data 1 through 3 preceding data 4 are aligned to the second minimum compatible data type of "float-string."

[0090] Step 520: Group the data type-aligned grouping intermediate results using a grouping operator for the second minimum compatible data type to obtain a data grouping result. For example, as shown in Table 3, after data 2 is input, data 1 and data 2 are grouped using a grouping operator for the second minimum compatible data type, i.e., a "float-string" grouping operator. Since the values ​​of the grouping fields key1 and key2 of data 1 and data 2 are the same after the data type alignment, they are grouped into the same group with group number 1. For another example, as shown in Table 3, after data 4 is input, data 1 to 4 are grouped using a grouping operator for the second minimum compatible data type, i.e., a "float-string" grouping operator. Since the values ​​of the grouping fields key1 and key2 of data 1 to 3 are the same after the data type alignment, they are grouped into the same group with group number 1. The values ​​of the grouping fields key1 and key2 of data 4 are different from the values ​​of the grouping fields key1 and key2 of data 1 to 3, so they are grouped into another group with group number 2.

[0091] It will be understood that after the grouping is completed, the above steps can be performed separately within each group. Figure 2 and Figure 3 The aggregation processing described above can be performed, and the final aggregate query result can be a combination of multiple intra-group aggregation results.

[0092] According to some embodiments, the data types of the plurality of data to be processed may include at least one of integer, floating point, and string. For example, as shown in Table 1, the data types of the data fields of data 1 to 5 include integer, floating point, and string.

[0093] According to some embodiments, the data aggregation query instruction may include at least one of a sum instruction, an average instruction, a maximum instruction, a minimum instruction, a median instruction, a variance instruction, and a standard deviation instruction. For example, the data aggregation query instruction may be an AVG(data) instruction or a total sum instruction.

[0094] Next, through Figure 6 The data aggregation query method according to the embodiment of the present disclosure is further explained. Figure 6 is a flowchart illustrating performing a data aggregation query using a data aggregation query method according to an exemplary embodiment.

[0095] like Figure 6 As shown, the method 600 includes:

[0096] Step S601: input a query statement or function call;

[0097] Step S602: reading data;

[0098] Step S603: Determine whether to group. If yes, proceed to S604; if not, proceed to S607.

[0099] Step S604: Determine whether the grouping operator is initialized. If yes, proceed to S606; if not, proceed to S605.

[0100] Step S605: Initialize the grouping operator;

[0101] Step S606: Update the intermediate grouping result;

[0102] Step S607: Determine whether the intra-group aggregation operator is initialized. If yes, proceed to S609; if not, proceed to S608.

[0103] Step S608: Initialize the aggregation operator;

[0104] Step S609: Update the aggregated intermediate result;

[0105] Step S610: Determine whether to output or end, if yes, go to S611, if not, go to S602;

[0106] Step S611: Determine whether to group, if yes, proceed to S612, if not, proceed to S615;

[0107] Step S612: input the grouping intermediate result;

[0108] Step S613: Convert the group to the minimum compatible type;

[0109] Step S614: The grouping results are merged and output;

[0110] Step S615: output the aggregated intermediate result;

[0111] Step S616: Convert to the minimum compatible type; and

[0112] Step S617: The aggregation results are merged and output.

[0113] In step S601, a query statement or function call is input. In this example, the input instruction can be the instruction AVG(data) for calculating the overall average, or the instruction SUM(data) GROUP BY key1, key2 for calculating the grouped cumulative sum.

[0114] Step S602, read data. In the example, as shown in Table 1, after obtaining the instruction AVG(data) for calculating the overall average, according to the instruction, multiple pieces of data to be processed in the field data can be obtained, such as integer 2, integer 4, floating point type 6.0, integer 8, and string "10.0", each of which has a corresponding data type. In another example, continuing to refer to Table 1, after obtaining the instruction SUM(data) GROUP BY key1, key2 for calculating the grouped cumulative sum, according to the instruction, all pieces of data to be processed under the fields data, key1, and key2 can be obtained. It will be understood that the multiple pieces of data can be streaming data.

[0115] Step S603 determines whether grouping is performed. If yes, proceed to S604; if no, proceed to S607. This determination is made based on the input query statement or function call. In this example, if the input instruction is SUM(data) GROUP BY key1, key2, grouping is performed, proceeding to S604. In another example, if the input instruction is AVG(data), grouping is not performed, proceeding to S607.

[0116] Step S604, determine whether the grouping operator is initialized. If so, proceed to S606; if not, proceed to S605. Determine whether the grouping operator is initialized by querying the grouping operator set for the first grouping operator of the data type of the grouping field of the data. If found, proceed to S606; if not, proceed to S605. For example, as shown in Table 3, after data 1 is input, the input data of the field key1 of data 1 is integer 1, and the input data of the field key2 of data 1 is string "10", then the first grouping operator "integer-string" grouping operator for the data types of the grouping fields key1 and key2 of data 1 is queried in the grouping operator set. Similarly, after data 2 is input, the first grouping operator "floating-point-integer" grouping operator for the data types of the grouping fields key1 and key2 of data 2 is queried in the grouping operator set.

[0117] Step S605: Initialize the grouping operator. For example, as shown in Table 3, after data 2 is input, the grouping operator set includes the "integer-string" grouping operator. Therefore, the first grouping operator "float-integer" grouping operator for the data types of the grouping fields key1 and key2 of data 2 cannot be found in the grouping operator set. In response to not finding the first grouping operator "float-integer" grouping operator in the grouping operator set, the "float-integer" grouping operator is initialized.

[0118] Step S606: Update the intermediate grouping result. For example, as shown in Table 3, after data 2 is input, the intermediate grouping result of the first grouping operator is updated based on data 2, that is, data 2 is assigned to the group of the "floating point type - integer type" grouping operator.

[0119] Step S607, determine whether the aggregation operator in the group is initialized, if yes, go to S609, if not, go to S608. By querying the first aggregation operator for the data type of the data in the aggregation operator set, determine whether the aggregation operator in the group is initialized. If found, go to S609, if not, go to S608. For example, as shown in Table 2, input the data numbered 1-5 in Table 1 in sequence. After inputting data 1, query the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer 2) for the field data of data 1 in the aggregation operator set. Therefore, if the integer aggregation operator is not found in the aggregation operator set, go to S608. For another example, as shown in Table 2, after data 2 is input, the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer) for the field data data (i.e., integer 4) of data 2 is queried in the aggregation operator set. At this time, the aggregation operator set includes the integer aggregation operator. Therefore, when the integer aggregation operator is queried in the aggregation operator set, enter S609.

[0120] Step S608, initialize the aggregation operator. In response to not finding the first aggregation operator in the aggregation operator set, generate the first aggregation operator in the aggregation operator set. For example, as shown in Table 2, the data in Table 1 are input sequentially. After data 1 is input, the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer) for the field data data (i.e., integer 2) of data 1 is queried in the aggregation operator set. However, since data 1 is the first input data, the aggregation operator set is empty at this time. Therefore, no integer aggregation operator is found in the aggregation operator set. In response to not finding the integer aggregation operator in the aggregation operator set, an integer aggregation operator is generated in the aggregation operator set. After data 3 is input, the first aggregation operator (i.e., floating-point aggregation operator) of the input data type (i.e., floating-point type) for the field data data of data 3 (i.e., floating-point type 6.0) is queried in the aggregation operator set. However, since the aggregation operator set at this time only contains integer aggregation operators, the floating-point aggregation operator cannot be queried in the aggregation operator set. In response to the fact that the floating-point aggregation operator is not queried in the aggregation operator set, a floating-point aggregation operator is generated in the aggregation operator set.

[0121] Step S609: Update the intermediate aggregation result. As shown in Table 2, the data in Table 1 are input sequentially. After data 1 is input, the first aggregation operator (i.e., integer aggregation operator) of the input data type (i.e., integer) for the field data data (i.e., integer 2) of data 1 is searched in the aggregation operator set. However, since data 1 is the first input data, the aggregation operator set is empty at this time. Therefore, no integer aggregation operator is found in the aggregation operator set. In response to the fact that no integer aggregation operator is found in the aggregation operator set, an integer aggregation operator is generated in the aggregation operator set, and the intermediate aggregation result (i.e., sum (i.e., integer 2) and the number of data (i.e., 1 data)) corresponding to the generated first aggregation operator (i.e., integer aggregation operator) is updated based on data 1 (i.e., integer 2). For another example, after data 3 is input, the first aggregation operator (i.e., floating-point aggregation operator) of the input data type (i.e., floating-point type) for the field data data of data 3 (i.e., floating-point type 6.0) is queried in the aggregation operator set. However, since the aggregation operator set at this time only contains integer aggregation operators, the floating-point aggregation operator cannot be queried in the aggregation operator set. In response to the fact that the floating-point aggregation operator is not queried in the aggregation operator set, a floating-point aggregation operator is generated in the aggregation operator set, and the aggregation intermediate result (i.e., the sum (i.e., floating-point type 6.0) and the number of data (i.e., 1 data)) corresponding to the generated first aggregation operator (i.e., floating-point type aggregation operator) is updated based on data 3 (i.e., floating-point type 6.0).

[0122] Step S610 determines whether to output or terminate. If so, the process proceeds to S611; if not, the process proceeds to S602. The process determines whether to output by determining whether there is more data input. For example, as shown in Table 2, if the data numbers 1-5 in Table 1 are sequentially input, and after data 1 is input, there is still data input, the process proceeds to S602. For another example, as shown in Table 2, if the data numbers 1-5 in Table 1 are sequentially input, and after data 5 is input, there is no data input, the process proceeds to S611. For another example, as shown in Table 2, if a temporary output instruction from the user is received after data 2 is input, the process proceeds to S602.

[0123] Step S611 determines whether grouping is performed. If yes, proceed to S612; if no, proceed to S615. This determination is made based on the input query statement or function call. In this example, if the input instruction is SUM(data) GROUP BY key1, key2, grouping is performed, proceeding to S612. In another example, if the input instruction is AVG(data), grouping is not performed, proceeding to S615.

[0124] Step S612: Input the intermediate grouping result. Input the grouping result updated in S606.

[0125] Step S613: Group the data into the minimum compatible type. As shown in Table 3, after data numbered 1-5 is input, the key1 field of group 1 data 1-3 is converted to a floating-point type, the key2 field of group 1 data 1-3 is converted to a string, the key1 field of group 2 data 1-3 is converted to an integer, and the key2 field of group 2 data 1-3 is converted to a string.

[0126] Step S614, the grouping results are merged and output. Step S615, the aggregated intermediate results are output. As shown in Table 3, after inputting data numbered 1-5 and outputting them in groups, data 1-3 can be divided into group 1, and data 4-5 can be divided into group 2. For another example, as shown in Table 3, after inputting data 2 and outputting them in groups, the data types of the grouping fields key1 and key2 of data 2 and data 1 before data 2 are aligned to the second minimum compatible data type "float-string", and the grouping operator for the second minimum compatible data type, i.e., the "float-string" grouping operator, is used to group data 1 and data 2. Since the values ​​of the grouping fields key1 and key2 of data 1 and data 2 are the same after the data type alignment, they are divided into the same group with group number 1. For another example, as shown in Table 3, after data 4 is input, it is grouped and output, and the data types of the grouping fields key1 and key2 of data 4 and data 1 to 3 before data 4 are aligned to the second minimum compatible data type "float-string", and the grouping operator for the second minimum compatible data type, that is, the "float-string" grouping operator, is used to group data 1 to 4. Since the values ​​of the grouping fields key1 and key2 of data 1 to 3 are the same after the data type alignment, they are divided into the same group with group number 1. The values ​​of the grouping fields key1 and key2 of data 4 are different from the values ​​of the grouping fields key1 and key2 of data 1 to 3, so they are divided into another group with group number 2.

[0127] Step S616: Convert to the minimum compatible type. As shown in Table 3, after inputting data numbered 1-5, the data fields 1-3 of group 1 are converted to floating point type, and the data fields 4-5 of group 2 are converted to floating point type.

[0128] Step S617: The aggregation results are combined and output. As shown in Table 3, after inputting data numbered 1-5, the data in the fields 1-3 of group 1 are summed and output as a floating point type of 12.0, and the data in the fields 4-5 of group 2 are summed and output as a floating point type of 18.0.

[0129] According to another aspect of the present disclosure, a data aggregation query device is provided.

[0130] Figure 7 FIG. 7 is a block diagram illustrating a data aggregation query apparatus 700 according to an exemplary embodiment. Figure 7 As shown, the data aggregation query device 700 includes:

[0131] The instruction acquisition module 710 is configured to acquire a data aggregation query instruction;

[0132] The data acquisition module 720 is configured to acquire a plurality of to-be-processed data, each having a data type, according to the data aggregation query instruction; and

[0133] The data processing module 730 is configured to perform aggregation processing on each data in at least one group of data among multiple data to be processed in sequence according to the data aggregation query instruction. The aggregation processing includes: querying the first aggregation operator for the data type of the data in the aggregation operator set; in response to querying the first aggregation operator in the aggregation operator set, updating the aggregation intermediate result of the first aggregation operator based on the data; in response to obtaining the data output instruction, determining the first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and using the first aggregation operator and the aggregation operator for the first minimum compatible data type in the other aggregation operators to update the data aggregation result at least based on the aggregation intermediate result.

[0134] It should be understood that Figure 7 The modules of the apparatus 700 shown in FIG. 7 can be used in conjunction with the reference Figure 2 The steps in the method 200 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 200 are also applicable to the apparatus 700 and the modules included therein. For the sake of brevity, some operations, features and advantages are not described here in detail.

[0135] Although specific functions are discussed above with reference to specific modules, it should be noted that the functions of the various modules discussed herein may be divided into multiple modules, and / or at least some functions of multiple modules may be combined into a single module. The specific module discussed herein performing an action includes the specific module itself performing the action, or alternatively the specific module calling or otherwise accessing another component or module that performs the action (or performs the action in conjunction with the specific module). Therefore, the specific module that performs an action may include the specific module itself that performs the action and / or another module that the specific module calls or otherwise accesses to perform the action. As used herein, the phrase "entity A initiates action B" may mean that entity A issues an instruction to perform action B, but entity A itself does not necessarily perform the action B.

[0136] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program modules. Figure 7The various modules described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these modules can be implemented as computer program code / instructions, which are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these modules can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of the instruction acquisition module 710, the data acquisition module 720, and the data processing module 730 can be implemented together in a system on chip (SoC). The SoC can include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and can optionally execute the received program code and / or include embedded firmware to perform functions.

[0137] According to one aspect of the present disclosure, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory. The processor is configured to execute the computer program to implement the steps of any one of the method embodiments described above.

[0138] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method embodiment described above are implemented.

[0139] According to one aspect of the present disclosure, a computer program product is provided, which includes a computer program. When the computer program is executed by a processor, the steps of any one of the method embodiments described above are implemented.

[0140] In the following, combined Figure 8 Illustrative examples of such a computer device, non-transitory computer-readable storage medium, and computer program product are described.

[0141] Figure 8 800 illustrates an example configuration of a computer device that can be used to implement the methods described herein. Figure 1 The server 120 and / or the client device 110 shown in FIG may include an architecture similar to the computer device 800. The above-mentioned apparatus 700 may also be implemented in whole or at least in part by the computer device 800 or a similar device or system.

[0142] The computer device 800 can be a variety of different types of devices. Examples of the computer device 800 include, but are not limited to, a desktop computer, a server computer, a laptop or netbook computer, a mobile device (e.g., a tablet computer, a cellular or other wireless phone (e.g., a smartphone), a notepad computer, a mobile station), a wearable device (e.g., eyeglasses, a watch), an entertainment device (e.g., an entertainment appliance, a set-top box communicatively coupled to a display device, a game console), a television or other display device, an automobile computer, and the like.

[0143] The computer device 800 may include at least one processor 802, memory 804, communication interface(s) 806, a display device 808, other input / output (I / O) devices 810, and one or more mass storage devices 812, all capable of communicating with one another, such as via a system bus 814 or other appropriate connections.

[0144] The processor 802 may be a single processing unit or multiple processing units, all of which may include a single or multiple computing units or multiple cores. The processor 802 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operational instructions. Among other capabilities, the processor 802 may be configured to retrieve and execute computer-readable instructions stored in the memory 804, mass storage device 812, or other computer-readable media, such as program code for an operating system 816, program code for application programs 818, program code for other programs 820, and the like.

[0145] The memory 804 and the mass storage device 812 are examples of computer-readable storage media for storing instructions that are executed by the processor 802 to implement the various functions described above. For example, the memory 804 may generally include both volatile memory and non-volatile memory (e.g., RAM, ROM, etc.). In addition, the mass storage device 812 may generally include a hard drive, a solid-state drive, removable media, including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network attached storage, storage area networks, etc. The memory 804 and the mass storage device 812 may all be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by the processor 802 as a specific machine configured to implement the operations and functions described in the examples herein.

[0146] A number of programs may be stored on the mass storage device 812. These programs include an operating system 816, one or more application programs 818, other programs 820, and program data 822, and they may be loaded into the memory 804 for execution. Examples of such applications or program modules may include, for example, computer program logic (e.g., computer program code or instructions) for implementing the method 200 and / or other embodiments described herein.

[0147] Although Figure 8 800, but modules 816, 818, 820, and 822, or portions thereof, may be implemented using any form of computer-readable media accessible by the computer device 800. As used herein, "computer-readable media" includes at least two types of computer-readable media, namely, computer-readable storage media and communication media.

[0148] Computer-readable storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information, such as computer-readable instructions, data structures, program modules or other data. Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD), or other optical storage devices, magnetic cassettes, magnetic tape, magnetic disk storage devices or other magnetic storage devices, or any other non-transmission media that can be used to store information for access by a computer device. In contrast, communication media can embody computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism. Computer-readable storage media as defined herein does not include communication media.

[0149] One or more communication interfaces 806 are used to exchange data with other devices, such as through a network, a direct connection, etc. Such communication interfaces can be one or more of the following: any type of network interface (e.g., a network interface card (NIC)), a wired or wireless (such as IEEE 802.11 wireless LAN (WLAN)) wireless interface, a Worldwide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth TMThe communication interface 806 may include a wireless network interface, a near field communication (NFC) interface, and the like. The communication interface 806 may facilitate communication within a variety of network and protocol types, including wired networks (e.g., LAN, cable, etc.) and wireless networks (e.g., WLAN, cellular, satellite, etc.), the Internet, and the like. The communication interface 806 may also provide for communication with external storage devices (not shown) such as storage arrays, network attached storage, storage area networks, and the like.

[0150] In some examples, a display device 808 such as a monitor may be included for displaying information and images to the user. Other I / O devices 810 may be devices that receive various inputs from the user and provide various outputs to the user, and may include a touch input device, a gesture input device, a camera, a keyboard, a remote control, a mouse, a printer, an audio input / output device, and the like.

[0151] The technology described herein can be supported by these various configurations of the computer device 800 and is not limited to the specific examples of the technology described herein. For example, the functionality can also be implemented in whole or in part on a "cloud" by using a distributed system. The cloud includes and / or represents a platform for resources. The platform abstracts the underlying functionality of the hardware (e.g., servers) and software resources of the cloud. Resources can include applications and / or data that can be used when performing computing processing on a server away from the computer device 800. Resources can also include services provided over the Internet and / or through a subscriber network such as a cellular or Wi-Fi network. The platform can abstract resources and functionality to connect the computer device 800 to other computer devices. Therefore, the implementation of the functionality described herein can be distributed throughout the cloud. For example, functionality can be implemented partially on the computer device 800 and partially through a platform that abstracts the functionality of the cloud.

[0152] Although the present disclosure has been illustrated and described in detail in the drawings and the foregoing description, such illustration and description are to be considered illustrative and exemplary and not restrictive; the present disclosure is not limited to the disclosed embodiments. Variations to the disclosed embodiments will be understood and effected by those skilled in the art in practicing the claimed subject matter by studying the drawings, the disclosure and the appended claims. In the claims, the word "comprising" does not exclude other elements or steps that are not listed, the indefinite article "a" or "an" does not exclude a plurality, the term "plurality" means two or more, and the term "based on" should be interpreted as "based at least in part on". The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

Claims

1. A data aggregation query method, comprising: Get data aggregation query instructions; According to the data aggregation query instruction, a plurality of to-be-processed data, each having a data type, are obtained; as well as According to the data aggregation query instruction, aggregation processing is sequentially performed on each piece of data in at least one group of data among the multiple pieces of data to be processed, and the aggregation processing includes: Query the first aggregation operator for the data type of the data in the aggregation operator set; In response to finding the first aggregation operator in the aggregation operator set, updating the aggregation intermediate result of the first aggregation operator based on the data; In response to obtaining the data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and The data aggregation result is updated based on at least the aggregation intermediate result by using the first aggregation operator and the aggregation operator for the first minimum compatible data type among the other aggregation operators.

2. The method according to claim 1, wherein The aggregation process further includes: In response to not finding the first aggregation operator in the aggregation operator set, generating the first aggregation operator in the aggregation operator set; and The intermediate aggregation result of the first aggregation operator generated based on the updated data.

3. The method according to claim 1, wherein Using the first aggregation operator and the aggregation operator for the first minimum compatible data type among the other aggregation operators, updating the data aggregation result based on at least the aggregation intermediate result includes: aligning the data type of the intermediate aggregation result corresponding to each aggregation operator in the aggregation operator set to the first minimum compatible data type; and Aggregation operators for the first minimum compatible data type are used to aggregate the aggregation intermediate results of the aligned data types to obtain the data aggregation result.

4. The method according to any one of claims 1 to 3, wherein The data aggregation query instruction includes an instruction for performing a group aggregation query on the plurality of data to be processed, and the method further includes: Performing group processing on each of the plurality of pieces of data to be processed in sequence to obtain a plurality of groups of data including the at least one group of data, wherein the group processing includes: Query the first grouping operator for the data type of the grouping field of the data piece in the grouping operator set; In response to finding the first grouping operator in the grouping operator set, updating the grouping intermediate result of the first grouping operator based on the piece of data; In response to obtaining the data output instruction, determining a second minimum compatible data type between the first grouping operator and other grouping operators in the grouping operator set; and The data piece is grouped based on at least the grouping intermediate result by using the first grouping operator and a grouping operator for the second minimum compatible data type among the other grouping operators.

5. The method according to claim 4, wherein The grouping process further includes: In response to not finding the first grouping operator in the grouping operator set, generating the first grouping operator in the grouping operator set; and The intermediate grouping result of the first grouping operator generated based on the updated data.

6. The method according to claim 4, wherein: Grouping the piece of data by using the first grouping operator and a grouping operator for the second minimum compatible data type among the other grouping operators includes: aligning the data type of the grouping intermediate result corresponding to each grouping operator in the grouping operator set to the second minimum compatible data type; and The grouped intermediate results of the aligned data types are grouped using a grouping operator for the second minimum compatible data type to obtain the multiple groups of data.

7. The method according to any one of claims 1 to 3, wherein The data types of the plurality of pieces of data to be processed include at least one of an integer type, a floating point type, and a character string.

8. The method according to any one of claims 1 to 3, wherein The data aggregation query instruction includes at least one of a sum instruction, an average instruction, a maximum instruction, a minimum instruction, a median instruction, a variance instruction, and a standard deviation instruction.

9. A data aggregation query device, comprising: An instruction acquisition module is configured to acquire data aggregation query instructions; A data acquisition module is configured to acquire a plurality of to-be-processed data, each having a data type, according to the data aggregation query instruction; as well as The data processing module is configured to perform aggregation processing on each piece of data in at least one group of data among the multiple pieces of data to be processed in sequence according to the data aggregation query instruction, wherein the aggregation processing includes: Query the first aggregation operator for the data type of the data in the aggregation operator set; In response to finding the first aggregation operator in the aggregation operator set, updating the aggregation intermediate result of the first aggregation operator based on the data; In response to obtaining the data output instruction, determining a first minimum compatible data type between the first aggregation operator and other aggregation operators in the aggregation operator set; and The data aggregation result is updated based on at least the aggregation intermediate result by using the first aggregation operator and the aggregation operator for the first minimum compatible data type among the other aggregation operators.

10. A computer device comprising: at least one processor; as well as at least one memory having a computer program stored thereon, When the computer program is executed by the at least one processor, the at least one processor is caused to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 8.

12. A computer program product comprising a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Real-time data acquisition method, device and equipment and readable storage medium

    CN116089126A

  • Query decomposition for scalability of continuous query processing

    US20170116289A1