# US 11,030,178 B2 · Data storage method and apparatus

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

- Number: US 11,030,178 B2
- Document ID: US11030178B2
- Status: Granted
- Kind: B2
- Application number: 15/991,845
- Filed: 2018-05-29
- Published: 2018-09-27
- Granted: 2021-06-08
- Earliest claimed: 2016-01-29
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Jieshan Bi; Yijun Guo
- Web page: https://patentgrep.com/patent/US11030178B2

## CPC

- G06F 16/2264: {Multidimensional index structures}
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2272: {Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data storage method and apparatus, where the method includes obtaining a primary index of a data object, where a row identifier of the primary index includes at least one field, determining a row identifier of a secondary index of the data object, where the row identifier of the secondary index includes an index field and a field other than the index field in the at least one field of the row identifier of the primary index, and the index field is different from the first field in the at least one field of the row identifier of the primary index, generating the secondary index of the data object according to the row identifier of the secondary index, and storing the data object according to the primary index and the secondary index, thereby saving storage space.

## Claims

### Claim 1

A data storage method, comprising:
obtaining a primary index of a data object, wherein each row identifier of the primary index comprises a first field, a second field, a third field, a fourth field, and a fifth field, and wherein the first field comprises a first index field for the primary index;
generating a secondary index of the data object according to the row identifier of the primary index, wherein each row identifier of the secondary index comprises the first field, the second field, and the third field, wherein the second field comprises a second index field for the secondary index, wherein the first index field and the second index field are different, and wherein each row identifier of the secondary index does not comprise the fourth field and the fifth field; and
storing the data object according to the primary index and the secondary index.

### Claim 2 (depends on 1)

The data storage method of claim 1, wherein the first field comprises a column attribute of the data object, a random number, a constant, or processing on column data of the data object.

### Claim 3 (depends on 1)

The data storage method of claim 1, wherein the first field for the primary index of the data object comprises an identification number, and wherein the second field for the secondary index of the data object comprises a name.

### Claim 4 (depends on 1)

The data storage method of claim 1, further comprising:
receiving a data query request instructing to query data in the data object according to a value of the second index field;
querying the secondary index of the data object according to the value of the second index field to determine a secondary-index row identifier value corresponding to the data in the data object;
determining, according to the secondary-index row identifier value, a primary-index row identifier value corresponding to the data in the data object; and
obtaining the data in the data object according to the primary-index row identifier value.

### Claim 5 (depends on 4)

The data storage method of claim 4, wherein determining the primary-index row identifier value corresponding to the data in the data object comprises:
restructuring the secondary-index row identifier value to obtain the primary-index row identifier value when the first field of the row identifier of the primary index comprises the first index field; and
removing the value of the second index field from the secondary-index row identifier value to obtain the primary-index row identifier value.

### Claim 6 (depends on 1)

The data storage method of claim 1, wherein the first field comprises a identification number, wherein the second field comprises a last name, wherein the third field comprises a date, wherein the fourth field comprises an address, and wherein the fifth field comprises a phone number.

### Claim 7 (depends on 6)

The data storage method of claim 6, wherein each row identifier of the secondary index only comprises the identification number, the last name, and the date, and wherein each row identifier of the secondary index does not comprise the address and the phone number.

### Claim 8

A data storage apparatus, comprising:
a processor; and
a non-transitory computer-readable storage medium coupled to the processor and storing instructions for execution by the processor, wherein the instructions cause the processor to be configured to:
obtain a primary index of a data object, wherein each row identifier of the primary index comprises a first field, a second field, a third field, a fourth field, and a fifth field, and wherein the first field comprises a first index field for the primary index;
generate a secondary index of the data object according to the row identifier of the primary index, wherein each row identifier of the secondary index comprises the first field, the second field, and the third field, wherein the second field comprises a second index field for the secondary index, wherein the first index field and the second index field are different, and wherein each row identifier of the secondary index does not comprise the fourth field and the fifth field; and
store the data object according to the primary index and the secondary index.

### Claim 9 (depends on 8)

The data storage apparatus of claim 8, wherein the first field comprises a column attribute of the data object, a random number, a constant, or processing on column data of the data object.

### Claim 10 (depends on 8)

The data storage apparatus of claim 8, wherein the first field for the primary index of the data object comprises an identification number, and wherein the second field for the secondary index of the data object comprises a name.

### Claim 11 (depends on 8)

The data storage apparatus of claim 8, wherein the instructions further cause the processor to be configured to:
receive a data query request instructing to query data in the data object according to a value of the second index field;
query the secondary index of the data object according to the value of the second index field to determine a secondary-index row identifier value corresponding to the data in the data object;
determine, according to the secondary-index row identifier value, a primary-index row identifier value corresponding to the data in the data object; and
obtain the data in the data object according to the primary-index row identifier value.

### Claim 12 (depends on 11)

The data storage apparatus of claim 11, wherein the instructions further cause the processor to be configured to:
restructure the secondary-index row identifier value to obtain the primary-index row identifier value when the first field of the row identifier of the primary index comprises the first index field; and
remove the value of the second index field from the secondary-index row identifier value to obtain the primary-index row identifier value.

### Claim 13

A computer program product comprising a non-transitory computer-readable medium storing instructions that when executed by a processor, cause the processor to be configured to:
obtain a primary index of a data object, wherein each row identifier of the primary index comprises a first field, a second field, a third field, a fourth field, and a fifth field, and wherein the first field comprises a first index field for the primary index;
generate a secondary index of the data object according to the according to the row identifier of the primary index, wherein each row identifier of the secondary index comprises the first field, the second field, and the third field, wherein the second field comprises a second index field for the secondary index, wherein the first index field and the second index field are different, and wherein each row identifier of the secondary index does not comprise the fourth field and the fifth field; and
store the data object according to the primary index and the secondary index.

### Claim 14 (depends on 13)

The computer program product of claim 13, wherein the first field comprises a column attribute of the data object.

### Claim 15 (depends on 13)

The computer program product of claim 13, wherein at least one of the first field, the second field, or the third field comprises a random number.

### Claim 16 (depends on 13)

The computer program product of claim 13, wherein at least one of the first field, the second field, or the third field comprises a constant.

### Claim 17 (depends on 13)

The computer program product of claim 13, wherein at least one of the first field, the second field, or the third field comprises processing on column data of the data object.

### Claim 18 (depends on 13)

The computer program product of claim 13, wherein the first field for the primary index of the data object comprises an identification number, and wherein the second field for the secondary index of the data object comprises a name.

### Claim 19 (depends on 13)

The computer program product of claim 13, wherein the instructions further cause the processor to be configured to:
receive a data query request instructing to query data in the data object according to a value of the second index field;
query the secondary index of the data object according to the value of the second index field to determine a secondary-index row identifier value corresponding to the data in the data object;
determine, according to the secondary-index row identifier value, a primary-index row identifier value corresponding to the data in the data object; and
obtain the data in the data object according to the primary-index row identifier value.

### Claim 20 (depends on 19)

The computer program product of claim 19, wherein the instructions further cause the processor to be configured to:
restructure the secondary-index row identifier value to obtain the primary-index row identifier value when the first field of the row identifier of the primary index comprises the first index field; and
remove the value of the second index field from the secondary-index row identifier value to obtain the primary-index row identifier value.
