A method for testing the performance of a deep packet inspection device, and comprises: generating a first group of packets by a packet generating device and sending the generated first group of packets to a packet forwarding device and the DPI device respectively; receiving a second group of packets from the packet forwarding device by a performance analyzing device, wherein the second group of packets being output after the packet forwarding device forwards the first group of packets, and the packet forwarding device performing no DPI detection on the first group of packets, characterized in that it comprises: counting the number of packets included in the first group of packets; receiving a third group of packets from the DPI device by the performance analyzing device, the third group of packets being output after the DPI device processes the first group of packets; counting the number of packets included in the third group of packets; comparing packet transmission characteristics of the second group of packets with packet transmission characteristics of the third group of packets to obtain a first performance of the DPI device; comparing the number of first group of packets with the number of third group of packets to determine a second performance of the DPI device; generating a group of first protocol packets belonging to a first protocol in the first group of packets as follows: acquiring a fourth group of packets belonging to the first protocol; analyzing packet structural features of a protocol data unit of the fourth group of packets and value features of data blocks of the same length in the same position in the PDU of each packet; and generating the group of first protocol packets, wherein the PDU of the generated group of first protocol packets has the packet structural features, and data in the PDU of the group of first protocol packets has the value features. generating a first group of packets by a packet generating device and sending the generated first group of packets to a packet forwarding device and the DPI device respectively; receiving a second group of packets from the packet forwarding device by a performance analyzing device, wherein the second group of packets being output after the packet forwarding device forwards the first group of packets, and the packet forwarding device performing no DPI detection on the first group of packets, characterized in that it comprises: counting the number of packets included in the first group of packets; receiving a third group of packets from the DPI device by the performance analyzing device, the third group of packets being output after the DPI device processes the first group of packets; counting the number of packets included in the third group of packets; comparing packet transmission characteristics of the second group of packets with packet transmission characteristics of the third group of packets to obtain a first performance of the DPI device; comparing the number of first group of packets with the number of third group of packets to determine a second performance of the DPI device; generating a group of first protocol packets belonging to a first protocol in the first group of packets as follows: acquiring a fourth group of packets belonging to the first protocol; analyzing packet structural features of a protocol data unit of the fourth group of packets and value features of data blocks of the same length in the same position in the PDU of each packet; and generating the group of first protocol packets, wherein the PDU of the generated group of first protocol packets has the packet structural features, and data in the PDU of the group of first protocol packets has the value features. counting the number of packets included in the first group of packets; receiving a third group of packets from the DPI device by the performance analyzing device, the third group of packets being output after the DPI device processes the first group of packets; counting the number of packets included in the third group of packets; comparing packet transmission characteristics of the second group of packets with packet transmission characteristics of the third group of packets to obtain a first performance of the DPI device; comparing the number of first group of packets with the number of third group of packets to determine a second performance of the DPI device; generating a group of first protocol packets belonging to a first protocol in the first group of packets as follows: acquiring a fourth group of packets belonging to the first protocol; analyzing packet structural features of a protocol data unit of the fourth group of packets and value features of data blocks of the same length in the same position in the PDU of each packet; and generating the group of first protocol packets, wherein the PDU of the generated group of first protocol packets has the packet structural features, and data in the PDU of the group of first protocol packets has the value features. acquiring a fourth group of packets belonging to the first protocol; analyzing packet structural features of a protocol data unit of the fourth group of packets and value features of data blocks of the same length in the same position in the PDU of each packet; and generating the group of first protocol packets, wherein the PDU of the generated group of first protocol packets has the packet structural features, and data in the PDU of the group of first protocol packets has the value features.