Due to the advantages of data immutability and traceability,blockchain technology has broad application prospects in areas such as finance and the energy internet.However,compared to traditional distributed systems,blockchain systems still have certain gaps in terms of performance and scalability.Consortium blockchain systems such as Hyperledger Fabric and Xuper Chain use the "execute-order-validation" architecture to achieve parallel execution of transactions by multiple nodes,greatly improving the performance and scalability of blockchain systems.However,there are still some issues that affect system performance under this architecture.One problem is that conflict transactions are not detected in a timely manner.Conflict transactions are only marked as invalid in the validation phase,which wastes node computing resources and increases the average transaction latency of the system.Another problem is that the efficiency of conflict detection in range query transactions is low.Existing systems use a one-by-one matching scheme to read the set information for all types of transactions during transaction conflict detection.In the case of a large range of transaction reads,the efficiency of this scheme for conflict detection is low.This thesis selects Hyperledger Fabric as the experimental platform to conduct a series of research work to address the aforementioned issues.The main research content are as follows:First,to address the problem of delayed detection of conflict transactions that affects system performance,this article proposes a conflict transaction detection scheme for client nodes.This scheme improves the endorsement node to generate the write-set version of the transaction during the transaction simulation endorsement phase.At the client node,by utilizing the transaction response returned by the endorsement node and the event listening mechanism,the cuckoo filter,lock-free queue,and distributed lock are maintained to achieve early termination of conflict transactions and batch restart,thereby avoiding wasting node computing resources in the network.Comparative experiments have shown that this scheme can significantly reduce the average transaction latency and reduce the negative impact of conflict transactions on system performance.Secondly,in response to the low efficiency of conflict detection in range query transactions in the scenario of more reads than writes,this thesis proposes a range query transaction conflict detection scheme based on a caching mechanism.The scheme allows the validation node to locally maintain a global transaction write-set list,which enables the read-set of the range query transaction to compare only a portion of the information in the global transaction write-set list to complete conflict detection.Additionally,in order to make the range query transaction conflict detection scheme applicable to various transaction scenarios,this thesis combines the existing range query transaction conflict detection scheme in Fabric with the proposed range query transaction conflict detection scheme to achieve an adaptive range query transaction conflict detection scheme.Experiments show that the proposed adaptive range query transaction conflict detection scheme can switch to the best conflict detection strategy based on the different situations of range query transactions.At the same time,the range query transaction conflict detection scheme based on caching mechanism proposed in this paper can significantly improve the efficiency of conflict detection in range query transactions when the range of the query is large,and reduce the average transaction latency of the system.Finally,based on the above research contents,this thesis builds a prototype system for electricity trading using the Hyperledger Fabric blockchain platform as the underlying architecture.The system can realize functions such as user deposits and withdrawals,publishing and purchasing electricity trading,and calculating market information,solving problems such as information asymmetry and data security in electricity trading scenarios in the energy internet. |