The cross-chain
data query and
consensus optimization method for e-government includes the following steps: 1) for M prefecture-level government departments, M sub-
blockchain systems are constructed and the nodes in the
system are divided into roles; 2) a government collaborative main chain is constructed to store the summaries of the full
business data of M sub-chains, and the sub-chain representative nodes are responsible for maintaining the main chain and uploading the sub-chain
business data to the main chain to generate publicly available data summaries; 3) a fast index table of the main chain
summary data is generated by associating the index field of the
summary data with the data storage location, and the table is persisted in the index
database; 4) the main chain with a large amount of data is sharded for storage, and a BP
neural network classifier is used in the sharding process to classify the main chain blocks with the maximum query probability of the node for the block as the goal; 5) in the process of cross-chain data interaction, a
consensus decider based on a
dynamic programming algorithm is used to select the optimal
consensus mechanism C that can reduce the consensus
delay between the two parties of the government cross-chain, and reach a consensus on the
verification and automatic update of
transaction data. Through the above method, the present invention provides a cross-chain
data query and consensus optimization method for e-government, effectively improves the
data query efficiency of cross-chain
data sharing among government departments and realizes the consensus
delay optimization in the process of cross-chain collaborative operation of government affairs.