In the past few decades, coexistence of various fieldbus, industrial ethernet and industrial wireless networks, making the industrial communication field always in the stage of coexistence of multiple buses. The emergence of OPC technology has improved the status of industrial communication, but OPC technology can only adapt to the information transmission of the application layer, and does not achieve complete communication, so the OPC Foundation proposes OPC Unified Architecture (UA), and With the development of TSN technology, it is possible to apply OPC UA to the field level. Due to the tight coupling and server performance bottlenecks in the current OPC UA client/server communication mode, the publish/subscribe mode is used as an additional communication mode for OPC UA. This paper will focus on the research and implementation of the OPC UA publish/subscribe mechanism. Firstly, the key technologies such as address space, data encoding and communication mode are studied, and the communication mechanisms of client/server and publish/subscribe in OPC UA are compared. Secondly, this paper designs and implements two message middleware technologies based on UDP broker-less mechanism and AMQP broker-based mechanism. Finally, this paper designs an OPC UA publish/subscribe overall system architecture based on message middleware technology, and implements the specific functions of address space module, write module, read module, connection module and security module in the system, and summarizes the status of the system. Machine model and the workflow of publishers and subscribers. This paper completed the system code writing of the OPC UA publish/subscribe mechanism, and built a local network in the lab. The experiment verified the stability of the system function and the ability to transmit data. The test results show that the system has many advantages such as correctness, independence and high throughput.