IP Library Granted Patent US 11,068,457
Granted Patent B2
US 11,068,457 · App. 16/945,593 · Granted Jul 20, 2021

Creating index in blockchain-type ledger

Inventor: Xinying Yang (Hangzhou, CN)
Assignee: Advanced New Technologies Co., Ltd.
G06F16/2255G06F16/22G06F16/2365G06F16/2379G06F16/248G06F16/24558G06Q50/265
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,068,457
App. No.
16/945,593
Granted
Jul 20, 2021
Kind
B2
Abstract

A method and an apparatus for creating an index in a blockchain-type ledger, and a device are disclosed. According to one implementation, a method may include obtaining, by a centralized database server, a data record, wherein the data record is stored in a blockchain-type ledger, and wherein the data record comprises a service attribute and a sequence number; determining location information of the data record in the blockchain-type ledger, wherein the location information comprises a block height of a data block comprising the data record, and an offset of the data record in the data block; establishing a mapping relationship between the service attribute, the location information, and the sequence number; and based on the sequence number, writing the mapping relationship to an index.

Claims (76)

1. A computer-implemented method comprising:

obtaining, by a centralized database server, a data record, wherein the data record is stored in a blockchain-type ledger, and wherein the data record comprises a service attribute and a sequence number;

determining location information of the data record in the blockchain-type ledger, wherein the location information comprises a block height of a data block comprising the data record, and an offset of the data record in the data block;

establishing a mapping relationship between the service attribute, the location information, and the sequence number;

based on the sequence number, writing the mapping relationship to an index;

receiving data to be stored;

generating a second data record comprising the data to be stored, and determining a hash value of the second data record, wherein the second data record further comprises a second service attribute and a second sequence number;

generating a second data block that comprises the hash value of the second data record in response to a predetermined block forming condition being satisfied,

wherein the predetermined block forming condition comprises a quantity of data records to be stored reaching a quantity threshold or a time interval from a previous block forming time reaching a time threshold;

storing a first set of one or more data records in the second data block;

determining that the second data block occurs after an initial data block in a sequence of the blockchain-type ledger; and

in response, computing the hash value of the second data record based on the second data block, the second data record, and a hash value of a data block that precedes the second data block within the sequence of the blockchain-type ledger, wherein block heights of the data blocks within the sequence of the blockchain-type ledger increase monotonically based on when a given block of the blockchain-type ledger is formed.

2. The computer-implemented method of claim 1 , wherein

obtaining the service attribute and the sequence number comprises:

responsive to receiving the data record, obtaining the service attribute and the sequence number comprised in a specified identification field in the data record; or

determining the data record comprised in the data block in the blockchain-type ledger, and obtaining the service attribute and the sequence number that are comprised in the specified identification field in any data record comprised in the data block.

3. The computer-implemented method of claim 1 , wherein writing the mapping relationship to the index comprises:

when a primary key in the index does not comprise the service attribute:

creating an index record using the service attribute as the primary key in an index table; and

when the primary key in the index comprises the service attribute:

writing the location information and the sequence number to the index record, wherein the index record comprises the service attribute.

4. The computer-implemented method of claim 1 , wherein the method further comprises:

receiving a query instruction, from a query instruction sender, wherein the query instruction comprises a specific value of the service attribute;

performing matching in an index table based on the specific value of the service attribute to determine location information and sequence numbers corresponding to the specific value of the service attribute in the index table; and

obtaining corresponding data records from the blockchain-type ledger based on the location information corresponding to the specific value of the service attribute in the index table, and returning the obtained corresponding data records to the query instruction sender.

5. The computer-implemented method of claim 1 , further comprising:

performing statistical analysis on a second set of one or more data records stored in the blockchain-type ledger, wherein the second set of one or more data records comprise the data record.

6. The computer-implemented method of claim 1 , wherein each data block other than the initial data block of the blockchain-type ledger comprises at least one data record and a hash value of the data block, wherein the hash value of the data block is determined based on a hash value of a previous data block and the data record comprised in the data block, and wherein block heights of data blocks increase based on when a given block of the blockchain-type ledger is formed.

7. A non-transitory, computer-readable medium storing one or more instructions executable by a computer system to perform operations comprising:

obtaining, by a centralized database server, a data record, wherein the data record is stored in a blockchain-type ledger, and wherein the data record comprises a service attribute and a sequence number;

determining location information of the data record in the blockchain-type ledger, wherein the location information comprises a block height of a data block comprising the data record, and an offset of the data record in the data block;

establishing a mapping relationship between the service attribute, the location information, and the sequence number;

based on the sequence number, writing the mapping relationship to an index;

receiving data to be stored;

generating a second data record comprising the data to be stored, and determining a hash value of the second data record, wherein the second data record further comprises a second service attribute and a second sequence number;

generating a second data block that comprises the hash value of the second data record in response to a predetermined block forming condition being satisfied,

wherein the predetermined block forming condition comprises a quantity of data records to be stored reaching a quantity threshold or a time interval from a previous block forming time reaching a time threshold;

storing a first set of one or more data records in the second data block;

determining that the second data block occurs after an initial data block in a sequence of the blockchain-type ledger; and

in response, computing the hash value of the second data record based on the second data block, the second data record, and a hash value of a data block that precedes the second data block within the sequence of the blockchain-type ledger, wherein block heights of the data blocks within the sequence of the blockchain-type ledger increase monotonically based on when a given block of the blockchain-type ledger is formed.

8. The non-transitory, computer-readable medium of claim 7 , wherein obtaining the service attribute and the sequence number comprises:

responsive to receiving the data record, obtaining the service attribute and the sequence number comprised in a specified identification field in the data record; or

determining the data record comprised in the data block in the blockchain-type ledger, and obtaining the service attribute and the sequence number that are comprised in the specified identification field in any data record comprised in the data block.

9. The non-transitory, computer-readable medium of claim 7 , wherein writing the mapping relationship to the index comprises:

when a primary key in the index does not comprise the service attribute:

creating an index record using the service attribute as the primary key in an index table; and

when the primary key in the index comprises the service attribute:

writing the location information and the sequence number to the index record, wherein the index record comprises the service attribute.

10. The non-transitory, computer-readable medium of claim 7 , wherein the operations further comprise:

receiving a query instruction, from a query instruction sender, wherein the query instruction comprises a specific value of the service attribute;

performing matching in an index table based on the specific value of the service attribute to determine location information and sequence numbers corresponding to the specific value of the service attribute in the index table; and

obtaining corresponding data records from the blockchain-type ledger based on the location information corresponding to the specific value of the service attribute in the index table, and returning the obtained corresponding data records to the query instruction sender.

11. The non-transitory, computer-readable medium of claim 7 , wherein the operations further comprise:

performing statistical analysis on a second set of one or more data records stored in the blockchain-type ledger, wherein the second set of one or more data records comprise the data record.

12. The non-transitory, computer-readable medium of claim 7 , wherein each data block other than the initial data block of the blockchain-type ledger comprises at least one data record and a hash value of the data block, wherein the hash value of the data block is determined based on a hash value of a previous data block and the data record comprised in the data block, and wherein block heights of data blocks increase based on when a given block of the blockchain-type ledger is formed.

13. A computer-implemented system, comprising: one or more computers; and

one or more computer memory devices interoperably coupled with the one or more computers and having tangible, non-transitory, machine-readable media storing one or more instructions that, when executed by the one or more computers, perform one or more operations comprising:

obtaining, by a centralized database server, a data record, wherein the data record is stored in a blockchain-type ledger, and wherein the data record comprises a service attribute and a sequence number;

determining location information of the data record in the blockchain-type ledger, wherein the location information comprises a block height of a data block comprising the data record, and an offset of the data record in the data block;

establishing a mapping relationship between the service attribute, the location information, and the sequence number;

based on the sequence number, writing the mapping relationship to an index;

receiving data to be stored;

generating a second data record comprising the data to be stored, and determining a hash value of the second data record, wherein the second data record further comprises a second service attribute and a second sequence number;

generating a second data block that comprises the hash value of the second data record in response to a predetermined block forming condition being satisfied,

wherein the predetermined block forming condition comprises a quantity of data records to be stored reaching a quantity threshold or a time interval from a previous block forming time reaching a time threshold;

storing a first set of one or more data records in the second data block;

determining that the second data block occurs after an initial data block in a sequence of the blockchain-type ledger; and

in response, computing the hash value of the second data record based on the second data block, the second data record, and a hash value of a data block that precedes the second data block within the sequence of the blockchain-type ledger, wherein block heights of the data blocks within the sequence of the blockchain-type ledger increase monotonically based on when a given block of the blockchain-type ledger is formed.

14. The computer-implemented system of claim 13 , wherein obtaining the service attribute and the sequence number comprises:

responsive to receiving the data record, obtaining the service attribute and the sequence number comprised in a specified identification field in the data record; or

determining the data record comprised in the data block in the blockchain-type ledger, and obtaining the service attribute and the sequence number that are comprised in the specified identification field in any data record comprised in the data block.

15. The computer-implemented system of claim 13 , wherein writing the mapping relationship to the index comprises:

when a primary key in the index does not comprise the service attribute:

creating an index record using the service attribute as the primary key in an index table; and

when the primary key in the index comprises the service attribute:

writing the location information and the sequence number to the index record, wherein the index record comprises the service attribute.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 18, 2025
From: ADVANCED NEW TECHNOLOGIES CO., LTD.
To: ANTCHAIN TECHNOLOGY PTE. LTD.
Reel/Frame 070253/0064 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 10, 2020
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053754/0625 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: YANG, XINYING
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 053647/0924 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 31, 2020
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 053743/0464 →