多模式匹配算法是网络监测和内容过滤系统的核心算法,但是现有的多模式匹配算法无法实现高并发下动态更新模式串的功能。通过改进Karp-Rabin算法,实现了多模式字符串匹配技术,实验表明多模式Karp-Rabin算法具有良好的性能。随后在多模式Karp-Rabin算法的基础上进一步改进,使其在高并发情况下能够支持模式串动态增删功能。实验表明该算法在单个线程不断更新的条件下,随着扫描线程个数的增加,搜索速度能够保持线性增长。
Multi-pattern matching algorithm plays an important role in network monitoring and filtering system, but the existing multi-pattern matching algorithms can not achieve the function of updating patterns dynamically with high concurrencies.Firstly, the paper has realized multi-pattern matching technology by improving Karp-Rabin algorithm. Experiments show that the improved algorithm exhibits good performance. Then on the basis of the improvement, functionality of updating patterns dynamically is improved. Experiments show that if there is a single thread updating continuously, search speed keeps linear growth with the increase of scanning thread.