The technological development of artificial intelligence, Internet of Vehicles, big data, edge computing, intelligent manufacturing, 5G and other technologies will bring great prospects to the popularization of the Internet of Things. In the future, we will see more and more IoT systems of different sizes. It is particularly important to ensure the control of IoT system message transmission, ensure system security, and monitor IoT systems. The Internet of Things protocol and its system node authentication mechanism have great research value. This paper analyzes the MQTT protocol and its security authentication mechanism, and designs and implements an identity authentication mechanism based on historical information nodes. The proposed authentication mechanism can effectively prevent forgery attacks, counterfeit attacks, replay attacks, and Sybil attacks.