IP Library Granted Patent US 11,223,471
Granted Patent B2
US 11,223,471 · App. 17/195,408 · Granted Jan 11, 2022

Blockchain-type data storage

Inventors: Yuan Zhang (Hangzhou, CN); Xinying Yang (Hangzhou, CN); Yize Li (Hangzhou, CN)
Assignee: Advanced New Technologies Co., Ltd.
H04L9/0643G06F16/901G06F16/9035H04L2209/38
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,223,471
App. No.
17/195,408
Granted
Jan 11, 2022
Kind
B2
Abstract

This disclosure relates to blockchain-type storage of receipt data. In one aspect, a method includes obtaining a to-be-stored data record including a first service attribute. Execution information of the to-be-stored data record is determined. A previous data record is obtained from a blockchain-type ledger. The previous data record includes a second service attribute that is the same as the first service attribute. Each data block in the blockchain-type ledger includes a block header and a block body. A hash value of the previous data record is determined. A receipt record is generated. The receipt record includes the hash value of the previous data record and the execution information of the to-be-stored data record. The to-be-stored data record and the receipt record are written into a same block body in the blockchain-type ledger.

Claims (95)

1. A computer-implemented method for receipt data storage, the method comprising:

obtaining a to-be-stored data record comprising a first service attribute;

determining execution information of the to-be-stored data record;

obtaining, from a blockchain-type ledger, a previous data record comprising a second service attribute that is the same as the first service attribute, wherein each data block in the blockchain-type ledger comprises a block header and a block body, wherein obtaining the previous data record comprises,

obtaining, from an index, location information corresponding to the first service attribute, wherein the location information comprises a plurality of block heights comprising a respective block height of each previous data block that includes a respective service attribute that is the same as the first service attribute,

determining a maximum block height of the plurality of block heights, and

obtaining the previous data record from a given previous data block using the maximum block height;

determining a hash value of the previous data record;

generating a receipt record comprising the hash value of the previous data record and the execution information of the to-be-stored data record; and

writing the to-be-stored data record and the receipt record into a same block body of a new data block in the blockchain-type ledger.

2. The computer-implemented method of claim 1 , further comprising updating the index, the updating including:

obtaining the first service attribute from the to-be-stored data record;

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

establishing a mapping relationship between the first service attribute and the location information of the to-be-stored data record; and

writing the mapping relationship into the index using the first service attribute as a primary key.

3. The computer-implemented method of claim 1 , wherein writing the to-be-stored data record and the receipt record into the same block body of the new data block in the blockchain-type ledger comprises:

obtaining a plurality of to-be-stored data records including the to-be-stored data record and, for each of the to-be-stored data records, a corresponding receipt record;

determining a hash value of each of the to-be-stored data records; and

in response to a predetermined block forming condition being satisfied:

determining one or more to-be-stored data records of the plurality of to-be-stored data records and a corresponding receipt record for each of the one or more to-be-stored data records to be written into a data block; and

generating an N th data block comprising a hash value for the N th data block, wherein N is a sequence number of the Nth data block in a sequence of data blocks, and the generating comprising:

when N=1, generating the Nth data block comprises:

determining the hash value for the Nth data block based on (i) the hash value of each of the one or more to-be-stored data records or (ii) a default hash value; and

assigning, as a block height of the Nth data block, an initial block height; and

when N>1, generating the Nth data block comprises:

determining the hash value for the N th data block based on the one or more to-be-stored data records, the corresponding receipt record for each of the one or more to-be-stored data records, and a hash value of an (N−1) th data block;

writing the hash value for the N th data block into a block header of the N th data block; and

writing each of the one or more to-be-stored data records and the corresponding receipt record for each of the one or more to-be-stored data records into a block body of the N th data block.

4. The computer-implemented method of claim 3 , wherein the predetermined block forming condition comprises at least one of:

a quantity of to-be-stored data records reaching a quantity threshold; or

a time interval from a last block forming moment reaching a time threshold.

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

obtaining a to-be-stored data record comprising a first service attribute;

determining execution information of the to-be-stored data record;

obtaining, from a blockchain-type ledger, a previous data record comprising a second service attribute that is the same as the first service attribute, wherein each data block in the blockchain-type ledger comprises a block header and a block body, wherein obtaining the previous data record comprises,

obtaining, from an index, location information corresponding to the first service attribute, wherein the location information comprises a plurality of block heights comprising a respective block height of each previous data block that includes a respective service attribute that is the same as the first service attribute,

determining a maximum block height of the plurality of block heights, and

obtaining the previous data record from a given previous data block using the maximum block height;

determining a hash value of the previous data record;

generating a receipt record comprising the hash value of the previous data record and the execution information of the to-be-stored data record; and

writing the to-be-stored data record and the receipt record into a same block body of a new data block in the blockchain-type ledger.

6. The non-transitory, computer-readable medium of claim 5 , wherein the operations comprise updating the index, the updating including:

obtaining the first service attribute from the to-be-stored data record;

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

establishing a mapping relationship between the first service attribute and the location information of the to-be-stored data record; and

writing the mapping relationship into the index using the first service attribute as a primary key.

7. The non-transitory, computer-readable medium of claim 5 , wherein writing the to-be-stored data record and the receipt record into the same block body of the new data block in the blockchain-type ledger comprises:

obtaining a plurality of to-be-stored data records including the to-be-stored data record and, for each of the to-be-stored data records, a corresponding receipt record;

determining a hash value of each of the to-be-stored data records; and

in response to a predetermined block forming condition being satisfied:

determining one or more to-be-stored data records of the plurality of to-be-stored data records and a corresponding receipt record for each of the one or more to-be-stored data records to be written into a data block; and

generating an N th data block comprising a hash value for the N th data block, wherein N is a sequence number of the Nth data block in a sequence of data blocks, and the generating comprising:

when N=1, generating the Nth data block comprises:

determining the hash value for the Nth data block based on (i) the hash value of each of the one or more to-be-stored data records or (ii) a default hash value; and

assigning, as a block height of the Nth data block, an initial block height; and

when N>1, generating the Nth data block comprises:

determining the hash value for the N th data block based on the one or more to-be-stored data records, the corresponding receipt record for each of the one or more to-be-stored data records, and a hash value of an (N−1) th data block;

writing the hash value for the N th data block into a block header of the N th data block; and

writing each of the one or more to-be-stored data records and the corresponding receipt record for each of the one or more to-be-stored data records into a block body of the N th data block.

8. The non-transitory, computer-readable medium of claim 7 , wherein the predetermined block forming condition comprises at least one of:

a quantity of to-be-stored data records reaching a quantity threshold; or

a time interval from a last block forming moment reaching a time threshold.

9. 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 a to-be-stored data record comprising a first service attribute;

determining execution information of the to-be-stored data record;

obtaining, from a blockchain-type ledger, a previous data record comprising a second service attribute that is the same as the first service attribute, wherein each data block in the blockchain-type ledger comprises a block header and a block body, wherein obtaining the previous data record comprises,

obtaining, from an index, location information corresponding to the first service attribute, wherein the location information comprises a plurality of block heights comprising a respective block height of each previous data block that includes a respective service attribute that is the same as the first service attribute,

determining a maximum block height of the plurality of block heights, and

obtaining the previous data record from a given previous data block using the maximum block height;

determining a hash value of the previous data record;

generating a receipt record comprising the hash value of the previous data record and the execution information of the to-be-stored data record; and

writing the to-be-stored data record and the receipt record into a same block body of a new data block in the blockchain-type ledger.

10. The computer-implemented system of claim 9 , wherein the operations comprise updating the index, the generating including:

obtaining the first service attribute from the to-be-stored data record;

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

establishing a mapping relationship between the first service attribute and the location information of the to-be-stored data record; and

writing the mapping relationship into the index using the first service attribute as a primary key.

11. The computer-implemented system of claim 9 , wherein writing the to-be-stored data record and the receipt record into the same block body of the new data block in the blockchain-type ledger comprises:

obtaining a plurality of to-be-stored data records including the to-be-stored data record and, for each of the to-be-stored data records, a corresponding receipt record;

determining a hash value of each of the to-be-stored data records; and

in response to a predetermined block forming condition being satisfied:

determining one or more to-be-stored data records of the plurality of to-be-stored data records and a corresponding receipt record for each of the one or more to-be-stored data records to be written into a data block; and

generating an N th data block comprising a hash value for the N th data block, wherein N is a sequence number of the Nth data block in a sequence of data blocks, and the generating comprising:

when N=1, generating the Nth data block comprises:

determining the hash value for the Nth data block based on (i) the hash value of each of the one or more to-be-stored data records or (ii) a default hash value; and

assigning, as a block height of the Nth data block, an initial block height; and

when N>1, generating the Nth data block comprises:

determining the hash value for the N th data block based on the one or more to-be-stored data records, the corresponding receipt record for each of the one or more to-be-stored data records, and a hash value of an (N−1) th data block;

writing the hash value for the N th data block into a block header of the N th data block; and

writing each of the one or more to-be-stored data records and the corresponding receipt record for each of the one or more to-be-stored data records into a block body of the N th data block.

12. The computer-implemented system of claim 11 , wherein the predetermined block forming condition comprises at least one of:

a quantity of to-be-stored data records reaching a quantity threshold; or

a time interval from a last block forming moment reaching a time threshold.

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 May 4, 2021
From: ZHANG, YUAN; YANG, XINYING; LI, YIZE
To: ALIBABA GROUP HOLDING LIMITED
Reel/Frame 056125/0833 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 4, 2021
From: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
To: ADVANCED NEW TECHNOLOGIES CO., LTD.
Reel/Frame 056126/0409 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 4, 2021
From: ALIBABA GROUP HOLDING LIMITED
To: ADVANTAGEOUS NEW TECHNOLOGIES CO., LTD.
Reel/Frame 056126/0449 →
Priority Claims (1)
CN 201910537650.2 · Jun 20, 2019 · national
Continuity (3)
Continuation 16815539 · Mar 11, 2020
Continuation PCTCN2020071601 · Jan 11, 2020
Related Publication 20210194675A1 · Jun 24, 2021