I. Introduction
The security threat posed by M2M communication is becoming more and more serious. In particular, the security of data transmission at the application layer of the Internet of Things, such as the DDos attack launched by Mirai, has received unprecedented attention. However, traditional methods such as TLS (Transport Layer Security) and symmetric encryption are not entirely suitable for resource- constrained IoT environments. The MQTT (Message Queue Telemetry Transport, MQTT) protocol has been widely used in the field of Internet of Things due to its subscription and release mode, and has even become a de facto data transmission standard [2]. MQTT was proposed in 1999 by Andy Stanford-Clark of IBM and Arlen Nipper of Arcom, and then became an OASIS standard in 2013. In theory, the MQTT protocol can realize encrypted transmission through SSL/TLS, but this method has obvious limitations on resource-constrained IoT devices [3]. In fact, many existing MQTT services do not even have any security settings. The main reason for this situation is the complicated usage of SSL/TLS and resource occupation [3]. Intrusion Detection Systems (Intrusion Detection Systems) and authentication (authentication) have long been applied to MQTT security protection, and have achieved good results under specific conditions [4],[5]. However, it is difficult to be widely used due to too narrow conditions and too complicated implementation.