# US 2017/0286470 A1 · Method and Apparatus for Querying Service Data, and Database System

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0286470 A1
- Document ID: US20170286470A1
- Status: Published application
- Kind: A1
- Application number: 15/630,195
- Filed: 2017-06-22
- Published: 2017-10-05
- Earliest claimed: 2014-12-22
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Zhongliang Jin
- Web page: https://patentgrep.com/patent/US20170286470A1

## CPC

- G06F 16/22: Indexing; Data structures therefor; Storage structures
- G06F 16/2315: {Optimistic concurrency control}
- G06F 16/00: Information retrieval; Database structures therefor; File system structures therefor
- G06F 16/24552: {Database cache management}
- G06F 16/283: {Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP}
- G06F 16/951: Indexing; Web crawling techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and an apparatus for querying service data are provided. A database memory includes a column buffer and a row buffer, a column of the column buffer is used to load column data of a database, and a row of the row buffer is used to load column data of the column buffer or the column data of the database. When a transactional service data query request that is sent by a transactional service system and that includes a target column identifier and a first query condition is received, it is detected whether a row index corresponding to the target column identifier exists, and if yes, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index is queried based on the first query condition, to obtain a query result.

## Claims

### Claim 1

A method for querying service data, wherein a database memory comprises a column buffer and a row buffer, wherein a column of the column buffer is used to load column data of a database, wherein a row of the row buffer is used to load column data of the column buffer or the column data of the database, and wherein the method comprises:
detecting whether a row index corresponding to a target column identifier exists when receiving a transactional service data query request that is sent by a transactional service system and that comprises the target column identifier and a first query condition;
querying, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result when the row index corresponding to the target column identifier exists; and
returning the query result to the transactional service system.

### Claim 2 (depends on 1)

The method according to claim 1, wherein when the row index corresponding to the target column identifier does not exist, the method further comprises:
detecting whether the column data corresponding to the target column identifier is loaded in the column buffer;
reading the column data corresponding to the target column identifier from the column buffer if the column data corresponding to the target column identifier is loaded in the column buffer;
loading the read column data corresponding to the target column identifier to a row in the row buffer;
establishing a correspondence between the target column identifier and a row index of the row;
querying, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result; and
returning the query result to the transactional service system.

### Claim 3 (depends on 2)

The method according to claim 2, wherein when the column data corresponding to the target column identifier is not loaded in the column buffer, before loading the read column data corresponding to the target column identifier to a row in the row buffer, the method further comprises reading the column data corresponding to the target column identifier from the database.

### Claim 4 (depends on 1)

The method according to claim 1, wherein before receiving the transactional service data query request that is sent by a transactional service system and that comprises a target column identifier and a first query condition, the method further comprises:
detecting whether the column data corresponding to the target column identifier is loaded in the row buffer when receiving a query registration request that is sent by the transactional service system and that comprises the target column identifier;
detecting whether the column data corresponding to the target column identifier is loaded in the column buffer when the column data corresponding to the target column identifier is not loaded in the row buffer; and
reading the column data corresponding to the target column identifier from the column buffer when the column data corresponding to the target column identifier is loaded in the column buffer;
reading the column data corresponding to the target column identifier from the database when the column data corresponding to the target column identifier is not loaded in the column buffer;
loading the read column data corresponding to the target column identifier to a row in the row buffer; and
establishing a correspondence between the target column identifier and a row index of the row.

### Claim 5 (depends on 2)

The method according to claim 2, wherein the row buffer comprises several sub-buffers, wherein each sub-buffer comprises several rows having a same length, wherein the sub-buffers have a same quantity of rows, wherein rows of a same rank in the several sub-buffers share a same row index, and wherein loading the read column data corresponding to the target column identifier to a row in the row buffer comprises:
dividing, according to the quantity of the rows of the sub-buffer in the row buffer, the read column data corresponding to the target column identifier; and
loading one by one each partial column data obtained by means of division to a same location of each row comprised in any one of the sub-buffers.

### Claim 6 (depends on 5)

The method according to claim 5, wherein querying, based on the first query condition, the column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain the query result comprises:
determining each row that is in the row buffer and corresponds to the row index and that is located in any one of the sub-buffers; and
querying, based on the first query condition, each partial column data that corresponds to the target column identifier, and that is loaded in a same location in each row that is located in any one of the sub-buffers and corresponds to the row index, to obtain the query result.

### Claim 7 (depends on 2)

The method according to claim 2, further comprising:
detecting whether column data corresponding to a specified column identifier is loaded in the column buffer when receiving an analytical service data query request that is sent by an analytical service system and that comprises the specified column identifier and a second query condition;
querying, based on the second query condition, the column data that is corresponding to the specified column identifier and that is in the column buffer, to obtain a query result; and
returning the query result to the analytical service system when the column data corresponding to the specified column identifier is loaded in the column buffer.

### Claim 8 (depends on 7)

The method according to claim 7, wherein when the column data corresponding to the specified column identifier is not loaded in the column buffer, the method further comprises:
reading the column data corresponding to the specified column identifier from the database;
loading the read column data corresponding to the specified column identifier to a column of the column buffer;
querying, based on the second query condition, the column data corresponding to the specified column identifier from the column buffer, to obtain a query result; and
returning the query result to the analytical service system.

### Claim 9

An apparatus for querying service data, wherein a database memory comprises a column buffer and a row buffer, wherein a column of the column buffer is used to load column data of a database, wherein a row of the row buffer is used to load column data of the column buffer or the column data of the database, and wherein the apparatus comprises:
a memory storing executable instructions; and
a processor coupled to the memory and configured to:
detect whether a row index corresponding to a target column identifier exists when receiving a transactional service data query request that is sent by a transactional service system and that comprises the target column identifier and a first query condition;
query, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result when the row index corresponding to the target column identifier exists;
output the result; and
return the query result to the transactional service system.

### Claim 10 (depends on 9)

The apparatus according to claim 9, wherein the processor is further configured to:
detect whether the column data corresponding to the target column identifier is loaded in the column buffer when the row index corresponding to the target column identifier does not exist;
read the column data corresponding to the target column identifier from the column buffer when the column data corresponding to the target column identifier is loaded in the column buffer;
load the column data that corresponds to the target column identifier to a row in the row buffer;
establish a correspondence between the target column identifier and a row index of the row; and
trigger the querying, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result.

### Claim 11 (depends on 10)

The apparatus according to claim 10, wherein the processor is further configured to read the column data corresponding to the target column identifier from the database when the column data corresponding to the target column identifier is not loaded in the column buffer.

### Claim 12 (depends on 9)

The apparatus according to claim 9, wherein processor is further configured to:
detect, before receiving the transactional service data query request that is sent by the transactional service system and that comprises the target column identifier and the first query condition, whether the column data corresponding to the target column identifier is loaded in the row buffer when receiving a query registration request that is sent by the transactional service system and that comprises the target column identifier;
detect whether the column data corresponding to the target column identifier is loaded in the column buffer when the column data corresponding to the target column identifier is not loaded in the row buffer;
read the column data corresponding to the target column identifier from the column buffer when the column data corresponding to the target column identifier is loaded in the column buffer;
read the column data corresponding to the target column identifier from the database when the column data corresponding to the target column identifier is not loaded in the column buffer;
load the column data that corresponds to the target column identifier to a row in the row buffer; and
establish a correspondence between the target column identifier and a row index of the row.

### Claim 13 (depends on 10)

The apparatus according to claim 10, wherein the row buffer comprises several sub-buffers, wherein each sub-buffer comprises several rows having a same length, wherein the sub-buffers have a same quantity of rows, and wherein rows of a same rank in the several sub-buffers share a same row index, wherein the manner of loading the read column data corresponding to the target column identifier to the row in the row buffer comprises:
dividing, according to the quantity of the rows of the sub-buffer in the row buffer, the read column data corresponding to the target column identifier; and
loading one by one each partial column data obtained by means of division to a same location of each row comprised in any one of the sub-buffers.

### Claim 14 (depends on 13)

The apparatus according to claim 13, wherein the processor is further configured to:
determine each row that is in the row buffer and corresponds to the row index and that is located in any one of the sub-buffers; and
query, based on the first query condition, partial column data that corresponds to the target column identifier, and that is loaded in a same location in each row that is located in any one of the sub-buffers and corresponds to the row index, to obtain a query result.

### Claim 15

A database system, comprising:
a database;
a database memory comprising a column buffer and a row buffer, wherein a column of the column buffer is used to load column data of the database, and wherein a row of the row buffer is used to load column data of the column buffer or the column data of the database; and
an apparatus for querying service data, comprising:
a memory storing executable instructions; and
a processor coupled to the memory and configured to:
detect whether a row index corresponding to a target column identifier exists when receiving a transactional service data query request that is sent by a transactional service system and that comprises the target column identifier and a first query condition;
query, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result when the row index corresponding to the target column identifier exists;
output the result; and
return the query result to the transactional service system.

### Claim 16 (depends on 15)

The database system according to claim 15, wherein the processor is further configured to:
detect whether the column data corresponding to the target column identifier is loaded in the column buffer when the row index corresponding to the target column identifier does not exist;
read the column data corresponding to the target column identifier from the column buffer when the column data corresponding to the target column identifier is loaded in the column buffer;
load the column data that corresponds to the target column identifier to a row in the row buffer;
establish a correspondence between the target column identifier and a row index of the row; and
trigger the querying, based on the first query condition, column data that corresponds to the target column identifier, and that is in a row that is in the row buffer and corresponds to the row index, to obtain a query result.

### Claim 17 (depends on 16)

The database system according to claim 16, wherein the processor is further configured to read the column data corresponding to the target column identifier from the database when the column data corresponding to the target column identifier is not loaded in the column buffer.

### Claim 18 (depends on 15)

The database system according to claim 15, wherein processor is further configured to:
detect, before receiving the transactional service data query request that is sent by the transactional service system and that comprises the target column identifier and the first query condition, whether the column data corresponding to the target column identifier is loaded in the row buffer when receiving a query registration request that is sent by the transactional service system and that comprises the target column identifier;
detect whether the column data corresponding to the target column identifier is loaded in the column buffer when the column data corresponding to the target column identifier is not loaded in the row buffer;
read the column data corresponding to the target column identifier from the column buffer when the column data corresponding to the target column identifier is loaded in the column buffer;
read the column data corresponding to the target column identifier from the database when the column data corresponding to the target column identifier is not loaded in the column buffer;
load the column data that corresponds to the target column identifier to a row in the row buffer; and
establish a correspondence between the target column identifier and a row index of the row.

### Claim 19 (depends on 16)

The database system according to claim 16, wherein the row buffer comprises several sub-buffers, wherein each sub-buffer comprises several rows having a same length, wherein the sub-buffers have a same quantity of rows, and wherein rows of a same rank in the several sub-buffers share a same row index, wherein the manner of loading the read column data corresponding to the target column identifier to the row in the row buffer comprises:
dividing, according to the quantity of the rows of the sub-buffer in the row buffer, the read column data corresponding to the target column identifier; and
loading one by one each partial column data obtained by means of division to a same location of each row comprised in any one of the sub-buffers.

### Claim 20 (depends on 19)

The database system according to claim 19, wherein the processor is further configured to:
determine each row that is in the row buffer and corresponds to the row index and that is located in any one of the sub-buffers; and
query, based on the first query condition, partial column data that corresponds to the target column identifier, and that is loaded in a same location in each row that is located in any one of the sub-buffers and corresponds to the row index, to obtain a query result.
