首页 | 官方网站   微博 | 高级检索  
     

基于双字符序检测的BM模式匹配改进算法
引用本文:王浩,张霖,张庆.基于双字符序检测的BM模式匹配改进算法[J].计算机工程与科学,2012,34(3):113-117.
作者姓名:王浩  张霖  张庆
作者单位:安徽建筑工业学院信息网络中心,安徽合肥,230022
基金项目:安徽高校省级自然科学研究重点项目(KJ2009A61);安徽高校省级自然科学研究一般项目(KJ2010B041)
摘    要:BM算法是一类效率较高的单模式匹配算法,通常改进的BM算法往往从提高字符首次不匹配概率和匹配窗口的最大移动距离入手,但为实现此目的所带来的高访存开销使算法实际效率受到影响。DCSBM算法以适当减小关键步长为代价,在利用双字符序检测提高首次匹配失败概率的同时,对匹配窗口移动关键步长字符距离所需的查表次数和访存次数进行优化。经测试,DCSBM算法显著提高了匹配窗口的平均移动距离。在文本或模式串相对较长情况下,该算法实际测试效率优于BM、BMHS、BMN等算法。

关 键 词:模式匹配  双字符序  BM算法  BMHS算法

An Improved BM Pattern Matching Algorithm Based on Double Character Sequence Checking
WANG Hao , ZHANG Lin , ZHANG Qing.An Improved BM Pattern Matching Algorithm Based on Double Character Sequence Checking[J].Computer Engineering & Science,2012,34(3):113-117.
Authors:WANG Hao  ZHANG Lin  ZHANG Qing
Affiliation:(Information and Network Center,Anhui Institute of Architecture and Industry,Hefei 230022,China)
Abstract:The BM algorithm is a more efficient single pattern matching algorithm. The common method of improving the BM algorithm is to start with increasing the probability of the first failure character matching and the maximal moving distance of the matching window. At the same time, the higher cost of accessing memory counteracts the actual efficiency of the new algorithm. Optimizing the number of the look-up table and the times of accessing memory when it moves the key distance of the matching window, and DCSBM makes good use of the double character’s first failure matching probability at the cost of reducing the key steps properly. It is tested that DCSBM obviously increases the average moving distance of the matching window. In larger length of the text or pattern, the real efficiency of DCSBM is higher than BM, BMHS, or BMN algorithm.
Keywords:pattern matching  double character sequence  BM algorithm  BMHS algorithm
本文献已被 CNKI 万方数据 等数据库收录!
点击此处可从《计算机工程与科学》浏览原始摘要信息
点击此处可从《计算机工程与科学》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号