Variable length data sequence backtracking a trie structure
First Claim
1. Method for retrieving a prefix match, a postfix match or a complete match, preferably the longest prefix- or postfix match, or all prefix- or postfix matches of a search argument (input key) from entries stored in a database with a trie-like structure having nodes (20), with each node containing first link information (21) leading to at least one previous node (parent pointer) and second link information (25,26) leading to at least one following node (child pointer), at least one stored key (entry,23,24), or a combination, thereof, said method comprising the steps ofentering at a node of said database (root node);
- determining a search path from one node to another through said trie-like database by successively processing segments of said search argument which comprise only those parts of the entries which are necessary to identify the next (child) node, and said second link information (25,26) until said segments are consumed or a (leaf) node lacking said second link information (25,26) is reached;
comparing with said search argument an entry stored in the node at which said search path ended; and
if no at least partial match between the search argument and said entry is found in said current node,backtracking said search path by processing said first link information (21) of said current node; and
repeating the previous two steps until said at least partial match is found or said root node is reached.
0 Assignments
0 Petitions
Accused Products
Abstract
The building, maintenance, and use of a database is described having a trie-like structure for storing entries and retrieving an at least partial match, preferably the longest partial match, or all partial matches of a search argument (input key) from said entries, said database having nodes (20), with each node containing first link information (21) leading to at least one previous node (parent pointer) and second link information (25,26) leading to at least one following node (child pointer), at least a stored key (entry, 23, 24), or a combination, thereof. The particular structure of the nodes allows a two-step search process, in which segments of a search argument are firstly used to determine a search path through the trie-like database, said search path being backtracked in the second part of the search. During the second part of the search the entire search argument is compared to entries stored in the nodes until a match is found. The described database allows an efficient use of memories and is advantageously applied to fast data retrieval, in particular related to communication within computer networks. No recursive procedures are applied.
-
Citations
13 Claims
-
1. Method for retrieving a prefix match, a postfix match or a complete match, preferably the longest prefix- or postfix match, or all prefix- or postfix matches of a search argument (input key) from entries stored in a database with a trie-like structure having nodes (20), with each node containing first link information (21) leading to at least one previous node (parent pointer) and second link information (25,26) leading to at least one following node (child pointer), at least one stored key (entry,23,24), or a combination, thereof, said method comprising the steps of
entering at a node of said database (root node); -
determining a search path from one node to another through said trie-like database by successively processing segments of said search argument which comprise only those parts of the entries which are necessary to identify the next (child) node, and said second link information (25,26) until said segments are consumed or a (leaf) node lacking said second link information (25,26) is reached; comparing with said search argument an entry stored in the node at which said search path ended; and
if no at least partial match between the search argument and said entry is found in said current node,backtracking said search path by processing said first link information (21) of said current node; and repeating the previous two steps until said at least partial match is found or said root node is reached. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. Database with a trie-like structure for storing entries and retrieving a prefix match, a postfix match or a complete match, preferably the longest prefix- or postfix match, or all prefix- or postfix matches of a search argument (input key) from said entries, said database having nodes (20) which contain first link information (21) leading to at least one previous node (parent pointer), second link information (25,26) leading to at least one following node (child pointer), two stored keys (entries,23,24), and an index (22) identifying a segment at which the two stored entries differ, said second link information (25,26) being processable for determining a search path from one node to another through said trie-like database by successively processing said segments and said entries being comparable with said search argument and if no prefix-, postfix- or complete match between said search argument and said entry is found in said node, said first link information (21) being processable for backtracking said search path.
-
10. Apparatus for storing entries and retrieving a prefix match, a postfix match or a complete match, preferably the longest prefix- or postfix match, or all prefix- or postfix matches of a search argument (input key) from said entries, said apparatus comprising
at least one memory unit (6) for storing said entries in nodes (20) of a trie-like structure, some of said nodes containing first link information (21) leading to at least one previous node (parent pointer) and second link information (25,26) leading to at least one following node (child pointer) and a stored key (entry,23,24) and an index, register means (2) for intermediately storing said search argument, a fetch unit (4) using said index for identifying and providing a segment of said search argument, a comparator unit (3) for comparing said segment of said search argument with the corresponding part of an entry stored in a node, and a search engine (5) for addressing and/or receiving entries stored in said memory, for determining a search path through said nodes depending on the output of said fetch unit (4), and for backtracking said search path depending on the output of said comparator unit (3) by comparing with said search argument an entry stored in the node at which said search path ends and if no prefix-, postfix-, or complete match between said search argument and said entry is found in said node, processing said first link information (21) of said node and repeating the previous two steps until said at least partial match is found or a root node is reached.
Specification