| In the field of anti-counterfeiting and traceability,blockchain technology provides a solid foundation for building reliable and consistent traceability platforms,due to its characteristic data traceability and tamperresistance.However,current blockchain-based anti-counterfeiting traceability systems generally face two major challenges:firstly,the data submission rate in anti-counterfeiting and traceability scenarios is affected by the product manufacturing process,and existing blockchain frameworks can only package blocks based on a fixed number of transactions.This leads to throughput bottlenecks in high-frequency writing and frequent triggering of timeout thresholds in low-frequency writing,thus affecting the stability of the system.Secondly,most existing traceability systems focus only on specific goods or brands,leading to insufficient traceability information and limited application scope,which does not cover the entire product manufacturing process.Therefore,this paper aims to research and improve the on-chain transaction writing process,enhance the throughput of blockchain frameworks under fluctuating transaction rates,and reduce the average latency.Furthermore,we design and implement a full-process anti-counterfeiting traceability system based on these improvements.To address the throughput bottleneck and high latency issues of traditional blockchain frameworks,we propose and implement a dynamic block control model.This model is based on a PID feedback control algorithm and consists of a block-generation adjustment mechanism and an auxiliary control module.With the adjustment mechanism,the model can calculate the transaction scale of the current block based on the number of transactions in several preceding blocks,thereby adaptively adjusting the block size.We have implemented this model in the Fabric consortium blockchain framework by modifying the source code and have conducted experimental analysis under varying transaction submission rates.The results show that,compared to the native and other improved frameworks,our dynamic block control model significantly improves the throughput of the Fabric framework in fluctuating transaction rate scenarios and reduces the average transaction processing latency.In response to the narrow application scope and scarcity of traceability information in traditional traceability systems,we design and implement a full-process anti-counterfeiting traceability system based on the improved Fabric framework and microservices architecture pattern.The system incorporates detailed implementation of raw material management,warehouse management,logistics management,processing management,and retail management modules.Additionally,it offers comprehensive information management units and flexible,universal data entry methods for enterprises and employees,resulting in broader product coverage.Finally,we have conducted detailed tests and analyses for the designed system.The test results demonstrate that the system has reliable anticounterfeiting and traceability service capabilities. |