Bitcoin is a digital currency system built on the foundation of fairness. However, some malicious miners, driven by their own interests, employ unfair tactics such as selfish mining to compete, which disregard the legitimate miners' investments in computational power and energy consumption. In order to assess the efficiency of the Bitcoin system in real-time and promptly detect malicious miners in the network, this paper proposes a data collection framework called BitTrace, which addresses the issues of low efficiency, lack of timeliness, and data loss in traditional data collection frameworks. BitTrace enables real-time collection and analysis of the blockchain formation process, storing it as structured data. Furthermore, the paper discusses factors that influence the efficiency of data collection and proposes a topological control scheme based on the DPC algorithm to enhance the integrity and efficiency of data collection. Researchers can explore various research areas and applications, such as selfish mining detection and legitimate mining strategy research.