In order to solve the problem of data transmission in the Internet of Things system, based on the Socket.IO protocol and related software and hardware modules, this study carried out the modular design and implementation steps of the real-time two-way communication system of the Internet of Things gateway. The gateway is divided into functional modules to realize the interaction process between the gateway and the platform about the underlying device authentication, device data transmission and device heartbeat. After the design is completed, the function and performance of the system are tested. The test results show that the designed system has achieved the expected goal in terms of function and performance, and can effectively improve the efficiency and quality of data transmission of the system.