This disclosure provides a security detection method, apparatus, and device for communication protocols, comprising: obtaining the structure of the communication protocol through
unsupervised learning and structural
parsing based on bidirectional raw traffic data; utilizing
sequence alignment algorithms to find common patterns and variable fields among packets in different protocol session streams; identifying high-frequency
byte sequences that consistently appear in
application layer payload data; dividing the
payload of a single packet into multiple fields and inferring the semantic type of each field; and constructing a protocol
syntax tree for the communication protocol; then, based on the protocol
syntax tree, modeling normal communication behavior to obtain a behavioral baseline of the behavioral patterns under normal communication behavior; and performing
anomaly detection on real-time traffic obtained from the communication network based on the protocol
syntax tree and the behavioral baseline. Thus, without prior knowledge of the detailed protocol specifications, it can intelligently learn from communication behavior to discover potential threats, reducing the application limitations of this security detection method.