In today's era of big data, to guarantee the network security system run efficiently is very necessary. Pattern-matching algorithm is an important module of network security system, so it is facing a growing challenge. More and more as the number of patterns, pattern-matching algorithms need to be optimized constantly. Matching-algorithm of small set is not efficient applied to today's network security system. By analyzing the characteristics of the pattern set of network security system, a matching-algorithm of large-scale set was proposed in this paper. The algorithm is based on the idea of classification, and it combines two efficient algorithms skillfully. This makes the algorithm can still run efficiently in the large-scale pattern set. Through experimental comparison with other algorithms, this algorithm not only has advantages of speed, but also has smaller amount of memory. It meets the the demand of the network security system in the modern era of big data.