CPC G06F 12/0875 (2013.01) [G06F 12/0804 (2013.01); G06F 12/0893 (2013.01); G06F 16/27 (2019.01); G06F 2212/163 (2013.01)] | 20 Claims |
1. A method for processing data based on a block chain, executed by a computer device, comprising:
adding transaction data in at least two blocks into an execution queue according to a block height sequence and transaction data sequence numbers, and acquiring at least two pieces of transaction data from the execution queue in sequence, the at least two pieces of transaction data carrying contract information;
executing contract services corresponding to the contract information carried by the at least two pieces of transaction data in parallel, and acquiring a read cache and a write cache of a parallel transaction generated by executing each contract service, the at least two pieces of transaction data comprising target transaction data;
determining a write cache of a merged transaction in block caches respectively corresponding to the at least two blocks, and acquiring a read cache of an updated transaction corresponding to the target transaction data in the write cache of the merged transaction, a position or addition time of the transaction data corresponding to the write cache of the merged transaction in the execution queue being in front of the target transaction data;
determining a write cache of the transaction to be merged of the target transaction data according to the read cache of the updated transaction, the read cache of the parallel transaction corresponding to the target transaction data and the write cache of the parallel transaction corresponding to the target transaction data; and
merging the write cache of the transaction to be merged of the target transaction data into a block cache to which the target transaction data belongs, and continuously merging a write cache of the transaction to be merged of the transaction data next to the target transaction data.
|