Intelligent graph walking
First Claim
1. A method for performing a search for a match of at least one expression in an input stream, the method comprising:
- generating a graph of expressions including a plurality of interconnected nodes, at least one ending node, and at least one starting node, the starting node including a comparison command and a location table, the location table including node position information of the at least one ending node and a value of a sub-string between the at least one starting node and the at least one ending node;
traversing the nodes of the graph to search for the match of the at least one expression in the input stream;
upon reaching the at least one starting node in the graph, detecting a common sub-string in the at least one expression and the sub-string value in the location table, using the comparison command; and
upon detection of the common sub-string, bypassing at least two consecutively interconnected nodes to reach the at least one ending node.
7 Assignments
0 Petitions
Accused Products
Abstract
An apparatus, and corresponding method, for performing a search for a match of at least one expression in an input stream is presented. A graph including a number of interconnected nodes is generated. A compiler may assign at least one starting node and at least one ending node. The starting node includes a location table with node position information of an ending node and a sub-string value associated with the ending node. Using the node position information and a string comparison function, intermediate nodes located between the starting and ending nodes may be bypassed. The node bypassing may reduce the number of memory accesses required to read the graph.
149 Citations
24 Claims
-
1. A method for performing a search for a match of at least one expression in an input stream, the method comprising:
-
generating a graph of expressions including a plurality of interconnected nodes, at least one ending node, and at least one starting node, the starting node including a comparison command and a location table, the location table including node position information of the at least one ending node and a value of a sub-string between the at least one starting node and the at least one ending node; traversing the nodes of the graph to search for the match of the at least one expression in the input stream; upon reaching the at least one starting node in the graph, detecting a common sub-string in the at least one expression and the sub-string value in the location table, using the comparison command; and upon detection of the common sub-string, bypassing at least two consecutively interconnected nodes to reach the at least one ending node. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10)
-
-
11. A processor configured to search for a match of at least one expression in an input stream, the processor comprising:
-
a compiler configured to generate a graph of expressions including a plurality of interconnected nodes, at least one ending node, and at least one starting node, the starting node including a comparison command and a location table, the location table including node position information of the at least one ending node and a value of a sub-string between the at least one starting node and the at least one ending node; a memory unit configured to store the graph; and a walker process configured to traverse the nodes of the graph to search for the match of the at least one expression in the input stream, upon reaching the at least one starting node, the walker process configured to detect a common sub-string in the at least one expression and the sub-string value in the location table, using the comparison command, and upon detection of the common sub-string, the walker process further being configured to bypass at least two consecutively interconnected nodes to reach the at least one ending node. - View Dependent Claims (12, 13, 14, 15, 16, 17)
-
-
18. A processor configured to search for a match of at least one expression in an input stream, the processor comprising:
-
means for generating a graph of expressions including a plurality of interconnected nodes, at least one ending node, and at least one starting node, the starting node including a comparison command and a location table, the location table including node position information of the at least one ending node and a value of a sub-string between the at least one starting node and the at least one ending node; means for traversing the nodes of the graph to search for the match of the at least one expression in the input stream; means for detecting, upon reaching the at least one starting node, a common sub-string in the at least one expression and the sub-string value in the location table, using the comparison command; and means for bypassing, upon detection of the common sub-string, at least two consecutively interconnected nodes to reach the at least one ending node.
-
-
19. A computer implemented method for traversing a deterministic finite automata-based graph comprising:
-
traversing nodes in the graph, with a walker process, to search for an expression in an input stream based on pointers to next nodes stored in a node; and upon detecting a string comparison match associated with at least one node, executing a bypass function identified by the string comparison to manage the walker process. - View Dependent Claims (20, 21)
-
-
22. A processor comprising:
-
a memory unit configured to store a graph having a plurality of nodes; and a content search mechanism, the content search mechanism comprising a walker that walks the plurality of nodes in the graph to search for an expression in an input stream by executing a string comparison function in at least one node to manage a bypass function of the walker. - View Dependent Claims (23)
-
-
24. A method for performing a search for a match for plural expressions in a string of characters, the method comprising:
-
generating a graph for the expressions, the graph including a plurality of interconnected nodes, each node having a location table comprising an array of next node pointers, each next node pointer indicating the next node for a particular character;
for at least one starting node in the graph, the location table further including at least one bypass node pointer indicating a bypass node for a common substring;traversing the graph to search for the expressions in an input stream based on the pointers stored in the location table at each node; and upon reaching a starting node in the graph, bypassing, with the bypass node pointer, intermediate nodes if the corresponding substring matches.
-
Specification