《電子技術(shù)應(yīng)用》
您所在的位置:首頁(yè) > 模擬設(shè)計(jì) > 設(shè)計(jì)應(yīng)用 > 一種基于指令流水線(xiàn)的數(shù)據(jù)匹配算法
一種基于指令流水線(xiàn)的數(shù)據(jù)匹配算法
電子技術(shù)應(yīng)用
楊嘉佳,李正,鄭兒,趙靜,燕瑋,劉金
中國(guó)電子信息產(chǎn)業(yè)集團(tuán)有限公司第六研究所
摘要: 基于正則表達(dá)式的數(shù)據(jù)匹配技術(shù)在基礎(chǔ)數(shù)據(jù)治理和清洗方面有著重要的應(yīng)用價(jià)值。然而,在高性能計(jì)算領(lǐng)域的數(shù)據(jù)處理過(guò)程中因算法匹配吞吐率低,無(wú)法滿(mǎn)足大數(shù)據(jù)處理環(huán)境下對(duì)算法的高性能要求,造成其應(yīng)用范圍受限。針對(duì)此現(xiàn)象,提出一種基于指令流水線(xiàn)的數(shù)據(jù)匹配算法,稱(chēng)之為γFA:利用Intel架構(gòu)內(nèi)置的向量指令流水式讀入若干字符段,通過(guò)大寬度向量比較函數(shù)進(jìn)行字符段與非信任字符集的流水比值處理并轉(zhuǎn)換成整型向量,通過(guò)位置定位函數(shù)累加定位出所有整型向量的首個(gè)非信任字符位置,計(jì)算出可略過(guò)的總字符數(shù),減少正則表達(dá)式匹配引擎因處理非信任字符集導(dǎo)致訪(fǎng)問(wèn)低速內(nèi)存而帶來(lái)巨大的時(shí)間開(kāi)銷(xiāo),實(shí)現(xiàn)正則表達(dá)式匹配算法的性能提升。實(shí)驗(yàn)結(jié)果表明,γFA算法的吞吐率是原始DFA算法的15.88~53.06倍,相比于ßFA算法,吞吐率提升了35.12%~63.26%,取得較好的性能加速效果。此外,通過(guò)對(duì)γFA算法進(jìn)行優(yōu)化后,性能可接近100 Gb/s,為原始DFA匹配算法性能的15.88~64.94倍,相比于γFA算法性能提升了2.15%~43.09%。
中圖分類(lèi)號(hào):TP391.1 文獻(xiàn)標(biāo)志碼:A DOI: 10.16157/j.issn.0258-7998.245345
中文引用格式: 楊嘉佳,李正,鄭兒,等. 一種基于指令流水線(xiàn)的數(shù)據(jù)匹配算法[J]. 電子技術(shù)應(yīng)用,2025,51(2):81-85.
英文引用格式: Yang Jiajia,Li Zheng,Zheng Er,et al. A data matching algorithm based on instruction pipeline[J]. Application of Electronic Technique,2025,51(2):81-85.
A data matching algorithm based on instruction pipeline
Yang Jiajia,Li Zheng,Zheng Er,Zhao Jing,Yan Wei,Liu Jin
The Sixth Research Institute of China Electronics Corporation
Abstract: The data matching technology based on regular expressions has significant application value in basic data governance and cleaning. However, in the data processing process of high-performance computing, the low performance of algorithm matching cannot meet the high-performance requirements of algorithms in the big data processing environment, resulting in limited application scope. To address this issue, a high-performance data matching algorithm based on instruction pipelining is proposed, known as γFA. It utilizes the vector instruction pipelining built into the Intel architecture to read in multiple character segments, performs pipeline ratio processing of the character segments with untrusted character sets through a wide-width vector comparison function, and converts them into integer vectors. The position location function is then used to accumulate and locate the first untrusted character position in the integer vector, calculate the number of characters that can be skipped, and reduce the significant time overhead caused by the regular expression matching engine accessing slow memory when processing untrusted character sets. This achieves performance acceleration for the regular expression matching algorithm. Experimental results show that the γFA algorithm achieves a throughput rate that is 15.88 to 53.06 times higher than the original DFA algorithm. Compared to the ßFA algorithm, the throughput rate is improved by 35.12% to 63.26%, achieving a better performance acceleration effect. Furthermore, after optimizing the γFA algorithm, a performance close to 100 Gb/s can be achieved, which is 15.88 to 64.94 times better than the performance of the original DFA matching algorithm. This represents an improvement of 2.15% to 43.09% compared to the γFA algorithm.
Key words : regular expression matching;instruction pipeline;high-performance data matching

引言

數(shù)據(jù)匹配技術(shù)可應(yīng)用于數(shù)據(jù)的清洗和治理,如基于正則表達(dá)式的數(shù)據(jù)匹配技術(shù)在基礎(chǔ)數(shù)據(jù)的過(guò)濾方面發(fā)揮重要作用,通過(guò)數(shù)據(jù)匹配可將無(wú)關(guān)數(shù)據(jù)剔除過(guò)濾,減少噪聲數(shù)據(jù)的干擾。正則表達(dá)式因具有強(qiáng)大的表征能力,適合用于匹配過(guò)濾真實(shí)環(huán)境下的復(fù)雜噪聲數(shù)據(jù)。例如,開(kāi)源入侵檢測(cè)系統(tǒng)Bro IDS、Snort[1]等都使用了基于正則表達(dá)式的數(shù)據(jù)匹配功能。

基于正則表達(dá)式的數(shù)據(jù)匹配實(shí)現(xiàn)方式通常可分成兩種:基于非確定型有限自動(dòng)機(jī)(NFA)和確定型有限自動(dòng)機(jī)(DFA)。前者空間復(fù)雜度比較低,與正則表達(dá)式的長(zhǎng)度呈線(xiàn)性關(guān)系,但因處理一個(gè)字符需激活多個(gè)狀態(tài),造成匹配時(shí)間復(fù)雜性較大和匹配性能不穩(wěn)定。相比而言,DFA的時(shí)間復(fù)雜性比較低,處理一個(gè)字符只需一次激活單個(gè)狀態(tài),然而卻因規(guī)則的復(fù)雜性易導(dǎo)致?tīng)顟B(tài)轉(zhuǎn)移空間膨脹甚至“爆炸”,造成巨大的空間開(kāi)銷(xiāo)。

在大數(shù)據(jù)匹配環(huán)境中,DFA更多地被選擇與應(yīng)用。DFA的匹配性能和空間消耗是基于正則表達(dá)式數(shù)據(jù)匹配技術(shù)的重要衡量因素。截至目前,DFA的空間消耗已有很多可行的算法被提出[2],因而不是本文研究重點(diǎn)。盡管已有若干算法對(duì)DFA的匹配性能進(jìn)行研究,但性能低依舊是制約其廣泛應(yīng)用的瓶頸因素。

針對(duì)此問(wèn)題,本文基于單指令多數(shù)據(jù)流(Single Instruction Multiple Data)向量指令連續(xù)從內(nèi)存中讀入若干字符段,然后分別與最常被訪(fǎng)問(wèn)狀態(tài)(行)對(duì)應(yīng)的非信任字符集進(jìn)行字符并行比較操作,通過(guò)位置定位函數(shù)累加定位出首個(gè)非信任字符位置,獲取直接略過(guò)的總字符數(shù),減少訪(fǎng)存次數(shù),提高算法吞吐率。


本文詳細(xì)內(nèi)容請(qǐng)下載:

http://www.jysgc.com/resource/share/2000006330


作者信息:

楊嘉佳,李正,鄭兒,趙靜,燕瑋,劉金

(中國(guó)電子信息產(chǎn)業(yè)集團(tuán)有限公司第六研究所,北京 100083)


Magazine.Subscription.jpg

此內(nèi)容為AET網(wǎng)站原創(chuàng),未經(jīng)授權(quán)禁止轉(zhuǎn)載。
主站蜘蛛池模板: 6080午夜乱理伦片| 中文字幕第35页| 波多野结衣电车痴汉| 又粗又长又黄又爽视频| 韩国三级女电影完整版| 国产精品jizzjizz| 97久久天天综合色天天综合色 | 日本三级黄色网址| 久青草无码视频在线观看| 亚洲色图13p| 在线播放无码后入内射少妇| 一本久久A久久免费精品不卡| 无遮挡边吃摸边吃奶边做| 久久精品国产清自在天天线| 欧美丝袜高跟鞋一区二区| 午夜久久久久久久| 青青青青手机在线观看| 国产成人高清视频| 2021三级a电影大全| 在线观看视频国产| a级毛片高清免费视频就| 日韩伦理片电影在线免费观看| 亚洲五月激情网| 欧美日产国产亚洲综合图区一| 亚洲精品乱码久久久久久蜜桃不卡| 神秘电影欧美草草影院麻豆第一页 | 欧美一级黄色影院| 亚洲无线一二三四区| 正在播放国产乱子伦视频| 亚洲自偷自偷在线制服| 男女搞基视频软件| 免费看激情按摩肉体视频| 精品国产va久久久久久久冰 | 再深点灬舒服灬太大了添网站| 网址你懂的在线观看| 四虎影视在线影院4hutv| 老司机午夜免费视频| 四虎影院一级片| 美女航空一级毛片在线播放| 国产91精品久久| 老司机亚洲精品|