WO2011091581A1 - 关键字存储、查找的方法及装置 - Google Patents
关键字存储、查找的方法及装置 Download PDFInfo
- Publication number
- WO2011091581A1 WO2011091581A1 PCT/CN2010/070364 CN2010070364W WO2011091581A1 WO 2011091581 A1 WO2011091581 A1 WO 2011091581A1 CN 2010070364 W CN2010070364 W CN 2010070364W WO 2011091581 A1 WO2011091581 A1 WO 2011091581A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- keyword
- hash bucket
- compressed
- pointer
- hash
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 230000006870 function Effects 0.000 claims abstract description 48
- 230000006835 compression Effects 0.000 claims description 40
- 238000007906 compression Methods 0.000 claims description 40
- 238000000151 deposition Methods 0.000 claims 1
- 230000008569 process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 230000009467 reduction Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/901—Indexing; Data structures therefor; Storage structures
- G06F16/9014—Indexing; Data structures therefor; Storage structures hash tables
Definitions
- Keyword storage search method and device
- the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for storing and searching keywords. Background technique
- Hash-based exact matching algorithms are widely used in various fields. Low latency, low probability of collision and high performance are the goals that everyone pursues.
- the prior art provides a scheme for achieving an exact match lookup by a secondary hash algorithm.
- two hash functions are used for a keyword (key) that performs an exact match lookup.
- an initial hash bucket address can be obtained.
- the initial hash bucket contains a number of compressed key units and a linked list pointer.
- Each compressed keyword unit consists of a compressed keyword and a keyword pointer.
- a valid cascading list pointer points to a cascading hash bucket.
- the data structure of the cascaded hash bucket is consistent with the initial hash bucket.
- the obtained compressed keyword is compared with the valid compressed keyword stored in the initial hash bucket and/or the concatenated hash bucket as follows: If there is no matching compression keyword in the initial hash bucket and the corresponding linked list, then Check if there is a valid concatenated hash bucket pointer, and compare whether there is a valid matching compression keyword in the concatenated hash bucket;
- the embodiment of the invention provides a method for storing a keyword, which is used to save storage space and bandwidth.
- the method includes:
- the keyword is subjected to a first hash function operation to obtain an address of the first hash bucket; and the first hash bucket is searched according to the address of the first hash bucket;
- the keyword is operated by the second hash function to obtain an address of the second hash bucket; and the second hash bucket is searched according to the address of the second hash bucket;
- the compressed keyword of the keyword is obtained by the keyword through a third hash function operation, and the shell IJ:
- the compressed keyword of the keyword and the pointer of the keyword are stored in the first hash bucket;
- Compressing the keyword when there is no remaining space in the first hash bucket, there is remaining space in the second hash bucket, and there is no compressed keyword in the second hash bucket that conflicts with the compression keyword of the keyword The keyword and the pointer of the keyword are stored in the second hash bucket.
- the embodiment of the present invention further provides a method for searching for a keyword, which is used to reduce the search delay and improve the search efficiency.
- the search method includes:
- the embodiment of the present invention further provides a storage device for a keyword, which is used to save storage space and bandwidth.
- the device includes:
- a first hash bucket search module configured to: use a first hash function to obtain an address of the first hash bucket; and find a first hash bucket according to an address of the first hash bucket;
- a second hash bucket search module configured to: calculate, by the second hash function, the address of the second hash bucket; and find the second hash bucket according to the address of the second hash bucket;
- a first determining module configured to determine, in the first hash bucket, a compressed keyword that does not conflict with a compression keyword of the keyword, where the compressed keyword of the keyword passes the third hash function of the keyword Obtain an operation
- a first storage module configured to store the compressed keyword of the keyword and the pointer of the keyword into the first hash bucket when the first hash bucket has a remaining space
- a second storage module configured to: when there is no remaining space in the first hash bucket, there is a remaining space in the second hash bucket, and there is no compressed keyword in the second hash bucket that conflicts with the compression keyword of the keyword,
- the compressed keyword of the keyword and the pointer of the keyword are stored in a second hash bucket.
- the embodiment of the present invention further provides a keyword searching device, which is used to reduce the search delay and improve the search efficiency.
- the keywords in the search device are stored by the storage device of the keyword, and the search device includes:
- a first keyword search module configured to search for the keyword or the compressed keyword of the keyword in the TCAM
- a second keyword search module configured to search for compression of the keyword in the first hash bucket when the first keyword search module does not find the keyword or the compressed keyword of the keyword Keyword
- a third keyword search module configured to search for a compressed keyword of the keyword in the second hash bucket when the second keyword search module does not find the compressed keyword of the keyword.
- the keyword is operated by the first hash function to obtain the address of the first hash bucket; according to the address of the first hash bucket, the first hash bucket is searched; Hash letter a number operation, obtaining an address of the second hash bucket; searching for the second hash bucket according to the address of the second hash bucket; different from the prior art, obtaining the initial hash bucket address by only one hash function, by initial The intermediate bucket linked list pointer points to the cascade hash bucket, but the hash bucket of the address obtained by different hash functions is used to complete the storage operation of the keyword, thereby greatly improving memory utilization and saving storage space.
- the two hash buckets obtained by the keyword through different hash function operations can adopt different depths, which can increase storage flexibility; in addition, storage in the first hash bucket or the second hash bucket
- the compression keyword conflict judgment performed on the keyword can also avoid the situation where the compression keyword conflict occurs in the first hash bucket or the second hash bucket.
- the compressed keyword of the keyword or the keyword is searched in the TCAM, and if the search can be found, the first hash bucket and/or the second hash bucket can be avoided, so that the search delay is greatly increased. Reduced, search efficiency is effectively improved.
- Figure 1 is a key point in the embodiment of the present invention
- FIG. 3 is a key point in the embodiment of the present invention.
- FIG. 4 is a key point in the embodiment of the present invention.
- FIG. 6, and FIG. 7 are schematic diagrams showing the structure of a key storage device according to an embodiment of the present invention
- FIG. 8 and FIG. 9 are schematic diagrams showing the structure of a keyword search device according to an embodiment of the present invention.
- a processing flow of a keyword storage method may include:
- Step 101 Perform a first hash function on the keyword to obtain an address of the first hash bucket; and find a first hash bucket according to an address of the first hash bucket;
- Step 102 The second hash function is obtained by the second hash function, and the second hash bucket is searched according to the address of the second hash bucket.
- Step 103 If there is no compressed keyword in the first hash bucket that conflicts with the compressed keyword of the keyword, the compressed keyword of the keyword is obtained by the keyword through a third hash function operation. Determining whether the first hash bucket has remaining space, and if so, proceeding to step 104; if not, proceeding to step 105;
- Step 104 Store a compressed keyword of the keyword and a pointer of the keyword into a first hash bucket
- Step 105 When there is a remaining space in the second hash bucket and there is no compressed keyword in the second hash bucket that conflicts with the compression keyword of the keyword, the compressed keyword of the keyword and the The pointer to the keyword is stored in the second hash bucket.
- the keyword is operated by the first hash function to obtain the address of the first hash bucket; and the first hash is searched according to the address of the first hash bucket.
- a bucket performing the second hash function operation to obtain an address of the second hash bucket; searching for the second hash bucket according to the address of the second hash bucket; different from the prior art, only one
- the Greek function obtains the initial hash bucket address, and the initial hash bucket intermediate chain table pointer points to the cascade hash bucket, but completes the storage of the keyword by two hash buckets that respectively obtain addresses by different hash functions.
- the two hash buckets obtained by keywords through different hash function operations can adopt different depths, which can increase storage flexibility.
- the compression keyword conflict determination performed when the first hash bucket or the second hash bucket stores the keyword may also avoid the occurrence of a compression keyword conflict in the first hash bucket or the second hash bucket.
- step 101 and step 102 the keyword is subjected to a first hash function operation to obtain an address of the first hash bucket; and the keyword is subjected to a second hash function operation to obtain an address of the second hash bucket.
- the first hash function and the second hash function are different hash functions, and the keywords are operated by the two different hash functions to obtain two different hash bucket addresses,
- the specific settings of the hash functions can be known using the prior art.
- the first hash bucket can be found according to the address of the first hash bucket; the second hash bucket can be found according to the address of the second hash bucket, so that steps 103 to 105 can be performed, in the first hash.
- the key is stored in the bucket or the second hash bucket.
- the compressed keyword of the keyword to be stored may be obtained by the keyword through a third hash function, and the specific setting of the third hash function may also be known by using the prior art.
- TCAM Ternary Content Addressable Memory
- Address memory store operations on keywords.
- TCAM can store pointers to complete keywords and keywords, and can also store keywords for keywords and keywords for saving storage space.
- Gp can be implemented as:
- the keyword and the pointer of the keyword are stored in the TCAM, or the key of the keyword is compressed.
- a word and a pointer to the keyword are stored in the TCAM;
- the second hash bucket has compression that conflicts with the compressed keyword of the keyword Keyword
- the pointer and the pointer of the keyword are stored in the TCAM, or the compressed keyword of the keyword and the pointer of the keyword are stored in the TCAM;
- the keyword and the pointer of the keyword are stored in the TCAM, or the compressed keyword and the keyword of the keyword are A pointer to the keyword is stored in the TCAM.
- the method for storing the keyword may further include:
- the compressed keyword and the corresponding keyword pointer are moved to the first hash bucket;
- the compressed keyword and the corresponding keyword pointer are moved to the second hash bucket.
- the compressed keyword of the keyword deleted in the first hash bucket or the second hash bucket and the pointer of the keyword may no longer conflict;
- the TCAM scan moves the conflicting compression keyword and the corresponding keyword pointer from the TCAM to the first hash bucket or the second hash bucket, which can effectively save the TCAM space and avoid the TCAM available after repeated deletion. The reduction of space.
- the embodiment of the present invention further provides a method for searching for a keyword, where the keyword in the search method is stored according to the storage method of the keyword, and the searching method may include: Step 201: The compression key step 202 of searching for the keyword or the keyword in the TCAM, if the keyword or the compressed keyword of the keyword is not found in the TCAM, then in the first hash bucket Find the compressed keyword of the keyword;
- Step 203 If the compressed keyword of the keyword is still not found in the first hash bucket, search for the compressed keyword of the keyword in the second hash bucket.
- the lookup delay can also be stabilized at a fixed value.
- the key corresponding to the compressed keyword may be further selected. The word pointer looks for the complete keyword to determine if it can really find the keyword you are looking for.
- the keyword is searched for by the keyword pointer corresponding to the compressed keyword; if not found, Searching for the compressed keyword of the keyword in the second hash bucket; if the compressed keyword of the keyword is found in the second hash bucket, searching for the keyword pointer corresponding to the compressed keyword The keyword.
- the compressed keyword of the keyword may also be moved to In the TCAM, this ensures that the first hash bucket and the second hash bucket are not accessed during the next search, thereby improving the efficiency of the search.
- FIG. 3 is a schematic diagram of a storage method and a search method of the above keywords.
- the hash bucket in FIG. 3 includes: a first hash bucket (HT1) and a second hash bucket (HT2); and the first hash bucket, the second hash bucket, and the TCAM are also shown in FIG.
- the full keyword pointed to by the keyword pointer which is stored in a full keyword bucket (KT).
- the hash bucket communicates with the lookup engine through the storage interface 0; the full key bucket communicates with the lookup engine through the storage interface 1; the lookup engine communicates with the TCAM; and the TCAM communicates with the SRAM.
- the operation process of the keyword is completed by the first hash bucket, the second hash bucket, and the TCAM.
- the bucket depth of the first hash bucket and the second hash bucket may be different.
- FIG. 4 specifically shows the pointers of the first hash bucket, the second hash bucket, and the TCAM stored in FIG. 3, the compression keywords, and the keywords.
- the first hash bucket and the second hash bucket each store a compressed keyword and a corresponding keyword pointer, and the pointer of the keyword also points to the complete keyword in the complete keyword bucket.
- a pointer to a keyword and a keyword is stored in the TCAM.
- a storage device and a search device for keywords are also provided in the embodiment of the present invention, as described in the following embodiments. Since the principle of solving the problems of the devices is similar to the keyword storage method and the searching method, the implementation of the devices can be referred to the implementation of the method, and the repeated description is not repeated.
- the storage device of the keyword in the embodiment of the present invention may include: a first hash bucket search module 501, configured to perform a first hash function operation on the keyword to obtain an address of the first hash bucket. Find the first hash bucket according to the address of the first hash bucket;
- a second hash bucket search module 502 configured to: calculate, by the second hash function, the address of the second hash bucket; and find the second hash bucket according to the address of the second hash bucket;
- the first determining module 503 is configured to determine, in the first hash bucket, that there is no compressed keyword that conflicts with the compressed keyword of the keyword, where the compressed keyword of the keyword passes the third hash of the keyword Function calculation obtained;
- the first storage module 504 is configured to: when the first hash bucket has a remaining space, store the compressed keyword of the keyword and the pointer of the keyword into the first hash bucket;
- the second storage module 505 is configured to: when there is no remaining space in the first hash bucket, there is a remaining space in the second hash bucket, and there is no compression keyword in the second hash bucket that conflicts with the compression keyword of the keyword And storing the compressed keyword of the keyword and the pointer of the keyword into the second hash bucket.
- the storage device of the keyword shown in FIG. 5 may further include: a second determining module 601, configured to determine that the first hash bucket has a compression keyword of the keyword a conflicting compression keyword; a third storage module 602, configured to store the keyword and the pointer of the keyword into the TCAM, or store the compressed keyword of the keyword and the pointer of the keyword into the TCAM; Or the second determining module 601 is configured to determine that there is no compressed keyword in the first hash bucket that conflicts with the compressed keyword of the keyword, and there is no remaining space, and the second hash bucket has the key and the key The compression keyword of the word conflicts with the compressed keyword; the third storage module 602 is configured to store the keyword and the pointer of the keyword into the TCAM, or compress the keyword of the keyword and The pointer of the keyword is stored in the TCAM;
- the second determining module 601 is configured to determine that the first hash bucket and the second hash bucket have no remaining space;
- the third storage module 602 is configured to save the keyword and the pointer of the keyword Entering the TCAM, or storing the compressed keyword of the keyword and the pointer of the keyword into the TCAMo
- the storage device of the keyword shown in FIG. 6 may further include: a first moving module 701, configured to have a compression keyword in the first hash bucket in the TCAM.
- a first moving module 701 configured to have a compression keyword in the first hash bucket in the TCAM.
- the embodiment of the present invention further provides a keyword searching device.
- the searched keyword is stored by a storage device of the keyword shown in FIG. 6 or FIG. 7, and the searching device may include:
- a first keyword search module 801 configured to search for the keyword or the compressed keyword of the keyword in the TCAM
- the second keyword search module 802 is configured to: when the first keyword search module 801 does not find the compressed keyword of the keyword, search for the compression key of the keyword in the first hash bucket.
- the keyword search module 803 is configured to search for a compression key of the keyword in the second hash bucket when the second keyword search module 802 does not find the compressed keyword of the keyword.
- the two keyword lookup module 802 can also be used to: When the compressed keyword of the keyword is found in the first hash bucket, the keyword is searched for by the keyword pointer corresponding to the compressed keyword;
- the third keyword search module 803 is further configured to: when the second keyword search module 802 does not find the keyword, search for a compressed keyword of the keyword in the second hash bucket; When the compressed keyword of the keyword is found in the bucket, the keyword is searched for by the keyword pointer corresponding to the compressed keyword.
- the search device of the keyword shown in FIG. 8 may further include: a second moving module 901, configured to search for the first hash bucket in the second keyword search module. a compressed keyword of the keyword, and when the third keyword search module finds the compressed keyword of the keyword in the second hash bucket, the compressed keyword of the keyword and the keyword The pointer is moved to the TCAM.
- a second moving module 901 configured to search for the first hash bucket in the second keyword search module. a compressed keyword of the keyword, and when the third keyword search module finds the compressed keyword of the keyword in the second hash bucket, the compressed keyword of the keyword and the keyword The pointer is moved to the TCAM.
- the keyword is operated by the first hash function to obtain the address of the first hash bucket; according to the address of the first hash bucket, the first hash bucket is searched; a hash function operation, obtaining an address of the second hash bucket; searching for the second hash bucket according to the address of the second hash bucket; different from the prior art, obtaining the initial hash bucket address by only one hash function,
- the initial hash bucket intermediate chain table pointer points to the cascade hash bucket, but the hash bucket of the address is independently obtained by different hash functions to complete the storage operation of the keyword, thereby greatly improving memory utilization and saving Storage space and bandwidth; and, two hash buckets obtained by keywords through different hash function operations can adopt different depths, which can increase storage flexibility; in addition, in the first hash bucket or the second hash
- the compression keyword conflict judgment performed when the bucket stores the keyword can also avoid the situation where the compression keyword conflict occurs in the first hash bucket or the second hash bucket.
- the TCAM is introduced to store the keyword, and the compression keyword conflict in the hash bucket may be further avoided, and in the keyword search method, the key is first searched in the TCAM. If the word or keyword compression keyword can be found, it can avoid finding the first hash bucket and/or the second hash bucket, so that the search delay is greatly reduced, and the search efficiency is effectively improved. In addition, there will be no conflicting compressed keywords and corresponding keyword pointers from The TCAM can be moved to the hash bucket, which can effectively save the TCAM space and avoid the reduction of the available space of the TCAM after repeated deletion.
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
公开了一种关键字的存储方法,该方法包括:将关键字分别经第一哈希函数、第二哈希函数运算,获得第一哈希桶、第二哈希桶的地址;根据第一哈希桶、第二哈希桶的地址,查找第一哈希桶、第二哈希桶;若第一哈希桶中没有与该关键字的压缩关键字相冲突的压缩关键字,则:在第一哈希桶有剩余空间时,将该关键字的压缩关键字及该关键字的指针存入第一哈希桶;在第一哈希桶没有剩余空间、第二哈希桶有剩余空间且第二哈希桶中没有与该关键字的压缩关键字相冲突的压缩关键字时,将该关键字的压缩关键字及该关键字的指针存入第二哈希桶。同时公开一种关键字的查找方法、存储装置和查找装置。可以大大提高内存利用率,节省存储空间和带宽。
Description
关键字存储、 查找的方法及装置 技术领域
本发明涉及通信技术领域, 尤其涉及关键字存储、 查找的方法及装置。 背景技术
基于哈希 (hash ) 的精确匹配算法在各领域均有广泛应用。 低延时、 低 冲突概率和高性能是大家追求的目标。
现有技术提供了一种通过二次哈希算法实现精确匹配查找的方案。 该方 案中, 对于一个进行精确匹配查找的关键字 (key ) , 使用两个哈希函数。
通过哈希函数 1运算, 可以得到一个初始哈希桶地址, 初始哈希桶中包 含若干压缩关键字单元和一个级连链表指针。 每个压缩关键字单元由一个压 缩关键字和一个关键字指针构成。 有效的级连链表指针指向一个级连哈希 桶。 级连哈希桶的数据结构与初始哈希桶一致。
通过哈希函数 2运算, 可以得到一个压缩关键字。 将得到的压缩关键字 与初始哈希桶和 /或级连哈希桶中存储的有效的压缩关键字进行如下比较: 如果初始哈希桶及相应的链表中没有匹配的压缩关键字, 则需要检查是 否有有效的级连哈希桶指针, 并比较级连哈希桶中是否存在有效的匹配的压 缩关键字;
如果所有关联的哈希桶中都没有匹配的压缩关键字, 则说明本次查找没 有命中; 如果有有效的匹配的压缩关键字, 则需要一一检查对应的完整关键 字是否匹配, 直至遍历结束或找到匹配的完整关键字;
如果所有有效匹配的压缩关键字对应的完整关键字都不匹配, 说明本次 查找没有命中; 如果查到有匹配的完整关键字, 则说明本次查找命中, 查找 结束。
发明人在实现本发明的过程中, 发现上述现有技术存在如下不足:
哈希函数 1的冲突会导致初始哈希桶中需要保存较多表项才能达到减少 级连哈希桶的目的。 但是初始哈希桶的桶深过深会导致存储空间和带宽的浪 费。 哈希函数 2的冲突会导致压缩关键字冲突, 需要多次访问哈希桶才能完 成查找, 这样会增加查找延时。 发明内容
本发明实施例提供一种关键字的存储方法, 用以节约存储空间和带宽, 该方法包括:
将关键字经第一哈希函数运算, 获得第一哈希桶的地址; 根据第一哈希 桶的地址, 查找第一哈希桶;
将所述关键字经第二哈希函数运算, 获得第二哈希桶的地址; 根据第二 哈希桶的地址, 查找第二哈希桶;
若第一哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈希函数运算获得, 贝 IJ :
在第一哈希桶有剩余空间时, 将所述关键字的压缩关键字及所述关键字 的指针存入第一哈希桶;
在第一哈希桶没有剩余空间、 第二哈希桶有剩余空间且第二哈希桶中没 有与所述关键字的压缩关键字相冲突的压缩关键字时, 将所述关键字的压缩 关键字及所述关键字的指针存入第二哈希桶。
本发明实施例还提供一种关键字的查找方法, 用以降低查找延时, 提高 查找效率, 该查找方法包括:
在所述 TCAM 中查找所述关键字或所述关键字的压缩关键字; 若未查找 到, 则:
在第一哈希桶中查找所述关键字的压缩关键字; 若未查找到, 贝 IJ : 在第二哈希桶中查找所述关键字的压缩关键字。
本发明实施例还提供一种关键字的存储装置, 用以节约存储空间和带 宽, 该装置包括:
第一哈希桶查找模块, 用于将关键字经第一哈希函数运算, 获得第一哈 希桶的地址; 根据第一哈希桶的地址, 查找第一哈希桶;
第二哈希桶查找模块, 用于将所述关键字经第二哈希函数运算, 获得第 二哈希桶的地址; 根据第二哈希桶的地址, 查找第二哈希桶;
第一确定模块, 用于确定第一哈希桶中没有与所述关键字的压缩关键字 相冲突的压缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈希函 数运算获得;
第一存储模块, 用于在第一哈希桶有剩余空间时, 将所述关键字的压缩 关键字及所述关键字的指针存入第一哈希桶;
第二存储模块, 用于在第一哈希桶没有剩余空间、 第二哈希桶有剩余空 间且第二哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键字时, 将所述关键字的压缩关键字及所述关键字的指针存入第二哈希桶。
本发明实施例还提供一种关键字的查找装置, 用以降低查找延时, 提高 查找效率, 该查找装置中的关键字由上述关键字的存储装置进行存储, 该查 找装置包括:
第一关键字查找模块, 用于在所述 TCAM 中查找所述关键字或所述关键 字的压缩关键字;
第二关键字查找模块, 用于在所述第一关键字查找模块未查找到所述关 键字或所述关键字的压缩关键字时, 在第一哈希桶中查找所述关键字的压缩 关键字;
第三关键字查找模块, 用于在所述第二关键字查找模块未查找到所述关 键字的压缩关键字时, 在第二哈希桶中查找所述关键字的压缩关键字。
本发明实施例中, 将关键字经第一哈希函数运算, 获得第一哈希桶的地 址; 根据第一哈希桶的地址, 查找第一哈希桶; 将所述关键字经第二哈希函
数运算, 获得第二哈希桶的地址; 根据第二哈希桶的地址, 查找第二哈希 桶; 不同于现有技术中仅通过一个哈希函数获得初始哈希桶地址, 由初始哈 希桶中级连链表指针指向级连哈希桶, 而是通过两个由不同哈希函数独立获 取地址的哈希桶, 来完成对关键字的存储操作, 从而大大提高内存利用率, 节省存储空间和带宽; 并且, 由关键字经不同哈希函数运算获得地址的两个 哈希桶可以采用不同的深度, 可以增加存储的灵活性; 另外, 在第一哈希桶 或第二哈希桶存储关键字时进行的压缩关键字冲突判断, 也可以避免第一哈 希桶或第二哈希桶中出现压缩关键字冲突的情况。
本发明实施例中, 先在 TCAM 中查找关键字或关键字的压缩关键字, 若 能够查找到, 则可以避免查找第一哈希桶和 /或第二哈希桶, 从而使查找延 时大幅降低, 查找效率得以有效提高。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下 , 还可以根据这些附图获得其他的附图。 在 附图中:
图 1为本发明实施例中关键
图 2为本发明实施例中关键
图 3为本发明实施例中关键
图 4为本发明实施例中关键
图 5、 图 6、 图 7为本发明实施例中关键字的存储装置的结构示意图; 图 8、 图 9为本发明实施例中关键字的查找装置的结构示意图。 具体实施方式
为使本发明实施例的目的、 技术方案和优点更加清楚明白, 下面结合附 图对本发明实施例做进一歩详细说明。 在此, 本发明的示意性实施例及其说 明用于解释本发明, 但并不作为对本发明的限定。
如图 1 所示, 本发明实施例中, 关键字的存储方法的处理流程可以包 括:
歩骤 101、 将关键字经第一哈希函数运算, 获得第一哈希桶的地址; 根 据第一哈希桶的地址, 查找第一哈希桶;
歩骤 102、 将所述关键字经第二哈希函数运算, 获得第二哈希桶的地 址; 根据第二哈希桶的地址, 查找第二哈希桶;
歩骤 103、 若第一哈希桶中没有与所述关键字的压缩关键字相冲突的压 缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈希函数运算获 得, 确定第一哈希桶是否有剩余空间, 若是, 则转入歩骤 104; 若否, 则转 入歩骤 105;
歩骤 104、 将所述关键字的压缩关键字及所述关键字的指针存入第一哈 希桶;
歩骤 105、 在第二哈希桶有剩余空间且第二哈希桶中没有与所述关键字 的压缩关键字相冲突的压缩关键字时, 将所述关键字的压缩关键字及所述关 键字的指针存入第二哈希桶。
由图 1所示流程可以得知, 本发明实施例中, 将关键字经第一哈希函数 运算, 获得第一哈希桶的地址; 根据第一哈希桶的地址, 查找第一哈希桶; 将所述关键字经第二哈希函数运算, 获得第二哈希桶的地址; 根据第二哈希 桶的地址, 查找第二哈希桶; 不同于现有技术中仅通过一个哈希函数获得初 始哈希桶地址, 由初始哈希桶中级连链表指针指向级连哈希桶, 而是通过两 个由不同哈希函数独立获取地址的哈希桶, 来完成对关键字的存储操作, 从 而大大提高内存利用率, 节省存储空间和带宽; 并且, 由关键字经不同哈希 函数运算获得地址的两个哈希桶可以采用不同的深度, 可以增加存储的灵活
性; 另外, 在第一哈希桶或第二哈希桶存储关键字时进行的压缩关键字冲突 判断, 也可以避免第一哈希桶或第二哈希桶中出现压缩关键字冲突的情况。
图 1中歩骤 101和歩骤 102的执行先后顺序并不影响本发明实施例的具 体实施。 歩骤 101和歩骤 102中, 将关键字经第一哈希函数运算, 可以获得 第一哈希桶的地址; 将关键字经第二哈希函数运算, 可以获得第二哈希桶的 地址; 此处, 第一哈希函数和第二哈希函数为不同的哈希函数, 将关键字经 这两个不同的哈希函数进行运算, 可以获得两个不同的哈希桶地址, 这两个 哈希函数的具体设定利用现有技术即可得知。 根据第一哈希桶的地址可以查 找到第一哈希桶; 根据第二哈希桶的地址可以查找到第二哈希桶, 从而可以 实施歩骤 103至歩骤 105, 在第一哈希桶或第二哈希桶中, 对关键字进行存 储操作。 具体实施时, 待存储的关键字的压缩关键字, 可以由关键字经第三 哈希函数运算获得, 第三哈希函数的具体设定利用现有技术也可得知。
为了更进一歩地避免存储时第一哈希桶或第二哈希桶中出现压缩关键字 冲突的情况, 另一实施例中, 还可以引入 TCAM ( Ternary Content Addressable Memory , 三进制内容可寻址存储器) , 对关键字进行存储操 作。 当然, TCAM 中可以存储完整的关键字和关键字的指针, 也可以为节省 存储空间的目的, 存储关键字的压缩关键字和关键字的指针。 gp, 具体可实 施为:
若第一哈希桶中有与所述关键字的压缩关键字相冲突的压缩关键字, 则 将所述关键字及所述关键字的指针存入 TCAM, 或将所述关键字的压缩关键 字及所述关键字的指针存入所述 TCAM;
或, 若第一哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键 字且没有剩余空间、 第二哈希桶中有与所述关键字的压缩关键字相冲突的压 缩关键字, 则将所述关键字及所述关键字的指针存入所述 TCAM, 或将所述 关键字的压缩关键字及所述关键字的指针存入所述 TCAM;
或, 若第一哈希桶和第二哈希桶均没有剩余空间, 则将所述关键字及所 述关键字的指针存入所述 TCAM, 或将所述关键字的压缩关键字及所述关键 字的指针存入所述 TCAM。
一个实施例中, 上述关键字的存储方法还可以包括:
若所述 TCAM 中有与第一哈希桶中压缩关键字不相冲突的压缩关键字, 则将该压缩关键字及对应的关键字指针搬移到第一哈希桶中;
若所述 TCAM 中有与第二哈希桶中压缩关键字不相冲突的压缩关键字, 则将该压缩关键字及对应的关键字指针搬移到第二哈希桶中。
例如, 当在第一哈希桶或第二哈希桶中删除的关键字的压缩关键字及关 键字的指针达到一定数量时, 原冲突的压缩关键字可能已不再冲突; 此时可 以启动 TCAM 扫描, 将不再存在冲突的压缩关键字及对应的关键字指针从 TCAM搬移到第一哈希桶或第二哈希桶中, 这样可以有效的节约 TCAM空间, 避免反复添加删除后 TCAM可用空间的降低。
如图 2所示, 本发明实施例中还提供一种关键字的查找方法, 该查找方 法中的关键字按前述关键字的存储方法进行存储, 该查找方法可以包括: 歩骤 201、 在所述 TCAM 中查找所述关键字或所述关键字的压缩关键 歩骤 202、 若在所述 TCAM 中未查找到所述关键字或所述关键字的压缩 关键字, 则在第一哈希桶中查找所述关键字的压缩关键字;
歩骤 203、 若在第一哈希桶中仍未查找到所述关键字的压缩关键字, 则 在第二哈希桶中查找所述关键字的压缩关键字。
由图 2所示流程可以得知, 本发明实施例中, 按前述关键字的存储方法 存储关键字后, 先在 TCAM 中查找关键字或关键字的压缩关键字, 若能够查 找到, 则可以避免查找第一哈希桶和 /或第二哈希桶, 从而使查找延时大幅 降低, 查找效率得以有效提高。 具体实施时, 查找延时还可以稳定在一个固 定值。
当然, 实施过程中, 为了提高查找的准确性, 在第一哈希桶和 /或第二 哈希桶中查找到关键字的压缩关键字后, 还可以进一歩按该压缩关键字对应 的关键字指针查找完整的关键字, 以确定是否真正能够找到要找的关键字。
一个实施例中, 若在第一哈希桶中查找到所述关键字的压缩关键字, 则 进一歩按该压缩关键字对应的关键字指针查找所述关键字; 若未查找到, 则 在第二哈希桶中查找所述关键字的压缩关键字; 若在第二哈希桶中查找到所 述关键字的压缩关键字, 则进一歩按该压缩关键字对应的关键字指针查找所 述关键字。
查找过程中, 若在第一哈希桶和第二哈希桶中均查找到所述关键字的压 缩关键字, 还可以将所述关键字的压缩关键字及所述关键字的指针搬移到所 述 TCAM 中, 这样可以保证下次查找时不会既访问第一哈希桶又访问第二哈 希桶, 从而进一歩提高查找的效率。
下面结合图例综合说明上述实施例中关键字的存储方法和查找方法。 图 3为上述关键字的存储方法和查找方法的示意图。 图 3中的哈希桶包括: 第 一哈希桶 (HT1 ) 、 第二哈希桶 (HT2 ) ; 图 3中还示出了第一哈希桶、 第二 哈希桶和 TCAM 中存储的关键字指针指向的完整关键字, 这些完整关键字存 储于一个完整关键字桶 (KT ) 。 哈希桶通过存储接口 0 与查找引擎相互通 信; 完整关键字桶通过存储接口 1 与查找引擎相互通信; 查找引擎与 TCAM 相互通信; TCAM与 SRAM相互通信。 如图 3所示, 由第一哈希桶、 第二哈希 桶和 TCAM配合完成对关键字的操作过程。 第一哈希桶和第二哈希桶的桶深 可以不同。
图 4具体示出了图 3所示第一哈希桶、 第二哈希桶和 TCAM所存储的关 键字、 压缩关键字和关键字的指针。 其中, 第一哈希桶和第二哈希桶中均存 储有压缩关键字和对应关键字指针, 关键字的指针还指向完整关键字桶中完 整的关键字。 TCAM中存储有关键字和关键字的指针。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分歩骤 是可以通过程序来指令相关的硬件完成, 所述的程序可以存储于一计算机可 读取存储介质中, 该程序在执行时, 可以包括上述实施例方法中的全部或部 分歩骤, 所述的存储介质可以包括: R0M、 RAM, 磁盘、 光盘等。
本发明实施例中还提供了一种关键字的存储装置和查找装置, 如下面的 实施例所述。 由于该些装置解决问题的原理与关键字存储方法和查找方法相 似, 因此该些装置的实施可以参见方法的实施, 重复之处不再赘述。
如图 5所示, 本发明实施例中的关键字的存储装置可以包括: 第一哈希桶查找模块 501, 用于将关键字经第一哈希函数运算, 获得第 一哈希桶的地址; 根据第一哈希桶的地址, 查找第一哈希桶;
第二哈希桶查找模块 502, 用于将所述关键字经第二哈希函数运算, 获 得第二哈希桶的地址; 根据第二哈希桶的地址, 查找第二哈希桶;
第一确定模块 503, 用于确定第一哈希桶中没有与所述关键字的压缩关 键字相冲突的压缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈 希函数运算获得;
第一存储模块 504, 用于在第一哈希桶有剩余空间时, 将所述关键字的 压缩关键字及所述关键字的指针存入第一哈希桶;
第二存储模块 505, 用于在第一哈希桶没有剩余空间、 第二哈希桶有剩 余空间且第二哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键字 时, 将所述关键字的压缩关键字及所述关键字的指针存入第二哈希桶。
如图 6所示, 一个实施例中, 图 5所示关键字的存储装置还可以包括: 第二确定模块 601, 用于确定第一哈希桶中有与所述关键字的压缩关键 字相冲突的压缩关键字; 第三存储模块 602, 用于将所述关键字及所述关键 字的指针存入 TCAM, 或将所述关键字的压缩关键字及所述关键字的指针存 入所述 TCAM;
或, 所述第二确定模块 601用于确定第一哈希桶中没有与所述关键字的 压缩关键字相冲突的压缩关键字且没有剩余空间、 第二哈希桶中有与所述关 键字的压缩关键字相冲突的压缩关键字; 所述第三存储模块 602用于将所述 关键字及所述关键字的指针存入所述 TCAM, 或将所述关键字的压缩关键字 及所述关键字的指针存入所述 TCAM;
或, 所述第二确定模块 601用于确定第一哈希桶和第二哈希桶均没有剩 余空间; 所述第三存储模块 602用于将所述关键字及所述关键字的指针存入 所述 TCAM , 或将所述关键字的压缩关键字及所述关键字的指针存入所述 TCAMo
如图 7所示, 一个实施例中, 图 6所示关键字的存储装置还可以包括: 第一搬移模块 701, 用于在所述 TCAM 中有与第一哈希桶中压缩关键字 不相冲突的压缩关键字时, 将该压缩关键字及对应的关键字指针搬移到第一 哈希桶中; 在所述 TCAM 中有与第二哈希桶中压缩关键字不相冲突的压缩关 键字时, 将该压缩关键字及对应的关键字指针搬移到第二哈希桶中。
如图 8所示, 本发明实施例中还提供一种关键字的查找装置, 所查找的 关键字由图 6 或图 7 所示关键字的存储装置进行存储, 该查找装置可以包 括:
第一关键字查找模块 801, 用于在所述 TCAM 中查找所述关键字或所述 关键字的压缩关键字;
第二关键字查找模块 802, 用于在所述第一关键字查找模块 801未查找 到所述关键字的压缩关键字时, 在第一哈希桶中查找所述关键字的压缩关键 第三关键字查找模块 803, 用于在所述第二关键字查找模块 802未查找 到所述关键字的压缩关键字时, 在第二哈希桶中查找所述关键字的压缩关键 一个实施例中, 二关键字查找模块 802还可以用于:
在第一哈希桶中查找到所述关键字的压缩关键字时, 按该压缩关键字对 应的关键字指针查找所述关键字;
第三关键字查找模块 803还可以用于: 在第二关键字查找模块 802未查 找到所述关键字时, 在第二哈希桶中查找所述关键字的压缩关键字; 在第二 哈希桶中查找到所述关键字的压缩关键字时, 按该压缩关键字对应的关键字 指针查找所述关键字。
如图 9所示, 一个实施例中, 图 8所示关键字的查找装置还可以包括: 第二搬移模块 901, 用于在所述第二关键字查找模块在第一哈希桶查找 到所述关键字的压缩关键字, 且所述第三关键字查找模块在第二哈希桶中查 找到所述关键字的压缩关键字时, 将所述关键字的压缩关键字及所述关键字 的指针搬移到所述 TCAM中。
本发明实施例中, 将关键字经第一哈希函数运算, 获得第一哈希桶的地 址; 根据第一哈希桶的地址, 查找第一哈希桶; 将所述关键字经第二哈希函 数运算, 获得第二哈希桶的地址; 根据第二哈希桶的地址, 查找第二哈希 桶; 不同于现有技术中仅通过一个哈希函数获得初始哈希桶地址, 由初始哈 希桶中级连链表指针指向级连哈希桶, 而是通过两个由不同哈希函数独立获 取地址的哈希桶, 来完成对关键字的存储操作, 从而大大提高内存利用率, 节省存储空间和带宽; 并且, 由关键字经不同哈希函数运算获得地址的两个 哈希桶可以采用不同的深度, 可以增加存储的灵活性; 另外, 在第一哈希桶 或第二哈希桶存储关键字时进行的压缩关键字冲突判断, 也可以避免第一哈 希桶或第二哈希桶中出现压缩关键字冲突的情况。
本发明实施例中, 引入 TCAM对关键字进行存储操作, 还可以进一歩地 避免哈希桶中出现压缩关键字冲突的情况, 并且, 在上述关键字的查找方法 中, 先在 TCAM 中查找关键字或关键字的压缩关键字, 若能够查找到, 则可 以避免查找第一哈希桶和 /或第二哈希桶, 使查找延时大幅降低, 查找效率 得以有效提高。 另外, 将不再存在冲突的压缩关键字及对应的关键字指针从
TCAM搬移到哈希桶中, 也可以有效的节约 TCAM空间, 避免反复添加删除后 TCAM可用空间的降低。
以上所述的具体实施例, 对本发明的目的、 技术方案和有益效果进行了 进一歩详细说明, 所应理解的是, 以上所述仅为本发明的具体实施例而已, 并不用于限定本发明的保护范围, 凡在本发明的精神和原则之内, 所做的任 何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。
Claims
1、 一种关键字的存储方法, 其特征在于, 该方法包括:
将关键字经第一哈希函数运算, 获得第一哈希桶的地址; 根据第一哈希 桶的地址, 查找第一哈希桶;
将所述关键字经第二哈希函数运算, 获得第二哈希桶的地址; 根据第二 哈希桶的地址, 查找第二哈希桶;
若第一哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈希函数运算获得, 贝 iJ : 在第一哈希桶有剩余空间时, 将所述关键字的压缩关键字及所述关键字 的指针存入第一哈希桶;
在第一哈希桶没有剩余空间、 第二哈希桶有剩余空间且第二哈希桶中没 有与所述关键字的压缩关键字相冲突的压缩关键字时, 将所述关键字的压缩 关键字及所述关键字的指针存入第二哈希桶。
2、 如权利要求 1所述的方法, 其特征在于, 还包括:
若第一哈希桶中有与所述关键字的压缩关键字相冲突的压缩关键字, 则 将所述关键字及所述关键字的指针存入三进制内容可寻址存储器 TCAM, 或 将所述关键字的压缩关键字及所述关键字的指针存入所述 TCAM;
或, 若第一哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键 字且没有剩余空间、 第二哈希桶中有与所述关键字的压缩关键字相冲突的压 缩关键字, 则将所述关键字及所述关键字的指针存入所述 TCAM, 或将所述 关键字的压缩关键字及所述关键字的指针存入所述 TCAM;
或, 若第一哈希桶和第二哈希桶均没有剩余空间, 则将所述关键字及所 述关键字的指针存入所述 TCAM, 或将所述关键字的压缩关键字及所述关键 字的指针存入所述 TCAM。
3、 如权利要求 2所述的方法, 其特征在于, 还包括: 若所述 TCAM 中有与第一哈希桶中压缩关键字不相冲突的压缩关键字, 则将该压缩关键字及对应的关键字指针搬移到第一哈希桶中;
若所述 TCAM 中有与第二哈希桶中压缩关键字不相冲突的压缩关键字, 则将该压缩关键字及对应的关键字指针搬移到第二哈希桶中。
4、 一种关键字的查找方法, 其特征在于, 所述关键字按权利要求 2 或 3所述方法进行存储, 所述查找方法包括:
在所述 TCAM 中查找所述关键字或所述关键字的压缩关键字; 若未查找 到, 则:
在第一哈希桶中查找所述关键字的压缩关键字; 若未查找到, 贝 IJ : 在第二哈希桶中查找所述关键字的压缩关键字。
5、 如权利要求 4所述的方法, 其特征在于, 若在第一哈希桶中查找到 所述关键字的压缩关键字, 则进一歩按该压缩关键字对应的关键字指针查找 所述关键字; 若未查找到, 则在第二哈希桶中查找所述关键字的压缩关键 若在第二哈希桶中查找到所述关键字的压缩关键字, 则进一歩按该压缩 关键字对应的关键字指针查找所述关键字。
6、 如权利要求 5 所述的方法, 其特征在于, 若在第一哈希桶和第二哈 希桶中均查找到所述关键字的压缩关键字, 贝 IJ :
将所述关键字的压缩关键字及所述关键字的指针搬移到所述 TCAM中。
7、 一种关键字的存储装置, 其特征在于, 该装置包括:
第一哈希桶查找模块, 用于将关键字经第一哈希函数运算, 获得第一哈 希桶的地址; 根据第一哈希桶的地址, 查找第一哈希桶;
第二哈希桶查找模块, 用于将所述关键字经第二哈希函数运算, 获得第 二哈希桶的地址; 根据第二哈希桶的地址, 查找第二哈希桶; 第一确定模块, 用于确定第一哈希桶中没有与所述关键字的压缩关键字 相冲突的压缩关键字, 所述关键字的压缩关键字由所述关键字经第三哈希函 数运算获得;
第一存储模块, 用于在第一哈希桶有剩余空间时, 将所述关键字的压缩 关键字及所述关键字的指针存入第一哈希桶;
第二存储模块, 用于在第一哈希桶没有剩余空间、 第二哈希桶有剩余空 间且第二哈希桶中没有与所述关键字的压缩关键字相冲突的压缩关键字时, 将所述关键字的压缩关键字及所述关键字的指针存入第二哈希桶。
8、 如权利要求 7所述的装置, 其特征在于, 还包括:
第二确定模块, 用于确定第一哈希桶中有与所述关键字的压缩关键字相 冲突的压缩关键字; 第三存储模块, 用于将所述关键字及所述关键字的指针 存入 TCAM , 或将所述关键字的压缩关键字及所述关键字的指针存入所述 TCAM;
或, 所述第二确定模块用于确定第一哈希桶中没有与所述关键字的压缩 关键字相冲突的压缩关键字且没有剩余空间、 第二哈希桶中有与所述关键字 的压缩关键字相冲突的压缩关键字; 所述第三存储模块用于将所述关键字及 所述关键字的指针存入所述 TCAM, 或将所述关键字的压缩关键字及所述关 键字的指针存入所述 TCAM;
或, 所述第二确定模块用于确定第一哈希桶和第二哈希桶均没有剩余空 间; 所述第三存储模块用于将所述关键字及所述关键字的指针存入所述 TCAM, 或将所述关键字的压缩关键字及所述关键字的指针存入所述 TCAM。
9、 如权利要求 8所述的装置, 其特征在于, 还包括:
第一搬移模块, 用于在所述 TCAM 中有与第一哈希桶中压缩关键字不相 冲突的压缩关键字时, 将该压缩关键字及对应的关键字指针搬移到第一哈希 桶中; 在所述 TCAM 中有与第二哈希桶中压缩关键字不相冲突的压缩关键字 时, 将该压缩关键字及对应的关键字指针搬移到第二哈希桶中。
10、 一种关键字的查找装置, 其特征在于, 所述关键字由权利要求 8或 9所述关键字的存储装置进行存储, 所述查找装置包括:
第一关键字查找模块, 用于在所述 TCAM 中查找所述关键字或所述关键 字的压缩关键字;
第二关键字查找模块, 用于在所述第一关键字查找模块未查找到所述关 键字或所述关键字的压缩关键字时, 在第一哈希桶中查找所述关键字的压缩 关键字;
第三关键字查找模块, 用于在所述第二关键字查找模块未查找到所述关 键字的压缩关键字时, 在第二哈希桶中查找所述关键字的压缩关键字。
11、 如权利要求 10 所述的装置, 其特征在于, 所述第二关键字查找模 块进一歩用于:
在第一哈希桶中查找到所述关键字的压缩关键字时, 按该压缩关键字对 应的关键字指针查找所述关键字;
所述第三关键字查找模块进一歩用于: 在所述第二关键字查找模块未查 找到所述关键字时, 在第二哈希桶中查找所述关键字的压缩关键字; 在第二 哈希桶中查找到所述关键字的压缩关键字时, 按该压缩关键字对应的关键字 指针查找所述关键字。
12、 如权利要求 11所述的装置, 其特征在于, 还包括:
第二搬移模块, 用于在所述第二关键字查找模块在第一哈希桶查找到所 述关键字的压缩关键字, 且所述第三关键字查找模块在第二哈希桶中查找到 所述关键字的压缩关键字时, 将所述关键字的压缩关键字及所述关键字的指 针搬移到所述 TCAM中。
Priority Applications (4)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP10844359.9A EP2515487B1 (en) | 2010-01-26 | 2010-01-26 | Method and device for storing and searching keyword |
CN201080003439XA CN102232219B (zh) | 2010-01-26 | 2010-01-26 | 关键字存储、查找的方法及装置 |
PCT/CN2010/070364 WO2011091581A1 (zh) | 2010-01-26 | 2010-01-26 | 关键字存储、查找的方法及装置 |
US13/559,032 US20120330965A1 (en) | 2010-01-26 | 2012-07-26 | Method and apparatus for storing and searching for keyword |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2010/070364 WO2011091581A1 (zh) | 2010-01-26 | 2010-01-26 | 关键字存储、查找的方法及装置 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US13/559,032 Continuation US20120330965A1 (en) | 2010-01-26 | 2012-07-26 | Method and apparatus for storing and searching for keyword |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011091581A1 true WO2011091581A1 (zh) | 2011-08-04 |
Family
ID=44318607
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2010/070364 WO2011091581A1 (zh) | 2010-01-26 | 2010-01-26 | 关键字存储、查找的方法及装置 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20120330965A1 (zh) |
EP (1) | EP2515487B1 (zh) |
CN (1) | CN102232219B (zh) |
WO (1) | WO2011091581A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111819552A (zh) * | 2018-06-20 | 2020-10-23 | 华为技术有限公司 | 访问控制列表的管理方法及装置 |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103001878B (zh) * | 2012-11-26 | 2018-02-16 | 中兴通讯股份有限公司 | Mac地址哈希冲突的确定方法及装置 |
CN103117931B (zh) * | 2013-02-21 | 2015-07-01 | 烽火通信科技股份有限公司 | 基于哈希表和tcam表的mac地址硬件学习方法及系统 |
CN104050180B (zh) * | 2013-03-13 | 2017-06-06 | 华为技术有限公司 | 文件指纹处理方法及装置 |
CN103577564A (zh) * | 2013-10-25 | 2014-02-12 | 盛科网络(苏州)有限公司 | 通过软件搬移降低hash冲突的方法及装置 |
CN104639570A (zh) * | 2013-11-06 | 2015-05-20 | 南京中兴新软件有限责任公司 | 资源对象存储处理方法及装置 |
CN104077272B (zh) * | 2014-06-23 | 2017-01-04 | 华为技术有限公司 | 一种字典压缩的方法和装置 |
CN106033420A (zh) * | 2015-03-11 | 2016-10-19 | 杭州华三通信技术有限公司 | 哈希表的处理方法及装置 |
CN105426519B (zh) * | 2015-12-04 | 2018-12-14 | 河海大学 | 一种用于离线搜索的小规模索引数据存储方法 |
CN107204891A (zh) * | 2016-03-18 | 2017-09-26 | 中兴通讯股份有限公司 | 一种海量规则下报文识别的方法及装置 |
CN107766258B (zh) * | 2017-09-27 | 2021-11-16 | 恩亿科(北京)数据科技有限公司 | 内存存储方法与装置、内存查询方法与装置 |
CN113519144B (zh) * | 2019-01-10 | 2023-06-27 | 马维尔以色列(M.I.S.L.)有限公司 | 用于网络设备的精确匹配和三元内容可寻址存储器(tcam)混合查找 |
CN110737678B (zh) * | 2019-10-23 | 2023-08-04 | 北京锐安科技有限公司 | 一种数据查找方法、装置、设备和存储介质 |
CN111984835B (zh) * | 2020-08-20 | 2022-07-05 | 国家计算机网络与信息安全管理中心 | 一种IPv4掩码五元组规则存储压缩方法及装置 |
CN112148738B (zh) * | 2020-09-24 | 2024-06-11 | 苏州盛科通信股份有限公司 | 哈希冲突处理方法及系统 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1932818A (zh) * | 2006-09-20 | 2007-03-21 | 华为技术有限公司 | 数据库系统及管理数据库数据的方法 |
US20080034115A1 (en) * | 2006-08-01 | 2008-02-07 | Yuan-Sun Chu | Apparatus for handling hash collisions of hash searching and method using the same |
CN101247337A (zh) * | 2008-02-18 | 2008-08-20 | 华为技术有限公司 | 一种报文转发的方法和设备 |
CN101483605A (zh) * | 2009-02-25 | 2009-07-15 | 北京星网锐捷网络技术有限公司 | 数据报文的存储、查找方法和装置 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5446881A (en) * | 1992-09-25 | 1995-08-29 | At&T Corp. | Database storage and retrieval method using a declining stage size and repetitive searches |
US6625612B1 (en) * | 2000-06-14 | 2003-09-23 | Ezchip Technologies Ltd. | Deterministic search algorithm |
US20060248095A1 (en) * | 2005-04-29 | 2006-11-02 | Cisco Technology, Inc. (A California Corporation) | Efficient RAM lookups by means of compressed keys |
US7680806B2 (en) * | 2005-05-17 | 2010-03-16 | Cisco Technology, Inc. | Reducing overflow of hash table entries |
US8078454B2 (en) * | 2007-09-28 | 2011-12-13 | Microsoft Corporation | Two-pass hash extraction of text strings |
-
2010
- 2010-01-26 CN CN201080003439XA patent/CN102232219B/zh not_active Expired - Fee Related
- 2010-01-26 EP EP10844359.9A patent/EP2515487B1/en not_active Not-in-force
- 2010-01-26 WO PCT/CN2010/070364 patent/WO2011091581A1/zh active Application Filing
-
2012
- 2012-07-26 US US13/559,032 patent/US20120330965A1/en not_active Abandoned
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080034115A1 (en) * | 2006-08-01 | 2008-02-07 | Yuan-Sun Chu | Apparatus for handling hash collisions of hash searching and method using the same |
CN1932818A (zh) * | 2006-09-20 | 2007-03-21 | 华为技术有限公司 | 数据库系统及管理数据库数据的方法 |
CN101247337A (zh) * | 2008-02-18 | 2008-08-20 | 华为技术有限公司 | 一种报文转发的方法和设备 |
CN101483605A (zh) * | 2009-02-25 | 2009-07-15 | 北京星网锐捷网络技术有限公司 | 数据报文的存储、查找方法和装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP2515487A4 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111819552A (zh) * | 2018-06-20 | 2020-10-23 | 华为技术有限公司 | 访问控制列表的管理方法及装置 |
Also Published As
Publication number | Publication date |
---|---|
CN102232219B (zh) | 2012-10-10 |
EP2515487A1 (en) | 2012-10-24 |
CN102232219A (zh) | 2011-11-02 |
EP2515487B1 (en) | 2019-01-23 |
US20120330965A1 (en) | 2012-12-27 |
EP2515487A4 (en) | 2012-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2011091581A1 (zh) | 关键字存储、查找的方法及装置 | |
WO2018099107A1 (zh) | 一种哈希表管理的方法和装置、计算机存储介质 | |
US7600094B1 (en) | Linked list traversal with reduced memory accesses | |
US9171153B2 (en) | Bloom filter with memory element | |
US20170038978A1 (en) | Delta Compression Engine for Similarity Based Data Deduplication | |
US7680806B2 (en) | Reducing overflow of hash table entries | |
CN102880628B (zh) | 哈希数据存储方法和装置 | |
US9294390B2 (en) | Hash table storage and search methods and devices | |
CN107368527B (zh) | 基于数据流的多属性索引方法 | |
WO2018036549A1 (zh) | 分布式数据库查询方法、装置及管理系统 | |
WO2015127721A1 (zh) | 数据匹配的方法、装置及计算机存储介质 | |
WO2014067063A1 (zh) | 重复数据检索方法及设备 | |
US20180083770A1 (en) | Detecting encoding attack | |
US10783153B2 (en) | Efficient internet protocol prefix match support on No-SQL and/or non-relational databases | |
US20080133494A1 (en) | Method and apparatus for searching forwarding table | |
WO2018068524A1 (zh) | 路由表建立、以及ip路由查找方法、装置、存储介质 | |
CN112231398B (zh) | 数据存储方法、装置、设备及存储介质 | |
CN102045412B (zh) | IPv6地址前缀压缩存储方法及设备 | |
WO2013078644A1 (zh) | 路由前缀存储方法、装置及路由地址查找方法、装置 | |
CN102437937A (zh) | 一种深度包检测方法 | |
CN112214468B (zh) | 一种分布式存储系统小文件加速方法、装置、设备及介质 | |
CN102308296A (zh) | 哈希计算处理方法及装置 | |
WO2019019382A1 (zh) | 缓存处理方法、装置、计算机设备和存储介质 | |
WO2015061995A1 (zh) | 数据处理方法、装置及重删处理器 | |
WO2021208403A1 (zh) | 数据流表及其处理方法、装置、存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
WWE | Wipo information: entry into national phase |
Ref document number: 201080003439.X Country of ref document: CN |
|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 10844359 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2010844359 Country of ref document: EP |
|
NENP | Non-entry into the national phase |
Ref country code: DE |