发明名称 Regular expression matching method and system, and searching device
摘要 A regular expression matching method and system, and a searching device are provided. First, the searching device performs string filtering on a data stream to be matched, in which if keywords in the data stream and preset character words have at least one same character, the searching device indicates that the data stream passes through the string filtering. Then the searching device performs regular expression filtering on the data stream passing through the string filtering. In a string filtering process through the method, system, and device, when Hash mapping positions of the keywords of the data stream are a subset of the Hash mapping positions of the character words, it indicates that the data stream passes through the string filtering, and it is not required to store the keywords and further compare the keywords with the character words, thereby saving the storage space and improving performance.
申请公布号 US9390134(B2) 申请公布日期 2016.07.12
申请号 US201113339043 申请日期 2011.12.28
申请人 Huawei Technologies Co., Ltd. 发明人 Hu Rui;Chen Jian
分类号 G06F17/30 主分类号 G06F17/30
代理机构 Brinks Gilson & Lione 代理人 Brinks Gilson & Lione
主权项 1. A regular expression filtering method, comprising: obtaining a string rule base and a regular expression rule base; wherein obtaining the string rule base comprises: extracting character words from an input rule;establishing a bit array corresponding to the character words, a counting array corresponding to the bit array, and a drop-down linked list configured to store the character words; andobtaining the string rule base according to the counting array, the bit array, and the linked list; performing a string filtering on a data stream to be matched according to the string rule base, if keywords in the data stream and the character words have at least one same character, indicating that the data stream passes through the string filtering; wherein the at least one same character comprises: Hash mapping positions of the keywords of the data stream that are a subset of Hash mapping positions of the character words; and performing regular expression filtering on the data stream that passes through the string filtering according to the regular expression rule base; wherein performing the string filtering on the data stream to be matched, comprises: performing Hash operation on the keywords of the data stream to obtain Hash values of the keywords;determining whether the Hash mapping positions of the keywords of the data stream belong to the Hash mapping positions of the character words;acquiring the data stream that passes through the string filtering when the Hash mapping positions of the keywords of the data stream are the subset of the Hash mapping positions of the character words.
地址 Shenzhen CN