With the continuous development of network technology, distributed systems have been widely studied and applied. The Publish/Subscribe (Pub/Sub) model supports asynchronous and multipoint communication, enabling the participants of distributed systems to be completely decoupled in time, space, and control flow, thereby solving the problems of integration and dynamic reorganization of distributed systems. The purpose of this paper is to design a distributed system for wheel and rail detection based on ZeroMQ. On the basis of distributed system research, it first analyzes the ZEROMQ message queue operation in detail, combining the characteristics of big data, system architecture, logical architecture, partial architecture and ZERCMQ-based. The distributed design scheme of the distributed system is proposed, and a set of methods to solve the lateral force and vertical force of the wheel-rail contact based on the axonometric method and the combined wheel measurement method are proposed. Finally, the final performance test of the distributed system based on ZEROMQ, the insert performance results show that when the number of insert commands is 10, the average execution time is 2,500,000us, and the query performance results show that when the number of search commands is 10, the average The execution time is 500000us, it can be seen that the system has excellent concurrent performance.