《電子技術應用》
您所在的位置:首頁 > 模擬設計 > 設計應用 > ɑFA:一種基于非信任字符比較的高性能正則表達式匹配算法
ɑFA:一種基于非信任字符比較的高性能正則表達式匹配算法
電子技術應用
楊嘉佳,關健,于增明,張雷,姚旺君
中國電子信息產業(yè)集團有限公司第六研究所
摘要: 正則表達式匹配技術在數(shù)據(jù)治理、解析提取和深度包檢測方面有著重大應用價值。然而,由于其在通用平臺上的匹配性能較低,無法滿足實際環(huán)境下數(shù)據(jù)實時處理的應用需求,限制了其在高性能數(shù)據(jù)處理領域的應用范圍。針對當前正則表達式匹配性能較低的問題,提出一種基于非信任字符比較的高性能正則表達式匹配算法,稱之為ɑFA。該算法通過每次判斷連續(xù)的若干個字符是否屬于最常被訪問狀態(tài)的非信任字符集,獲取無需通過DFA匹配可直接跳過的字符數(shù),減少字符匹配過程中訪問內存DFA狀態(tài)轉移表的次數(shù),從而實現(xiàn)字符匹配的加速處理。實驗結果表明,ɑFA算法可獲得相比于原始DFA匹配算法約為1.05~7.58倍的性能加速比。
中圖分類號:TP391.1 文獻標志碼:A DOI: 10.16157/j.issn.0258-7998.244911
中文引用格式: 楊嘉佳,關健,于增明,等. ɑFA:一種基于非信任字符比較的高性能正則表達式匹配算法[J]. 電子技術應用,2024,50(6):57-60.
英文引用格式: Yang Jiajia,Guan Jian,Yu Zengming,et al. ɑFA: a high-performance regular expression matching algorithm based on untrusted character comparison[J]. Application of Electronic Technique,2024,50(6):57-60.
ɑFA: a high-performance regular expression matching algorithm based on untrusted character comparison
Yang Jiajia,Guan Jian,Yu Zengming,Zhang Lei,Yao Wangjun
The Sixth Research Institute of China Electronics Corporation
Abstract: Regular expression matching technology has significant application value in data governance, parsing extraction, and deep packet inspection. However, due to its low matching performance on general-purpose platforms, it cannot meet the application requirements of real-time data processing in practical environments, which limits its application scope in the field of high-performance data processing. In response to the current issue, a high-performance regular expression matching algorithm based on untrusted character comparison is proposed, which is called ɑFA. This algorithm determines whether a sequence of consecutive characters belongs to the untrusted character set of the most frequently accessed state. By doing so, it acquires the number of characters that can be skipped directly without DFA matching, reduces the number of accesses to the DFA state transition table in memory during character matching, and thus achieves accelerated processing of character matching. The experimental results indicate that the ɑFA algorithm can achieve a performance acceleration of approximately 1.05 times to 7.58 times compared to the original DFA matching algorithm.
Key words : regular expression matching;deterministic finite automaton;high-performance data processing

引言

正則表達式因擁有強大的表達能力與靈活性,在數(shù)據(jù)治理、解析提取和深度包檢測方面得到了廣泛應用。比如著名的搜索工具grepsed以及入侵檢測系統(tǒng)Snort[1]都包含了很多正則表達式規(guī)則。

正則表達式匹配方法通常分為基于確定型有限自動機(Deterministic Finite Automata, DFA)和基于非確定型有限自動機(Nondeterministic Finite Automata, NFA)[2]。兩者的區(qū)別在于NFA的空間需求較少,但匹配性能較低;DFA則相反,匹配性能較高,但空間需求大。

在真實數(shù)據(jù)處理環(huán)境背景下,正則表達式的匹配性能是最重要的衡量因素之一。以狀態(tài)轉移次數(shù)計算,DFA匹配單個字符時發(fā)生一次狀態(tài)轉移,轉移次數(shù)固定,性能較高且較為穩(wěn)定;相反,NFA匹配單個字符時可能會引發(fā)若干次狀態(tài)轉移,轉移次數(shù)較多,性能較低且穩(wěn)定性較差。因此,現(xiàn)有的高性能匹配研究工作主要集中于如何提升DFA的匹配性能。

截止目前,各式各樣的DFA加速匹配方法已被提出[3],包括經典的多步長自動機、多核平臺并行匹配加速、基于枚舉方法的SIMD加速、基于推測與枚舉方法相結合的新型并行化匹配方法等。但是,這些算法在加速匹配過程中需多次訪問內存導致較大的時間開銷,因而性能還有進一步提升的空間。

因此,本文專注于DFA的匹配性能問題,提出了一種基于非信任字符比較的高性能正則表達式匹配算法。通過每次判斷連續(xù)的若干個字符是否屬于最常被訪問狀態(tài)的非信任字符集,獲得無需通過DFA匹配可直接跳過的字符數(shù),從而實現(xiàn)DFA的加速處理。理論分析與實驗結果表明,此算法可達到原始DFA性能加速比的1.05~7.58倍。


本文詳細內容請下載:

http://www.xxav2194.com/resource/share/2000006031


作者信息:

楊嘉佳,關健,于增明,張雷,姚旺君

(中國電子信息產業(yè)集團有限公司第六研究所,北京 100083)


Magazine.Subscription.jpg

此內容為AET網站原創(chuàng),未經授權禁止轉載。
主站蜘蛛池模板: 内地女星风流艳史肉之| 欧美三级不卡在线观看| 国产福利在线观看你懂的| 久久精品亚洲精品国产欧美| 男人边摸边吃奶边做下面 | 日本最新免费不卡二区在线| 亚洲精品成人片在线观看精品字幕| 草莓视频在线免费播放草莓视频在线免费播放 | 波多野42部无码喷潮在线| 国产福利小视频| sss欧美一区二区三区| 欧美成人午夜免费完成| 国产女18片毛片水真多| 99re在线视频| 性美国xxxxx免费| 久久婷婷五月综合色欧美| 欧美日韩综合在线视频免费看| 另类视频色综合| 91视频第一页| 成av免费大片黄在线观看| 亚洲欧美国产五月天综合| 黄a大片av永久免费| 婷婷被公交车猛烈进出视频 | 韩国18福利视频免费观看| 好男人www.| 久久久无码精品午夜| 欧美国产一区二区三区激情无套| 国产又爽又黄又无遮挡的激情视频 | 中文字幕第二页| 曰批免费视频播放60分钟| 亚洲成a人片在线看| 男生和女生污污的视频| 日本a级作爱片金瓶双艳| 亚洲精品456| 久久久久久久影院| 在公交车上弄到高c了公交车视频| 中文在线最新版天堂| 日本高清护士xxxxx| 亚洲Av人人澡人人爽人人夜夜| 污污的软件下载| 人妻精品久久久久中文字幕一冢本 |