The invention discloses a communication protocol modeling method. The method comprises the following steps of: S1, analyzing a communication protocol, and determining a system connected with the communication protocol and a mutual relation between the systems; S2, analyzing the composition form of the user-oriented application data of the communication protocol; and S3, establishing a model according to the relationship between the data elements of the communication data packet in the communication protocol. According to the invention, the data in the interface communication protocol of the serial communication type and the interaction relationship of the data are analyzed, a completely described mathematical model for various action relationships of the communication protocol is established; based on the mathematical model, a system communication protocol described by a natural language is converted into a machine language which can be recognized by a computer, then the purpose of automatically generating a test case is achieved by researching a certain test case calculation algorithm, and finally automatic execution of an interface protocol test is achieved, so that the test efficiency is improved.