Computer Engineering and Applications ›› 2013, Vol. 49 ›› Issue (8): 133-137.

Previous Articles     Next Articles

Improved string matching algorithm

DONG Shibo, LI Xungen, YIN Zhenzhen   

  1. CAD Laboratory, Hangzhou Dianzi University, Hangzhou 310018, China
  • Online:2013-04-15 Published:2013-04-15

一种改进的字符串多模式匹配算法

董世博,李训根,殷珍珍   

  1. 杭州电子科技大学 CAD研究所,杭州 310018

Abstract: String matching algorithm is an important method in intrusion detection. An improved algorithm is proposed for string matching based on the discussions of several common string matching algorithms, for example, AC, AC_BMH, Sunday, etc. This algorithm can jump over more characters to do next matching when this matching is lost. At the same time, the matching times decrease sharply. In this case, it improves the matching efficiency. The analysis of this algorithm’s performance and the comparisons of the testing results of several matching algorithms are given.

Key words: pattern matching, AC algorithm, AC_BMH algorithm

摘要: 基于字符串匹配的检测方法是入侵检测系统中的一种重要方法。通过分析几种常见的字符串匹配算法(AC、AC_BMH、Sunday等)的基础,提出了一种对AC算法的改进,新算法每一次匹配不成功后都能跳过尽可能多的字符以进行下一轮匹配,使得匹配次数大大减少,从而提高了匹配效率。分析了该算法的性能,并用具体的实验数据给出了几种匹配算法的测试结果。

关键词: 模式匹配, AC算法, AC_BMH算法