Method and apparatus for OLAP-focused database crowd selection

The Clickhouse and Spark-based method and apparatus enhance crowd selection efficiency by partitioning tables and executing queries in parallel, addressing performance and scalability issues in existing systems.

CA3140571CActive Publication Date: 2026-11-2410353744 CANADA LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CA3140571
Authority / Receiving Office
CA · CA
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-11-26
Filing Date
2021-11-26
Publication Date
2026-11-24
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

Existing compute engines like Elasticsearch and Spark are inadequate for quasi real-time performance and data volume scaling, making precise crowd selection from massive internet data time-consuming and inefficient.

Method used

A method and apparatus using Clickhouse and Spark for crowd selection, involving configuring tag information, partitioning tables based on feature types, generating SQL query criteria, and executing query clauses in parallel through multithreading to acquire and store data in Hive tables.

Benefits of technology

This approach significantly reduces computation time from minutes to seconds, enhances aggregation performance, and optimizes hardware resource usage, providing efficient crowd selection.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

A method and apparatus for OLAP-focused database selection relate to big data technologies, and satisfy requirements of the business side for fast and efficient computation of crowd packages. The method involves: configurating tag information to create Spark™ tasks, and introducing original-table data of tags into a CH table of a Clickhouse™ engine according to configured information items; based on feature types of tag values, partitioning the CH table into aggregation tables of different types; acquiring query tags from a user to generate SQL™ query criteria, and converting the SQL™ query criteria into Clickhouse™ query clauses; and by means of multithreading executing the Clickhouse™ query clauses parallelly, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive™ table, and obtaining crowd selection query results. The apparatus implements the described method.
Need to check novelty before this filing date? Find Prior Art

Description

METHOD AND APPARATUS FOR OLAP-FOCUSED DATABASE CROWD SELECTION BACKGROUND OF THE INVENTION Technical Field

[0001] The present invention relates to the technical field of big data, and more particularly to a method and apparatus for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection. Description of Related Art

[0002] Currently, precise selection of crowd from massive internet data is critical to successful placement of advertising information. Usually, this can be achieved by tagging user characteristic behaviors, using the obtained tags as criteria to screen the target crowd, and placing real-time advertisement. Since advertising campaigns are usually audience specific, criteria used for screening different crowds are highly diverse.

[0003] Conventionally, off-line compute engines such as Elasticsearch<com:Sup>TM< / com:Sup> and Spark<com:Sup>TM< / com:Sup> are used to determine this selection. However, as the business side has increasingly demanding requirements for computation performance in terms of crowd packages, these existing compute engines are becoming incompetent to satisfy users when it comes to quasi real-time performance. Besides, the data volume of selection criteria has now reached a scale of hundreds of millions, making data pulling extremely time-consuming, and this is adverse to business needs. SUMMARY OF THE INVENTION

[0004] The objective of the present invention is to provide a method and an apparatus for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection, which provide the business side with fast and efficient computation of crowd packages.

[0005] To achieve the foregoing objective, in a first aspect, the present invention provides a method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection, which comprises:

[0006] configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items;

[0007] partitioning the CH table into aggregation tables of different types on the basis of feature types of tag values;

[0008] acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses; and

[0009] executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results.

[0010] Preferably, the step of configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items comprises:

[0011] configurating the tag information through a visual interface of a business system, wherein the tag information includes three kinds of configuration information items and the corresponding tag original-table data, wherein the three kinds of configuration information items are tag codes, tag names, and tag values; and

[0012] automatically creating Spark<com:Sup>TM< / com:Sup> tasks to process the tag original-table data, and introducing the tag original-table data into the CH table in the Clickhouse<com:Sup>TM< / com:Sup> engine in formats of tag codes, tag names, and tag values.

[0013] More preferably, the step of based on feature types of tag values, partitioning the CH table into aggregation tables of different types comprises:

[0014] dividing the feature types of the tag values into an int type, a double type, a string type, and a date type; and

[0015] according to the feature types of the tag values in the tag original-table data, partitioning the CH table correspondingly into an int-type tag-value aggregation table, a double-type tag- value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table.

[0016] Further, after the step of partitioning the CH table into aggregation tables of different types on the basis of feature types of tag values, the method further comprises:

[0017] distributing the aggregation tables across nodes of the Clickhouse<com:Sup>TM< / com:Sup> engine, for performing distributed query.

[0018] Preferably, the step of acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses comprises:

[0019] selecting the query tags through the visual interface of the business system to form the SQL<com:Sup>TM< / com:Sup> query criteria, and sending the SQL<com:Sup>TM< / com:Sup> query criteria to Kafka<com:Sup>TM< / com:Sup>; and

[0020] consuming SQL<com:Sup>TM< / com:Sup> query criteria data, receiving drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into the Clickhouse<com:Sup>TM< / com:Sup> query clauses.

[0021] Preferably, the step of executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results comprises:

[0022] using the Spark<com:Sup>TM< / com:Sup> tasks to execute the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, while acquiring detail data from the corresponding aggregation tables and storing the detail data into the Hive<com:Sup>TM< / com:Sup> table, so as to obtain the crowd selection query results through computation.

[0023] Preferably, after the step of executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results, the method further comprises:

[0024] storing the detail data of the Hive<com:Sup>TM< / com:Sup> table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

[0025] As compared to the prior art, the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection of the present invention has the following beneficial effects:

[0026] With the disclosed method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection, a user is enabled to configure tag information through a back end of a business system and create Spark<com:Sup>TM< / com:Sup> tasks. Then the user can introduce original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items. Afterward, according to feature types of tag values, a CH table in a Clickhouse<com:Sup>TM< / com:Sup> engine can be partitioned into different types of aggregation table. Subsequently, the user can provide query tags to generate SQL<com:Sup>TM< / com:Sup> query criteria. The criteria are then converted into Clickhouse<com:Sup>TM< / com:Sup> query clauses. By means of multithreading, the Clickhouse<com:Sup>TM< / com:Sup> query clauses are executed parallelly. Query detail data are acquired from aggregation tables of the corresponding types, and stored into a Hive<com:Sup>TM< / com:Sup> table, so that crowd selection query results can be obtained.

[0027] It is thus clear that the present invention uses a concept of Clickhouse<com:Sup>TM< / com:Sup> + Spark<com:Sup>TM< / com:Sup> computation to introduce the computation process for criteria of tag combinations into a Clickhouse<com:Sup>TM< / com:Sup> engine, and use the combination of the Spark<com:Sup>TM< / com:Sup> compute engine and the Clickhouse<com:Sup>TM< / com:Sup> compute engine to generate the crowd package, thereby shortening the time required by computation of detail data satisfying the criteria of tag combinations from minutes to seconds.

[0028] In a second aspect, the present invention provides an apparatus for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection, which is applicable to the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection of the foregoing technical scheme. The apparatus comprises:

[0029] a configuring unit, for configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items;

[0030] a table-partitioning unit, for partitioning the CH table into aggregation tables of different types on the basis of feature types of tag values;

[0031] a query unit, for acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses; and

[0032] a processing unit, for executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results.

[0033] Preferably, the table-partitioning unit is for dividing the feature types of the tag values into an int type, a double type, a string type, and a date type, according to the feature types of the tag values in the tag original-table data, partitioning the CH table correspondingly into an int-type tag-value aggregation table, a double-type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table.

[0034] As compared to the prior art, the disclosed apparatus for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection provides beneficial effects that are similar to those provided by the disclosed method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection as enumerated above, and thus no repetitions are made herein.

[0035] In a third aspect, the present invention provides a computer-readable storage medium, storing thereon a computer program. When the computer program is executed by a processor, it implements the steps of the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection as described previously.

[0036] As compared to the prior art, the disclosed computer-readable storage medium provides beneficial effects that are similar to those provided by the disclosed method for Clickhouse<com:Sup>TM< / com:Sup>- based crowd selection as enumerated above, and thus no repetitions are made herein. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings are provided herein for better understanding of the present invention and form a part of this disclosure. The illustrative embodiments and their descriptions are for explaining the present invention and by no means form any improper limitation to the present invention, wherein:

[0038] FIG. 1 is a flowchart of the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection of one embodiment of the present invention;

[0039] FIG. 2 is a schematic drawing illustrating that a CH table is partitioned into four types of aggregation tables according to an embodiment of the present invention; and

[0040] FIG. 3 is another flowchart of the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection of the embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0041] To make the foregoing objectives, features, and advantages of the present invention clearer and more understandable, the following description will be directed to some embodiments as depicted in the accompanying drawings to detail the technical schemes disclosed in these embodiments. It is, however, to be understood that the embodiments referred herein are only a part of all possible embodiments and thus not exhaustive. Based on the embodiments of the present invention, all the other embodiments can be conceived without creative labor by people of ordinary skill in the art, and all these and other embodiments shall be embraced in the scope of the present invention. Embodiment 1

[0042] Referring to FIG. 1 through FIG. 3, the present embodiment provides a method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection that comprises:

[0043] configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items; partitioning the CH table into aggregation tables of different types on the basis of feature types of tag values; acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses; and by means of multithreading executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results.

[0044] With the disclosed method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection, a user is enabled to configure tag information through a back end of a business system and create Spark<com:Sup>TM< / com:Sup> tasks. Then the user can introduce original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items. Afterward, according to feature types of tag values, a CH table in a Clickhouse<com:Sup>TM< / com:Sup> engine can be partitioned into different types of aggregation table. Subsequently, the user can provide query tags to generate SQL<com:Sup>TM< / com:Sup> query criteria. The criteria are then converted into Clickhouse<com:Sup>TM< / com:Sup> query clauses. By means of multithreading, the Clickhouse<com:Sup>TM< / com:Sup> query clauses are executed parallelly. Query detail data are acquired from aggregation tables of the corresponding types, and stored into a Hive<com:Sup>TM< / com:Sup> table, so that crowd selection query results can be obtained.

[0045] It is thus clear that the present invention uses a concept of Clickhouse<com:Sup>TM< / com:Sup> + Spark<com:Sup>TM< / com:Sup> computation to introduce the computation process for criteria of tag combinations into a Clickhouse<com:Sup>TM< / com:Sup> engine, and use the combination of the Spark<com:Sup>TM< / com:Sup> compute engine and the Clickhouse<com:Sup>TM< / com:Sup> compute engine to generate the crowd package, thereby shortening the time required by computation of detail data satisfying the criteria of tag combinations from minutes to seconds.

[0046] In the foregoing embodiment, the step of configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items comprises:

[0047] configurating the tag information through a visual interface of a business system, wherein the tag information includes three kinds of configuration information items and the corresponding tag original-table data, wherein the three kinds of configuration information items are tag codes, tag names, and tag values; and automatically creating Spark<com:Sup>TM< / com:Sup> tasks to process the tag original-table data, and introducing the tag original-table data into the CH table in the Clickhouse<com:Sup>TM< / com:Sup> engine in formats of tag codes, tag names, and tag values.

[0048] In a particular implementation, the information items may include three types, namely tag codes, tag names, and tag values. For instance, if it is desired to know preferences of male members about some merchandise item, the tag code, tag name, and tag value of the information items are set as labelname, labelvalue, and userid, respectively. Then the tag original-table data are introduced into the CH table in the formats of the foregoing information items. For an example where one of the entries of the CH table is labelname =A, then labelvalue <com:Math><semantics>=<annotation encoding="application / x-tex">=< / annotation>< / semantics>< / com:Math>male(1), userid=[1,2,3,4].

[0049] As a further example, in order to query a crowd package of 18-year-old male members, a user may, through the back end of the business system, visually configure a tag A=gender (labelname=A, labelvalue=1 representing male), and a tag B= age (labelname=B, labelvalue=18), so as to obtain the SQL<com:Sup>TM< / com:Sup> query criteria of "age=18 && gender =male." Then, data of male members and data of 18-year-old members are acquired from the corresponding aggregation tables. These data are assembled and computed before fed back to the user as the query results for crowd selection.

[0050] In the foregoing embodiment, the step of based on feature types of tag values, partitioning the CH table into aggregation tables of different types comprises:

[0051] dividing the feature types of the tag values into an int type, a double type, a string type, and a date type; and according to the feature types of the tag values in the tag original-table data, partitioning the CH table correspondingly into an int-type tag-value aggregation table, a double-type tag-value aggregation table, a string-type tag-value aggregation table, and a date- type tag-value aggregation table.

[0052] As shown in FIG. 2, in a particular implementation, through the back end of the business system, the commonly used tag values are divided into four types, namely the int type, the double type, the string type, and the date type, so as to satisfy diverse business needs about query criteria. Then according to the feature types of the tag values in the tag original-table data, the CH table can correspondingly be partitioned into the int-type tag-value aggregation table, the double-type tag-value aggregation table, the string-type tag-value aggregation table, and the date-type tag-value aggregation table. This is to say that all the tag values in the int- type tag-value aggregation table are of the int type, and all the tag values in the double-type tag-value aggregation table are of the double type, and so on.

[0053] For example, for checking the access count, the relevant tag values are obviously of the int type, and the conditional operators for crowd package data are count days>= '15' and count days<'30'. In other words, it is to query for the access count generated between the date of 15 and the date of 30.

[0054] For example, for checking the coordinate locations of users, the relevant tag values are obviously of the double type. This type is suitable for queries of coordinate locations, and helps select a member crowd in a certain latitude-longitude coordinate range.

[0055] For example, for checking member levels of users, the relevant tag values are obviously of the string type. This type is favorable to precise query matching.

[0056] For example, for checking access dates of users, the relevant tag values are obviously of the date type. This type is suitable for comparison of dates, such as criteria for crowd packages like a first-for-purchase time later than a certain date.

[0057] To satisfy business needs, in the present embodiment, four types of CH aggregation tables are introduced, with the following table structures: [Image disponible dans le document PDF, Image available in the PDF document]

[0058] As can be seen, all labelname fields are of the String type. This is usually used to express a tag code. The labelvalue fields may be of the String type, the Int type, the double type, or the Date type, usually for expressing a tag value. uv is usually used to express a tag name.

[0059] With the four types of aggregation tables, data can be acquired from corresponding types of CH aggregation tables according to business needs automatically for subsequent computation, thereby significantly improving computation performance of the system.

[0060] For example, for tags related to the number of days users sleep for, the criteria are described as users sleeping for more than a certain number of days or fewer than a certain number of days, i.e., count days>= '15' and count days<'30'. The aggregation tables of the Int type are correspondingly selected for data acquiring and to support data operators.

[0061] In the foregoing embodiment, after the step of partitioning the CH table into aggregation tables of different types on the basis of feature types of tag values, the method further comprises: distributing the aggregation tables across nodes of the Clickhouse<com:Sup>TM< / com:Sup> engine, for performing distributed query.

[0062] In a particular implementation, since the aggregation tables are local tables distributed across nodes of the Clickhouse<com:Sup>TM< / com:Sup> engine, a distributed table directing to the aggregation tables at the nodes may be used to realize distributed query computation. As demonstrated in tests, when tag data were introduced into a Clickhouse<com:Sup>TM< / com:Sup> engine from an original table (such as HDFS), the standalone performance was 1 million / sec, showing linear expansion in terms of performance. It was also found through actual measurement that 50 billion data could be introduced into the CH table in one hour. The measurement was performed in a Clickhouse<com:Sup>TM< / com:Sup> cluster environment, with the following machine configuration: 32 cores, 256G, 4T drive, using a cluster of 6 machines.

[0063] In the foregoing embodiment, the step of acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses comprises:

[0064] selecting the query tags through the visual interface of the business system to form the SQL<com:Sup>TM< / com:Sup> query criteria, and sending the SQL<com:Sup>TM< / com:Sup> query criteria to Kafka<com:Sup>TM< / com:Sup>; and consuming SQL<com:Sup>TM< / com:Sup> query criteria data, receiving drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into the Clickhouse<com:Sup>TM< / com:Sup> query clauses.

[0065] In the foregoing embodiment, the step of executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results comprises:

[0066] using the Spark<com:Sup>TM< / com:Sup> tasks to execute the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, while acquiring detail data from the corresponding aggregation tables and storing the detail data into the Hive<com:Sup>TM< / com:Sup> table, so as to obtain the crowd selection query results through computation.

[0067] In the foregoing embodiment, after the step of executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results, the method further comprises:

[0068] storing the detail data of the Hive<com:Sup>TM< / com:Sup> table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

[0069] Referring to FIG. 3, for easy understanding, an example is used to explain the scheme as discussed in the foregoing embodiment:

[0070] A user may select query tags through the page of the business system to generate SQL<com:Sup>TM< / com:Sup> query criteria and send them to Kafka<com:Sup>TM< / com:Sup>. SparkStreaming<com:Sup>TM< / com:Sup> consumes the corresponding Kafka<com:Sup>TM< / com:Sup> data and converts SQL<com:Sup>TM< / com:Sup> into Clickhouse<com:Sup>TM< / com:Sup> query clauses that are then stored into MySQL<com:Sup>TM< / com:Sup>. Spark<com:Sup>TM< / com:Sup> tasks read Clickhouse<com:Sup>TM< / com:Sup> query clauses from MySQL<com:Sup>TM< / com:Sup>. Afterward, by means of multithreading, the Clickhouse<com:Sup>TM< / com:Sup> query clauses are executed parallelly to query detail data from the CH aggregation tables corresponding to the distributed nodes. The detail data are then stored into a Hive<com:Sup>TM< / com:Sup> table for the business system to query and use, thereby outputting crowd selection query results. In addition, the detail data in the hive table may be transferred to Redis<com:Sup>TM< / com:Sup> according to business needs, so as to provide the business system with other query services.

[0071] To sum up, the present embodiment has the following innovations: 1. The present invention uses a concept of Clickhouse<com:Sup>TM< / com:Sup> + Spark<com:Sup>TM< / com:Sup> computation to introduce the computation process for criteria of tag combinations into a Clickhouse<com:Sup>TM< / com:Sup> engine, and use the combination of the Spark<com:Sup>TM< / com:Sup> compute engine and the Clickhouse<com:Sup>TM< / com:Sup> compute engine to generate the crowd package, thereby shortening the time required by computation of detail data satisfying the criteria of tag combinations from minutes to seconds. 2. Addition or removal of tags can be visually configured through the back end of the business system, thereby eliminating hassles about complicated operations for adding or removing tags. 3. The present invention leverages the benefits of Clickhouse<com:Sup>TM< / com:Sup> to solve issues about aggregation performance related to large volume of data, thereby providing better user experience. 4. The present invention saves hardware resources. According to early-stage assessment, Clickhouse<com:Sup>TM< / com:Sup> only needs half of the hardware computation resources required by Elasticsearch<com:Sup>TM< / com:Sup>. As to storage capacity, for identical data, one Clickhouse<com:Sup>TM< / com:Sup> machine is equivalent to 27 Elasticsearch<com:Sup>TM< / com:Sup> machines. Embodiment 2

[0072] The present embodiment provides a Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection apparatus, which comprises:

[0073] a configuring unit, for configurating tag information to create Spark<com:Sup>TM< / com:Sup> tasks, and introducing original-table data of tags into a CH table of a Clickhouse<com:Sup>TM< / com:Sup> engine according to configured information items;

[0074] a table-partitioning unit, for based on feature types of tag values, partitioning the CH table into aggregation tables of different types;

[0075] a query unit, for acquiring query tags from a user to generate SQL<com:Sup>TM< / com:Sup> query criteria, and converting the SQL<com:Sup>TM< / com:Sup> query criteria into Clickhouse<com:Sup>TM< / com:Sup> query clauses; and

[0076] a processing unit, for executing the Clickhouse<com:Sup>TM< / com:Sup> query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of the corresponding types, storing the detail data into a Hive<com:Sup>TM< / com:Sup> table, and obtaining crowd selection query results.

[0077] Preferably, the table-partitioning unit is for dividing the feature types of the tag values into an int type, a double type, a string type, and a date type, according to the feature types of the tag values in the tag original-table data, partitioning the CH table correspondingly into an int-type tag-value aggregation table, a double-type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table.

[0078] As compared to the prior art, the disclosed apparatus for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection provides beneficial effects that are similar to those provided by the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection as enumerated above, and thus no repetitions are made herein. Embodiment 3

[0079] The present embodiment provides a computer-readable storage medium, storing thereon a computer program. When the computer program is executed by a processor, it implements the steps of the method for Clickhouse<com:Sup>TM< / com:Sup>-based crowd selection as described previously.

[0080] As compared to the prior art, the disclosed computer-readable storage medium provides beneficial effects that are similar to those provided by the disclose method as enumerated above, and thus no repetitions are made herein.

[0081] As will be appreciated by people of ordinary skill in the art, implementation of all or a part of the steps of the method of the present invention as described previously may be realized by having a program instruct related hardware components. The program may be stored in a computer-readable storage medium, and the program is about performing the individual steps of the methods described in the foregoing embodiments. The storage medium may be a ROM / RAM, a magnetic disk, an optical disk, a memory card or the like.

[0082] The present invention has been described with reference to the preferred embodiments and it is understood that the embodiments are not intended to limit the scope of the present invention. Moreover, as the contents disclosed herein should be readily understood and can be implemented by a person skilled in the art, all equivalent changes or modifications which do not depart from the concept of the present invention should be encompassed by the appended claims. Hence, the scope of the present invention shall only be defined by the appended claims.

Claims

Claims: A device for crowd selection for advertising, comprising: a configuring module configured to configure tags of user information, through a visual interface of a business system, to create tasks, and introduce data of tags into a table of an engine according to configured information items, wherein the tags of user information include three kinds of configuration information items and corresponding tag data, and wherein the three kinds of configuration information items are tag codes, tag names, and tag values; a table-partitioning module configured to partition the table into aggregation tables of different types based on the tag values; a query module configured to acquire query tags from a user to generate query criteria, and convert the query criteria into query clauses; and a processing module configured to use the tasks to execute the query clauses parallelly by means of multithreading, acquire query detail data from the aggregation tables of corresponding types, store the detail data into a second table, and obtain crowd selection results.

2. The device of claim 1, wherein the configuring module is further configured to: automatically create the tasks to process the tag data, and introduce the tag data into the table in the engine in formats of the tag codes, the tag names, and the tag values.

3. The device of claim 2, wherein the table-partitioning module is further configured to: divide feature types of the tag values into an int type, a double type, a string type, and a date type; and partition the table correspondingly into an int-type tag-value aggregation table, a double- type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table according to the feature types of the tag values in the tag data.

4. The device of claim 3, wherein after partitioning the table into the aggregation tables of different types based on the tag values, the table-partitioning module is further configured to: distribute the aggregation tables across nodes of the engine, for performing distributed query.

5. The device of any one of claims 1 to 4, wherein the query module is further configured to: select the query tags through the visual interface of the business system to form the query criteria, and send the query criteria to Kafka<com:Sup>TM< / com:Sup>; and consume query criteria data, receive drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and convert the query criteria into the query clauses.

6. The device of claim 1, further configured to: store the detail data of the second table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

7. The device of any one of claims 1 to 6, wherein the tag code is a labelname.

8. The device of any one of claims 1 to 7, wherein the tag name is a labelyalue.

9. The device of any one of claims 1 to 8, wherein the tag value is a user ID.

10. The device of any one of claims 3 to 9 further comprising: checking an access count wherein the tag values are of the int type.

11. The device of claim 10, wherein checking the access count includes generating a query for the access count between specific dates.

12. The device of any one of claims 3 to 11 further configured to: check for coordinate locations of users wherein the tag values are of the double type.

13. The device of claim 12 wherein query of coordinate locations is to select a member crowd in a certain latitude-longitude coordinate range.

14. The device of any one of claims 3 to 13 further configured to: check a member level of users wherein the tag values are of the string type.

15. The device of any one of claims 3 to 14 further configured to: check access dates of users wherein the tag values are of the date type.

16. The device of claim 15 wherein query of access dates is to compare dates for specific criteria.

17. The device of any one of claims 5 to 9, wherein the query clauses are stored in MySQL<com:Sup>TM< / com:Sup>.

18. The device of claim 17, wherein the tasks read the query clauses from MySQL<com:Sup>TM< / com:Sup>.

19. A system for crowd selection, comprising: a configuring module configured to configure tags of user information, through a visual interface of a business system, to create tasks, and introducing data of tags into a table of an engine according to configured information items, wherein the tags of the user information includes three kinds of configuration information items and corresponding tag data, and wherein the three kinds of configuration information items are tag codes, tag names, and tag values; a table-partitioning module configured to partition the table into aggregation tables of different types based on the tag values; a query module configured to acquire query tags from a user to generate query criteria, and converting the query criteria into query clauses; and a processing module configured to execute the query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of corresponding types, storing the detail data into a second table, and obtaining crowd selection results.

20. The system of claim 19, the configure module is further configured to: automatically create the tasks to process the tag data, and introduce the tag data into the table in the engine in formats of the tag codes, the tag names, and the tag values.

21. The system of claim 20, wherein the table-partitioning module is further configured to: divide feature types of the tag values into an int type, a double type, a string type, and a date type; and partition the table correspondingly into an int-type tag-value aggregation table, a double- type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table according to the feature types of the tag values in the tag data.

22. The system of claim 21, wherein after partitioning the table into aggregation tables of different types based on tag values, the table-partitioning module is further configured to: distribute the aggregation tables across nodes of the engine, for performing distributed query.

23. The system of any one of claims 19 to 22, wherein the query module is further configured to: select the query tags through the visual interface of the business system to form the query criteria, and sending the query criteria to Kafka<com:Sup>TM< / com:Sup>; and consume query criteria data, receiving drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and converting the query criteria into the query clauses.

24. The system of claim 19 further configured to: storing the detail data of the second table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

25. The system of any one of claims 19 to 24, wherein the tag code is a labelname.

26. The system of any one of claims 19 to 25, wherein the tag name is a labelyalue.

27. The system of any one of claims 19 to 26, wherein the tag value is a user ID.

28. The system of any one of claims 21 to 27 further configured to: check an access count wherein the tag values are of the int type.

29. The system of claim 28, wherein checking the access count includes generating a query is for the access count between specific dates.

30. The system of any one of claims 21 to 29 further configured to: check for coordinate locations of users wherein the tag values are of the double type.

31. The system of claim 30, wherein query of coordinate locations is to select a member crowd in a certain latitude-longitude coordinate range.

32. The system of any one of claims 21 to 31 further configured to: check a member level of users wherein the tag values are of the string type.

33. The system of any one of claims 21 to 32 further configured to check access dates of users wherein the tag values are of the date type.

34. The system of claim 33, wherein query of access dates is to compare dates for specific criteria.

35. The system of any one of claims 23 to 27, wherein the query clauses are stored in MySQL<com:Sup>TM< / com:Sup>.

36. The system of claim 35, wherein the tasks read the query clauses from MySQL<com:Sup>TM< / com:Sup>.

37. A method for crowd selection, comprising: configuring tags of user information, through a visual interface of a business system, to create tasks, and introducing data of tags into a table of an engine according to configured information items, wherein the tags of the user information include three kinds of configuration information items and corresponding tag data, and wherein the three kinds of configuration information items are tag codes, tag names, and tag values; partitioning the table into aggregation tables of different types based on the tag values; acquiring query tags from a user to generate query criteria, and converting the query criteria into query clauses; and executing the query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of corresponding types, storing the detail data into a second table, and obtaining crowd selection results.

38. The method of claim 37, wherein configuring the tags to create the tasks, and introducing the data of tags into the table of the engine according to the configured information items comprises: automatically creating the tasks to process the tag data, and introducing the tag data into the table in the engine in formats of the tag codes, the tag names, and the tag values.

39. The method of claim 38, wherein the step of partitioning the table into the aggregation tables of different types based on the tag values comprises: dividing feature types of the tag values into an int type, a double type, a string type, and a date type; and partitioning the table correspondingly into an int-type tag-value aggregation table, a double-type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table according to the feature types of the tag values in the tag data.

40. The method of claim 39, wherein after the step of partitioning the table into the aggregation tables of different types based on the tag values, the method further comprises: distributing the aggregation tables across nodes of the engine, for performing distributed query.

41. The method of any one of claims 37 to 40, wherein the step of acquiring query tags from a user to generate query criteria, and converting the query criteria into query clauses comprises: selecting the query tags through the visual interface of the business system to form the query criteria, and sending the query criteria to Kafka<com:Sup>TM< / com:Sup>; and consuming query criteria data, receiving drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and converting the query criteria into the query clauses.

42. The method of claim 37, wherein after the step of executing the query clauses parallelly by means of multithreading, acquiring the query detail data from the aggregation tables of the corresponding types, storing the detail data into the second table, and obtaining the crowd selection results, the method further comprises: storing the detail data of the second table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

43. The method of any one of claims 37 to 42, wherein the tag code is a labelname.

44. The method of any one of claims 37 to 43, wherein the tag name is a labelyalue.

45. The method of any one of claims 37 to 44, wherein the tag value is a user ID.

46. The method of any one of claims 39 to 45 further comprising: checking an access count wherein the tag values are of the int type.

47. The method of claim 46, wherein checking the access count includes generating a query is for the access count between specific dates.

48. The method of any one of claims 39 to 47 further comprising: checking for coordinate locations of users wherein the tag values are of the double type.

49. The method of claim 48, wherein query of coordinate locations is to select a member crowd in a certain latitude-longitude coordinate range.

50. The method of any one of claims 39 to 49 further comprising: checking a member level of users wherein the tag values are of the string type.

51. The method of any one of claims 39 to 50 further comprising: checking access dates of users wherein the tag values are of the date type.

52. The method of claim 51, wherein query of access dates is to compare dates for specific criteria.

53. The method of any one of claims 41 to 45, wherein the query clauses are stored in MySQL<com:Sup>TM< / com:Sup>.

54. The method of claim 53, wherein the tasks read the query clauses from MySQL<com:Sup>TM< / com:Sup>.

55. A computer equipment comprising: a computer readable physical memory; a processor communicatively coupled to the memory, a computer program stored on the memory and operable on the processor, wherein the processor executes the computer program configured to: configure tags of user information, through a visual interface of a business system, to create tasks, and introduce data of tags into a table of an engine according to configured information items, wherein the tags of the user information include three kinds of configuration information items and corresponding tag data, and wherein the three kinds of configuration information items are tag codes, tag names, and tag values; partition the table into aggregation tables of different types based on the tag values; acquire query tags from a user to generate query criteria, and convert the query criteria into query clauses; and execute the query clauses parallelly by means of multithreading, acquiring query detail data from the aggregation tables of corresponding types, store the detail data into a second table, and obtain crowd selection results.

56. The computer equipment of claim 55, further configured to: automatically create the tasks to process the tag data, and introduce the tag data into the table in the engine in formats of the tag codes, the tag names, and the tag values.

57. The computer equipment of claim 56 further configured to: divide feature types of the tag values into an int type, a double type, a string type, and a date type; and partition the table correspondingly into an int-type tag-value aggregation table, a double- type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table according to the feature types of the tag values in the tag data.

58. The computer equipment of claim 57 further configured to: distribute the aggregation tables across nodes of the engine, for performing distributed query.

59. The computer equipment of any one of claims 55 to 58, further configured to: select the query tags through the visual interface of the business system to form the query criteria, and send the query criteria to Kafka<com:Sup>TM< / com:Sup>; and consume query criteria data, receive drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and convert the query criteria into the query clauses.

60. The computer equipment of claim 55, further configured to: store the detail data of the second table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

61. The computer equipment of any one of claims 55 to 60, wherein the tag code is a labelname.

62. The computer equipment of any one of claims 55 to 61, wherein the tag name is a labelyalue.

63. The computer equipment of any one of claims 55 to 62, wherein the tag value is a user ID.

64. The computer equipment of any one of claims 57 to 63 further configured to: check an access count wherein the tag values are of the int type.

65. The computer equipment of claim 64, wherein checking the access count includes generating a query is for the access count between specific dates.

66. The computer equipment of any one of claims 57 to 65 further configured to: check for coordinate locations of users wherein the tag values are of the double type.

67. The computer equipment of claim 66, wherein query of coordinate locations is to select a member crowd in a certain latitude-longitude coordinate range.

68. The computer equipment of any one of claims 57 to 67 further configured to: check a member level of users wherein the tag values are of the string type.

69. The computer equipment of any one of claims 57 to 68 further configured to: check access dates of users wherein the tag values are of the date type.

70. The computer equipment of claim 69, wherein query of access dates to compare dates for specific criteria.

71. The computer equipment of any one of claims 59 to 63, wherein the query clauses are stored in MySQL<com:Sup>TM< / com:Sup>.

72. The computer equipment of claim 71, wherein the tasks read the query clauses from <com:Math><semantics>MySQLTM<annotation encoding="application / x-tex">MySQL^{TM}< / annotation>< / semantics>< / com:Math>.

73. A computer readable physical memory having stored thereon a computer program executed by a computer configured to: configure tags of user information, through a visual interface of a business system, to create tasks, and introduce data of tags into a table of an engine according to configured information items, wherein the tags of the user information include three kinds of configuration information items and corresponding tag data, and wherein the three kinds of configuration information items are tag codes, tag names, and tag values; partition the table into aggregation tables of different types based on the tag values; acquire query tags from a user to generate query criteria, and convert the query criteria into query clauses; and execute the query clauses parallelly by means of multithreading, acquire query detail data from the aggregation tables of corresponding types, store the detail data into a second table, and obtain crowd selection results.

74. The memory of claim 73, wherein the computer program is further configured to: automatically create the tasks to process the tag data, and introduce the tag data into the table in the engine in formats of the tag codes, the tag names, and the tag values.

75. The memory of claim 74, wherein the computer program is further configured to: divide feature types of the tag values into an int type, a double type, a string type, and a date type; and partition the table correspondingly into an int-type tag-value aggregation table, a double- type tag-value aggregation table, a string-type tag-value aggregation table, and a date-type tag-value aggregation table according to the feature types of the tag values in the tag data.

76. The memory of claim 75, wherein the computer program is further configured to: distribute the aggregation tables across nodes of the engine, for performing distributed query.

77. The memory of claim 76, wherein the computer program is further configured to: select the query tags through the visual interface of the business system to form the query criteria, and send the query criteria to Kafka<com:Sup>TM< / com:Sup>; and consume query criteria data, receive drop tables through SparkStreaming<com:Sup>TM< / com:Sup> tasks, and convert the query criteria into the query clauses.

78. The memory of claim 73, wherein the computer program is further configured to: store the detail data of the second table into Redis<com:Sup>TM< / com:Sup>, for the business system to use according to business needs.

79. The memory of any one of claims 73 to 78, wherein the tag code is a labelname.

80. The memory of any one of claims 73 to 79, wherein the tag name is a labelyalue.

81. The memory of any one of claims 73 to 80, wherein the tag value is a user ID.

82. The memory of any one of claims 75 to 81 further comprising: check an access count wherein the tag values are of the int type.

83. The memory of claim 82, wherein checking the access count includes generating a query is for the access count between specific dates.

84. The memory of any one of claims 75 to 83, wherein the computer program is further configured to: check for coordinate locations of users wherein the tag values are of the double type.

85. The memory of claim 84, wherein query of coordinate locations is to select a member crowd in a certain latitude-longitude coordinate range.

86. The memory of any one of claims 75 to 85, wherein the computer program is further configured to: check a member level of users wherein the tag values are of the string type.

87. The memory of any one of claims 75 to 86, wherein the computer program is further configured to: check access dates of users wherein the tag values are of the date type.

88. The memory of claim 87, wherein query of access dates to compare dates for specific criteria.

89. The memory of any one of claims 77 to 81, wherein the query clauses are stored in MySQL<com:Sup>TM< / com:Sup>.

90. The memory of claim 89, wherein the tasks read the query clauses from MySQL<com:Sup>TM< / com:Sup>.