A method for detecting a packet, comprising: performing flow table matching on a received packet, wherein the flow table matching comprises matching second match information in the packet with second match information in a flow table, and the second match information is used to search for relevant information, comprising an execution policy corresponding to the packet, in a flow corresponding to the packet; the method is characterized in that: if the flow table matching does not succeed, performing association recognition table matching between first match information in the received packet and first match information in an association recognition table, wherein the first match information in the association recognition table is obtained by extracting a content of a control packet used for creating a data channel, the first match information corresponds to a packet protocol, and the packet protocol is obtained by performing protocol recognition on the control packet; and when the association recognition table matching succeeds, outputting protocol information obtained after the association recognition table matching succeeds; wherein the first match information comprises a Type, a source Internet Protocol, IP, address, SIP, and a source port, SPort, or the first match information comprises a Type, a destination IP address, DIP, and a destination port, DPort; and the second match information comprises the Type, the SIP, the SPort, the DIP, and the DPort. performing flow table matching on a received packet, wherein the flow table matching comprises matching second match information in the packet with second match information in a flow table, and the second match information is used to search for relevant information, comprising an execution policy corresponding to the packet, in a flow corresponding to the packet; the method is characterized in that: if the flow table matching does not succeed, performing association recognition table matching between first match information in the received packet and first match information in an association recognition table, wherein the first match information in the association recognition table is obtained by extracting a content of a control packet used for creating a data channel, the first match information corresponds to a packet protocol, and the packet protocol is obtained by performing protocol recognition on the control packet; and when the association recognition table matching succeeds, outputting protocol information obtained after the association recognition table matching succeeds; wherein the first match information comprises a Type, a source Internet Protocol, IP, address, SIP, and a source port, SPort, or the first match information comprises a Type, a destination IP address, DIP, and a destination port, DPort; and the second match information comprises the Type, the SIP, the SPort, the DIP, and the DPort. if the flow table matching does not succeed, performing association recognition table matching between first match information in the received packet and first match information in an association recognition table, wherein the first match information in the association recognition table is obtained by extracting a content of a control packet used for creating a data channel, the first match information corresponds to a packet protocol, and the packet protocol is obtained by performing protocol recognition on the control packet; and when the association recognition table matching succeeds, outputting protocol information obtained after the association recognition table matching succeeds; wherein the first match information comprises a Type, a source Internet Protocol, IP, address, SIP, and a source port, SPort, or the first match information comprises a Type, a destination IP address, DIP, and a destination port, DPort; and the second match information comprises the Type, the SIP, the SPort, the DIP, and the DPort.