一种改进的Sunday匹配算法
2016-01-22李明月张善卿陆剑锋孙冬梅
李明月,张善卿,陆剑锋,孙冬梅
(杭州电子科技大学计算机学院,浙江 杭州 310018)
摘要:字符串的模式匹配算法在多协议识别技术中,起着至关重要的作用,为了提高多协议识别效率,该文在分析几种经典模式匹配算法的基础上,提出一种基于Sunday算法的改进算法。算法主要是在每次匹配开始前通过一个条件判断语句,判断主串中的相应后缀是否在模式串中,从而减少了无意义的匹配次数,提高了算法的执行效率,通过对比实验证明了该算法的有效性。
关键词:Sunday算法;RoSunday算法;匹配模式
DOI: 10.13954/j.cnki.hdu.2015.01.019
一种改进的Sunday匹配算法
李明月,张善卿,陆剑锋,孙冬梅
(杭州电子科技大学计算机学院,浙江 杭州 310018)
摘要:字符串的模式匹配算法在多协议识别技术中,起着至关重要的作用,为了提高多协议识别效率,该文在分析几种经典模式匹配算法的基础上,提出一种基于Sunday算法的改进算法。算法主要是在每次匹配开始前通过一个条件判断语句,判断主串中的相应后缀是否在模式串中,从而减少了无意义的匹配次数,提高了算法的执行效率,通过对比实验证明了该算法的有效性。
关键词:Sunday算法;RoSunday算法;匹配模式
DOI:10.13954/j.cnki.hdu.2015.01.019
收稿日期:2014-05-09
基金项目:浙江省自然科学基金资助项目(LY14F020043)
通信作者:
作者简介:李明月(1989-),男,河南固始人,在读研究生,数据可视化技术.张善卿副教授,E-mail: zhangsq71@126.com.
中图分类号:TP301.6
文献标识码::A
文章编号::1001-9146(2015)01-0093-04
Abstract:Pattern-matching algorithm of string plays an important role in multi-protocol recognition technology, in order to improve the efficiency of multi-protocol recognition, this paper analyzed several classical pattern matching algorithms and presented a modified SuSunday algorithm on the base of RoSunday algorithm. The algorithm mainly judged the suffix of the main string whether contain in the pattern string through the conditional judgment before the start of each matching, thereby reducing the frequency of meaningless matching, improve the execution efficiency of the algorithm, and verified the effectiveness of this algorithm through comparison testing.
0引言

1字符串匹配算法
1.1 Sunday算法
Sunday算法的思想是:在匹配过程中,模式串首先按从左向右进行逐个匹配,当发现有不匹配的字符时,当前匹配的位置就跳过尽可能大的步长,再进行下一轮的匹配,从而达到提高匹配效率的摸底。……
