| CPC H04L 9/50 (2022.05) | 20 Claims |

|
1. A blockchain data processing method, performed by an electronic device acting as a local consensus node in a local consensus network, the method comprising:
packaging a local consensus transaction, a main chain binding height, and a main chain read dataset into a local consensus block, the local consensus transaction being a service transaction executed in the local consensus network, wherein the local consensus network is deployed in a service network of a multi-layer chain network, and a core consensus network comprising a core consensus node is deployed in the multi-layer chain network and independent of the service network, and the main chain binding height being a block height of a first global consensus block, the first global consensus block being synchronized from a main chain of the core consensus node when packaging the local consensus transaction, the main chain read dataset being obtained by clearing from a first global contract state and being used for executing the local consensus transaction, and the first global contract state being a read dataset that is read when a global consensus transaction in the first global consensus block is executed;
broadcasting the local consensus block to a local verification node, the local verification node being configured to obtain a voting consensus result corresponding to a transaction execution result of the local consensus transaction when a synchronized block height is greater than or equal to the main chain binding height, and a synchronized read dataset is consistent with the main chain read dataset, and the local verification node being a consensus node other than the local consensus node in the local consensus network;
when determining that consensus is reached based on the voting consensus result returned by the local verification node, uploading the local consensus block to a local consensus sub-chain corresponding to the local consensus network, and writing the local consensus block into a local consensus ledger database;
invoking a local consensus service contract on the local consensus sub-chain to perform the following processing:
obtaining a target block height from a main chain sub-ledger database, wherein the target block height is a block height of a second global consensus block that is synchronized from the main chain through the core consensus node, and the second global consensus block is a global consensus block that is synchronized from the main chain when consensus on the local consensus block is reached;
searching, when the target block height is greater than or equal to the main chain binding height, a read dataset associated with the first global consensus block in the main chain sub-ledger database, to obtain a target read dataset; and
using a key-value pair in the target read dataset as a first key-value pair, using a key-value pair in the main chain read dataset as a second key-value pair, and executing, when the first key-value pair is consistent with the second key-value pair, the local consensus transaction in the local consensus block, to obtain the transaction execution result.
|