Background A production line is the basic unit of smart factories and smart manufacturing. However, owing to the development of the industrial Internet of Things, sensors, and other technologies, more data are being collected, leading to a data explosion, and the heterogeneous nature of multiple sources makes it difficult to manage data in a unified manner. Methods A production line data collection, storage, and management system based on cloud-fog-edge computing collaboration and a digital twin was designed. Multi-source heterogeneous data were collected and transmitted based on the OPC UA, and an information model of the production line was established. Modules for data mapping, publishing, and receiving were developed to achieve unified data collection and transmission. The data storage and management platform was constructed by front-end and back-end separation technologies. Results The developed data collection and management system was verified for functionality and performance on a digital twin production line. Functional tests show that the system has the functions of data acquisition and transmission, device addition and viewing, device data querying and downloading, data and model visualization, and user rights setting. The average time for edge data collection and transmission is 183.6ms. The average response time of the cloud for fog requests is less than 1s. This shows that the system can satisfy the real-time requirements of a digital twin production line. Conclusions The proposed system is real-time and stable, providing support for big data and virtual-reality interaction in digital twins.