欢迎访问中国科学院大学学报,今天是
计算机科学

改进的多模式串匹配算法及GPU并行化研究

  • 钱权 ,
  • 朱伟 ,
  • 车弘毅 ,
  • 张瑞
展开
  • 1. 上海大学计算机工程与科学学院, 上海 200072;
    2. 中国科学院软件研究所信息安全国家重点实验室, 北京 100190

收稿日期: 2012-10-11

  修回日期: 2013-02-06

  网络出版日期: 2013-09-15

基金资助

国家自然科学基金(61003248);上海市自然科学基金(13ZR1416100);上海教委重点学科(J50103);上海教委创新项目(09YZ05);教育部博士点基金(20093108120016);上海科委开放课题(09511501300)资助 

An improved multi-pattern string matching algorithm and GPU parallelization

  • QIAN Quan ,
  • ZHU Wei ,
  • CHE Hong-Yi ,
  • ZHANG Rui
Expand
  • 1. School of Computer Engineering & Science, Shanghai University, Shanghai 200072, China;
    2. State Key Laboratory of Information Security, Institute of Software, Chinese Academy of Sciences, Beijing 100190, China

Received date: 2012-10-11

  Revised date: 2013-02-06

  Online published: 2013-09-15

摘要

通过分析AC多模式匹配算法和正则语句搜索匹配在功能上的优劣,研究它们在生成确定性有穷自动机时的相同与差异,融合AC算法和正则语句运用于文本的多模式串匹配,使得AC算法能够识别正则语句,并且保持原有算法在匹配失败后,目标模式串指针不回退且AC自动机回退少的特点,使得算法兼有二者优点. 同时,讨论了在GPU上通过CUDA的并行程序环境实现算法的并行化,并详细比较了在GPU上利用不同类型存储器实现的算法的性能差异.

本文引用格式

钱权 , 朱伟 , 车弘毅 , 张瑞 . 改进的多模式串匹配算法及GPU并行化研究[J]. 中国科学院大学学报, 2013 , 30(5) : 706 -712 . DOI: 10.7523/j.issn.2095-6134.2013.05.021

Abstract

Multi-pattern matching algorithm has been widely used in text searching, intrusion detection, and some other areas. We focus on two matching algorithms, AC and regular expression. By comparing their DFA automata building process, we integrate the two processes to a new novel AC algorithm. The new AC maintains the advantages of the traditional AC when matching fails, the pointer of the target pattern does not turn back, and the AC automata pointer just moves back by a few steps. Meanwhile, we also discuss the AC parallelization based on GPU and CUDA, and compare the running performance when using GPU global memory or the texture one.

参考文献

[1] Aho A V, Corasick M J. Efficient string matching: an aid to bibliographic search[J]. Communications of the ACM, 1975, 18(6):333-340.
[2] Yang W, Fang B X, Liu B, et al. Intrusion detection system for high-speed network[J]. Computer Communications, 2004, 27(13):1288-1294.
[3] Thompson K. Regular expression search algorithm[J]. Communications of the ACM, 1968, 11(6): 419-422.
[4] Baker Z K, Prasanna V K. Time and area efficient pattern matching on FPGAs[C]//Proceedings of the 2004 ACM/SIGDA 12th International Symposium on Field Programmable Gate Arrays. New York: ACM Press, 2004:223-232.
[5] Sidhu R, Prasanna V. Fast regular expression matching using FPGAs[C]//Proceedings of the 9th Annual IEEE Symposium on Field-Programmable Custom Computing Machines. Washington: IEEE Computer Society, 2001:227-238.
[6] Jacob N, Brodley C. Offloading IDS computation to the GPU[C]//Proceedings of the 22nd Annual Computer Security Applications Conference, Washington: IEEE Computer Society, 2006: 371-380.
[7] Kouzinopoulos C S, Margaritis K G. String matching on a multicore GPU using CUDA[C]//Proceedings of the 13th Panhellenic Conference on Informatics. Washington: IEEE Computer Society, 2009:14-18.
[8] Vasiliadis G, Polychronakis M, Antonatos S, et al. Regular expression matching on graphics hardware for intrusion detection[C]//Proceedings of the 12th International Symposium on Recent Advances in Intrusion Detection. Berlin: Springer-Verlag Press, 2009:265-283.
[9] Vasiliadis G, Antonatos S, Polychronakis M, et al. Gnort: High performance network intrusion detection using graphics processors[C]//Proceedings of 11th international Symposium on Recent Advances in Intrusion Detection. Berlin: Springer-Verlag Press, 2008:116-134.
[10] Sipser M. Introduction to the theory of computation[M]. Boston: Thomson Learning Press, 2006.
[11] Wikimedia Foundation Inc. Shunting-yard algorithm: USA [DB/OL]. [2013-01-20]. http://en.wikipedia.org/wiki/Shunting-yard_algorithm.
[12] Fegaras L. University of Texas at Arlington: USA, CSE 5317/4305: design and construction of compilers [EB/OL]. (2012-01-10) [2012-09-10]. http://lambda.uta.edu/cse5317/.
[13] NVIDIA Corporation. All NVIDIA related information: USA[EB/OL].[2012-09-10]. http://www.nvidia.com/object/cuda_home. html.
[14] NVIDIA Corporation. NVIDIA CUDA programming guide: USA[G/OL].[2013-09-10]. http://developer.download.nvidia.com/compute/cuda/3_0/toolkit/docs/NVIDIA_CUDA_ ProgrammingGuide.pdf.
[15] 张舒, 褚艳利. GPU高性能运算之CUDA[M]. 北京: 中国水利水电出版社, 2009.
文章导航

/