IP Library › Granted Patent US 8,413,124
Granted Patent B2
US 8,413,124 · App. 12/696,421 · Granted Apr 2, 2013

System and method for compiling and matching regular expressions

Inventor: Hao Wang (Shenzhen, CN)
Assignee: Huawei Technologies Co., Ltd.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,413,124
App. No.
12/696,421
Granted
Apr 2, 2013
Kind
B2
Abstract

A system and method for compiling and matching regular expressions is disclosed. The regular expression compiling system includes a syntax analyzing module and at least two types of compiling modules. The syntax analyzing module is configured to analyze syntactic characteristics of a regular expression and send the regular expression to an appropriate compiling module according to preset syntactic rules and the syntactic characteristics of the regular expression; and the appropriate compiling module is configured to receive the regular expression and compile the regular expression into a data structure of a specific form.

Claims (27)

1. A regular expression matching system, configured to match a received data packet by communicating with a regular expression compiling system, the regular expression compiling system comprising:

at least one processor;

a syntax analyzing module configured to analyze syntactic characteristics of a regular expression and send the regular expression to an appropriate compiler of at least two types of compilers according to preset syntactic rules and the syntactic characteristics of the regular expression; and

the at least two types of compilers configured to receive the regular expression and compile the regular expression into a data structure of a specific form according to preset rules; and

a category information library, wherein decision information generated by the syntax analyzing module is recorded in the category information library;

wherein the regular expression matching system comprises:

at least two types of matching modules, configured to match the received data packet according to the syntactic characteristics of the regular expression which the data packet is matched with and is compiled into the data structure of the specific form by the regular expression compiling system, wherein the at least two types of matching modules comprise a Deterministic Finite Automaton (DFA) adapter and a Perl Compatible Regular Expression (PCRE) adapter; and

a mediating module, configured to search category information in the category information library using the generated decision information associated with the regular expression to determine which adapter will perform matching according to a search result;

wherein, when the regular expression is compiled into a DFA transition table, the regular expression is sent to the DFA adapter;

when the regular expression is compiled into a PCRE segment, the regular expression is sent to the PCRE adapter.

2. The system of claim 1 , further comprising the mediating module configured to determine a processing sequence of the data packet by the at least two types of matching modules according to a preset rule, wherein inter-module linkage modes between the at least two types of matching modules comprise one-channel linkage, parallel linkage and serial linkage.

3. The system of claim 1 , further comprising an integrated output module, connected to the matching modules and configured to receive matching results outputted by the at least two types of matching modules; wherein the integrated output module comprises a cache configured to sort packet matching results.

4. The system of claim 3 , wherein the integrated output module makes data statistics on the matching results, and feeds the data statistics back to the syntax analyzing module; and

the syntax analyzing module updates the preset syntactic rules according to the data statistics and initiates a second compiling process.

5. A regular expression matching method, comprising:

receiving, by a regular expression matching engine, a data packet requiring matching from a front-end module;

searching, by a mediating module in the matching engine, a category information library for category information associated with a regular expression using a decision information for determining which adapter will perform matching according to a search result;

wherein, when the regular expression is compiled into a Deterministic Finite Automation (DFA) transition table the regular expression is sent to a DFA adapter;

when the regular expression is compiled into a Perl Compatible Regular Expression (PCRE) segment, the regular expression is sent to a PCRE adapter; and

matching, by the DFA adapter or the PCRE adapter which is determined by the mediating module, the data packet according to syntactic characteristics of the regular expressions which the data packet is matched with and is compiled into a data structure of a specific form by a regular expression compiling method;

wherein the regular expression compiling method comprising:

receiving a user-inputted regular expression rule which includes the regular expression and analyzing the syntax characteristics of the regular expression to generate the decision information and record in the category information library; and

sending the regular expression to an appropriate compiler of at least two types of compilers according to preset syntactic rules and the syntactic characteristics of the regular expression to compile the regular expression into the data structure of the specific form by the appropriate compiler according to preset rules.

6. The method of claim 5 , further comprising: determining a processing sequence of the data packet by the DFA adapter and the PCRE adapter according to a preset rule, wherein linkage modes of the DFA adapter and the PCRE adapter comprise one-channel linkage, parallel linkage and serial linkage.

7. The method of claim 6 , wherein the DFA adapter and the PCRE adapter send matching results uniformly to an integrated output module; the integrated output module comprises a cache configured to sort packet matching results.

8. The method of claim 7 , wherein the integrated output module makes data statistics on the matching results, and feeds the data statistics back to a syntax analyzing module; and

the syntax analyzing module updates the preset syntactic rules according to the data statistics and initiates a second compiling process.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 29, 2010
From: WANG, HAO
To: HUAWEI TECHNOLOGIES CO., LTD.
Reel/Frame 023871/0895 →
Priority Claims (1)
CN 2007 1 0075449 · Jul 30, 2007 · national
Continuity (2)
Continuation PCTCN2008071811 · Jul 30, 2008
Related Publication 20100131935A1 · May 27, 2010