摘要: 基于字符串匹配的检测方法是入侵检测系统中的一种重要方法。在分析了几种常见的字符串匹配算法(BF、KMP、BM、Sunday等)的基础上,提出了一种改进的字符串匹配算法——SundayNew。该算法使每一次匹配不成功后都能跳过尽可能多的字符以进行下一轮匹配,并且匹配次数大大减少,从而提高了匹配效率。最后,分析了该算法的性能,并用具体的实验数据给出了几种匹配算法的测试结果。
关键词:
字符串搜索;模式匹配;算法
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, BF, KMP, BM, 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 decreases sharply. In this case, it improves the matching efficiency. In the end, the analysis of this algorithm’s performance and the comparisons of the testing results of several matching algorithms are given.
Key words:
String searching; Pattern matching; Algorithm
王 成,刘金刚. 一种改进的字符串匹配算法[J]. 计算机工程, 2006, 32(2): 62-64.
WANG Cheng, LIU Jingang. An Improved String Matching Algorithm[J]. Computer Engineering, 2006, 32(2): 62-64.