Language selection

Search

Patent 3131330 Summary

Third-party information liability

Some of the information on this Web page has been provided by external sources. The Government of Canada is not responsible for the accuracy, reliability or currency of the information supplied by external sources. Users wishing to rely upon this information should consult directly with the source of the information. Content provided by external sources is not subject to official languages, privacy and accessibility requirements.

Claims and Abstract availability

Any discrepancies in the text and image of the Claims and Abstract are due to differing posting times. Text of the Claims and Abstract are posted:

  • At the time the application is open to public inspection;
  • At the time of issue of the patent (grant).
(12) Patent Application: (11) CA 3131330
(54) English Title: DATABASE AGGREGATION QUERY METHOD, DEVICE AND SYSTEM
(54) French Title: METHODE, DISPOSITIF ET SYSTEME DE RECHERCHE EN BASE DE DONNEES PAR AGREGATION
Status: Examination
Bibliographic Data
(51) International Patent Classification (IPC):
  • G06F 16/24 (2019.01)
(72) Inventors :
  • ZHANG, QIANG (China)
  • WANG, JINZHONG (China)
  • SUN, QIAN (China)
(73) Owners :
  • 10353744 CANADA LTD.
(71) Applicants :
  • 10353744 CANADA LTD. (Canada)
(74) Agent: JAMES W. HINTONHINTON, JAMES W.
(74) Associate agent:
(45) Issued:
(22) Filed Date: 2021-09-20
(41) Open to Public Inspection: 2022-03-18
Examination requested: 2022-09-16
Availability of licence: N/A
Dedicated to the Public: N/A
(25) Language of filing: English

Patent Cooperation Treaty (PCT): No

(30) Application Priority Data:
Application No. Country/Territory Date
202010988662.X (China) 2020-09-18

Abstracts

English Abstract


A method, an apparatus and a system for database aggregate query, which
involves: receiving a
query request, obtaining a corresponding data table according to the query
request, acquiring
grouped fields of to-be-processed tuples in the data table, wherein the
grouped fields refer to
fields in the data table that are grouped according to grouping information
provided in the query
request; performing a calculation on the to-be-processed tuples that have
identical grouped fields
with an aggregate function to obtain aggregate results; taking the grouped
fields as primary keys
for a hat trie and taking the aggregate results corresponding to the grouped
fields as values
corresponding to the primary keys, and saving all the primary keys and their
corresponding
values to the hat trie; and returning the primary keys and their corresponding
values saved in the
hat trie as query results, to effectively reduce resource occupation for
grouped aggregate queries
and enhance overall query efficiency.


Claims

Note: Claims are shown in the official language in which they were submitted.


CLAIMS
What is claimed is:
1. A method for database aggregate query, comprising
receiving a query request, obtaining a corresponding data table according to
the query request,
acquiring grouped fields of to-be-processed tuples in the data table, wherein
the grouped fields
refer to fields in the data table that are grouped according to grouping
information provided in
the query request;
performing a calculation on the to-be-processed tuples that have identical
said grouped fields
with an aggregate function so as to obtain aggregate results; taking the
grouped fields as primary
keys for a hat trie and taking the aggregate results corresponding to the
grouped fields, which
results are obtained by the calculation with the aggregate function, as values
corresponding to
the primary keys, and saving all the primary keys and their corresponding
values to the hat trie;
and
returning the primary keys and their corresponding values saved in the hat
trie as query results
to a user.
2. The method of claim 1, wherein the step of "obtaining a corresponding data
table according to
the query request" comprises:
reading information of to-be-aggregated data from a database according to the
query request, and
converting the information into the data table.
3. The method of claim 1 or 2, wherein the step of "performing a calculation
on the to-be-
processed tuples that have identical said grouped fields with an aggregate
function so as to obtain
an aggregate result" further comprises:
checking whether there is already a primary key in the hat trie identical to
the grouped field of
18
Date recue / Date received 2021-11-22

the tuple; and
if there is not, taking the grouped field as the primary key, and calculating
the aggregate result
corresponding to the grouped field with the aggregate function, taking the
aggregate result as the
value corresponding to the primary key in the hat trie, and saving the both
into the hat trie;
if there is, searching the value corresponding to the primary key and taking
it as an initial value
for the calculation with the aggregate function, calculating the aggregate
result corresponding to
the grouped field with the aggregate function, updating the value
corresponding to the primary
key in the hat trie, and saving it into the hat trie.
4. The method of claim 3, further comprising:
checking resources occupation, if the occupation exceeds a predetermined
range, caching a part
of the primary keys and their corresponding values from a memory to a disk
using a format
required by the hat trie, and generating a cache file.
5. The method of claim 4, wherein the step of "returning the primary keys and
their corresponding
values saved in the hat trie as query results to a user" comprises:
checking whether there is a cache file generated with the disk,
if there is, merging the primary keys and their corresponding values in the
cache file to the
hat trie, and returning the primary keys and their corresponding values saved
in the hat trie as
the query results to the user;
if there is not, directly returning the primary keys and their corresponding
values saved in the
hat (fie as the query results to the user.
6. An apparatus for database aggregate query, comprising:
an acquiring unit, for receiving a query request, obtaining a corresponding
data table according
to the query request, acquiring grouped fields of to-be-processed tuples in
the data table, wherein
19
Date recue / Date received 2021-11-22

the grouped fields refer to fields in the data table that are grouped
according to grouping
information provided in the query request;
an aggregating unit, for performing a calculation on the to-be-processed
tuples that have identical
said grouped fields with an aggregate function so as to obtain aggregate
results; taking the
grouped fields as primary keys for a hat trie and taking the aggregate results
corresponding to
the grouped fields, which results are obtained by the calculation with the
aggregate function, as
values corresponding to the primary keys, and saving all the primary keys and
their
corresponding values to the hat trie; and
a returning unit, for returning the primary keys and their corresponding
values saved in the
hat trie as query results to a user.
7. The apparatus of claim 6, wherein said "obtaining a corresponding data
table according to the
query request" is achieved by:
reading information of to-be-aggregated data from a database according to the
query request, and
converting the information into the data table.
8. The apparatus of claim 6, wherein the aggregating unit is particularly for:
checking whether there is already a primary key in the hat trie identical to
the grouped field of
the tuple; and
if there is not, taking the grouped field as the primary key, and calculating
the aggregate result
corresponding to the grouped field with the aggregate function, taking the
aggregate result as the
value corresponding to the primary key in the hat trie, and saving the both
into the hat trie;
if there is, searching the value corresponding to the primary key and taking
it as an initial value
for the calculation with the aggregate function, calculating the aggregate
result corresponding to
the grouped field with the aggregate function, updating the value
corresponding to the primary
key in the hat trie, and saving it into the hat trie.
Date recue / Date received 2021-11-22

9. The apparatus of claim 6, further comprising
a caching unit, for checking resources occupation,
if the occupation exceeds a predetermined range, caching a part of the primary
keys and their
corresponding values from a memory to a disk using a format required by the
hat trie, and
generating a cache file.
10. A computer system, comprising:
one or more processor; and
a memory associated with the one or more processor, the memory storing one or
more program
instructions, which, when read and executed by the one or more processors,
perform a method
of any of claims 1 through 5.
21
Date recue / Date received 2021-11-22

Description

Note: Descriptions are shown in the official language in which they were submitted.


DATABASE AGGREGATION QUERY METHOD, DEVICE AND SYSTEM
BACKGROUND OF THE INVENTION
Technical Field
[0001] The present invention relates to Internet technologies, and more
particularly to a method,
an apparatus, and a system for database aggregate query.
Description of Related Art
[0002] Aggregate query is one type of query features of relational databases,
and includes
several kinds, such as group by, and distinct. This type of queries is mainly
used for
grouping indicator fields to be analyzed according to the dimension field as
specified in a
database, thereby facilitating subsequent pooled analysis, such as finding
sum, avg, count
and so on, making them a frequently used solution for making queries in online
analytical
processing (OLAP) systems.
[0003] The conventional database engines usually use a hash-table data
structure to realize
grouped aggregate queries. While the hash-type data structure is known to be
simple,
versatile, low time complexity of 0(1), and efficient, its disadvantageously
occupies
considerable memory resources, and this particularly true for a grouped query
that involves
high field cardinality and many groups (or buckets). Specifically, assuming
grouped fields
have 50 million strings having an average length of 10Byte (namely 500MB in
total), the
inteiniediately generated Hash table will produce a series of link table
structures that jointly
take 5GB memory capacity, meaning a 10X expansion. Since such a query occupies
considerably memory space and CPU resources, its execution may cause other
queries to
have prolonged execution time and even time-out problems.
SUMMARY OF THE INVENTION
[0004] The present invention provides a method, an apparatus, and a system for
database
aggregate query, which effectively reduce resource occupation for grouped
aggregate
queries and enhance overall query efficiency.
1
Date recue / Date received 202 1-1 1-22

[0005] The present invention provides the following solutions:
[0006] In a first aspect, the present invention provides a method for database
aggregate query,
which comprises:
[0007] receiving a query request, obtaining a corresponding data table
according to the query
request, acquiring grouped fields of to-be-processed tuples in the data table,
wherein the
grouped fields refer to fields in the data table that are grouped according to
grouping
information provided in the query request;
[0008] performing a calculation on the to-be-processed tuples that have
identical said grouped
fields with an aggregate function so as to obtain aggregate results; taking
the grouped fields
as primary keys for a hat tri e and taking the aggregate results corresponding
to the grouped
fields, which results are obtained by the calculation with the aggregate
function, as values
corresponding to the primary keys, and saving all the primary keys and their
corresponding
values to the hat trie; and
[0009] and returning the primary keys and their corresponding values saved in
the hat trie as
query results to a user.
[0010] Further, the step of "obtaining a corresponding data table according to
the query request"
comprises:
[0011] reading information of to-be-aggregated data from a database according
to the query
request, and converting the information into the data table.
[0012] Further, the performing a calculation on the to-be-processed tuples
that have identical
said grouped fields with an aggregate function so as to obtain an aggregate
result comprises:
[0013] for every said to-be-processed tuple, checking whether there is already
a primary key in
the hat trie identical to the grouped field of the tuple; and
[0014] if there is not, taking the grouped field as the primary key, and
taking its corresponding
aggregate result as the value corresponding to the primary key and saving the
both into the
hat trie; or
[0015] if there is, taking the value corresponding to the primary key as an
initial value for the
operation performed with the aggregate function, performing a further
operation on the
aggregate results corresponding to the grouped fields with the aggregate
function so as to
update the value corresponding to the primary key in the hat trie, and saving
the updated
2
Date recue / Date received 202 1-1 1-22

value into the hat trie.
[0016] Further, the method further comprises:
[0017] checking resources occupation, if the occupation exceeds a
predetermined range,
caching a part of the primary keys and their corresponding values from a
memory to a disk
using a format required by the hat trie, and generating a cache file.
[0018] Further, the step of "returning the primary keys and their
corresponding values saved in
the hat trie as query results to a user" comprises:
[0019] checking whether the cache file generated in the disk exists, and if it
does, merging the
primary keys and their corresponding values in the cache file to the hat trie,
and returning
the primary keys and their corresponding values saved in the hat trie as the
query results
to the user; or
[0020] if it does not, directly returning the primary keys and their
corresponding values saved
in the hat trie as the query results to the user.
[0021] In a second aspect, the present invention provides an apparatus for
database aggregate
query, which comprises:
[0022] an acquiring unit, for receiving a query request, obtaining a
corresponding data table
according to the query request, acquiring grouped fields of to-be-processed
tuples in the
data table, wherein the grouped fields refer to fields in the data table that
are grouped
according to grouping information provided in the query request;
[0023] an aggregating unit, for performing a calculation on the to-be-
processed tuples that have
identical said grouped fields with an aggregate function so as to obtain
aggregate results;
taking the grouped fields as primary keys for a hat trie and taking the
aggregate results
corresponding to the grouped fields, which results are obtained by the
calculation with the
aggregate function, as values corresponding to the primary keys, and saving
all the primary
keys and their corresponding values to the hat trie; and
[0024] a returning unit, for returning the primary keys and their
corresponding values saved in
the hat trie as query results to a user.
[0025] Further, the step of "obtaining a corresponding data table according to
the query request"
comprises:
3
Date recue / Date received 202 1-1 1-22

[0026] reading information of to-be-aggregated data from a database according
to the query
request, and converting the information into the data table.
[0027] Further, the aggregating unit is for:
[0028] for every said to-be-processed tuple, checking whether there is already
a primary key in
the hat trie identical to the grouped field of the tuple; and
[0029] if there is not, taking the grouped field as the primary key, and
taking its corresponding
aggregate result as the value corresponding to the primary key and saving the
both into the
hat trie; or
[0030] if there is, taking the value corresponding to the primary key as an
initial value for the
operation performed with the aggregate function, performing a further
operation on the
aggregate results corresponding to the grouped fields with the aggregate
function so as to
update the value corresponding to the primary key in the hat trie, and saving
the updated
value into the hat trie.
[0031] Further, the apparatus further comprises:
[0032] a caching unit, for checking resources occupation, if the occupation
exceeds a
predetermined range, caching a part of the primary keys and their
corresponding values
from a memory to a disk using a format required by the hat trie, and
generating a cache
file.
[0033] In a third aspect, the present invention provides a computer system,
which comprises:
[0034] one or more processor; and
[0035] a memory associated with the one or more processor, the memory storing
one or more
program instructions, which, when read and executed by the one or more
processors,
perform the foregoing method.
[0036] As described in the embodiments of the present invention, the present
invention
discloses the following technical effects: acquiring grouped fields of to-be-
processed tuples
from a data table obtained in advance, performing a calculation on the to-be-
processed
tuples that have identical said grouped fields with an aggregate function so
as to obtain
aggregate results; taking the grouped fields as primary keys for a hat trie
and taking the
aggregate results corresponding to the grouped fields as values corresponding
to the
4
Date recue / Date received 202 1-1 1-22

primary keys, and saving all the primary keys and their corresponding values
to the hat trie,
wherein the hat trie data structure uses common prefixes of strings to
significantly reduce
resource occupation as compared to the conventional primary key -value
structure, and
returning the primary keys and their corresponding values saved in the hat
trie as query
results to a user. Thus, the present invention helps to reduce query time and
improve overall
query efficiency.
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 a method for database aggregate query
according to a first
embodiment of the present invention;
[0039] FIG. 2 is a structural diagram illustrating an apparatus for database
aggregate query
according to a second embodiment of the present invention;
[0040] FIG. 3 is a structural diagram illustrating a computer system according
to a third
embodiment of the present invention; and
[0041] FIG. 4 shows strings stored in a hat tri e data structure according to
the present invention.
DETAILED DESCRIPTION OF THE INVENTION
[0042] 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.
[0043] As described earlier about the prior art, the conventional database
engines usually use a
Date recue / Date received 202 1-1 1-22

hash-table data structure to realize grouped aggregate queries. While the hash-
type data
structure is known to be simple, versatile, low time complexity of 0(1), and
efficient, its
disadvantageously occupies considerable memory resources, and this
particularly true for
a grouped query that involves high field cardinality and many groups (or
buckets).
Specifically, assuming grouped fields have 50 million strings having an
average length of
10Byte (namely 500MB in total), the intermediately generated Hash table will
produce a
series of link table structures that jointly take 5GB memory capacity, meaning
a 10X
expansion. Since such a query occupies considerably memory space and CPU
resources,
its execution may cause other queries to have prolonged execution time and
even time-out
problems. Since such a query occupies considerably memory space and CPU
resources, its
execution may cause other queries to have prolonged execution time and even
time-out
problems.
[0044] The hat trie data structure combines the advantages of trie-, array-
and hash-based
approaches. Hat trie is useful in cases where string-type data is taken as
primary keys
because it uses common prefixes of strings to significantly reduce resource
occupation as
compared to the conventional primary key -value structure.
[0045] One example of a hat trie data structure storing string-type data is as
below:
romane ruber
romanes rubes
romanus rubicon
romulus rubicundus
rubens rubric
[0046] FIG. 4 shows how the strings above stored in a hat trie structure.
[0047] Hence, the present invention provides a method for database aggregate
query, which
involves acquiring grouped fields of to-be-processed tuples from a data table
obtained in
advance, performing a calculation on the to-be-processed tuples that have
identical said
grouped fields with an aggregate function so as to obtain aggregate results;
taking the
grouped fields as primary keys for a hat trie and taking the aggregate results
corresponding
to the grouped fields as values corresponding to the primary keys, and saving
all the
primary keys and their corresponding values to the hat trie, wherein the hat
trie data
structure uses common prefixes of strings to significantly reduce resource
occupation as
6
Date recue / Date received 202 1-1 1-22

compared to the conventional primary key -value structure, and returning the
primary keys
and their corresponding values saved in the hat trie as query results to a
user, thereby
decreasing query time and improving overall query efficiency.
Embodiment 1
[0048] The present invention embodiment provides a method for database
aggregate query. As
one example, the method is herein described as being applied to an apparatus
for database
aggregate query, and the apparatus may be used in any computer devices so that
the
computer device can perform the method for database aggregate query.
[0049] As shown in FIG. 1, the foregoing method comprises steps described
below.
[0050] The step Sll involves receiving a query request, obtaining a
corresponding data table
according to the query request, acquiring grouped fields of to-be-processed
tuples in the
data table, wherein the grouped fields refer to fields in the data table that
are grouped
according to grouping information provided in the query request.
[0051] The request for a grouped aggregate query contains grouping
information. The grouping
information usually refers to a specified dimension. The objective of query is
to group
indicator fields to be analyzed according to the dimension field as specified
in a database,
thereby facilitating subsequent pooled analysis. For example, a grouped
aggregate query
may be made for Data Table 1:
Year City
2016 Beijing
2016 Shanghai
2017 Beijing
2017 Hangzhou
[0052] The query request is "Selet Year, count(City) from table group by
year," and the field
following "group by" is the grouping information. Accordingly, the data shall
be grouped
by the dimension "Year," and subject to pooled analysis. The grouped fields
are results of
grouping the data by "Year" according to the query request, i.e., 2016 and
2017. Every line
in the data table is a tuple. Grouped fields of to-be-processed tuples come
from a data table
7
Date recue / Date received 202 1-1 1-22

obtained in advance. In this case, all the lines in the table above are to-be-
processed tuple,
so 2016, 2016, 2017, 2017 shall be acquired.
[0053] The step S12 involves performing a calculation on the to-be-processed
tuples that have
identical said grouped fields with an aggregate function so as to obtain
aggregate results;
taking the grouped fields as primary keys for a hat trie and taking the
aggregate results
corresponding to the grouped fields as values corresponding to the primary
keys, and
saving all the primary keys and their corresponding values to the hat Vie.
[0054] A calculation is performed on the to-be-processed tuples that have
identical said grouped
fields with an aggregate function so as to obtain aggregate results. The
grouped fields are
taken as primary keys for a hat trie, and the aggregate results corresponding
to the grouped
fields are taken as values corresponding to the primary keys, in order to save
all the primary
keys and their corresponding values to the hat Vie. In this case, the grouped
fields are 2016,
2016, 2017, 2017. The aggregate function is used to operate the to-be-
processed tuples
having 2016 and 2017, respectively, so as to obtain aggregate results. Then,
2016, 2017 are
taken as primary keys for the hat trie, and the aggregate results that are
obtained using the
aggregate function and corresponding to 2016 and 2017 are taken as values
corresponding
to the primary keys. According to Data Table 1, the aggregate results are 2
and 2, so what
is saved into the hat trie herein is "2016, 2; 2017, 2".
[0055] The step S13 involves returning the primary keys and their
corresponding values saved
in the hat trie as query results to a user.
[0056] The step of "obtaining a corresponding data table according to the
query request"
comprises:
[0057] reading information of to-be-aggregated data from a database according
to the query
request, and converting the information into the data table.
[0058] According to the query request, information about the database, table
and fields involved
in the query is acquired. Then the data information to be aggregated is read
from the
database and converted into a data table having tuples.
[0059] The step of "performing a calculation on the to-be-processed tuples
that have identical
8
Date recue / Date received 202 1-1 1-22

said grouped fields with an aggregate function so as to obtain an aggregate
result" further
comprises:
[0060] for every said to-be-processed tuple, checking whether there is already
a primary key in
the hat trie identical to the grouped field of the tuple; and
[0061] if there is not, taking the grouped field as the primary key, and
taking its corresponding
aggregate result as the value corresponding to the primary key and saving the
both into the
hat trie; or
[0062] if there is, taking the value corresponding to the primary key as an
initial value for the
operation performed with the aggregate function, performing a further
operation on the
aggregate results corresponding to the grouped fields with the aggregate
function so as to
update the value corresponding to the primary key in the hat trie, and saving
the updated
value into the hat trie.
[0063] Since every tuple is a line, in the process of acquiring the grouped
fields of the to-be-
processed tuples in the data table, the data is acquired line by line. For
example, to acquire
grouped fields of to-be-processed tuples in Data Table 1, the grouped field
2016 in the first
line is acquired first. In the part of determining whether there is already a
primary key
identical to 2016 in the hat trie, since 2016 is from the first line, there
could not be any
primary key identical to it in the hat trie at that moment. Therefore, 2016 is
taken as a
primary key and save to the hat trie. Then the aggregate function is used to
get an aggregate
result 1 corresponding to the grouped field as a value corresponding to that
primary key in
the hat trie, so the value "1" is saved to the hat vie. The same process is
repeated for the
grouped field, 2016, in the second line. At this time, since there is already
a primary key
identical to 2016 in the hat trie, as a result of processing the first line,
there is a primary
key identical to 2016 in the hat trie now. Thus, the value corresponding to
the primary key
(i.e., 1) is taken as the initial value for the operation performed with the
aggregate function,
and the aggregate result 2 that is obtained using the aggregate function and
corresponding
to the grouped field now processed is taken as the value corresponding to the
primary key
2016. Then the value "2" is saved into the hat trie to substitute the previous
value "1." In
other words, the value corresponding to the primary key 2016 is now updated
from "1" to
"2." Then reading is continued and the above processing steps are repeated
until the last
line is read. To this point, all the primary keys and values corresponding to
the primary
keys are saved to the hat vie.
9
Date recue / Date received 202 1-1 1-22

[0064] The method further comprises:
[0065] checking resources occupation, if the occupation exceeds a
predetermined range,
caching a part of the primary keys and their corresponding values from a
memory to a disk
using a format required by the hat trie, and generating a cache file.
[0066] During a grouped aggregate query, resource allocation is made according
to the resource
application contained in the query statement to the query. At this step,
resources occupation
is checked, if the occupation exceeds a predetermined range, a part of the
primary keys and
their corresponding values are cached from a memory to a disk using a format
required by
the hat trie, and a corresponding cache file is generated.
[0067] The step of "returning the primary keys and their corresponding values
saved in the
hat trie as query results to a user" comprises:
[0068] checking whether the cache file generated in the disk exists, and if it
does, merging the
primary keys and their corresponding values in the cache file to the hat trie,
and returning
the primary keys and their corresponding values saved in the hat trie as the
query results
to the user; or
[0069] if it does not, directly returning the primary keys and their
corresponding values saved
in the hat trie as the query results to the user.
[0070] Before the query results are returned, the existence of the foregoing
cache file in the disk
is checked. If there is such a cache file, the primary keys and their
corresponding values in
the cache file are saved to the hat trie. If there is not such a cache file,
the primary keys
and their corresponding values saved in the hat trie are directly returned to
the user as the
query results.
Embodiment 2
[0071] The present invention embodiment provides an apparatus for database
aggregate query
that implements the foregoing method. As shown in FIG. 2, the apparatus
comprises: an
acquiring unit 21, an aggregating unit 22, and a returning unit 23:
[0072] acquiring unit 21, for receiving a query request, obtaining a
corresponding data table
according to the query request, acquiring grouped fields of to-be-processed
tuples in the
data table, wherein the grouped fields refer to fields in the data table that
are grouped
Date recue / Date received 202 1-1 1-22

according to grouping information provided in the query request;
[0073] The request for a grouped aggregate query contains grouping
information. The grouping
information usually refers to a specified dimension. The objective of query is
to group
indicator fields to be analyzed according to the dimension field as specified
in a database,
thereby facilitating subsequent pooled analysis. For example, a grouped
aggregate query
may be made for Data Table 1:
Year City
2016 Beijing
2016 Shanghai
2017 Beijing
2017 Hangzhou
[0074] The query request is "Selet Year, count(City) from table group by
year," and the field
following "group by" is the grouping information. Accordingly, the data shall
be grouped
by the dimension "Year", and subject to pooled analysis. The grouped fields
are results of
grouping the data by "Year" according to the query request, i.e., 2016 and
2017. Every line
in the data table is a tuple. Grouped fields of to-be-processed tuples come
from a data table
obtained in advance. In this case, all the lines in the table above are to-be-
processed tuple,
so 2016, 2017 shall be acquired.
[0075] The aggregating unit 22 performs a calculation on the to-be-processed
tuples that have
identical said grouped fields with an aggregate function so as to obtain
aggregate results.
It then takes the grouped fields as primary keys for a hat trie and takes the
aggregate results
corresponding to the grouped fields as values corresponding to the primary
keys, and saves
all the primary keys and their corresponding values to the hat trie.
[0076] The aggregating unit 22 performs a calculation on the to-be-processed
tuples that have
identical said grouped fields with an aggregate function so as to obtain
aggregate results.
The grouped fields are taken as primary keys for a hat trie, and the aggregate
results
corresponding to the grouped fields are taken as values corresponding to the
primary keys,
in order to save all the primary keys and their corresponding values to the
hat trie. In this
case, the grouped fields are 2016, 2016, 2017, 2017. The aggregate function is
used to
11
Date recue / Date received 202 1-1 1-22

operate the to-be-processed tuples having 2016 and 2017, respectively, so as
to obtain
aggregate results. Then, 2016, 2017 are taken as primary keys for the hat
trie, and the
aggregate results that are obtained using the aggregate function and
corresponding to 2016
and 2017 are taken as values corresponding to the primary keys. According to
Data Table
1, the aggregate results are 2 and 2, so what is saved into the hat trie
herein is "2016, 2;
2017, 2".
[0077] The returning unit 23 is for returning the primary keys and their
corresponding values
saved in the hat trie as query results to a user.
[0078] The step of "obtaining a corresponding data table according to the
query request"
comprises:
[0079] reading information of to-be-aggregated data from a database according
to the query
request, and converting the information into the data table.
[0080] The aggregating unit is particularly for:
[0081] for every said to-be-processed tuple, checking whether there is already
a primary key in
the hat trie identical to the grouped field of the tuple; and
[0082] if there is not, taking the grouped field as the primary key, and
taking its corresponding
aggregate result as the value corresponding to the primary key and saving the
both into the
hat trie;
[0083] if there is, taking the value corresponding to the primary key as an
initial value for the
operation performed with the aggregate function, performing a further
operation on the
aggregate results corresponding to the grouped fields with the aggregate
function so as to
update the value corresponding to the primary key in the hat trie, and saving
the updated
value into the hat trie.
[0084] Since every tuple is a line, in the process of acquiring the grouped
fields of the to-be-
processed tuples in the data table, the data is acquired line by line. For
example, to acquire
grouped fields of to-be-processed tuples in Data Table 1, the grouped field
2016 in the first
line is acquired first. In the part of determining whether there is already a
primary key
identical to 2016 in the hat trie, since 2016 is from the first line, there
could not be any
primary key identical to it in the hat trie at that moment. Therefore, 2016 is
taken as a
12
Date recue / Date received 202 1-1 1-22

primary key and save to the hat trie. Then the aggregate function is used to
get an aggregate
result 1 corresponding to the grouped field as a value corresponding to that
primary key in
the hat trie, so the value "1" is saved to the hat vie. The same process is
repeated for the
grouped field, 2016, in the second line. At this time, since there is already
a primary key
identical to 2016 in the hat trie, as a result of processing the first line,
there is a primary
key identical to 2016 in the hat trie now. Thus, the value corresponding to
the primary key
(i.e., 1) is taken as the initial value for the operation performed with the
aggregate function,
and the aggregate result 2 that is obtained using the aggregate function and
corresponding
to the grouped field now processed is taken as the value corresponding to the
primary key
2016. Then the value "2" is saved into the hat trie to substitute the previous
value "1." In
other words, the value corresponding to the primary key 2016 is now updated
from "1" to
"2." Then reading is continued and the above processing steps are repeated
until the last
line is read. To this point, all the primary keys and values corresponding to
the primary
keys are saved to the hat Vie.
[0085] The apparatus further comprises:
[0086] a caching unit, for checking resources occupation, if the occupation
exceeds a
predetermined range, caching a part of the primary keys and their
corresponding values
from a memory to a disk using a format required by the hat trie, and
generating a cache
file.
[0087] During a grouped aggregate query, resource allocation is made according
to the resource
application contained in the query statement to the query. At this step,
resources occupation
is checked, if the occupation exceeds a predetermined range, a part of the
primary keys and
their corresponding values are cached from a memory to a disk using a format
required by
the hat trie, and a corresponding cache file is generated.
[0088] The apparatus for database aggregate query disclosed in the present
embodiment is
based on the same concept as the foregoing method for database aggregate
query, and is
configured to implement the disclosed method for database aggregate query. It
has the
function modules required by execution of the method for database aggregate
query and
provides the same beneficial effects as the method. For avoiding unnecessary
reiteration,
technical features not detailed herein for succinctness may be refer to the
method for
13
Date recue / Date received 202 1-1 1-22

database aggregate query as described in the previous embodiment provides.
[0089] Embodiment 3
[0090] The present embodiment provides a computer system for implementing the
foregoing
method and apparatus. The computer system comprises:
[0091] one or more processor; and
[0092] a memory associated with the one or more processor, the memory storing
one or more
program instructions, which, when read and executed by the one or more
processors,
perform the steps of the method as described in Embodiment 1, namely:
[0093] receiving a query request, obtaining a corresponding data table
according to the query
request, acquiring grouped fields of to-be-processed tuples in the data table,
wherein the
grouped fields refer to fields in the data table that are grouped according to
grouping
information provided in the query request;
[0094] performing a calculation on the to-be-processed tuples that have
identical said grouped
fields with an aggregate function so as to obtain aggregate results; taking
the grouped fields
as primary keys for a hat tri e and taking the aggregate results corresponding
to the grouped
fields as values corresponding to the primary keys, and saving all the primary
keys and
their corresponding values to the hat trie; and
[0095] returning the primary keys and their corresponding values saved in the
hat trie as query
results to a user.
[0096] FIG. 3 illustratively depicts a structure of the computer system. It
may specifically
include a processor 1510, a video display adapter 1511, a disk driver 1512, an
I/O port
1513, a network port 1514, and a memory 1520. The processor 1510, the video
display
adapter 1511, the disk driver 1512, the I/O port 1513, the network port 1514,
and the
memory 1520 may be communicatively connected through a communication bus 1530.
[0097] Therein, the processor 1510 may be implemented using a common CPU
(Central
Processing Unit), a microprocessor, an ASIC (Application Specific Integrated
Circuit), or
one or more integrated circuits for executing relevant programs to realize the
technical
scheme provided by the present invention.
[0098] The memory 1520 may be realized using a ROM (Read Only Memory), a RAM
14
Date recue / Date received 202 1-1 1-22

(Random Access Memory), a static storage device, a dynamic storage device or
any analog.
The memory 1520 may store for an operating system 1521 that controls operation
of the
computer system 1500, and a basic input/output system (BIOS) for controlling
low-level
operations of the computer system 1500. In addition, it may further store a
web browser
1523, a data storage management system 1524, and an icon and font processing
system
1525. The icon and font processing system 1525 may be an application enabling
operations
of the foregoing various steps of the embodiments of the present invention. In
any case,
when the technical scheme provided by present invention is realized using
software or
firmware, the related program codes are stored in the memory 1520 for the
processor 1510
to call and execute.
[0099] The input/output port 1513 is for connecting an I/O module for allowing
data input and
output. The input/output module may be built in the apparatus as a component
(not shown),
or may be set externally and connected to the apparatus so as to provides
corresponding
functions. Therein, the input device may include a keyboard, a mouse, a touch
panel, a
microphone, various sensors or more. The output device may include a display,
an amplifier,
a vibrator, an indicator or more.
[0100] The network port 1514 is for connecting a communication module (not
shown) to allow
communication between the disclosed apparatus and external devices. Therein,
the
communication module may enable communication either in a wired manner (such
as
through a USB, a network line, etc.) or in a wireless way (such as through a
mobile network,
WIFI, Bluetooth, etc.).
[0101] The bus 1530 comprises a channel allowing information transmission
among the
components of the device (i.e., the processor 1510, the video display adapter
1511, the disk
driver 1512, the I/O port 1513, the network port 1514, and the memory 1520).
[0102] Moreover, the computer system 1500 may further obtain information about
specific
collection conditions from a virtual resources object collection condition
information
database 1541 for its condition determination or the like.
[0103] It is to be noted that while the apparatus in the depicted embodiment
works merely by
Date recue / Date received 202 1-1 1-22

virtue of the processor 1510, the video display adapter 1511, the disk driver
1512, the I/O
port 1513, the network port 1514, the memory 1520, and the bus 1530, in
practical
implementations, the apparatus may further include additional components
required for its
desired purposes. Moreover, people skilled in the art would appreciate that
the disclosed
apparatus may only include the minimal number of components for realizing the
scheme
of the present invention instead of having all these depicted components.
[0104] From the description above, people skilled in the art would clearly
recognize that the
present invention may be realized using software in combination with necessary
universal
hardware-based platform. Based on this understanding, the technical scheme of
the present
invention may, in nature or for its part that is contributive to the
improvement of the prior
art, implemented in the form of a software product Such a computer software
product may
be stored in a storage medium, such as a ROM/RAM, a disc, an optical disk, or
the like and
include several instructions that direct a computer-based apparatus (such as a
personal
computer, a cloud server, or a network device) to perform the methods as
described in any
embodiment or any part of an embodiment of the present invention.
[0105] The embodiments disclosed herein are described in a progressive sense,
and therefore a
part in one embodiment may having tis details complemented by the description
for its
counter parts in other embodiments. Every embodiment is such described that it
only
emphasizes what differentiates it from the other embodiments. Particularly,
for a system or
an embodiment directed to a system, the subject matter may be described in a
simplified
way as more details may be learned from the embodiment about its relevant
method. The
system and system embodiment disclosed herein are merely illustrative, in
which a unit
described as a separated part may be or may be not physically separated, and a
part shown
as a unit may be or may be not a physical unit, meaning that it may be located
at one site
or alternatively be distributed across multiple units in a network. The
purpose of an
embodiment may be realized using all or some of the described/shown modules
according
to practical needs. People skilled in the art would understand and implement
the present
invention without paying creative efforts.
[0106] 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
16
Date recue / Date received 202 1-1 1-22

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.
17
Date recue / Date received 202 1-1 1-22

Representative Drawing
A single figure which represents the drawing illustrating the invention.
Administrative Status

2024-08-01:As part of the Next Generation Patents (NGP) transition, the Canadian Patents Database (CPD) now contains a more detailed Event History, which replicates the Event Log of our new back-office solution.

Please note that "Inactive:" events refers to events no longer in use in our new back-office solution.

For a clearer understanding of the status of the application/patent presented on this page, the site Disclaimer , as well as the definitions for Patent , Event History , Maintenance Fee  and Payment History  should be consulted.

Event History

Description Date
Examiner's Report 2024-08-15
Amendment Received - Response to Examiner's Requisition 2023-12-07
Amendment Received - Voluntary Amendment 2023-12-07
Examiner's Report 2023-08-10
Inactive: Report - No QC 2023-08-10
Advanced Examination Determined Compliant - paragraph 84(1)(a) of the Patent Rules 2023-05-11
Letter sent 2023-05-11
Amendment Received - Voluntary Amendment 2023-04-17
Amendment Received - Voluntary Amendment 2023-04-17
Inactive: Advanced examination (SO) fee processed 2023-04-17
Inactive: Advanced examination (SO) 2023-04-17
Letter Sent 2023-02-08
Inactive: Correspondence - PAPS 2022-12-23
All Requirements for Examination Determined Compliant 2022-09-16
Request for Examination Requirements Determined Compliant 2022-09-16
Request for Examination Received 2022-09-16
Application Published (Open to Public Inspection) 2022-03-18
Inactive: Cover page published 2022-03-17
Inactive: First IPC assigned 2022-01-26
Inactive: IPC assigned 2022-01-26
Inactive: Delete abandonment 2021-12-09
Inactive: Office letter 2021-12-09
Inactive: Reply received: Priority translation request 2021-11-22
Inactive: Reply received: Priority translation request 2021-11-22
Deemed Abandoned - Failure to Respond to Notice Requiring a Translation 2021-11-22
Letter sent 2021-10-08
Filing Requirements Determined Compliant 2021-10-08
Priority Claim Requirements Determined Compliant 2021-10-07
Inactive: Pre-classification 2021-10-07
Request for Priority Received 2021-10-07
Application Received - Regular National 2021-09-20
Letter Sent 2021-09-20
Inactive: QC images - Scanning 2021-09-20

Abandonment History

Abandonment Date Reason Reinstatement Date
2021-11-22

Maintenance Fee

The last payment was received on 2023-12-15

Note : If the full payment has not been received on or before the date indicated, a further fee may be required which may be one of the following

  • the reinstatement fee;
  • the late payment fee; or
  • additional fee to reverse deemed expiry.

Patent fees are adjusted on the 1st of January every year. The amounts above are the current amounts if received by December 31 of the current year.
Please refer to the CIPO Patent Fees web page to see all current fee amounts.

Fee History

Fee Type Anniversary Year Due Date Paid Date
Application fee - standard 2021-09-20 2021-09-20
Request for examination - standard 2025-09-22 2022-09-16
Advanced Examination 2023-04-17 2023-04-17
MF (application, 2nd anniv.) - standard 02 2023-09-20 2023-06-15
MF (application, 3rd anniv.) - standard 03 2024-09-20 2023-12-15
Owners on Record

Note: Records showing the ownership history in alphabetical order.

Current Owners on Record
10353744 CANADA LTD.
Past Owners on Record
JINZHONG WANG
QIAN SUN
QIANG ZHANG
Past Owners that do not appear in the "Owners on Record" listing will appear in other documentation within the application.
Documents

To view selected files, please enter reCAPTCHA code :



To view images, click a link in the Document Description column (Temporarily unavailable). To download the documents, select one or more checkboxes in the first column and then click the "Download Selected in PDF format (Zip Archive)" or the "Download Selected as Single PDF" button.

List of published and non-published patent-specific documents on the CPD .

If you have any difficulty accessing content, you can call the Client Service Centre at 1-866-997-1936 or send them an e-mail at CIPO Client Service Centre.

({010=All Documents, 020=As Filed, 030=As Open to Public Inspection, 040=At Issuance, 050=Examination, 060=Incoming Correspondence, 070=Miscellaneous, 080=Outgoing Correspondence, 090=Payment})


Document
Description 
Date
(yyyy-mm-dd) 
Number of pages   Size of Image (KB) 
Claims 2023-12-06 12 644
Description 2021-09-19 21 874
Description 2021-11-21 17 838
Claims 2021-11-21 4 137
Drawings 2021-11-21 3 94
Abstract 2021-11-21 1 25
Representative drawing 2022-02-14 1 22
Claims 2023-04-16 14 734
Examiner requisition 2024-08-14 5 139
Courtesy - Filing certificate 2021-10-07 1 569
Courtesy - Acknowledgement of Request for Examination 2023-02-07 1 423
Examiner requisition 2023-08-09 7 343
Amendment / response to report 2023-12-06 37 1,402
New application 2021-09-19 6 214
Commissioner’s Notice - Translation Required 2021-09-19 2 199
Translation Received 2021-11-21 29 1,218
Courtesy - Office Letter 2021-12-08 1 180
Translation Received 2021-11-21 29 1,218
Correspondence for the PAPS 2022-12-22 4 153
Advanced examination (SO) / Amendment / response to report 2023-04-16 20 718
Courtesy - Advanced Examination Request - Compliant (SO) 2023-05-10 1 176