A data packet classification method and system based on a convolutional neural network. The method comprises: merging each rule set in a training rule set to form a plurality of merging schemes, and determining an optimal merging scheme for each rule set in the training rule set on the basis of performance evaluation; converting a prefix combination distribution of each rule set in the training rule set and a target rule set into an image, and training a convolutional neural network model by means of taking the image and the corresponding optimal merging scheme as features; and classifying the target rule set on the basis of image similarity, and constructing a corresponding hash table for data packet classification. The method can improve the data packet search performance, increase the data packet search speed, and increase the rule update speed. According to the system, by means of the cooperation of an on-line system and an off-line system, it can be guaranteed that the on-line system realizes the efficient search of a data packet and the rapid updating of a rule set, and the updating of the rule set can be monitored, thereby reflecting the latest state of a network at all times.
展开▼