WO2008037201A1 - Procédé et appareil permettant de résoudre une collision de hachage - Google Patents

Procédé et appareil permettant de résoudre une collision de hachage Download PDF

Info

Publication number
WO2008037201A1
WO2008037201A1 PCT/CN2007/070474 CN2007070474W WO2008037201A1 WO 2008037201 A1 WO2008037201 A1 WO 2008037201A1 CN 2007070474 W CN2007070474 W CN 2007070474W WO 2008037201 A1 WO2008037201 A1 WO 2008037201A1
Authority
WO
WIPO (PCT)
Prior art keywords
entry
address
module
free
free address
Prior art date
Application number
PCT/CN2007/070474
Other languages
English (en)
French (fr)
Inventor
Jinhua Ye
Hao Sun
Lei Zhang
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2008037201A1 publication Critical patent/WO2008037201A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables

Definitions

  • the present invention relates to the field of network communications, and in particular, to a method and apparatus for solving hash collisions. Background of the invention
  • MAC addresses In Ethernet, MAC addresses often require automatic learning aging. Because the MAC address has 48 bits, it is impossible to assign an entry to each address in actual use. Therefore, in specific applications, the hash algorithm is often used, that is, according to the Hash algorithm. A certain rule is to convert the 48-bit MAC address into a lower-order address of ten bits, and then store the actual content to be transferred into the memory corresponding to the lower address.
  • the Hash algorithm is a high-speed table lookup algorithm that establishes a mapping from a set of keywords to a Hash index through a Hash function.
  • the advantages of the Hash algorithm are: fast lookup and high storage space utilization.
  • the disadvantages are: The time of the search is not fixed, and the more conflicts, the longer the search takes.
  • the mapping between the keyword set and the Hash index established by the Hash function is a many-to-one mapping. There must be a Hash conflict, that is, different keywords finally produce the same index. When a collision occurs, the performance of the Hash algorithm will be seriously degraded.
  • the Hash algorithm includes two aspects: one is the Hash function; the other is the conflict resolution. How to deal with conflicts is one of the keys to constructing a hash table. Different hash tables can be obtained by using different conflict handling methods. A common solution to handling hash collisions is the hashing method, which calculates another hash function address when an address conflict occurs, until the conflict no longer occurs. This method is not easy to generate aggregation, that is, the value of the conflicting value obtained by the first hash function is relatively small after being hashed by different hash functions.
  • the hashed entry contains four hash tables, which are divided into 1 to 4 levels according to their priorities. The sizes are 32K, 16 ⁇ , 8 ⁇ , 8 ⁇ . Each table operates exactly the same, and is hashed with 4 different hash functions to handle the conflict. If there are conflicts between the first hash table search by using four different hash functions in turn, the lower 14 bits of the hash address are taken, the 16K space is accessed, and the second hash table is searched, if there are also conflicts. Then take the lower 13 bits of the hash address, access the 8K space, search for the third hash table, and so on. If the four hash addresses of the four tables conflict, it indicates that the connection cannot be established or does not exist. Returns the corresponding response for the query.
  • the disadvantage of the hash method is that when the matching table entry is not found, the number of lookups becomes 16 times, especially when adding and deleting connections.
  • connection When the connection is deleted, if a matching entry is found, the content of the matching address is cleared, the connection is deleted, and the response register is set to succeed; if no matching entry is found, and the connection fails to be deleted, all 4 need to be found.
  • the 16 hash addresses of the tables, that is, the number of lookups is 16.
  • the last 12 of the 16 hash addresses of the four tables are empty. If you need to find an entry or need to add or delete a connection, you need to The 16 hash addresses of the four tables are searched for a long time and cause a lot of useless operations.
  • the random access memory (RAM) storing the conflict address is directly called to find the address.
  • RAM random access memory
  • an address is read from the RAM, and when a conflicting address is released, the address is written to the RAM. Due to the limited bandwidth, the amount of RAM execution at the same time is limited. If the current available bandwidth of the RAM is 0, it takes several clock cycles to read the conflict from RAM. The address, so that the search does not reach the maximum rate.
  • the embodiment of the invention provides a method and a device for resolving Hash conflicts, and shortens the time required to find matching entries in the process of resolving Hash conflicts as much as possible.
  • the information to be searched is hashed, and the corresponding table entry is searched in the hash table according to the operation result, and the hash table is composed of a link header, a pointer, and a link header;
  • the present invention also provides an apparatus for resolving Hash conflicts, the apparatus comprising the following modules:
  • a hash operation module configured to hash the information that needs to be searched, to obtain an operation result
  • a matching entry search module configured to search for a corresponding entry in the hash table according to the operation result, where the hash table is composed of a link header, a pointer, and a link header; if the link header of the hash table is found When the corresponding entry is still not found, the search ends.
  • the method and device for resolving hash conflicts solve the hash conflict by using a linked list method, and the hash table is composed of a link header, a pointer, and a link header, and the process of searching for information, or adding a connection, or deleting a connection is needed. If you need to find out whether there is a matching entry in the hash table, you can use the trailing list to determine whether all the entries have been found, that is, whether to stop the search. Therefore, the hash table hollow entries in the prior art are avoided. The useless operation of the lookup, so it can shorten the time to resolve the Hash conflict and find out if there is a matching entry. BRIEF DESCRIPTION OF THE DRAWINGS
  • FIG. 1 is a schematic structural diagram of an entry of a re-hash method in the prior art
  • FIG. 2 is a block diagram of a Hash structure of a linked list method provided by the present invention.
  • FIG. 3 is a flowchart of a method for adding a linked list according to Embodiment 1 of the present invention.
  • FIG. 4 is a flowchart of a method for deleting a linked list according to Embodiment 2 of the present invention.
  • FIG. 5 is a flowchart of a method for maintaining conflict address according to Embodiment 3 of the present invention
  • FIG. 6 is a schematic diagram of a device for resolving Hash conflicts according to Embodiment 4 of the present invention. Mode for carrying out the invention
  • the method and device for solving the hash conflict provided by the embodiment of the present invention generate a hash table by using a linked list method, and the hash table is composed of a link header, a pointer, and a linked list tail, in the process of searching for information, adding a linked list, or deleting a linked list.
  • the hash table is composed of a link header, a pointer, and a linked list tail, in the process of searching for information, adding a linked list, or deleting a linked list.
  • the information to be searched is hashed, and the corresponding table entry is searched in the hash table according to the operation result, where the hash table is composed of a chain header, a pointer, and a linked list tail;
  • the step of searching for the corresponding entry in the hash table according to the operation result specifically includes: determining whether the operation result is the same as the content in the link header, and if the same, determining that the content in the link header matches the information to be searched If different,
  • the method further includes:
  • Another method is:
  • the method further includes: determining whether the number of free addresses buffered in the read first in first out queue module is less than a preset value, and if less than, writing from the first in first out queue module, Or, from the conflicting free address space, the read idle address is placed in the read first in first out queue module.
  • Steps include:
  • the address where the released entry is stored as a free address can be: Save the address of the released entry as a free address to the conflict free address space, or write to the FIFO queue module.
  • the method further includes: determining whether the number of free addresses buffered in the write-first-in-first-out queue module is less than a preset value, and if not smaller, writing the first-in-first-out queue module The address is read into the FIFO queue module or read into the conflicting free address space.
  • FIG. 3 is a flowchart of a method for adding a linked list according to Embodiment 1 of the present invention, which includes:
  • Step 101 Perform a hash operation on the information to be stored, and check the result of the operation. Given the table, find the list header corresponding to the result of the operation.
  • the hash table here consists of a linked list header, a pointer, and a linked list tail.
  • Step 102 Determine whether the linked list header is empty, if it is empty, go to step 103; No ij, perform step 104;
  • Step 103 Fill in the operation result of the information to be stored into the linked list header.
  • Step 104 Determine whether the content stored in the link header is the same as the operation result of the information to be stored. If they are the same, the operation result of the information to be stored is not processed; if not, perform step 105.
  • Step 105 Determine whether there is a pointer to the next address in the list header. If yes, go to step 106. Otherwise, go to step 110.
  • Step 106 Find the entry corresponding to the next address according to the pointer in the header of the link, and determine whether the content of the entry is the same as the operation result of the information to be stored. If they are the same, the operation result of the information to be stored is not performed. Processing; otherwise, go to step 107.
  • Step 107 Determine whether there is a pointer to the next address in the current entry. If yes, go to step 108, otherwise, go to step 109.
  • Step 108 Find the entry corresponding to the next address according to the pointer in the current entry, and determine whether the content of the next entry is the same as the operation result of the information to be stored. If they are the same, the operation result of the information to be stored is Do not process; otherwise, return to step 108.
  • Step 109 Apply for a free address, fill in the operation result of the information to be stored into the entry corresponding to the applied idle address, and set a pointer to the free address in the entry.
  • Step 110 Apply for a free address, fill in the operation result of the information to be stored into the entry corresponding to the applied idle address, and set a pointer to the free address in the link header.
  • applying for a free address can be: directly from the conflict
  • the free address space reads a free address; or: reads a free address from the read first in first out queue (FIFO) module connected to the conflicting free address space.
  • the read FIFO module here is used to buffer a set number of currently available free addresses.
  • the keywords keyl, key2, key3, and key4 are used as information to be stored, and the keyl is stored first.
  • the hash (key 1) corresponding to the Hash operation corresponds to the linked list header of the second entry of the hash table, and the linked list is found at this time. If the header is empty, then hash(key 1 ) is filled in the list header.
  • hashing is performed on key 3. Similarly, if there is a hash (keyl) in the corresponding linked list header, and there is a pointer to the next address in the linked list header, the pointer is used to find the next entry. If there is a hash (key2) in the discovery entry, and the entry does not have a pointer to the next address, apply to the read FIFO module of the conflicting free address space for a free address to store the result of the key3 operation hash(key3), and The free address is stored in the form of a pointer in the entry of the hash (key2).
  • FIG. 4 is a flowchart of a method for deleting a linked list according to Embodiment 2 of the present invention, which includes:
  • Step 201 When there is information to be deleted, the information is hashed, and the operation result is obtained. According to the operation result, the corresponding entry is found in the hash table, and the entry is released, that is, the content in the entry. Delete
  • Step 202 Determine whether there is a pointer to the next entry in the current entry. If yes, go to step 203. Otherwise, go to step 204.
  • Step 203 Modify the pointer of the previous entry of the current entry to be a pointer stored in the current entry. If the current entry is a linked list header, put the content of the next entry pointed to by the pointer into the linked list header;
  • Step 204 Delete the pointer of the previous entry of the current entry.
  • Step 205 Save the address of the current entry as a free address.
  • the address of the current entry is saved as a free address: the address of the current entry is written as a free address in the conflicted free address space; or: the address of the current entry is used as the idle address and the conflicted idle address.
  • Space-connected write FIFO module The FIFO module is written here to buffer a set number of free addresses that have been released and have not been stored in the conflicting free address space.
  • FIG. 5 is a schematic diagram of an apparatus for resolving Hash conflicts according to Embodiment 4 of the present invention.
  • the device includes at least a hash operation module and a matching entry search module. among them,
  • a hash operation module configured to hash the information that needs to be searched, to obtain an operation result
  • a matching entry search module configured to search for a corresponding entry in the hash table according to the operation result, where the hash table is composed of a link header, a pointer, and a link header; if the link header of the hash table is found When the corresponding entry is still not found, the search ends.
  • the matching table entry is found in the hash table formed by the linked list method, if there is no matching entry in the hash table, only the trailing list entry needs to be found, thereby avoiding the searching for the empty table item in the prior art. , saving the search time.
  • the device further includes: an address requesting module, an information storage module, and a pointer setting module. among them,
  • An address requesting module configured to apply for a free address when the matching entry does not find the corresponding entry
  • An information storage module configured to store the operation result in an entry corresponding to the idle address of the application
  • a pointer setting module for setting a pointer to the address in the hash table when requesting a free address.
  • the device also includes:
  • conflict free address space used to save the currently available free address;
  • the address space is connected to the address requesting module, and the address requesting module reads the free address from the conflicting free address space.
  • the conflict free address space can be zero bus delay static random access memory
  • ZBT SRAM Zero-Bus Turnaround Static Random Access Memory
  • other random access memory any random access memory.
  • the apparatus may further include:
  • the FIFO queue module is respectively connected to the conflicting idle address space and the address requesting module, and is configured to read the currently available free address from the conflicting free address space, and cache the set number of currently available free addresses, and provide the address requesting module. Free address.
  • the device also includes:
  • the delete entry module is configured to release the information in the corresponding entry found by the matching entry search module, and save the address of the released entry as a free address to the conflict free address space.
  • the device may further include:
  • the FIFO queue module is respectively connected to the delete entry module and the conflict free address space, and is used to cache the free address currently released by the list module. When the cached free address exceeds the set number, the cached free address is saved. To the conflict free address space.
  • the write FIFO queue module may further be connected to the read FIFO module, and the number of currently available free addresses cached in the read FIFO module is less than a preset. In the case of the number, the free address of its own cache is provided to the read FIFO module.
  • Reading the FIFO queue module and writing the FIFO queue module and the conflicting free address space also requires setting the SRAM to the FIFO interface control module, which is responsible for converting the SRAM interface to the FIFO interface.
  • FIG. 6 is a flowchart of a method for maintaining conflict address according to an embodiment of the present invention. Specific steps are as follows:
  • Step 301 Initialize the conflicting free address space, and write the free address into the corresponding offset address.
  • two 16 X 13 bit FIFO reset signals are first pulled high, and the FIFO is reset for 8 time periods, and then pulled low. This is mainly because the FIFO has certain requirements for the length of the reset signal.
  • the preset value is set for the number of free addresses in the read FIFO module and the write FIFO module, and the preset value can be set according to experience, which is taken as 4 in this embodiment.
  • Step 302 Determine whether the current read FIFO module or the write FIFO module is detected, that is, whether there are 4 in the read FIFO module, and 4 in the write FIFO module. If the FIFO module is currently being detected, step 303 is performed. If the FIFO module is currently being detected, step 307 is performed.
  • Step 303 Determine whether the number of conflicting addresses in the read FIFO module is less than 4. If yes, go to step 304, otherwise return to step 302.
  • Step 304 Determine whether the conflict address in the write FIFO module satisfies 4, if there are 4, go to step 305; otherwise, go to step 306.
  • the preset value is taken as 4.
  • Step 305 Read 4 conflicting addresses from the write FIFO module.
  • Step 306 Send a request to the conflict free address space, and read 4 conflict addresses.
  • Step 307 Determine whether the number of conflicting addresses that can be stored in the write FIFO module is less than four, that is, whether the conflicting address is almost full, if it is less than the preset value, go to step 308; otherwise, return to step 302.
  • Step 308 Determine whether four addresses can be placed in the read FIFO module. If yes, execute Step 309; otherwise, step 310 is performed.
  • Step 309 Four addresses are sent from the write FIFO module to the read FIFO module.
  • Step 310 Write 4 addresses from the write FIFO module into the conflict free address space.
  • This embodiment provides a specific implementation of the maintenance read FIFO module and the write FIFO module, but in the actual implementation process, there are many implementations that can be used, for example, setting a cycle, reading the FIFO module And the write FIFO module performs detection, as long as the read FIFO module has remaining space, the read FIFO module is filled from the write FIFO module, or the free address in the conflict free address space; as long as the write FIFO module is not filled up , the currently free address can be cached into the write FIFO module.
  • the various ways of maintaining the read FIFO module and the write FIFO module cannot be exhaustive, and will not be described here.
  • the method and apparatus provided by the embodiments of the present invention solve the hash conflict by using a linked list method
  • the hash table is composed of a link header, a pointer, and a link header, and needs to find information, or add a linked list, or delete a linked list.
  • the process if it is necessary to find out whether there is a matching entry in the hash table, it is possible to determine whether all the entries have been found through the end of the linked list, that is, whether to stop the search, thereby avoiding the hollow table of the hash table in the prior art.
  • the item is used for search, so it can shorten the time to find a matching entry in the process of resolving the hash conflict.
  • the read and write operations of the externally conflicted free address space can be minimized, thereby saving time and saving bandwidth, and adding and deleting linked lists can be implemented in parallel.
  • the read FIFO module and the write FIFO module can perform internal information transfer, so that the read and write operations of the conflicting free address space can be further compressed.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

一种解决 Hash冲突的方法及装置
技术领域
本发明涉及网络通信领域, 特别涉及一种解决哈希 (Hash ) 沖突的 方法及装置。 发明背景
在以太网中, MAC地址往往需要自动学习老化技术, 由于 MAC地 址有 48bit, 在实际使用过程中不可能为每个地址都分配一个表项, 因此 在具体应用中常通过 Hash算法实现, 也就是按照一定的规则, 将 48bit 的 MAC地址转化为十几 bit的低位地址,然后将实际要转发的内容存放 到低位地址对应的存储器(memory ) 中。
Hash算法是一种高速查表算法, 它通过 Hash函数建立起从关键字 集合到 Hash索引之间的映射。 Hash算法的优点是: 查找快速、 存储空 间利用率高。 缺点是: 查找的时间不固定, 沖突越多查找的时间越长。
Hash函数所建立的从关键字集合到 Hash索引之间的映射是多对一 的映射, 必然存在 Hash沖突, 即不同的关键字最后产生相同的索引。 当发生沖突后, Hash算法的性能将严重降低。
Hash算法包括两方面的内容: 一是 Hash函数; 二是沖突解决方案。 如何处理沖突是构造 Hash表的关键之一。采用不同的沖突处理方法 就可以得到不同的 Hash表。 处理哈希沖突常用的解决方法是再哈希法, 即产生地址沖突时计算另一个哈希函数地址, 直到沖突不再发生。 这种 方法不易产生聚集, 即用第一个哈希函数求得的地址有沖突的值经过不 同的哈希函数再哈希后再有沖突的几率相对较小。
通常, 再哈希法的表项包含 4个 Hash表, 按优先次序分为 1~4级, 大小分别为 32K、 16Κ、 8Κ、 8Κ。 每个表的操作完全相同, 都是用 4个 不同 Hash函数进行再哈希来处理沖突。 如果依次用 4个不同的 Hash函 数对第 1个 Hash表进行查找都有沖突, 则取哈希地址的低 14位, 访问 16K空间, 对第 2个 Hash表进行查找, 如果同样都有沖突时再取哈希 地址的低 13位, 访问 8K空间, 对第 3个 Hash表进行查找, 如此类推, 如果 4个表的 4个 Hash地址都沖突, 则表明该连接无法建立或不存在, 查找模块返回相应的响应以便查询。
再哈希法的缺点是: 当找不到匹配表项时, 查找次数就变成 16次, 特别是在增加和删除连接的时候。
当增加连接时,要依次比较全部 4个表的 16个哈希地址,看是否已 经存在相同的连接, 如果存在相同连接就返回, 不再进行比较; 如果找 到第一个沖突地址, 即空闲地址, 就把该地址保存起来, 比较完 16 个 哈希地址后, 如果不存在相同的连接就向第一个沖突地址插入连接。
当删除连接时, 如果找到匹配的表项, 则将匹配地址的内容清零, 删除该连接, 并设置响应寄存器为成功; 在找不到匹配的表项, 删除连 接失败时,需要查找全部 4个表的 16个哈希地址, 即查找次数为 16次。
如果哈希表中存在大量空的表项,比如在 4个表的 16个哈希地址中 后 12个均为空, 则需要查找某一个表项或者需要增加或删除某一个连 接时, 需要依次对 4个表的 16个哈希地址进行查找, 查找时间很长, 并且造成大量无用操作。
现有技术获取沖突地址时, 直接对存储沖突地址的随机存储器 ( RAM )进行调用查找地址。 当需要一个沖突地址时, 从 RAM读一个 地址出来, 当释放掉一个沖突地址时, 再将此地址写入 RAM中。 由于 带宽有限, 因此 RAM同时执行的操作量是有限的, 如果 RAM当前的 可用带宽为 0, 则需要等待几个时钟周期, 才能从 RAM 中读取到沖突 地址, 从而使得查找达不到最大速率。 发明内容
本发明实施例提供了一种解决 Hash 沖突的方法及装置, 尽可能缩 短解决 Hash沖突的过程中, 查找匹配表项所需的时间。
本发明实施例提供的解决 Hash沖突的方法, 包括:
将需要查找的信息进行哈希运算, 根据运算结果在哈希表中查找对 应的表项, 所述哈希表由链表头、 指针和链表尾组成;
如果查找到所述哈希表的链表尾时, 仍未查找到对应的表项, 则结 束查找。
本发明还提供了一种解决 Hash 沖突的装置, 所述装置包括以下模 块:
哈希运算模块, 用于将需要查找的信息进行哈希运算, 得到运算结 果;
匹配表项查找模块, 用于根据所述运算结果在哈希表中查找对应的 表项, 所述哈希表由链表头、 指针和链表尾组成; 如果查找到所述哈希 表的链表尾时, 仍未查找到对应的表项, 则结束查找。
本发明实施例提供的解决 Hash 沖突的方法和装置, 通过采用链表 法解决 Hash沖突, 将哈希表由链表头、 指针和链表尾组成, 在需要查 找信息、 或增加连接、 或删除连接的过程中, 需要从哈希表中查找是否 存在匹配的表项时, 可以通过链表尾确定是否已经查找完所有表项, 即 是否停止查找, 因此避免了现有技术中对哈希表中空表项进行查找的无 用操作, 因此可以缩短解决 Hash沖突的过程中, 查找是否存在匹配表 项的时间。 附图简要说明
图 1为现有技术中再哈希法的表项结构示意图;
图 2为本发明提供的链表法的 Hash结构框图;
图 3为本发明实施例 1提供的添加链表方法流程图;
图 4为本发明实施例 2提供的删除链表方法流程图;
图 5为本发明实施例 3提供的沖突地址维护的方法流程图; 图 6为本发明实施例 4提供的解决 Hash沖突的装置示意图。 实施本发明的方式
下面结合附图和具体实施例对本发明实施例作进一步说明, 但不作 为对本发明实施例的限定。
本发明实施例提供的解决 Hash 沖突的方法及装置, 采用链表法生 成哈希表, 哈希表由链表头、 指针和链表尾组成, 在需要查找信息、 或 增加链表、 或删除链表的过程中, 从哈希表中查找是否存在匹配的表项 时, 可以通过链表尾确定是否已经查找完所有表项。
本发明实施例提供的解决 Hash沖突的方法, 包括:
将需要查找的信息进行哈希运算, 根据运算结果在哈希表中查找对 应的表项, 这里的哈希表由链表头、 指针和链表尾组成;
如果查找到哈希表的链表尾时, 仍未查找到对应的表项, 则结束查 找。
该方法中,根据运算结果在哈希表中查找对应表项的步骤具体包括: 判断运算结果与链表头中的内容是否相同, 如果相同, 则确定该链 表头中的内容与需要查找的信息匹配; 如果不同,
则判断链表头中是否有指向下一个表项的指针, 如果有, 则按照该 链表头中的指针找到下一个表项, 并判断当前找到的表项中存储的内容 与所述运算结果是否相同, 如果相同, 则确定该表项中的内容与需要查 找的信息匹配; 否则, 判断当前找到的表项中是否有指向下一个表项的 指针,如果没有,则确定该哈希表中没有与需要查找的信息匹配的表项; 如果有, 则采用相同的方式继续查找, 直到查找到链表尾。
如果需要查找的信息为要在哈希表中添加的链表时, 该方法进一步 包括:
如果查找到与需要查找的信息匹配的链表头或表项, 则不做处理; 如果链表头为空, 则直接将运算结果存储在链表头中;
如果未查找到与需要查找的信息匹配的表项, 则申请一个预先保存 的空闲地址, 将运算结果填入所申请的空闲地址对应的表项中, 并在该 表项中设置指向该空闲地址的指针。
这里, 申请一个空闲地址的方法有两种, 一种为: 直接从保存空闲 地址的沖突空闲地址空间读取一个空闲地址。
另外一种方法为:
预先从沖突空闲地址空间选出设定数目的空闲地址作为当前可获取 空闲地址; 或者从当前已释放, 緩存到写先进先出队列模块, 尚未保存 到沖突空闲地址空间的空闲地址中选出设定数目的空闲地址作为当前 可获取空闲地址緩存到读先进先出队列模块中;
在这种情况下, 申请一个空闲地址为: 从读先进先出队列模块中緩 存的当前可获取空闲地址中读取一个空闲地址。
为了维护读先进先出队列模块中的空闲地址, 该方法进一步包括: 判断读先进先出队列模块中緩存的空闲地址数目是否小于预设值, 如果小于, 则从写先进先出队列模块中, 或者从沖突空闲地址空间中, 读取空闲地址放入读先进先出队列模块中。
当需要查找的信息为要在所述哈希表中删除的链表时, 该方法进一 步包括:
释放找到的匹配表项, 将所释放表项所在的地址作为空闲地址保存 起来。
释放找到的匹配表项后, 进一步包括:
判断所释放表项中是否有指向下一个表项的指针, 如果有, 修改该 表项的上一个表项的指针为该表项的指针, 或者如果所释放表项为链表 头, 则将链表头中指针指向的下一个表项的内容放到该链表头中;
如果所释放表项中没有指向下一个表项的指针, 则删除所释放表项 的上一个表项的指针。
将所释放表项所在的地址作为空闲地址保存起来可以为: 将所释放 表项所在的地址作为空闲地址保存到沖突空闲地址空间, 或写先进先出 队列模块中。
为了维护写先进先出队列模块中的空闲地址, 该方法进一步包括: 判断写先进先出队列模块中緩存的空闲地址数目是否小于预设值, 如果不小于, 则将写先进先出队列模块中的地址读入读先进先出队列模 块中, 或者读入沖突空闲地址空间中。
图 2为本发明实施例由链表法生成的 Hash表结构示意图, 其中关 键字 keyl 、 key2、 key3、 key4 经 Hash 运算后的结果相同, 用 hash(keyl)=hash(key2)=hash(key3)=hash(key4)表示; 关键字 key5、 key6、 key7经 Hash运算后的结果相同, 用 hash(key5)=hash(key6)=hash(key7) 表示; 还有一个关键字 key8, 将上述关键字进行链表添加后的结果参见 图 2所示的哈希表。
参加图 3 , 图 3为本发明实施例 1提供的添加链表方法流程图, 包 括:
步骤 101 , 将需要存储的信息进行哈希运算, 按运算后的结果查哈 希表, 找到该运算结果对应的链表头。 这里的哈希表是由链表头、 指针 和链表尾组成。
步骤 102: 判断该链表头是否为空,如果为空,执行步骤 103; 否贝 ij , 执行步骤 104;
步骤 103: 将需要存储的信息的运算结果填入该链表头。
步骤 104: 判断链表头中存储的内容是否和需要存储的信息的运算 结果相同, 如果相同, 则不对需要存储的信息的运算结果做处理; 否贝 ij , 执行步骤 105。
步骤 105: 判断该链表头中是否有指向下一个地址的指针, 如果有, 执行步骤 106, 否则, 执行步骤 110。
步骤 106: 按照链表头中的指针找到下一个地址对应的表项, 判断 该表项中的内容与需要存储的信息的运算结果是否相同, 如果相同, 则 对需要存储的信息的运算结果不做处理; 否则, 执行步骤 107。
步骤 107: 判断当前表项中是否有指向下一个地址的指针。 如果有, 执行步骤 108, 否则, 执行步骤 109。
步骤 108: 按照当前表项中的指针找到下一个地址对应的表项, 判 断下一个表项中的内容与需要存储的信息的运算结果是否相同, 如果相 同, 则对需要存储的信息的运算结果不做处理; 否则, 返回步骤 108。
步骤 109: 申请一个空闲地址, 将需要存储的信息的运算结果填入 所申请的空闲地址对应的表项中, 并在这个表项中设置指向该空闲地址 的指针。
步骤 110: 申请一个空闲地址, 将需要存储的信息的运算结果填入 所申请的空闲地址对应的表项中, 并在链表头设置指向该空闲地址的指 针。
上述的步骤 109和 110中, 申请一个空闲地址可以为: 直接从沖突 空闲地址空间读取一个空闲地址; 或者为: 从沖突空闲地址空间连接的 读先进先出队列 (FIFO )模块读取一个空闲地址。 这里读 FIFO模块用 于緩存设定数目的当前可获取的空闲地址。
上述添加链表的过程以图 2中的关键字 key 1、 key2、 key3、 key4为 例进行说明如下:
将关键字 keyl、 key2, key3、 key4作为需要存储的信息,先存储 keyl , 经 Hash运算后的结果 hash(key 1)对应哈希表的第二个表项的链表头,此 时发现该链表头为空, 则将 hash(key 1 )填入该链表头。
当 要存储 key2 时 , 对 key2 进行哈希运算 , 因 为 hash(keyl)=hash(key2),所以发现哈希运算后的结果对应的链表头已经存 有 hash(keyl), 且该表项中没有指向下一个地址的指针, 则向沖突空闲 地址空间的读 FIFO模块申请一个空闲地址, 将这个空闲地址以指针形 式存储在 hash(keyl)的链表头。同时将 hash(key2)存储在该空闲地址对应 的表项中。
当要存储 key3时, 对 key 3进行哈希运算, 同理发现对应的链表头 中有 hash(keyl), 且该链表头中有指向下一个地址的指针, 则按该指针 找到下一个表项, 发现表项中有 hash(key2), 且该表项没有指向下一个 地址的指针, 则向沖突空闲地址空间的读 FIFO模块申请一个空闲地址 用来存储 key3的运算结果 hash(key3), 且把该空闲地址以指针的形式存 储在 hash(key2)所在的表项。
Key4的存储过程与 key3相同, 不再详述。
需要增加链表时, 根据哈希运算后的结果查找哈希表, 有 3种可能 结果:
1 )该连接已经存在于哈希表中, 增加连接失败;
2 )哈希表沖突, 没有空闲地址, 增加连接失败; 3 )存在空闲地址, 增加连接成功。但是由于链表结构有首节点和尾 节点指示, 当查询到链表尾还没有找到匹配表项时, 则可以直接判断查 找失败, 不再增加连接, 因此可以避免对空表项进行查找, 节省了查找 时间。
参见图 4, 图 4为本发明实施例 2提供的删除链表方法流程图, 包 括:
步骤 201 : 当有信息需要删除时, 对该信息进行哈希运算, 得到运 算结果, 根据该运算结果在哈希表中找到对应的表项, 将该表项释放, 即将该表项中的内容删除;
步骤 202: 判断当前表项中是否有指向下一个表项的指针, 如果有, 执行步骤 203, 否则, 执行步骤 204。
步骤 203: 修改当前表项的上一个表项的指针为当前表项存放的指 针, 如果当前表项为链表头, 则将指针指向的下一个表项的内容放到该 链表头;
步骤 204: 将当前表项的上一个表项的指针删除;
步骤 205: 将当前表项所在地址作为空闲地址保存起来。
这里, 将当前表项所在地址作为空闲地址保存起来可以为: 将当前 表项所在地址作为空闲地址写入沖突空闲地址空间中; 或者为: 当前表 项所在地址作为空闲地址写入与沖突空闲地址空间相连的写 FIFO模块 中。 这里写 FIFO模块用于緩存设定数目的当前已释放, 尚未存入沖突 空闲地址空间中的空闲地址。
当删除链表时, 有 2种可能结果:
1 )找到匹配表项, 将匹配表项的内容清零, 删除该连接, 同时将删 除掉的链表前后节点通过修改父子节点再重新连接起来, 然后将被删除 掉的链表地址再作为空闲地址存储起来。 2 )找不到匹配表项, 删除连接失败。 由于链表结构有首节点和尾节 点指示, 当查询到链表尾还没有找到匹配表项时, 则可以直接判断删除 连接失败, 因此链表法的查找是只查找到链表尾, 可以避免对空表项进 行查找, 节省了查找时间。
本发明实施例还提供了一种解决 Hash沖突的装置, 图 5为本发明 实施例 4提供的解决 Hash沖突的装置示意图, 该装置至少包括哈希运 算模块和匹配表项查找模块。 其中,
哈希运算模块, 用于将需要查找的信息进行哈希运算, 得到运算结 果;
匹配表项查找模块, 用于根据所述运算结果在哈希表中查找对应的 表项, 所述哈希表由链表头、 指针和链表尾组成; 如果查找到所述哈希 表的链表尾时, 仍未查找到对应的表项, 则结束查找。
应用这种装置从采用链表法构成的哈希表中查找匹配表项时, 如果 哈希表中没有匹配表项, 则只需要查找到链表尾, 避免了现有技术中对 空表项进行查找, 节省了查找时间。
如果需要在哈希表中增加链表, 则该装置还包括: 地址申请模块、 信息存储模块以及指针设置模块。 其中,
地址申请模块, 用于在匹配表项查找模块未查找到对应的表项时, 申请一个空闲地址;
信息存储模块, 用于将所述运算结果存储在申请的空闲地址对应的 表项中;
指针设置模块, 用于当申请一个空闲地址时, 在哈希表中设置指向 该地址的指针。
该装置还包括:
沖突空闲地址空间, 用于保存当前可用的空闲地址; 该沖突空闲地 址空间与地址申请模块相连, 地址申请模块从沖突空闲地址空间中读取 空闲地址。 这里的沖突空闲地址空间可以为零总线延迟静态随机存储器
(ZBT SRAM , Zero-Bus Turnaround Static Random Access Memory) , 或者 其它随机存储器。
为了避免现有技术获取空闲地址时, 直接对沖突空闲地址空间进行 调用查找地址, 该装置进一步可以包括:
读先进先出队列模块, 分别与沖突空闲地址空间和地址申请模块相 连, 用于从沖突空闲地址空间读取当前可获取空闲地址, 緩存设定数目 的当前可获取空闲地址, 为地址申请模块提供空闲地址。
如果需要删除哈希表中的链表, 则该装置还包括:
删除表项模块, 用于释放匹配表项查找模块查找到的对应表项中的 信息, 将所释放表项所在地址作为空闲地址保存到沖突空闲地址空间。
为了避免现有技术存入空闲地址时, 直接对沖突空闲地址空间进行 调用, 该装置进一步可以包括:
写先进先出队列模块, 分别与删除表项模块和沖突空闲地址空间相 连, 用于緩存删除列表模块当前已释放的空闲地址, 当緩存的空闲地址 超过设定数目时, 将緩存的空闲地址保存到沖突空闲地址空间。
为了进一步减轻沖突空闲地址空间的处理过程, 写先进先出队列模 块进一步可以与读先进先出队列模块相连, 用于在读先进先出队列模块 中緩存的当前可获取空闲地址的数目小于预设的数目时, 将自身緩存的 空闲地址提供给读先进先出队列模块。
读先进先出队列模块和写先进先出队列模块与沖突空闲地址空间之 间还需要设置 SRAM转为 FIFO接口控制模块,用于负责将 SRAM接口 转为 FIFO接口。
参见图 6, 图 6为本发明实施例提供的沖突地址维护的方法流程图, 具体步骤如下:
步骤 301 : 初始化沖突空闲地址空间, 将空闲地址写入对应的偏移 地址中。
本实施例先将两个 16 X 13bit的 FIFO复位信号拉高, FIFO进行复 位, 且持续 8个时间周期, 然后再将其拉低, 这主要是由于 FIFO对于 复位信号的长度有一定要求。
为读 FIFO模块和写 FIFO模块中的空闲地址个数设置预设值,该预 设值可以根据经验设定, 本实施例取 4。
接着向存储沖突地址的沖突空闲地址空间发出申请, 按顺序依次将 8k空闲地址写入到对应的偏移地址中去。 当全部写完以后, 跳到正常工 作状态, 即检测读 FIFO模块和写 FIFO模块。
步骤 302: 判断当前检测的是读 FIFO模块还是写 FIFO模块, 即检 测读 FIFO模块中有没有 4个, 写 FIFO模块中还能不能再放 4个。如果 当前检测的是读 FIFO模块, 执行步骤 303, 如果当前检测的是写 FIFO 模块, 执行步骤 307。
步骤 303: 判断读 FIFO模块中的沖突地址个数是否小于 4个,如果 是, 执行步骤 304, 否则返回步骤 302。
步骤 304: 判断写 FIFO模块中的沖突地址是否满足 4个, 如果有 4 个, 执行步骤 305; 否则, 执行步骤 306。 该预设值取为 4。
步骤 305: 从写 FIFO模块中读取 4个沖突地址。
步骤 306: 向沖突空闲地址空间中发请求, 读取 4个沖突地址。 步骤 307: 判断写 FIFO模块中能存放的沖突地址数是否小于 4个, 即沖突地址是否快要满, 如果小于预设值, 执行步骤 308; 否则返回步 骤 302。
步骤 308: 判断读 FIFO模块中是否能再放入 4个地址, 如果是, 执 行步骤 309; 否则执行步骤 310。
步骤 309: 从写 FIFO模块中取 4个地址送入读 FIFO模块中。
步骤 310:从写 FIFO模块中取 4个地址写入到沖突空闲地址空间中 去。
该实施例给出了一种具体的维护读 FIFO模块和写 FIFO模块的实现 方式,但是在实际实现过程中,还有很多种可以采用的实现方式, 比如, 设定一个周期,对读 FIFO模块和写 FIFO模块进行检测, 只要检测到读 FIFO模块有剩余空间, 就从写 FIFO模块中, 或沖突空闲地址空间中读 取空闲地址将读 FIFO模块填满; 只要检测到写 FIFO模块未填满, 就可 以将当前释放的空闲地址緩存到写 FIFO模块中。 对读 FIFO模块和写 FIFO模块进行维护的各种方式无法穷举完全, 这里不再赘述。
采用这样方法,就可以尽量减少对外接 ZBT SRAM的读写操作,从 而节约时间和节省带宽。
由以上实施例可见, 本发明实施例提供的方法和装置, 通过采用链 表法解决 Hash沖突, 将哈希表由链表头、 指针和链表尾组成, 在需要 查找信息、 或增加链表、 或删除链表的过程中, 需要从哈希表中查找是 否存在匹配的表项时, 可以通过链表尾确定是否已经查找完所有表项, 即是否停止查找, 因此避免了现有技术中对哈希表中空表项进行查找的 无用操作, 因此可以缩短解决 Hash沖突的过程中, 查找是否存在匹配 表项的时间。
另外, 通过设置与沖突空闲地址空间相连的读 FIFO模块和写 FIFO 模块, 可以尽量减少对外接沖突空闲地址空间的读写操作, 从而节约时 间和节省带宽, 还可以并行实现添加和删除链表。 同时, 读 FIFO模块 和写 FIFO模块可以进行内部信息传递, 因此可以进一步筒化沖突空闲 地址空间的读写操作。 以上所述的实施例, 只是本发明较优选的具体实施方式的一种, 本 领域的技术人员在本发明技术方案范围内进行的通常变化和替换都应 包含在本发明的保护范围内。

Claims

权利要求书
1、 一种解决 Hash沖突的方法, 其特征在于, 包括:
将需要查找的信息进行哈希运算, 根据运算结果在哈希表中查找对 应的表项, 所述哈希表由链表头、 指针和链表尾组成;
如果查找到所述哈希表的链表尾时, 仍未查找到对应的表项, 则结 束查找。
2、如权利要求 1所述的方法, 其特征在于, 所述根据运算结果在哈 希表中查找对应的表项具体包括:
判断所述运算结果与所述链表头中的内容是否相同, 如果相同, 则 确定该链表头中的内容与需要查找的信息匹配; 如果不同,
则判断所述链表头中是否有指向下一个表项的指针, 如果有, 则按 照所述指针找到下一个表项, 并判断当前找到的表项中存储的内容与所 述运算结果是否相同, 如果相同, 则确定该表项中的内容与需要查找的 信息匹配; 否则,判断当前找到的表项中是否有指向下一个表项的指针, 如果没有, 则确定所述哈希表中没有与需要查找的信息匹配的表项; 如 果有, 则采用相同的方式继续查找, 直到查找到链表尾。
3、 如权利要求 2所述的方法, 其特征在于, 当需要查找的信息为要 在所述哈希表中添加的链表时, 该方法进一步包括:
如果查找到与所述需要查找的信息匹配的链表头或表项, 则不做处 理;
如果所述链表头为空,则直接将所述运算结果存储在所述链表头中; 如果未查找到与所述需要查找的信息匹配的表项, 则申请一个预先 保存的空闲地址, 将所述运算结果填入所申请的空闲地址对应的表项 中, 并在所述表项中设置指向该空闲地址的指针。
4、如权利要求 3所述的方法, 其特征在于, 所述申请一个空闲地址 为: 从保存空闲地址的沖突空闲地址空间读取一个空闲地址。
5、 如权利要求 3所述的方法, 其特征在于, 该方法进一步包括: 从沖突空闲地址空间选出设定数目的空闲地址作为当前可获取空闲 地址; 或者从当前已释放, 緩存到写先进先出队列模块, 尚未保存到所 述沖突空闲地址空间的空闲地址中选出设定数目的空闲地址作为当前 可获取空闲地址緩存到读先进先出队列模块中;
所述申请空闲地址为: 从所述当前可获取空闲地址中读取一个空闲 地址。
6、 如权利要求 5所述的方法, 其特征在于, 该方法进一步包括: 判断所述读先进先出队列模块中緩存的空闲地址数目是否小于预设 值, 如果小于, 则从所述写先进先出队列模块中, 或者从所述沖突空闲 地址空间中, 读取空闲地址放入所述读先进先出队列模块中。
7、如权利要求 2所述的方法, 其特征在于, 当需要查找的信息为要 在所述哈希表中删除的链表时, 该方法进一步包括:
释放找到的匹配表项, 将所释放表项所在的地址作为空闲地址保存 起来。
8、如权利要求 7所述的方法, 其特征在于, 所述释放找到的匹配表 项后, 进一步包括:
判断所释放表项中是否有指向下一个表项的指针, 如果有, 修改该 表项的上一个表项的指针为该表项的指针, 或者如果所释放表项为链表 头, 则将链表头中指针指向的下一个表项的内容放到该链表头中; 如果所释放表项中没有指向下一个表项的指针, 则删除所释放表项 的上一个表项的指针。
9、如权利要求 7所述的方法, 其特征在于, 所述将所释放表项所在 的地址作为空闲地址保存起来为:
将所释放表项所在的地址作为空闲地址保存到沖突空闲地址空间, 或写先进先出队列模块中。
10、 如权利要求 9所述的方法, 其特征在于, 该方法进一步包括: 判断所述写先进先出队列模块中緩存的空闲地址数目是否小于预设 值, 如果不小于, 则将所述写先进先出队列模块中的地址读入所述读先 进先出队列模块中, 或者读入所述沖突空闲地址空间中。
11、 一种解决 Hash 沖突的装置, 其特征在于, 所述装置包括以下 模块:
哈希运算模块, 用于将需要查找的信息进行哈希运算, 得到运算结 果;
匹配表项查找模块, 用于根据所述运算结果在哈希表中查找对应的 表项, 所述哈希表由链表头、 指针和链表尾组成; 如果查找到所述哈希 表的链表尾时, 仍未查找到对应的表项, 则结束查找。
12、 如权利要求 11所述的装置, 其特征在于, 该装置还包括: 地址申请模块, 用于在所述匹配表项查找模块未查找到对应的表项 时, 申请一个空闲地址;
信息存储模块, 用于将所述运算结果存储在申请的空闲地址对应的 表项中;
指针设置模块, 用于当申请一个空闲地址时, 在哈希表中设置指向 该地址的指针。
13、 如权利要求 12所述的装置, 其特征在于, 该装置还包括: 沖突空闲地址空间, 用于保存当前可用的空闲地址; 与所述地址申 请模块相连, 所述地址申请模块从所述沖突空闲地址空间中读取空闲地 址。
14、 如权利要求 13所述的装置, 其特征在于, 该装置进一步包括: 读先进先出队列模块, 分别与所述沖突空闲地址空间和所述地址申 请模块相连, 用于从所述沖突空闲地址空间读取当前可获取空闲地址, 緩存设定数目的当前可获取空闲地址, 为所述地址申请模块提供空闲地 址。
15、 如权利要求 11至 14任一项所述的装置, 其特征在于, 所述装 置还包括:
删除表项模块, 用于释放所述匹配表项查找模块查找到的对应表项 中的信息, 将所释放表项所在地址作为空闲地址保存到沖突空闲地址空 间。
16、 如权利要求 15所述的装置, 其特征在于, 该装置进一步包括: 写先进先出队列模块, 分别与所述删除表项模块和沖突空闲地址空 间相连, 用于緩存所述删除列表模块当前已释放的空闲地址, 当緩存的 空闲地址超过设定数目时, 将緩存的空闲地址保存到所述沖突空闲地址 空间。
17、如权利要求 16所述的装置, 其特征在于, 所述写先进先出队列 模块进一步与所述读先进先出队列模块相连, 用于在所述读先进先出队 列模块中緩存的当前可获取空闲地址的数目小于预设的数目时, 将自身 緩存的空闲地址提供给所述读先进先出模块。
PCT/CN2007/070474 2006-09-29 2007-08-14 Procédé et appareil permettant de résoudre une collision de hachage WO2008037201A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CNB2006101525784A CN100550847C (zh) 2006-09-29 2006-09-29 一种解决Hash冲突的方法及装置
CN200610152578.4 2006-09-29

Publications (1)

Publication Number Publication Date
WO2008037201A1 true WO2008037201A1 (fr) 2008-04-03

Family

ID=37859240

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2007/070474 WO2008037201A1 (fr) 2006-09-29 2007-08-14 Procédé et appareil permettant de résoudre une collision de hachage

Country Status (2)

Country Link
CN (1) CN100550847C (zh)
WO (1) WO2008037201A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614734A (zh) * 2016-12-13 2018-10-02 迈普通信技术股份有限公司 安全参数索引管理方法及装置
CN111694559A (zh) * 2020-05-21 2020-09-22 北京云杉世纪网络科技有限公司 Gc程序语言中哈希表的实现方法及装置
CN111953682A (zh) * 2020-08-11 2020-11-17 北京八分量信息科技有限公司 银行云计算门户网站页面的防篡改方法、装置及相关产品
CN112783894A (zh) * 2021-01-11 2021-05-11 山东兆物网络技术股份有限公司 基于碰撞的带老化删除的双层无锁哈希表实现方法
CN117390029A (zh) * 2023-12-11 2024-01-12 格创通信(浙江)有限公司 一种表项插入方法、装置、电子设备及存储介质

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101232444B (zh) * 2008-01-22 2012-03-21 杭州华三通信技术有限公司 哈希冲突解决方法、装置及具有该装置的交换设备
CN101340386B (zh) * 2008-08-12 2011-08-10 华为技术有限公司 建立和查找路由表项的方法及路由器
TWI412929B (zh) * 2009-07-23 2013-10-21 Ipanel Tv Inc 散列表動態適應資料之方法及其裝置
CN101827001B (zh) * 2010-05-11 2014-04-09 中兴通讯股份有限公司 一种多任务间hash检测方法及装置
CN102780641B (zh) * 2012-08-17 2015-07-08 北京傲天动联技术股份有限公司 快速转发引擎的流表老化方法、装置以及交换机
CN104579970B (zh) * 2013-10-29 2018-06-12 国家计算机网络与信息安全管理中心 一种IPv6报文的策略匹配装置
EP3110092B1 (en) 2014-03-24 2019-03-13 Huawei Technologies Co., Ltd. Method for determining storage location for tables, forwarding device, and controller
CN104461400B (zh) * 2014-12-25 2017-09-19 浪潮(北京)电子信息产业有限公司 处理访存请求冲突的方法和装置
CN106815221B (zh) * 2015-11-27 2020-02-14 华为软件技术有限公司 一种电信业务关系判定方法及装置
CN106656865B (zh) * 2016-10-28 2019-06-07 杭州迪普科技股份有限公司 一种管理链表资源的方法及装置
CN106528670A (zh) * 2016-10-31 2017-03-22 盛科网络(苏州)有限公司 一种减少Hash查找冲突的方法
CN107992577B (zh) * 2017-12-04 2020-08-11 奇安信科技集团股份有限公司 一种哈希表数据冲突处理方法及装置
CN111431806B (zh) * 2020-03-18 2022-07-08 北京京安佳新技术有限公司 一种流表处理方法和设备
CN113779320B (zh) * 2021-08-18 2024-02-27 北京计算机技术及应用研究所 一种表项存储地址冲突的解决方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920900A (en) * 1996-12-30 1999-07-06 Cabletron Systems, Inc. Hash-based translation method and apparatus with multiple level collision resolution
US20040230737A1 (en) * 2003-05-16 2004-11-18 Burton David Alan Methods and systems of cache memory management and snapshot operations
CN1577326A (zh) * 2003-07-23 2005-02-09 英特尔公司 高性能散列系统

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5920900A (en) * 1996-12-30 1999-07-06 Cabletron Systems, Inc. Hash-based translation method and apparatus with multiple level collision resolution
US20040230737A1 (en) * 2003-05-16 2004-11-18 Burton David Alan Methods and systems of cache memory management and snapshot operations
CN1577326A (zh) * 2003-07-23 2005-02-09 英特尔公司 高性能散列系统

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108614734A (zh) * 2016-12-13 2018-10-02 迈普通信技术股份有限公司 安全参数索引管理方法及装置
CN108614734B (zh) * 2016-12-13 2022-08-12 迈普通信技术股份有限公司 安全参数索引管理方法及装置
CN111694559A (zh) * 2020-05-21 2020-09-22 北京云杉世纪网络科技有限公司 Gc程序语言中哈希表的实现方法及装置
CN111694559B (zh) * 2020-05-21 2023-07-21 北京云杉世纪网络科技有限公司 Gc程序语言中哈希表的实现方法及装置
CN111953682A (zh) * 2020-08-11 2020-11-17 北京八分量信息科技有限公司 银行云计算门户网站页面的防篡改方法、装置及相关产品
CN112783894A (zh) * 2021-01-11 2021-05-11 山东兆物网络技术股份有限公司 基于碰撞的带老化删除的双层无锁哈希表实现方法
CN112783894B (zh) * 2021-01-11 2022-12-20 山东兆物网络技术股份有限公司 基于碰撞的带老化删除的双层无锁哈希表实现方法
CN117390029A (zh) * 2023-12-11 2024-01-12 格创通信(浙江)有限公司 一种表项插入方法、装置、电子设备及存储介质
CN117390029B (zh) * 2023-12-11 2024-05-17 格创通信(浙江)有限公司 一种表项插入方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN100550847C (zh) 2009-10-14
CN1929451A (zh) 2007-03-14

Similar Documents

Publication Publication Date Title
WO2008037201A1 (fr) Procédé et appareil permettant de résoudre une collision de hachage
US7039764B1 (en) Near-perfect, fixed-time searching algorithm using hashing, LRU and cam-based caching
WO2008119269A1 (fr) Procédé et dispositif de moteur de stockage et de consultation d'informations
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
US8484439B1 (en) Scalable hash tables
US8542686B2 (en) Ethernet forwarding database method
WO2018099107A1 (zh) 一种哈希表管理的方法和装置、计算机存储介质
JP4621747B2 (ja) 通信制御装置および情報処理装置
CN110808910B (zh) 一种支持QoS的OpenFlow流表节能存储架构及其方法
US7930516B1 (en) Linked list traversal with reduced memory accesses
WO2014127605A1 (zh) 基于哈希表和tcam表的mac地址硬件学习方法及系统
US20080192754A1 (en) Routing system and method for managing rule entries of ternary content addressable memory in the same
US20020178341A1 (en) System and method for indexing and retriving cached objects
CN103428093A (zh) 一种基于名字路由前缀存储、匹配及更新方法与装置
CN111400307B (zh) 支持远程并发访问的持久哈希表访问系统
CN101237415B (zh) 一种实现arp协议ip核的方法
WO2012013023A2 (zh) 一种减少哈希冲突的哈希查找方法
CN114281712A (zh) 查表方法、装置、fpga及可读存储介质
US8503442B2 (en) Transmission information transfer apparatus and method thereof
WO2021208403A1 (zh) 数据流表及其处理方法、装置、存储介质
US6343289B1 (en) Efficient search and organization of a forwarding database or the like
WO2018006786A1 (zh) 转发表项访问
WO2021008552A1 (zh) 数据读取方法和装置、计算机可读存储介质
JP2016091222A (ja) データ処理装置、データ処理方法およびプログラム
CN111541624B (zh) 空间以太网缓存处理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 07800950

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 07800950

Country of ref document: EP

Kind code of ref document: A1