WO2012106916A1 - Method and apparatus for processing hash calculations - Google Patents

Method and apparatus for processing hash calculations Download PDF

Info

Publication number
WO2012106916A1
WO2012106916A1 PCT/CN2011/077484 CN2011077484W WO2012106916A1 WO 2012106916 A1 WO2012106916 A1 WO 2012106916A1 CN 2011077484 W CN2011077484 W CN 2011077484W WO 2012106916 A1 WO2012106916 A1 WO 2012106916A1
Authority
WO
WIPO (PCT)
Prior art keywords
hash
keyword
storage block
primary
standby
Prior art date
Application number
PCT/CN2011/077484
Other languages
French (fr)
Chinese (zh)
Inventor
卢胜文
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2011/077484 priority Critical patent/WO2012106916A1/en
Priority to CN2011800011227A priority patent/CN102308296A/en
Publication of WO2012106916A1 publication Critical patent/WO2012106916A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • 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 data processing technologies, and in particular, to a hash calculation processing method and apparatus. Background technique
  • a hash table also called a hash table, is a versatile and efficient looking data table.
  • the keyword is mapped to a value by a mapping function called a hash function, which is called a hash value.
  • the hash value is usually used as the location of the table to access the record to speed up the lookup.
  • you may get the same hash value, that is, the keyword key 1 ⁇ Key2, and the hash value key ( key 1 ) ⁇ ( Key2 ). This phenomenon is called Hash Chong
  • each hash bucket stores one record, forming a conflict list.
  • searching first find the given value through the hash function.
  • the hash address ⁇ ( ⁇ ) then read the records in its hash bucket with ⁇ ( ⁇ ) as the address, and finally match the read records with the keyword ,, if there is a match If the record is found, the search is successful, otherwise the search fails.
  • the problem with this method is that the length of the hash collision chain generated when hashing the keywords in the message cannot be controlled. If the length of the hash collision chain is too long, the storage efficiency of the message may be caused. Very low.
  • the Ternary Content Addressable Memory is a hardware chip dedicated to the search operation. It is mainly used to quickly find the Access Control List (ACL), routing and other entries. The entry of the entry into the TCAM enables the length of the hash collision chain to be controlled.
  • ACL Access Control List
  • Embodiments of the present invention provide a hash calculation processing method and apparatus for solving the problem of high cost of hash collision chain length control existing in the prior art.
  • a hash calculation processing method includes:
  • the primary hash storage block includes at least one of the first a conflicting entry, each of the first conflicting entries corresponding to a keyword, and the primary hash of each keyword of the first conflicting entry calculated by the primary hashing function The value is the same; if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, establishing a first conflicting table corresponding to the keyword in the primary hash storage block Item
  • the candidate hash function is used to perform hash calculation on the keyword to obtain an alternate hash corresponding to the keyword.
  • a second conflict entry corresponding to the keyword is established in the standby hash storage block corresponding to the standby hash value; wherein, the primary hash value and the standby hash value are not Similarly, the standby hash storage block includes at least one of the second conflicting entries, each of the second conflicting entries corresponding to a keyword, and the keyword corresponding to each of the second conflicting entries passes the The alternate hash value obtained after the standby hash function is calculated is the same.
  • a hash calculation processing device includes:
  • a receiving module configured to receive a message
  • a keyword extraction module configured to extract a keyword that needs to perform hash calculation in the packet
  • a primary hash calculation module configured to perform hash calculation on the keyword by using a primary hash function, Obtaining a primary hash value corresponding to the keyword
  • a first determining module configured to determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein, the primary hash storage The block includes at least one of the first conflicting entries, each of the first conflicting entries corresponding to a keyword, and a keyword corresponding to each of the first conflicting entries is calculated by using the primary hash function.
  • the primary hash value is the same;
  • a first conflicting table entry establishing module configured to establish, in the primary hash storage block, the key in the primary hash storage block when the number of the first conflicting entry in the primary hash storage block is less than the maximum conflicting number The first conflicting entry corresponding to the word;
  • a backup hash calculation module configured to: when the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a backup hash function to perform hash calculation on the keyword, An alternate hash value corresponding to the keyword;
  • a second conflict entry establishing module configured to establish a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value, where the primary hash value is The standby hash value is different, the standby hash storage block includes at least one second conflicting entry, each of the second conflicting entries corresponds to a keyword, and each of the second conflicting entries
  • the standby hash value obtained by calculating the corresponding keyword by the standby hash function is the same.
  • the hash calculation processing method and apparatus provided by the embodiment of the present invention, by extracting keywords that need to be hashed in the message, hashing the keyword using the primary hash function, and obtaining the keyword Corresponding primary hash value, determining whether the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value is less than a preset maximum conflict number, if the primary hash storage If the number of the first conflicting entries in the block is smaller than the maximum number of conflicts, the first conflicting entry corresponding to the keyword is established in the primary hash storage block, if the primary hash storage block The number of the first conflicting table entries is not less than the maximum number of conflicts, and the keyword is hashed using an alternate hash function to obtain an alternate hash value corresponding to the keyword, A second conflicting entry corresponding to the keyword is established in the spare hash storage block corresponding to the hash value.
  • Embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message.
  • FIG. 1 is a flowchart of a hash calculation processing method according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart of a hash calculation processing method according to Embodiment 2 of the present invention.
  • FIG. 3 is a schematic structural diagram of a hash storage block according to Embodiment 2 of the present invention.
  • FIG. 4 is a schematic structural diagram of a primary hash storage block when the number of first conflict entries is less than the maximum number of collisions according to Embodiment 2 of the present invention
  • Figure 5 (a) is a schematic structural diagram of a primary hash storage block when the number of first conflict entries is not less than the maximum number of collisions according to the second embodiment of the present invention
  • FIG. 5(b) is a schematic structural diagram of a backup hash storage block according to Embodiment 2 of the present invention
  • FIG. 6 is a flowchart of a hash calculation processing method according to Embodiment 3 of the present invention.
  • FIG. 7 is a flowchart of a hash calculation processing method according to Embodiment 4 of the present invention.
  • FIG. 8 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention.
  • FIG. 9 is a flowchart of the operation of the hash calculation processing apparatus according to Embodiment 5 of the present invention.
  • FIG. 10 is a schematic diagram of a hardware circuit of a hash calculation processing apparatus according to Embodiment 5 of the present invention
  • FIG. 11 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention.
  • FIG. 12 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention.
  • FIG. 13 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention. detailed description
  • This embodiment provides a hash calculation processing method. As shown in FIG. 1, the method includes:
  • the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a backup hash function to perform hash calculation on the keyword, to obtain a corresponding to the keyword.
  • the hash calculation processing method performs hash calculation on the keyword by using a primary hash function by extracting a keyword that needs to perform hash calculation in the packet, and obtains a keyword corresponding to the keyword. Determining, by the primary hash value, whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts, if the primary hash storage block is used And establishing, by the primary hash storage block, a first conflicting entry corresponding to the keyword, if the number of the first conflicting entry is less than the maximum number of conflicts, if the primary hashing block is in the primary hashing block The number of the first conflicting entry is not less than the maximum number of conflicts, and the keyword is hashed using an alternate hash function to obtain an alternate hash value corresponding to the keyword, and the standby hash value is A second conflicting entry corresponding to the keyword is established in the corresponding standby hash storage block.
  • the hash calculation processing method provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message.
  • the length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
  • This embodiment provides a hash calculation processing method. As shown in FIG. 2, the method includes:
  • the conflicting entry includes: a flag for performing a hash calculation using an alternate hash function, The entry valid tag and the IP address of the packet.
  • the hash storage block includes: a flag of a conflict entry established by the alternate hash function and an alternate hash function type flag.
  • a hash function that generates less hash collision than the primary hash function may be selected as the standby hash function
  • the hash function in the hash storage block corresponding to the hash function value is smaller than the hash function of the maximum conflict number as the standby hash function.
  • an initial value of a counter of a common standby hash function in the primary hash storage block may be set to a predetermined number (for example, 0), when the first one of the primary hash storage blocks is When the number of the conflicting entries is not less than the maximum number of conflicts, a second conflicting entry corresponding to the IP address of the packet is established in the standby hash storage block, and the primary hash storage block is used.
  • the counter value of the counter of the common alternate hash function is incremented by one.
  • the maximum number of collisions for generating a hash collision in the hash storage block is 6, and after receiving the message, extracting an IP address for which the packet needs to be hashed, assuming the The IP address of the packet is 10.0.0.1, and the IP address 10.0.0.1 of the packet is hashed using the primary hash function, and the primary user corresponding to the IP address 10.0.0.1 of the message is obtained.
  • the hash value is 1, and it is determined that the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value 1 is 0, less than the maximum conflict number 6, and is stored in the primary hash.
  • a first conflict entry corresponding to the IP address 10.0.0.1 of the packet is established in the block.
  • the IP address 11.0.0.1 of the hash calculation is extracted, and the primary hash function is used to perform hash calculation on the IP address 11.0.0.1 of the message.
  • the primary hash function is used to perform hash calculation on the IP address 11.0.0.1 of the message.
  • the first conflicting entry corresponding to the IP address 11.0.0.1 of the packet is established in the primary hash storage block, and the primary hash storage block is used.
  • the number of the first conflicting entries in the middle is 2.
  • the message 12.0.0.1, the message 13.0.0.1, the message 14.0.0.1, the message 15.0.0.1 are received, and the primary hash function is used to sequentially address the IP address 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 perform hash calculation, and the main hash values corresponding to IP addresses 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 are all 1 .
  • a first conflicting entry corresponding to the IP address 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 is established in the hash storage block, and the number of the first conflicting entry in the primary hash storage block is Is 6.
  • the Greek function type flag is not set, select one than the main Using a hash function to generate a hash function with less hash collision as a standby hash function, or hashing the IP address of the packet by using at least one hash function to obtain at least one IP with the packet a hash function value corresponding to the address, selecting a hash function in the hash storage block corresponding to the at least one hash function value that is smaller than the maximum conflict number as the standby hash function, using the The standby hash function performs a hash calculation on the IP address 16.0.0.1 of the packet, and obtains an alternate hash value corresponding to the IP address 16.0.0.1 of the packet, and stores the primary hash in the primary hash.
  • the alternate hash function type flag is set in the block. As shown in FIG. 5(b), a second conflict entry corresponding to the IP address 16.6.1.1 of the packet is established in the spare hash storage block corresponding to the standby hash value 16, and the The count value of the counter of the alternate hash function in the primary hash block is incremented by one.
  • the hash calculation processing method by setting whether a flag of a conflict entry established by a standby hash function and an alternate hash function type flag are set in the primary hash storage block, when the primary hash is used When the number of the first conflicting entries in the storage block is not less than the maximum number of conflicts, Determining whether the standby hash function type flag in the primary hash storage block is set, if the standby hash function type flag in the primary hash storage block has been set, according to the standby a hash function type flag, selecting a hash function corresponding to the standby hash function type flag as a standby hash function, performing hash calculation on the keyword by using the standby hash function, and obtaining the keyword And corresponding to the standby hash value, establishing a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value.
  • the hash calculation processing method provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message.
  • the length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
  • This embodiment provides a hash calculation processing method. As shown in FIG. 6, the method includes:
  • the hash calculation processing method provided by the embodiment of the present invention if the first conflict entry corresponding to the keyword is not found in the primary hash storage block, the standby hash function in the primary hash storage block is used.
  • the standby hash function corresponding to the type flag performs hash calculation on the keyword, obtains a standby hash value corresponding to the keyword, and searches for a location in the spare hash storage block corresponding to the standby hash value.
  • the second conflicting entry corresponding to the keyword returns the search result.
  • the hash calculation processing method provided by the embodiment of the present invention when the first conflict entry corresponding to the keyword is not found in the primary hash storage block, is in the standby hash storage. Querying the second conflicting entry corresponding to the keyword in the block can shorten the search time of the packet, thereby improving the searching efficiency of the packet.
  • the embodiment provides a hash calculation processing method. As shown in FIG. 7, the method includes: 701. Search, in a primary hash storage block, a first conflict entry corresponding to a keyword of a packet;
  • the function performs a hash calculation on the keyword to obtain an alternate hash value corresponding to the keyword;
  • the counter value of the counter of the standby hash function in the primary hash storage block is decremented by one.
  • the hash calculation processing method provided by the embodiment of the present invention, if the first conflict entry corresponding to the keyword of the packet is found in the primary hash storage block, deleting the primary hash storage block in the primary hash storage block If the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, the first conflicting entry corresponding to the keyword is searched for in the standby hash storage block. The second conflicting entry corresponding to the keyword is deleted, and if found, the second conflicting entry corresponding to the keyword is deleted in the standby hash storage block.
  • the hash calculation processing method provided by the embodiment of the present invention can solve the problem that the length of the hash collision chain generated by the prior art hashing the keywords in the message cannot be solved in a low-cost manner. Control problems, thereby improving the storage efficiency of messages.
  • the embodiment provides a hash calculation processing device.
  • the device includes: a receiving module 801, configured to receive a message;
  • a keyword extraction module 802 configured to extract a keyword that needs to perform hash calculation in the packet
  • a primary hash calculation module 803 configured to perform hash calculation on the keyword by using a primary hash function, to obtain The primary hash value corresponding to the keyword
  • a first determining module 804 configured to determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein, the primary hash The storage block includes at least one of the first conflicting entries, each of the first conflicting entries corresponding to a keyword, and the keyword corresponding to each of the first conflicting entries is calculated by using the primary hash function.
  • the obtained primary hash value is the same;
  • a first conflicting entry establishing module 805, configured to establish, in the primary hash storage block, the number of the first conflicting entry in the primary hash storage block when the number of the first conflicting entries is smaller than the maximum number of conflicting entries The first conflicting entry corresponding to the keyword;
  • the standby hash calculation module 806 is configured to: when the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a standby hash function to perform hash calculation on the keyword, Obtaining an alternate hash value corresponding to the keyword;
  • a second conflict entry creation module 807 configured to store the standby hash corresponding to the standby hash value Establishing, in the storage block, a second conflicting entry corresponding to the keyword; wherein, the primary hash value is different from the standby hash value, and the standby hash storage block includes at least one of the second a conflicting entry, each of the second conflicting entries corresponding to a keyword, and the candidate hash value obtained by calculating the keyword corresponding to the second conflicting entry is the same.
  • the keyword extraction module extracts a keyword that needs to be hashed in the message, and uses the main hashing module to use the main user.
  • the hash function performs a hash calculation on the keyword, and obtains a primary hash value corresponding to the keyword, and determines, by the first determining module, a primary hash storage block corresponding to the primary hash value. If the number of the first conflicting entries is less than the preset maximum number of conflicts, if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry is established.
  • the module establishes, in the primary hash storage block, a first conflicting entry corresponding to the keyword; if the number of the first conflicting entry in the primary hashed storage block is not less than the maximum number of conflicts,
  • the standby hash calculation module uses the standby hash function to perform hash calculation on the keyword, to obtain a backup hash value corresponding to the keyword, and the second conflict entry entry establishing module is in the standby hope A second conflicting entry corresponding to the keyword is established in the alternate hash storage block corresponding to the value.
  • the keyword extraction module extracts, by using a processor (such as a CPU), a keyword that needs to perform hash calculation in the packet, where
  • the primary hash calculation module performs hash calculation on the keyword by using the primary hash function by the processor, obtains a primary hash value corresponding to the keyword, and uses the primary hash value.
  • a processor such as a CPU
  • the primary hash calculation module performs hash calculation on the keyword by using the primary hash function by the processor, obtains a primary hash value corresponding to the keyword, and uses the primary hash value.
  • the first determining module determines, by the processor, whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is smaller than a maximum number of conflicts preset in the memory, If the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry establishing module is established in the primary hash storage block by the processor.
  • the standby hash calculation module uses an alternate hash function by the processor Performing a hash calculation on the keyword to obtain a backup hash value corresponding to the keyword, where the second conflict entry creation module passes the standby hash corresponding to the standby hash value by the processor.
  • a second conflicting entry corresponding to the keyword is established in the storage block, and the hash calculation processing result is sent to other devices through the interface unit.
  • the conflict entry includes: a flag for hash calculation using an alternate hash function, a valid entry of the entry, and the keyword.
  • the hash storage block includes: a flag of whether there is a conflict entry established by the standby hash function and an alternate hash function type flag.
  • the primary hash calculation module 803 includes:
  • a determining unit 8031 configured to determine whether the standby hash function type flag in the primary hash storage block is set; when the type flag has been set, according to the standby in the primary hash storage block a hash function type flag, selecting a hash function corresponding to the alternate hash function type flag as a standby hash function;
  • the first calculating unit 8033 is configured to hash the keyword by using the standby hash function. As shown in FIG. 11, the primary hash computing module 803 may further include: the type flag is not set. When selecting a hash function as an alternate hash function;
  • the first calculating unit 8033 is further configured to perform hash calculation on the keyword by using the standby hash function;
  • the setting unit 8035 is configured to set the standby hash function type flag in the primary hash storage block.
  • the second selecting unit 8034 further includes:
  • a second selection sub-unit 80342 configured to perform hash calculation on the keyword by using at least one hash function to obtain at least one hash function value corresponding to the keyword, and select one and the at least one hash
  • the hash function in the hash storage block corresponding to the function value is smaller than the hash function of the maximum conflict number as the standby hash function.
  • the apparatus may further include:
  • the finding module 808 is configured to search, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
  • the returning module 809 is configured to: when the first conflicting entry corresponding to the keyword is found in the primary hash storage block, return a search result;
  • the obtaining module 810 is configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the whether in the primary hash storage block There is a flag of the conflicting entry established by the alternate hash function and the alternate hash function type flag;
  • the second determining module 811 is configured to determine, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is a key established by the standby hash function and the key The second conflicting entry corresponding to the word;
  • the returning module 809 is configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, returning is not found;
  • the standby hash calculation module 806 is further configured to use the foregoing in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by the standby hash function.
  • the standby hash function corresponding to the standby hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; and searches for the second conflict entry corresponding to the keyword ;
  • the returning module 809 is further configured to: when the second conflicting entry corresponding to the keyword is found in the standby hash storage block, return a search result;
  • the returning module 809 is further configured to: when the second conflicting entry corresponding to the keyword is not found in the standby hash storage block, the return is not found.
  • the apparatus may further include:
  • the searching module 808 is further configured to search, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
  • a deleting module 812 configured to delete the first conflict corresponding to the keyword when the first conflicting entry corresponding to the keyword is found in the primary hash storage block Entry.
  • the apparatus may further include:
  • the obtaining module 810 is further configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the location in the primary hash storage block. Determining whether there is a flag of the conflicting entry established by the standby hash function and the standby hash function type flag; the second determining module 811 is further configured to: according to whether the primary hash storage block is There is a flag of the conflicting entry established by the standby hash function, and it is determined whether there is the second conflicting entry corresponding to the keyword established by the standby hash function;
  • the returning module 809 is further configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, the return is not found;
  • the standby hash calculation module 806 is further configured to use the foregoing in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by the standby hash function.
  • the standby hash function corresponding to the standby hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; and finds a second conflicting entry corresponding to the keyword;
  • the deleting module 812 is further configured to: when the second conflict entry corresponding to the keyword is found in the standby hash storage block, delete the first corresponding to the keyword Second conflict entry; When the second conflicting entry corresponding to the keyword is not found, the return is not found.
  • the hash calculation processing apparatus provided by the embodiment of the present invention extracts a keyword in the message that needs to be hashed by the keyword extraction module, and uses the main hash function to perform the keyword on the keyword by using the main hash calculation module.
  • the primary hash value corresponding to the keyword is obtained, and the first determining module determines whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a maximum number of conflicts, if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry building module is established in the primary hash storage block.
  • the first conflicting entry corresponding to the keyword if the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, hashing the keyword using an alternate hash function Calculating, obtaining a backup hash value corresponding to the keyword, and establishing, by the second conflict establishing module, a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value .
  • the hash calculation processing apparatus provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message.
  • the length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
  • the Hash calculation processing apparatus provided by the embodiment of the present invention may implement the foregoing method embodiment.
  • the hash calculation processing method and apparatus provided by the embodiments of the present invention can be applied to the switch router products in the field of data communication or wireless communication, but are not limited thereto.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Abstract

Disclosed in the embodiment of the present invention is a method and device for processing Hash calculations. The method comprises: receiving a message and extracting keywords from the message that requires Hash calculation; using a primary Hash function to perform a Hash calculation for the keywords; and determining whether the number of first conflict terms in a primary Hash storage block corresponding to a primary Hash value is smaller than a preset maximum conflict number. If the number of first conflict terms in the primary Hash storage block is smaller than the maximum conflict number, establishing a first conflict term corresponding to the keywords in the primary Hash storage block; if the number of first conflict entries in the primary Hash storage block is not smaller than the maximum conflict number, performing a Hash calculation for the keywords using a secondary Hash function, and establishing a secondary conflict term corresponding to the keywords in the secondary Hash storage block that corresponds to the secondary Hash value. The present invention applies to Hash calculation processing in the field of data processing technology.

Description

哈希计算处理方法及装置 技术领域  Hash calculation processing method and device
本发明涉及数据处理技术领域, 特别涉及一种哈希计算处理方法及装置。 背景技术  The present invention relates to the field of data processing technologies, and in particular, to a hash calculation processing method and apparatus. Background technique
哈希表(Hash Table )也叫散列表, 它是一种用途很广且查找效率很高的 数据表。 通过映射函数将关键字映射成一个值, 这个映射函数叫做哈希函数, 该值称之为哈希值。 哈希值通常作为表的位置来访问记录, 以加快查找的速 度。 但是, 对于不同的关键字在执行哈希计算时, 可能得到同一个哈希值, 即关键字 key 1≠Key2 , 而哈希值 Η ( key 1 ) =Η ( Key2 ) , 这种现象称为哈希冲  A hash table, also called a hash table, is a versatile and efficient looking data table. The keyword is mapped to a value by a mapping function called a hash function, which is called a hash value. The hash value is usually used as the location of the table to access the record to speed up the lookup. However, when performing hash calculation on different keywords, you may get the same hash value, that is, the keyword key 1≠Key2, and the hash value key ( key 1 ) = Η ( Key2 ). This phenomenon is called Hash Chong
为解决哈希冲突, 通常做法是在同一个哈希值下建立哈希桶, 每个哈希 桶存储 Ν个记录, 形成冲突链表, 在查找时, 首先通过哈希函数 Η找到给定值 Κ的哈希地址 Η ( Κ ), 然后以 Η ( Κ )为地址读出其哈希桶内的 Ν个记录, 最后 以关键字 Κ对读出的 Ν个记录进行精确匹配, 如果发现有匹配的记录, 则查找 成功, 否则查找失败。 但是, 这种方法存在的问题是在对报文中的关键字进 行哈希计算时产生的哈希冲突链的长度无法控制, 如果哈希冲突链的长度太 长会导致报文的存储的效率很低。 To solve the hash conflict, the usual practice is to create a hash bucket under the same hash value. Each hash bucket stores one record, forming a conflict list. When searching, first find the given value through the hash function. The hash address Η ( Κ ), then read the records in its hash bucket with Η ( Κ ) as the address, and finally match the read records with the keyword ,, if there is a match If the record is found, the search is successful, otherwise the search fails. However, the problem with this method is that the length of the hash collision chain generated when hashing the keywords in the message cannot be controlled. If the length of the hash collision chain is too long, the storage efficiency of the message may be caused. Very low.
三态内容寻址存储器 (Ternary Content Addressable Memory, 简称 TCAM) 是一种专用于进行查找操作的硬件芯片, 主要用于快速查找访问控制列表 ( Access Control List, ACL ), 路由等表项, 将冲突表项放入 TCAM中, 能够 使得哈希冲突链的长度可控。  The Ternary Content Addressable Memory (TCAM) is a hardware chip dedicated to the search operation. It is mainly used to quickly find the Access Control List (ACL), routing and other entries. The entry of the entry into the TCAM enables the length of the hash collision chain to be controlled.
在实现本发明的过程中, 发明人发现现有技术中至少存在如下问题: 现有技术中为解决报文的哈希冲突的问题而釆用建立哈希桶的方法, 无 法控制哈希冲突链的长度, 如果哈希冲突链的长度太长会导致报文的存储的 效率 4艮低; 而通过 TCAM实现哈希处理的方法, 虽然能够控制哈希冲突链的长 度, 但是实现成本较高。 发明内容 In the process of implementing the present invention, the inventors have found that at least the following problems exist in the prior art: In the prior art, in order to solve the problem of hash collision of a message, a method of establishing a hash bucket is used, and a hash collision chain cannot be controlled. The length of the hash collision chain is too long, resulting in a low efficiency of message storage. The method of hash processing by TCAM can control the length of the hash collision chain. Degree, but the implementation cost is higher. Summary of the invention
本发明的实施例提供一种哈希计算处理方法及装置, 用于解决现有技术 存在着的哈希冲突链长度控制成本较高的问题。  Embodiments of the present invention provide a hash calculation processing method and apparatus for solving the problem of high cost of hash collision chain length control existing in the prior art.
本发明实施例釆用的技术方案为:  The technical solution adopted by the embodiment of the present invention is:
一种哈希计算处理方法, 包括:  A hash calculation processing method includes:
接收报文, 提取所述报文中需要进行哈希计算的关键字;  Receiving a message, and extracting a keyword that needs to perform a hash calculation in the packet;
使用主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应 的主用哈希值;  Using the primary hash function to hash the keyword to obtain a primary hash value corresponding to the keyword;
判断与所述主用哈希值对应的主用哈希存储块中的第一冲突表项数是否 小于预设的最大冲突数; 其中, 所述主用哈希存储块包括至少一个所述第一 冲突表项, 每个所述第一冲突表项对应一个关键字, 每个所述第一冲突表项 对应的关键字通过所述主用哈希函数计算后得到的所述主用哈希值相同; 如果所述主用哈希存储块中的第一冲突表项数小于所述最大冲突数, 则 在所述主用哈希存储块中建立与所述关键字对应的第一冲突表项;  Determining whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein the primary hash storage block includes at least one of the first a conflicting entry, each of the first conflicting entries corresponding to a keyword, and the primary hash of each keyword of the first conflicting entry calculated by the primary hashing function The value is the same; if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, establishing a first conflicting table corresponding to the keyword in the primary hash storage block Item
如果所述主用哈希存储块中的第一冲突表项数不小于所述最大冲突数, 使用备用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备 用哈希值, 在与所述备用哈希值对应的备用哈希存储块中建立与所述关键字 对应的第二冲突表项; 其中, 所述主用哈希值与所述备用哈希值不相同, 所 述备用哈希存储块包括至少一个所述第二冲突表项, 每个所述第二冲突表项 对应一个关键字, 每个所述第二冲突表项对应的关键字通过所述备用哈希函 数计算后得到的所述备用哈希值相同。  If the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, the candidate hash function is used to perform hash calculation on the keyword to obtain an alternate hash corresponding to the keyword. a second conflict entry corresponding to the keyword is established in the standby hash storage block corresponding to the standby hash value; wherein, the primary hash value and the standby hash value are not Similarly, the standby hash storage block includes at least one of the second conflicting entries, each of the second conflicting entries corresponding to a keyword, and the keyword corresponding to each of the second conflicting entries passes the The alternate hash value obtained after the standby hash function is calculated is the same.
一种哈希计算处理装置, 包括:  A hash calculation processing device includes:
接收模块, 用于接收报文;  a receiving module, configured to receive a message;
关键字提取模块, 用于提取所述报文中需要进行哈希计算的关键字; 主用哈希计算模块, 用于使用主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的主用哈希值; a keyword extraction module, configured to extract a keyword that needs to perform hash calculation in the packet; a primary hash calculation module, configured to perform hash calculation on the keyword by using a primary hash function, Obtaining a primary hash value corresponding to the keyword;
第一判断模块, 用于判断与所述主用哈希值对应的主用哈希存储块中的 第一冲突表项数是否小于预设的最大冲突数; 其中, 所述主用哈希存储块包 括至少一个所述第一冲突表项, 每个所述第一冲突表项对应一个关键字, 每 个所述第一冲突表项对应的关键字通过所述主用哈希函数计算后得到的所述 主用哈希值相同;  a first determining module, configured to determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein, the primary hash storage The block includes at least one of the first conflicting entries, each of the first conflicting entries corresponding to a keyword, and a keyword corresponding to each of the first conflicting entries is calculated by using the primary hash function. The primary hash value is the same;
第一冲突表项建立模块, 用于当所述主用哈希存储块中的第一冲突表项 数小于所述最大冲突数时, 在所述主用哈希存储块中建立与所述关键字对应 的第一冲突表项;  a first conflicting table entry establishing module, configured to establish, in the primary hash storage block, the key in the primary hash storage block when the number of the first conflicting entry in the primary hash storage block is less than the maximum conflicting number The first conflicting entry corresponding to the word;
备用哈希计算模块, 用于当所述主用哈希存储块中的第一冲突表项数不 小于所述最大冲突数时, 使用备用哈希函数对所述关键字进行哈希计算, 得 到与所述关键字对应的备用哈希值;  a backup hash calculation module, configured to: when the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a backup hash function to perform hash calculation on the keyword, An alternate hash value corresponding to the keyword;
第二冲突表项建立模块, 用于在与所述备用哈希值对应的备用哈希存储 块中建立与所述关键字对应的第二冲突表项; 其中, 所述主用哈希值与所述 备用哈希值不相同, 所述备用哈希存储块包括至少一个所述第二冲突表项, 每个所述第二冲突表项对应一个关键字, 每个所述第二冲突表项对应的关键 字通过所述备用哈希函数计算后得到的所述备用哈希值相同。  a second conflict entry establishing module, configured to establish a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value, where the primary hash value is The standby hash value is different, the standby hash storage block includes at least one second conflicting entry, each of the second conflicting entries corresponds to a keyword, and each of the second conflicting entries The standby hash value obtained by calculating the corresponding keyword by the standby hash function is the same.
本发明实施例提供的哈希计算处理方法及装置, 通过提取报文中需要进 行哈希计算的关键字, 使用主用哈希函数对所述关键字进行哈希计算, 得到 与所述关键字对应的主用哈希值, 判断与所述主用哈希值对应的主用哈希存 储块中的第一冲突表项数是否小于预设的最大冲突数, 如果所述主用哈希存 储块中的第一冲突表项数小于所述最大冲突数, 则在所述主用哈希存储块中 建立与所述关键字对应的第一冲突表项, 如果所述主用哈希存储块中的第一 冲突表项数不小于所述最大冲突数, 使用备用哈希函数对所述关键字进行哈 希计算, 得到与所述关键字对应的备用哈希值, 在与所述备用哈希值对应的 备用哈希存储块中建立与所述关键字对应的第二冲突表项。 本发明实施例提 供的哈希计算处理方法及装置, 在对报文中的关键字进行哈希计算处理时, 可以用低成本的方式解决现有技术对报文中的关键字进行哈希计算时生成的 哈希冲突链的长度无法控制的问题, 从而提高报文的存储效率。 附图说明 The hash calculation processing method and apparatus provided by the embodiment of the present invention, by extracting keywords that need to be hashed in the message, hashing the keyword using the primary hash function, and obtaining the keyword Corresponding primary hash value, determining whether the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value is less than a preset maximum conflict number, if the primary hash storage If the number of the first conflicting entries in the block is smaller than the maximum number of conflicts, the first conflicting entry corresponding to the keyword is established in the primary hash storage block, if the primary hash storage block The number of the first conflicting table entries is not less than the maximum number of conflicts, and the keyword is hashed using an alternate hash function to obtain an alternate hash value corresponding to the keyword, A second conflicting entry corresponding to the keyword is established in the spare hash storage block corresponding to the hash value. Embodiment of the present invention The hash calculation processing method and device can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message. The problem that the length of the collision chain cannot be controlled, thereby improving the storage efficiency of the message. DRAWINGS
为了更清楚地说明本发明实施例中的技术方案, 下面将对实施例或现有 技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附 图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创 造性劳动的前提下, 还可以根据这些附图获得其它的附图。  In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the embodiments or the prior art description will be briefly described below. It is obvious that the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图 1为本发明实施例一提供的哈希计算处理方法流程图;  1 is a flowchart of a hash calculation processing method according to Embodiment 1 of the present invention;
图 2为本发明实施例二提供的哈希计算处理方法流程图;  2 is a flowchart of a hash calculation processing method according to Embodiment 2 of the present invention;
图 3为本发明实施例二提供的哈希存储块的结构示意图;  3 is a schematic structural diagram of a hash storage block according to Embodiment 2 of the present invention;
图 4为本发明实施例二提供的第一冲突表项数小于最大冲突数时的主用 哈希存储块的结构示意图;  4 is a schematic structural diagram of a primary hash storage block when the number of first conflict entries is less than the maximum number of collisions according to Embodiment 2 of the present invention;
图 5 ( a ) 为本发明实施例二提供的第一冲突表项数不小于最大冲突数时 的主用哈希存储块的结构示意图;  Figure 5 (a) is a schematic structural diagram of a primary hash storage block when the number of first conflict entries is not less than the maximum number of collisions according to the second embodiment of the present invention;
图 5 ( b ) 为本发明实施例二提供的备用哈希存储块的结构示意图; 图 6为本发明实施例三提供的哈希计算处理方法流程图;  FIG. 5(b) is a schematic structural diagram of a backup hash storage block according to Embodiment 2 of the present invention; FIG. 6 is a flowchart of a hash calculation processing method according to Embodiment 3 of the present invention;
图 7为本发明实施例四提供的哈希计算处理方法流程图;  7 is a flowchart of a hash calculation processing method according to Embodiment 4 of the present invention;
图 8为本发明实施例五提供的哈希计算处理装置结构示意图;  8 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention;
图 9为本发明实施例五提供的哈希计算处理装置工作流程图;  9 is a flowchart of the operation of the hash calculation processing apparatus according to Embodiment 5 of the present invention;
图 10为本发明实施例五提供的哈希计算处理装置的硬件电路示意图; 图 11为本发明实施例五提供的哈希计算处理装置结构示意图;  10 is a schematic diagram of a hardware circuit of a hash calculation processing apparatus according to Embodiment 5 of the present invention; FIG. 11 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention;
图 12为本发明实施例五提供的哈希计算处理装置结构示意图;  12 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention;
图 13为本发明实施例五提供的哈希计算处理装置结构示意图。 具体实施方式 FIG. 13 is a schematic structural diagram of a hash calculation processing apparatus according to Embodiment 5 of the present invention. detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其它实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
为使本发明技术方案的优点更加清楚, 下面结合附图和实施例对本发明 作详细说明。  In order to make the advantages of the technical solutions of the present invention clearer, the present invention will be described in detail below with reference to the accompanying drawings and embodiments.
实施例一  Embodiment 1
本实施例提供一种哈希计算处理方法, 如图 1所示, 所述方法包括: This embodiment provides a hash calculation processing method. As shown in FIG. 1, the method includes:
101、 接收报文, 提取所述报文中需要进行哈希计算的关键字; 101. Receive a message, and extract a keyword that needs to perform a hash calculation in the packet.
102、 使用主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字 对应的主用哈希值;  102. Perform hash calculation on the keyword by using a primary hash function, to obtain a primary hash value corresponding to the keyword;
103、 判断与所述主用哈希值对应的主用哈希存储块中的第一冲突表项数 是否小于预设的最大冲突数; 其中, 所述主用哈希存储块包括至少一个所述 第一冲突表项, 每个所述第一冲突表项对应一个关键字, 每个所述第一冲突 表项对应的关键字通过所述主用哈希函数计算后得到的所述主用哈希值相 同;  103. Determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts, where the primary hash storage block includes at least one a first conflicting entry, each of the first conflicting entries corresponding to a keyword, and the keyword corresponding to each of the first conflicting entries is calculated by using the primary hashing function. The hash value is the same;
104、 如果所述主用哈希存储块中的第一冲突表项数小于所述最大冲突 数, 则在所述主用哈希存储块中建立与所述关键字对应的第一冲突表项; 104. If the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, establish a first conflicting entry corresponding to the keyword in the primary hash storage block. ;
105、 如果所述主用哈希存储块中的第一冲突表项数不小于所述最大冲突 数, 使用备用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应 的备用哈希值, 在与所述备用哈希值对应的备用哈希存储块中建立与所述关 键字对应的第二冲突表项; 其中, 所述主用哈希值与所述备用哈希值不相同, 所述备用哈希存储块包括至少一个所述第二冲突表项, 每个所述第二冲突表 项对应一个关键字, 每个所述第二冲突表项对应的关键字通过所述备用哈希 函数计算后得到的所述备用哈希值相同。 本发明实施例提供的哈希计算处理方法, 通过提取报文中需要进行哈希 计算的关键字, 使用主用哈希函数对所述关键字进行哈希计算, 得到与所述 关键字对应的主用哈希值, 判断与所述主用哈希值对应的主用哈希存储块中 的第一冲突表项数是否小于预设的最大冲突数, 如果所述主用哈希存储块中 的第一冲突表项数小于所述最大冲突数, 则在所述主用哈希存储块中建立与 所述关键字对应的第一冲突表项, 如果所述主用哈希存储块中的第一冲突表 项数不小于所述最大冲突数, 使用备用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希值, 在与所述备用哈希值对应的备用哈希 存储块中建立与所述关键字对应的第二冲突表项。 本发明实施例提供的哈希 计算处理方法, 在对报文中的关键字进行哈希计算处理时, 可以用低成本的 方式解决现有技术对报文中的关键字进行哈希计算时生成的哈希冲突链的长 度无法控制的问题, 从而提高报文的存储效率。 105. If the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a backup hash function to perform hash calculation on the keyword, to obtain a corresponding to the keyword. a second hash entry corresponding to the keyword, in the standby hash storage block corresponding to the standby hash value, where the primary hash value and the standby hash are The value of the second hash entry includes at least one of the second conflicting entries, and each of the second conflicting entries corresponds to a keyword, and the keyword corresponding to each of the second conflicting entries passes The standby hash value obtained after the calculation of the standby hash function is the same. The hash calculation processing method provided by the embodiment of the present invention performs hash calculation on the keyword by using a primary hash function by extracting a keyword that needs to perform hash calculation in the packet, and obtains a keyword corresponding to the keyword. Determining, by the primary hash value, whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts, if the primary hash storage block is used And establishing, by the primary hash storage block, a first conflicting entry corresponding to the keyword, if the number of the first conflicting entry is less than the maximum number of conflicts, if the primary hashing block is in the primary hashing block The number of the first conflicting entry is not less than the maximum number of conflicts, and the keyword is hashed using an alternate hash function to obtain an alternate hash value corresponding to the keyword, and the standby hash value is A second conflicting entry corresponding to the keyword is established in the corresponding standby hash storage block. The hash calculation processing method provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message. The length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
实施例二  Embodiment 2
本实施例提供一种哈希计算处理方法, 如图 2所示, 所述方法包括: This embodiment provides a hash calculation processing method. As shown in FIG. 2, the method includes:
201、 接收报文, 提取所述报文中需要进行哈希计算的 IP地址; 201. Receive a packet, and extract an IP address that needs to be hashed in the packet.
202、 使用主用哈希函数对所述报文的 IP地址进行哈希计算, 得到与所述 才艮文的 IP地址对应的主用哈希值;  202. Perform a hash calculation on the IP address of the packet by using a primary hash function, and obtain a primary hash value corresponding to the IP address of the packet;
203、 判断与所述主用哈希值对应的主用哈希存储块中的第一冲突表项数 是否小于预设的最大冲突数; 其中, 所述主用哈希存储块包括至少一个所述 第一冲突表项,每个所述第一冲突表项对应一个报文的 IP地址,每个所述第一 冲突表项对应的报文的 IP地址通过所述主用哈希函数计算后得到的所述主用 哈希值相同;  203. Determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts, where the primary hash storage block includes at least one The first conflicting entry, each of the first conflicting entries corresponds to an IP address of a packet, and the IP address of the packet corresponding to each of the first conflicting entries is calculated by using the primary hash function. The obtained primary hash value is the same;
204、 如果所述主用哈希存储块中的第一冲突表项数小于所述最大冲突 数, 则在所述主用哈希存储块中建立与所述报文的 IP地址对应的第一冲突表 项;  204. If the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, establish a first one corresponding to the IP address of the packet in the primary hash storage block. Conflict entry
其中, 所述冲突表项包括: 是否使用备用哈希函数进行哈希计算的标记、 表项有效标记以及所述报文的 IP地址。 如图 3所示, 图中的冲突表项中的是否 使用备用哈希函数进行哈希计算的标记 B用于标识对所述报文的 IP地址使用 主用哈希函数进行哈希计算, 还是使用备用哈希函数进行哈希计算。 例如, 当 B=0时, 表示使用主用哈希函数对所述报文的 IP地址进行哈希计算, 当 B=l 时,表示使用备用哈希函数对所述报文的 IP地址进行哈希计算。 图中冲突表项 中的表项有效标志 D用于标识所述冲突表项是否有效, 当 D=l时, 表示所述冲 突表项有效, 当 D=0时, 表示所述冲突表项无效。 The conflicting entry includes: a flag for performing a hash calculation using an alternate hash function, The entry valid tag and the IP address of the packet. As shown in FIG. 3, whether the flag B in the conflicting entry in the figure uses the alternate hash function for hash calculation is used to identify that the IP address of the packet is hashed using the primary hash function, or Use the alternate hash function for hash calculations. For example, when B=0, it means that the IP address of the message is hashed using the primary hash function. When B=l, it means that the IP address of the packet is used by using the alternate hash function. Greek calculation. The table entry valid flag D in the conflicting entry is used to identify whether the conflicting entry is valid. When D=l, it indicates that the conflicting entry is valid. When D=0, the conflicting entry is invalid. .
所述哈希存储块包括: 一个是否存在通过备用哈希函数建立的冲突表项 的标志和一个备用哈希函数类型标志。 具体地, 如图 3所示, 可以在哈希存储 块中设置一个公共的备用哈希函数的计数器 C,用于对通过备用哈希函数建立 的第二冲突表项进行计数, 当 C=0时, 表示不存在通过备用哈希函数建立的第 二冲突表项,当 C=l时,表示存在一个通过备用哈希函数建立的第二冲突表项。 图中的哈希存储块中的备用哈希函数类型标志 T,表示是否设置了备用哈希函 数, 当 T=0时, 表示没有设置备用哈希函数。  The hash storage block includes: a flag of a conflict entry established by the alternate hash function and an alternate hash function type flag. Specifically, as shown in FIG. 3, a counter C of a common standby hash function may be set in the hash storage block for counting the second conflicting entry established by the standby hash function, when C=0 When it is, there is no second conflicting entry established by the standby hash function. When C=l, it indicates that there is a second conflicting entry established by the standby hash function. The alternate hash function type flag T in the hash memory block in the figure indicates whether an alternate hash function is set. When T=0, it indicates that the alternate hash function is not set.
205、 当所述主用哈希存储块中的第一冲突表项数不小于所述最大冲突数 时, 判断所述主用哈希存储块中的所述备用哈希函数类型标志是否被设置;  205. When the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, determine whether the standby hash function type flag in the primary hash storage block is set. ;
206、 如果所述主用哈希存储块中的所述备用哈希函数类型标志已经被设 置, 根据所述备用哈希函数类型标志, 选择与所述备用哈希函数类型标志对 应的哈希函数作为备用哈希函数;  206. If the standby hash function type flag in the primary hash storage block has been set, select a hash function corresponding to the standby hash function type flag according to the standby hash function type flag. As a backup hash function;
207、 如果所述主用哈希存储块中的所述备用哈希函数类型标志没有被设 置, 选择一个哈希函数作为备用哈希函数, 并在所述主用哈希存储块中设置 所述备用哈希函数的类型标志;  207. If the alternate hash function type flag in the primary hash storage block is not set, select a hash function as a standby hash function, and set the in the primary hash storage block. The type flag of the alternate hash function;
具体地, 可以选择一个比所述主用哈希函数产生哈希冲突少的哈希函数 作为备用哈希函数;  Specifically, a hash function that generates less hash collision than the primary hash function may be selected as the standby hash function;
或者,通过使用至少一个哈希函数对所述报文的 IP地址进行哈希计算,得 到至少一个与所述报文的 IP地址对应的哈希函数值,选择一个与所述至少一个 哈希函数值对应的哈希存储块中的冲突表项数小于所述最大冲突数的哈希函 数作为备用哈希函数。 Alternatively, by performing hash calculation on the IP address of the packet by using at least one hash function, obtaining at least one hash function value corresponding to the IP address of the packet, and selecting one and the at least one The hash function in the hash storage block corresponding to the hash function value is smaller than the hash function of the maximum conflict number as the standby hash function.
208、 使用所述备用哈希函数对所述报文的 IP地址进行哈希计算, 得到与 所述报文的 IP地址对应的备用哈希值;  208. Perform a hash calculation on the IP address of the packet by using the standby hash function, and obtain an alternate hash value corresponding to the IP address of the packet.
209、 在与所述备用哈希值对应的备用哈希存储块中建立与所述报文的 IP 地址对应的第二冲突表项。  209. Establish a second conflicting entry corresponding to the IP address of the packet in the standby hash storage block corresponding to the standby hash value.
具体地, 可以将所述主用哈希存储块中的公共的备用哈希函数的计数器 的初始值设为一个预定的数(例如 0 ), 当所述主用哈希存储块中的第一冲突 表项数不小于所述最大冲突数时, 在所述备用哈希存储块中建立与所述报文 的 IP地址对应的第二冲突表项,并将所述主用哈希存储块中的所述公共的备用 哈希函数的计数器的计数值加 1。  Specifically, an initial value of a counter of a common standby hash function in the primary hash storage block may be set to a predetermined number (for example, 0), when the first one of the primary hash storage blocks is When the number of the conflicting entries is not less than the maximum number of conflicts, a second conflicting entry corresponding to the IP address of the packet is established in the standby hash storage block, and the primary hash storage block is used. The counter value of the counter of the common alternate hash function is incremented by one.
如图 4所示, 例如预设在哈希存储块中产生哈希冲突的最大冲突数为 6 , 在接收到报文以后,提取所述报文需要进行哈希计算的 IP地址,假设所述报文 的 IP地址为 10.0.0.1 , 使用主用哈希函数对所述报文的 IP地址 10.0.0.1进行哈希 计算, 得到与所述 ^艮文的 IP地址 10.0.0.1对应的主用哈希值为 1 , 判断与所述主 用哈希值 1对应的主用哈希存储块中的第一冲突表项数为 0, 小于所述最大冲 突数 6,在所述主用哈希存储块中建立与所述报文的 IP地址 10.0.0.1对应的第一 冲突表项。 如果又接收到报文 11.0.0.1 , 提取所述报文需要进行哈希计算的 IP 地址 11.0.0.1 , 使用所述主用哈希函数对所述报文的 IP地址 11.0.0.1进行哈希计 算, 得到与所述报文的 IP地址 11.0.0.1对应的主用哈希值也是 1 , 判断与所述主 用哈希值 1对应的主用哈希存储块中的第一冲突表项数为 1 , 小于所述最大冲 突数 6,在所述主用哈希存储块中建立与所述报文的 IP地址 11.0.0.1对应的第一 冲突表项, 此时所述主用哈希存储块中的第一冲突表项数为 2。 类似地, 依次 接收到才艮文 12.0.0.1、 才艮文 13.0.0.1、 才艮文 14.0.0.1、 才艮文 15.0.0.1 , 使用所述主 用哈希函数依次对 IP地址 12.0.0.1、 13.0.0.1、 14.0.0.1、 15.0.0.1进行哈希计算, 得到与 IP地址 12.0.0.1、 13.0.0.1、 14.0.0.1、 15.0.0.1对应的主用哈希值都为 1 , 判断与所述主用哈希值 1对应的主用哈希存储块中的第一冲突表项数分别为 2, 3 , 4, 5 , 都小于所述最大冲突数 6, 在所述主用哈希存储块中建立与 IP地 址 12.0.0.1、 13.0.0.1、 14.0.0.1、 15.0.0.1对应的第一冲突表项, 此时所述主用 哈希存储块中的第一冲突表项数为 6。 As shown in FIG. 4, for example, the maximum number of collisions for generating a hash collision in the hash storage block is 6, and after receiving the message, extracting an IP address for which the packet needs to be hashed, assuming the The IP address of the packet is 10.0.0.1, and the IP address 10.0.0.1 of the packet is hashed using the primary hash function, and the primary user corresponding to the IP address 10.0.0.1 of the message is obtained. The hash value is 1, and it is determined that the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value 1 is 0, less than the maximum conflict number 6, and is stored in the primary hash. A first conflict entry corresponding to the IP address 10.0.0.1 of the packet is established in the block. If the message 11.0.0.1 is received again, the IP address 11.0.0.1 of the hash calculation is extracted, and the primary hash function is used to perform hash calculation on the IP address 11.0.0.1 of the message. Obtaining that the primary hash value corresponding to the IP address 11.0.0.1 of the packet is also 1, and determining that the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value 1 is 1 . The first conflicting entry corresponding to the IP address 11.0.0.1 of the packet is established in the primary hash storage block, and the primary hash storage block is used. The number of the first conflicting entries in the middle is 2. Similarly, in turn, the message 12.0.0.1, the message 13.0.0.1, the message 14.0.0.1, the message 15.0.0.1 are received, and the primary hash function is used to sequentially address the IP address 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 perform hash calculation, and the main hash values corresponding to IP addresses 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 are all 1 . Determining that the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value 1 is 2, 3, 4, 5, respectively, which are smaller than the maximum conflicting number 6, in the primary use A first conflicting entry corresponding to the IP address 12.0.0.1, 13.0.0.1, 14.0.0.1, 15.0.0.1 is established in the hash storage block, and the number of the first conflicting entry in the primary hash storage block is Is 6.
如图 5所示 (a ) 所示, 假如这时接收到 IP地址为 16.0.0.1的报文, 使用所 述主用哈希函数对所述报文的 IP地址 16.0.0.1进行哈希计算, 得到与所述报文 的 IP地址 16.0.0.1对应的主用哈希值也为 1 , 判断与所述主用哈希值 1对应的主 用哈希存储块中的第一冲突表项数为 6, 不小于所述最大冲突数 6, 判断所述 主用哈希存储块中的所述备用哈希函数类型标志 T是否被设置,如果所述主用 哈希存储块中的所述备用哈希函数类型标志 T=l ,表示所述主用哈希存储块中 的所述备用哈希函数类型标志已经被设置, 根据所述备用哈希函数类型标志, 选择与所述备用哈希函数类型标志对应的哈希函数作为备用哈希函数; 如果 所述主用哈希存储块中的所述备用哈希函数类型标志 Τ=0 ,表示所述主用哈希 存储块中的所述备用哈希函数类型标志没有被设置, 选择一个比所述主用哈 希函数产生哈希冲突少的哈希函数作为备用哈希函数, 或者通过使用至少一 个哈希函数对所述报文的 IP地址进行哈希计算,得到至少一个与所述报文的 IP 地址对应的哈希函数值, 选择一个与所述至少一个哈希函数值对应的哈希存 储块中的冲突表项数小于所述最大冲突数的哈希函数作为备用哈希函数, 使 用所述备用哈希函数对所述报文的 IP地址 16.0.0.1进行哈希计算, 得到与所述 报文的 IP地址 16.0.0.1对应的备用哈希值为 16, 并在所述主用哈希存储块中设 置所述备用哈希函数类型标志。 如图 5 ( b ) 所示, 在与所述备用哈希值 16对 应的备用哈希存储块中建立与所述报文的 IP地址 16.0.0.1对应的第二冲突表 项, 并将所述主用哈希存储块中的备用哈希函数的计数器的计数值加 1。  As shown in FIG. 5(a), if a packet with an IP address of 16.0.0.1 is received at this time, the primary hash function is used to perform a hash calculation on the IP address 16.0.0.1 of the packet. Obtaining that the primary hash value corresponding to the IP address 16.0.0.1 of the packet is also 1, and determining that the number of the first conflict entry in the primary hash storage block corresponding to the primary hash value 1 is 6, not less than the maximum number of collisions 6, determining whether the standby hash function type flag T in the primary hash storage block is set, if the standby hash in the primary hash storage block The hash function type flag T=l indicates that the alternate hash function type flag in the primary hash storage block has been set, and the standby hash function type is selected according to the standby hash function type flag. a hash function corresponding to the flag as a standby hash function; if the alternate hash function type flag Τ=0 in the primary hash storage block, indicating the standby hash in the primary hash storage block The Greek function type flag is not set, select one than the main Using a hash function to generate a hash function with less hash collision as a standby hash function, or hashing the IP address of the packet by using at least one hash function to obtain at least one IP with the packet a hash function value corresponding to the address, selecting a hash function in the hash storage block corresponding to the at least one hash function value that is smaller than the maximum conflict number as the standby hash function, using the The standby hash function performs a hash calculation on the IP address 16.0.0.1 of the packet, and obtains an alternate hash value corresponding to the IP address 16.0.0.1 of the packet, and stores the primary hash in the primary hash. The alternate hash function type flag is set in the block. As shown in FIG. 5(b), a second conflict entry corresponding to the IP address 16.6.1.1 of the packet is established in the spare hash storage block corresponding to the standby hash value 16, and the The count value of the counter of the alternate hash function in the primary hash block is incremented by one.
本发明实施例提供的哈希计算处理方法, 通过在主用哈希存储块中设置 一个是否存在通过备用哈希函数建立的冲突表项的标志和一个备用哈希函数 类型标志, 当主用哈希存储块中的第一冲突表项数不小于所述最大冲突数时, 判断所述主用哈希存储块中的所述备用哈希函数类型标志是否被设置, 如果 所述主用哈希存储块中的所述备用哈希函数类型标志已经被设置, 根据所述 备用哈希函数类型标志, 选择与所述备用哈希函数类型标志对应的哈希函数 作为备用哈希函数, 使用所述备用哈希函数对所述关键字进行哈希计算, 得 到与所述关键字对应的备用哈希值, 在与所述备用哈希值对应的备用哈希存 储块中建立与所述关键字对应的第二冲突表项。 本发明实施例提供的哈希计 算处理方法, 在对报文中的关键字进行哈希计算处理时, 可以用低成本的方 式解决现有技术对报文中的关键字进行哈希计算时生成的哈希冲突链的长度 无法控制的问题, 从而提高报文的存储效率。 The hash calculation processing method provided by the embodiment of the present invention, by setting whether a flag of a conflict entry established by a standby hash function and an alternate hash function type flag are set in the primary hash storage block, when the primary hash is used When the number of the first conflicting entries in the storage block is not less than the maximum number of conflicts, Determining whether the standby hash function type flag in the primary hash storage block is set, if the standby hash function type flag in the primary hash storage block has been set, according to the standby a hash function type flag, selecting a hash function corresponding to the standby hash function type flag as a standby hash function, performing hash calculation on the keyword by using the standby hash function, and obtaining the keyword And corresponding to the standby hash value, establishing a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value. The hash calculation processing method provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message. The length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
实施例三  Embodiment 3
本实施例提供一种哈希计算处理方法, 如图 6所示, 所述方法包括: This embodiment provides a hash calculation processing method. As shown in FIG. 6, the method includes:
601、 使用主用哈希函数对报文的关键字进行哈希计算, 得到与所述关键 字对应的主用哈希值; 601. Perform a hash calculation on the keyword of the packet by using a primary hash function, to obtain a primary hash value corresponding to the keyword;
602、 在所述主用哈希存储块中查找与所述关键字对应的所述第一冲突表 项, 判断在所述主用哈希存储块中是否查到与所述关键字对应的所述第一冲 突表项;  602. Search, in the primary hash storage block, the first conflicting entry corresponding to the keyword, and determine whether a location corresponding to the keyword is found in the primary hash storage block. The first conflicting entry;
603、 如果在所述主用哈希存储块中查到与所述关键字对应的所述第一冲 突表项, 返回查找结果;  603. If the first conflicting entry corresponding to the keyword is found in the primary hash storage block, return a search result.
604、 如果在所述主用哈希存储块中没有查到与所述关键字对应的所述第 一冲突表项, 获得所述主用哈希存储块中的所述是否存在通过备用哈希函数 建立的冲突表项的标志和所述备用哈希函数类型标志;  604. If the first conflict entry corresponding to the keyword is not found in the primary hash storage block, obtain whether the primary hash storage block exists in the primary hash storage block by using a standby hash. a flag of the conflicting entry established by the function and the alternate hash function type flag;
605、 根据所述主用哈希存储块中的所述是否存在通过备用哈希函数建立 的冲突表项的标志, 判断是否存在通过备用哈希函数建立的与所述关键字对 应的所述第二冲突表项;  605. Determine, according to whether the identifier of the conflicting entry established by the standby hash function exists in the primary hash storage block, whether there is the first identifier corresponding to the keyword established by the standby hash function. Second conflict entry;
606、 如果不存在通过备用哈希函数建立的与所述关键字对应的所述第二 冲突表项, 返回没有查到; 607、 如果存在通过备用哈希函数建立的与所述关键字对应的所述第二冲 突表项, 使用所述主用哈希存储块中的所述备用哈希函数类型标志对应的备 用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希 值; 606. If there is no second conflict entry corresponding to the keyword established by the standby hash function, the return is not found; 607. If there is the second conflict entry corresponding to the keyword established by the standby hash function, use the standby hash corresponding to the standby hash function type flag in the primary hash storage block. The function performs a hash calculation on the keyword to obtain an alternate hash value corresponding to the keyword;
608、 在与所述备用哈希值对应的备用哈希存储块中查找与所述关键字对 是否查到与所述关键字对应的所述第二冲突表项;  608. Search, in the standby hash storage block corresponding to the standby hash value, whether the second conflicting entry corresponding to the keyword is found by the keyword pair.
609、 如果在所述备用哈希存储块中查到与所述关键字对应的所述第二冲 突表项, 返回查找结果, 如果在所述备用哈希存储块中没有查到与所述关键 字对应的所述第二冲突表项, 则返回没有查到。  609. If the second conflict entry corresponding to the keyword is found in the standby hash storage block, return a search result, if the key is not found in the standby hash storage block. The second conflicting entry corresponding to the word is returned without being found.
本发明实施例提供的哈希计算处理方法, 如果在主用哈希存储块中没有 查到与关键字对应的第一冲突表项, 使用所述主用哈希存储块中的备用哈希 函数类型标志对应的备用哈希函数对所述关键字进行哈希计算, 得到与所述 关键字对应的备用哈希值, 在与所述备用哈希值对应的备用哈希存储块中查 找与所述关键字对应的第二冲突表项, 返回查找结果。 和现有技术相比, 本 发明实施例提供的哈希计算处理方法, 当在主用哈希存储块中没有找到与所 述关键字对应的第一冲突表项时, 则在备用哈希存储块中查找与所述关键字 对应的第二冲突表项, 可以缩短报文的查找时间, 从而提高报文的查找效率。  The hash calculation processing method provided by the embodiment of the present invention, if the first conflict entry corresponding to the keyword is not found in the primary hash storage block, the standby hash function in the primary hash storage block is used. The standby hash function corresponding to the type flag performs hash calculation on the keyword, obtains a standby hash value corresponding to the keyword, and searches for a location in the spare hash storage block corresponding to the standby hash value. The second conflicting entry corresponding to the keyword returns the search result. Compared with the prior art, the hash calculation processing method provided by the embodiment of the present invention, when the first conflict entry corresponding to the keyword is not found in the primary hash storage block, is in the standby hash storage. Querying the second conflicting entry corresponding to the keyword in the block can shorten the search time of the packet, thereby improving the searching efficiency of the packet.
实施例四  Embodiment 4
本实施例提供一种哈希计算处理方法, 如图 7所示, 所述方法包括: 701、 在主用哈希存储块中查找与报文的关键字对应的第一冲突表项; The embodiment provides a hash calculation processing method. As shown in FIG. 7, the method includes: 701. Search, in a primary hash storage block, a first conflict entry corresponding to a keyword of a packet;
702、 判断是否在所述主用哈希存储块中查到与所述关键字对应的第一冲 突表项; 702. Determine whether a first conflicting entry corresponding to the keyword is found in the primary hash storage block.
703、 如果在所述主用哈希存储块中查到与所述关键字对应的所述第一冲 突表项, 删除所述与所述关键字对应的所述第一冲突表项;  703. If the first conflicting entry corresponding to the keyword is found in the primary hash storage block, delete the first conflicting entry corresponding to the keyword.
704、 如果在所述主用哈希存储块中没有查到与所述关键字对应的第一冲 突表项, 获得所述主用哈希存储块中的所述是否存在通过备用哈希函数建立 的冲突表项的标志和所述备用哈希函数类型标志; 704. If the first rush corresponding to the keyword is not found in the primary hash storage block a table entry, obtaining, in the primary hash storage block, whether there is a flag of a conflicting entry established by a standby hash function and the standby hash function type flag;
705、 根据所述主用哈希存储块中的所述是否存在通过备用哈希函数建立 的冲突表项的标志, 判断是否存在通过备用哈希函数建立的与所述关键字对 应的所述第二冲突表项;  705. Determine, according to whether the identifier of the conflicting entry established by the standby hash function exists in the primary hash storage block, whether there is the first identifier corresponding to the keyword established by the standby hash function. Second conflict entry;
具体地, 可以通过所述主用哈希存储块中的公共的备用哈希函数的计数 器判断是否存在通过备用哈希函数建立的第二冲突表项, 如果所述主用哈希 存储块中的备用哈希函数的计数器的计数值不为 0 , 则存在通过备用哈希函数 建立的冲突表项, 如果所述主用哈希存储块中的备用哈希函数的计数器的计 数值为 0, 则不存在通过备用哈希函数建立的冲突表项。  Specifically, it may be determined by a counter of a common standby hash function in the primary hash storage block whether there is a second conflict entry established by the standby hash function, if the primary hash storage block If the count value of the counter of the standby hash function is not 0, there is a conflict entry established by the standby hash function. If the count value of the counter of the standby hash function in the primary hash storage block is 0, then There is no conflict entry created by the alternate hash function.
706、 如果不存在通过备用哈希函数建立的与所述关键字对应的所述第二 冲突表项, 返回没有查到;  706. If there is no second conflict entry corresponding to the keyword established by the standby hash function, the return is not found;
707、 如果存在通过备用哈希函数建立的与所述关键字对应的所述第二冲 突表项, 使用所述主用哈希存储块中的所述备用哈希函数类型标志对应的备 用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希 值;  707. If there is the second conflict entry corresponding to the keyword established by the standby hash function, use the standby hash corresponding to the standby hash function type flag in the primary hash storage block. The function performs a hash calculation on the keyword to obtain an alternate hash value corresponding to the keyword;
708、 在所述备用哈希值对应的备用哈希存储块中查找与所述关键字对应 的第二的冲突表项; 键字对应的第二的冲突表项;  708. Search for a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value; a second conflicting entry corresponding to the key;
710、 如果在所述备用哈希存储块中查到与所述关键字对应的所述第二冲 突表项, 删除所述与所述关键字对应的所述第二冲突表项, 如果在所述备用 哈希值对应的备用哈希存储块中没有查到与所述关键字对应的第二的冲突表 项, 则返回没有查到。  710. If the second conflicting entry corresponding to the keyword is found in the standby hash storage block, deleting the second conflicting entry corresponding to the keyword, if If the second conflict entry corresponding to the keyword is not found in the spare hash storage block corresponding to the standby hash value, the return is not found.
具体地, 在所述备用哈希存储块中删除与所述关键字对应的第二冲突表 项之后, 将所述主用哈希存储块中的备用哈希函数的计数器的计数值减 1。 本发明实施例提供的哈希计算处理方法, 如果在主用哈希存储块中查到 与报文的关键字对应的第一冲突表项, 在所述主用哈希存储块中删除所述与 所述关键字对应的第一冲突表项, 如果在所述主用哈希存储块中没有查到与 所述关键字对应的第一冲突表项, 在备用哈希存储块中查找与所述关键字对 应的第二冲突表项, 如果查到, 则在所述备用哈希存储块中删除与所述关键 字对应的第二冲突表项。 和现有技术相比, 本发明实施例提供的哈希计算处 理方法, 可以用低成本的方式解决现有技术对报文中的关键字进行哈希计算 时生成的哈希冲突链的长度无法控制的问题, 从而提高报文的存储效率。 Specifically, after deleting the second conflict entry corresponding to the keyword in the standby hash storage block, the counter value of the counter of the standby hash function in the primary hash storage block is decremented by one. The hash calculation processing method provided by the embodiment of the present invention, if the first conflict entry corresponding to the keyword of the packet is found in the primary hash storage block, deleting the primary hash storage block in the primary hash storage block If the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, the first conflicting entry corresponding to the keyword is searched for in the standby hash storage block. The second conflicting entry corresponding to the keyword is deleted, and if found, the second conflicting entry corresponding to the keyword is deleted in the standby hash storage block. Compared with the prior art, the hash calculation processing method provided by the embodiment of the present invention can solve the problem that the length of the hash collision chain generated by the prior art hashing the keywords in the message cannot be solved in a low-cost manner. Control problems, thereby improving the storage efficiency of messages.
实施例五  Embodiment 5
本实施例提供一种哈希计算处理装置, 如图 8所示, 所述装置包括: 接收模块 801 , 用于接收报文;  The embodiment provides a hash calculation processing device. As shown in FIG. 8, the device includes: a receiving module 801, configured to receive a message;
关键字提取模块 802, 用于提取所述报文中需要进行哈希计算的关键字; 主用哈希计算模块 803 , 用于使用主用哈希函数对所述关键字进行哈希计 算, 得到与所述关键字对应的主用哈希值;  a keyword extraction module 802, configured to extract a keyword that needs to perform hash calculation in the packet; a primary hash calculation module 803, configured to perform hash calculation on the keyword by using a primary hash function, to obtain The primary hash value corresponding to the keyword;
第一判断模块 804, 用于判断与所述主用哈希值对应的主用哈希存储块中 的第一冲突表项数是否小于预设的最大冲突数; 其中, 所述主用哈希存储块 包括至少一个所述第一冲突表项, 每个所述第一冲突表项对应一个关键字, 每个所述第一冲突表项对应的关键字通过所述主用哈希函数计算后得到的所 述主用哈希值相同;  a first determining module 804, configured to determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein, the primary hash The storage block includes at least one of the first conflicting entries, each of the first conflicting entries corresponding to a keyword, and the keyword corresponding to each of the first conflicting entries is calculated by using the primary hash function. The obtained primary hash value is the same;
第一冲突表项建立模块 805, 用于当所述主用哈希存储块中的第一冲突表 项数小于所述最大冲突数时, 在所述主用哈希存储块中建立与所述关键字对 应的第一冲突表项;  a first conflicting entry establishing module 805, configured to establish, in the primary hash storage block, the number of the first conflicting entry in the primary hash storage block when the number of the first conflicting entries is smaller than the maximum number of conflicting entries The first conflicting entry corresponding to the keyword;
备用哈希计算模块 806, 用于当所述主用哈希存储块中的第一冲突表项数 不小于所述最大冲突数时, 使用备用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希值;  The standby hash calculation module 806 is configured to: when the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a standby hash function to perform hash calculation on the keyword, Obtaining an alternate hash value corresponding to the keyword;
第二冲突表项建立模块 807, 用于在与所述备用哈希值对应的备用哈希存 储块中建立与所述关键字对应的第二冲突表项; 其中, 所述主用哈希值与所 述备用哈希值不相同, 所述备用哈希存储块包括至少一个所述第二冲突表项, 每个所述第二冲突表项对应一个关键字, 每个所述第二冲突表项对应的关键 字通过所述备用哈希函数计算后得到的所述备用哈希值相同。 a second conflict entry creation module 807, configured to store the standby hash corresponding to the standby hash value Establishing, in the storage block, a second conflicting entry corresponding to the keyword; wherein, the primary hash value is different from the standby hash value, and the standby hash storage block includes at least one of the second a conflicting entry, each of the second conflicting entries corresponding to a keyword, and the candidate hash value obtained by calculating the keyword corresponding to the second conflicting entry is the same.
如图 9所示, 通过所述接收模块接收到报文以后, 通过所述关键字提取模 块提取所述报文中需要进行哈希计算的关键字, 通过主用哈希计算模块使用 主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的主用哈 希值, 通过所述第一判断模块判断与所述主用哈希值对应的主用哈希存储块 中的第一冲突表项数是否小于预设的最大冲突数, 如果所述主用哈希存储块 中的第一冲突表项数小于所述最大冲突数, 通过所述第一冲突表项建立模块 在所述主用哈希存储块中建立与所述关键字对应的第一冲突表项; 如果所述 主用哈希存储块中的第一冲突表项数不小于所述最大冲突数, 通过所述备用 哈希计算模块使用备用哈希函数对所述关键字进行哈希计算, 得到与所述关 键字对应的备用哈希值, 通过第二冲突表项建立模块在与所述备用哈希值对 应的备用哈希存储块中建立与所述关键字对应的第二冲突表项。  As shown in FIG. 9, after receiving the message by the receiving module, the keyword extraction module extracts a keyword that needs to be hashed in the message, and uses the main hashing module to use the main user. The hash function performs a hash calculation on the keyword, and obtains a primary hash value corresponding to the keyword, and determines, by the first determining module, a primary hash storage block corresponding to the primary hash value. If the number of the first conflicting entries is less than the preset maximum number of conflicts, if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry is established. The module establishes, in the primary hash storage block, a first conflicting entry corresponding to the keyword; if the number of the first conflicting entry in the primary hashed storage block is not less than the maximum number of conflicts, The standby hash calculation module uses the standby hash function to perform hash calculation on the keyword, to obtain a backup hash value corresponding to the keyword, and the second conflict entry entry establishing module is in the standby hope A second conflicting entry corresponding to the keyword is established in the alternate hash storage block corresponding to the value.
具体地, 如图 10所示, 所述接收模块在接收到报文以后, 所述关键字提 取模块通过处理器(如 CPU )提取所述报文中需要进行哈希计算的关键字, 所述主用哈希计算模块通过所述处理器使用主用哈希函数对所述关键字进行 哈希计算, 得到与所述关键字对应的主用哈希值, 并将所述主用哈希值发送 到存储器进行存储。 所述第一判断模块通过所述处理器判断与所述主用哈希 值对应的主用哈希存储块中的第一冲突表项数是否小于在所述存储器中预设 的最大冲突数, 如果所述主用哈希存储块中的第一冲突表项数小于所述最大 冲突数, 所述第一冲突表项建立模块通过所述处理器在所述主用哈希存储块 中建立与所述关键字对应的第一冲突表项, 并通过接口单元将哈希计算处理 结果发送到其他设备; 如果所述主用哈希存储块中的第一冲突表项数不小于 所述最大冲突数, 所述备用哈希计算模块通过所述处理器使用备用哈希函数 对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希值, 所述第 二冲突表项建立模块通过所述处理器在与所述备用哈希值对应的备用哈希存 储块中建立与所述关键字对应的第二冲突表项, 并通过接口单元将哈希计算 处理结果发送到其他设备。 Specifically, as shown in FIG. 10, after receiving the packet, the keyword extraction module extracts, by using a processor (such as a CPU), a keyword that needs to perform hash calculation in the packet, where The primary hash calculation module performs hash calculation on the keyword by using the primary hash function by the processor, obtains a primary hash value corresponding to the keyword, and uses the primary hash value. Send to memory for storage. The first determining module determines, by the processor, whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is smaller than a maximum number of conflicts preset in the memory, If the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry establishing module is established in the primary hash storage block by the processor. a first conflicting entry corresponding to the keyword, and sending a hash calculation processing result to another device by using an interface unit; if the number of the first conflicting entry in the primary hash storage block is not less than the maximum conflict Number, the standby hash calculation module uses an alternate hash function by the processor Performing a hash calculation on the keyword to obtain a backup hash value corresponding to the keyword, where the second conflict entry creation module passes the standby hash corresponding to the standby hash value by the processor. A second conflicting entry corresponding to the keyword is established in the storage block, and the hash calculation processing result is sent to other devices through the interface unit.
进一步的, 所述冲突表项包括: 是否使用备用哈希函数进行哈希计算的 标记、 表项有效标记以及所述关键字。  Further, the conflict entry includes: a flag for hash calculation using an alternate hash function, a valid entry of the entry, and the keyword.
进一步的, 所述哈希存储块包括: 一个是否存在通过备用哈希函数建立 的冲突表项的标志和一个备用哈希函数类型标志。  Further, the hash storage block includes: a flag of whether there is a conflict entry established by the standby hash function and an alternate hash function type flag.
进一步的, 如图 11所示, 所述主用哈希计算模块 803包括:  Further, as shown in FIG. 11, the primary hash calculation module 803 includes:
判断单元 8031 , 用于判断所述主用哈希存储块中的所述备用哈希函数类 型标志是否被设置; 类型标志已经被设置时, 根据所述主用哈希存储块中的所述备用哈希函数类 型标志, 选择与所述备用哈希函数类型标志对应的哈希函数作为备用哈希函 数;  a determining unit 8031, configured to determine whether the standby hash function type flag in the primary hash storage block is set; when the type flag has been set, according to the standby in the primary hash storage block a hash function type flag, selecting a hash function corresponding to the alternate hash function type flag as a standby hash function;
第一计算单元 8033 , 用于使用所述备用哈希函数对所述关键字进行哈希 进一步的, 如图 11所示, 所述主用哈希计算模块 803还可以包括: 类型标志没有被设置时, 选择一个哈希函数作为备用哈希函数;  The first calculating unit 8033 is configured to hash the keyword by using the standby hash function. As shown in FIG. 11, the primary hash computing module 803 may further include: the type flag is not set. When selecting a hash function as an alternate hash function;
所述第一计算单元 8033 , 还用于使用所述备用哈希函数对所述关键字进 行哈希计算;  The first calculating unit 8033 is further configured to perform hash calculation on the keyword by using the standby hash function;
设置单元 8035 , 用于在所述主用哈希存储块中设置所述备用哈希函数类 型标志。  The setting unit 8035 is configured to set the standby hash function type flag in the primary hash storage block.
进一步的, 如图 11所示, 所述第二选择单元 8034还包括:  Further, as shown in FIG. 11, the second selecting unit 8034 further includes:
第一选择子单元 80341 , 用于选择一个比所述主用哈希函数产生哈希冲突 少的哈希函数作为备用哈希函数; a first selection sub-unit 80341 for selecting a hash collision than the primary hash function Less hash function as a standby hash function;
第二选择子单元 80342, 用于通过使用至少一个哈希函数对所述关键字进 行哈希计算, 得到至少一个与所述关键字对应的哈希函数值, 选择一个与所 述至少一个哈希函数值对应的哈希存储块中的冲突表项数小于所述最大冲突 数的哈希函数作为备用哈希函数。  a second selection sub-unit 80342, configured to perform hash calculation on the keyword by using at least one hash function to obtain at least one hash function value corresponding to the keyword, and select one and the at least one hash The hash function in the hash storage block corresponding to the function value is smaller than the hash function of the maximum conflict number as the standby hash function.
进一步的, 如图 12所示, 所述装置还可以包括:  Further, as shown in FIG. 12, the apparatus may further include:
查找模块 808, 在所述主用哈希存储块中查找与所述关键字对应的所述第 一冲突表项;  The finding module 808 is configured to search, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
返回模块 809, 用于当在所述主用哈希存储块中查到与所述关键字对应的 所述第一冲突表项时, 返回查找结果;  The returning module 809 is configured to: when the first conflicting entry corresponding to the keyword is found in the primary hash storage block, return a search result;
获得模块 810, 用于当在所述主用哈希存储块中没有查到与所述关键字对 应的所述第一冲突表项时, 获得所述主用哈希存储块中的所述是否存在通过 备用哈希函数建立的冲突表项的标志和所述备用哈希函数类型标志;  The obtaining module 810 is configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the whether in the primary hash storage block There is a flag of the conflicting entry established by the alternate hash function and the alternate hash function type flag;
第二判断模块 811 , 用于根据所述主用哈希存储块中的所述是否存在通过 备用哈希函数建立的冲突表项的标志, 判断是否存在通过备用哈希函数建立 的与所述关键字对应的所述第二冲突表项;  The second determining module 811 is configured to determine, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is a key established by the standby hash function and the key The second conflicting entry corresponding to the word;
所述返回模块 809, 用于当不存在通过备用哈希函数建立的与所述关键字 对应的所述第二冲突表项, 返回没有查到;  The returning module 809 is configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, returning is not found;
所述备用哈希计算模块 806, 还用于当存在通过备用哈希函数建立的与所 述关键字对应的所述第二冲突表项时, 使用所述主用哈希存储块中的所述备 用哈希函数类型标志对应的备用哈希函数对所述关键字进行哈希计算, 得到 与所述关键字对应的备用哈希值; 查找与所述关键字对应的所述第二冲突表项;  The standby hash calculation module 806 is further configured to use the foregoing in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by the standby hash function. The standby hash function corresponding to the standby hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; and searches for the second conflict entry corresponding to the keyword ;
所述返回模块 809 , 还用于当在所述备用哈希存储块中查到与所述关键字 对应的所述第二冲突表项时, 返回查找结果; 所述返回模块 809, 还用于当在所述备用哈希存储块中没有查到与所述关 键字对应的所述第二冲突表项, 返回没有查到。 The returning module 809 is further configured to: when the second conflicting entry corresponding to the keyword is found in the standby hash storage block, return a search result; The returning module 809 is further configured to: when the second conflicting entry corresponding to the keyword is not found in the standby hash storage block, the return is not found.
进一步的, 如图 13所示, 所述装置还可以包括:  Further, as shown in FIG. 13, the apparatus may further include:
所述查找模块 808, 还用于在所述主用哈希存储块中查找与所述关键字对 应的所述第一冲突表项;  The searching module 808 is further configured to search, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
删除模块 812, 用于当在所述主用哈希存储块中查到与所述关键字对应的 所述第一冲突表项时, 删除所述与所述关键字对应的所述第一冲突表项。  a deleting module 812, configured to delete the first conflict corresponding to the keyword when the first conflicting entry corresponding to the keyword is found in the primary hash storage block Entry.
进一步的, 如图 13所示, 所述装置还可以包括:  Further, as shown in FIG. 13, the apparatus may further include:
所述获得模块 810, 还用于当在所述主用哈希存储块中没有查到与所述关 键字对应的所述第一冲突表项, 获得所述主用哈希存储块中的所述是否存在 通过备用哈希函数建立的冲突表项的标志和所述备用哈希函数类型标志; 所述第二判断模块 811 , 还用于根据所述主用哈希存储块中的所述是否存 在通过备用哈希函数建立的冲突表项的标志, 判断是否存在通过备用哈希函 数建立的与所述关键字对应的所述第二冲突表项;  The obtaining module 810 is further configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the location in the primary hash storage block. Determining whether there is a flag of the conflicting entry established by the standby hash function and the standby hash function type flag; the second determining module 811 is further configured to: according to whether the primary hash storage block is There is a flag of the conflicting entry established by the standby hash function, and it is determined whether there is the second conflicting entry corresponding to the keyword established by the standby hash function;
所述返回模块 809, 还用于当不存在通过备用哈希函数建立的与所述关键 字对应的所述第二冲突表项时, 返回没有查到;  The returning module 809 is further configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, the return is not found;
所述备用哈希计算模块 806, 还用于当存在通过备用哈希函数建立的与所 述关键字对应的所述第二冲突表项时, 使用所述主用哈希存储块中的所述备 用哈希函数类型标志对应的备用哈希函数对所述关键字进行哈希计算, 得到 与所述关键字对应的备用哈希值; 找与所述关键字对应的第二的冲突表项;  The standby hash calculation module 806 is further configured to use the foregoing in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by the standby hash function. The standby hash function corresponding to the standby hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; and finds a second conflicting entry corresponding to the keyword;
所述删除模块 812 , 还用于当在所述备用哈希存储块中查到与所述关键字 对应的所述第二冲突表项时, 删除所述与所述关键字对应的所述第二冲突表 项; 没有查到与所述关键字对应的第二的冲突表项时, 返回没有查到。 本发明实施例提供的哈希计算处理装置, 通过关键字提取模块提取报文 中需要进行哈希计算的关键字, 通过主用哈希计算模块使用主用哈希函数对 所述关键字进行哈希计算, 得到与所述关键字对应的主用哈希值, 通过第一 判断模块判断与所述主用哈希值对应的主用哈希存储块中的第一冲突表项数 是否小于预设的最大冲突数, 如果所述主用哈希存储块中的第一冲突表项数 小于所述最大冲突数, 通过第一冲突表项建立模块在所述主用哈希存储块中 建立与所述关键字对应的第一冲突表项, 如果所述主用哈希存储块中的第一 冲突表项数不小于所述最大冲突数, 使用备用哈希函数对所述关键字进行哈 希计算, 得到与所述关键字对应的备用哈希值, 通过第二冲突建立模块在与 所述备用哈希值对应的备用哈希存储块中建立与所述关键字对应的第二冲突 表项。 本发明实施例提供的哈希计算处理装置, 在对报文中的关键字进行哈 希计算处理时, 可以用低成本的方式解决现有技术对报文中的关键字进行哈 希计算时生成的哈希冲突链的长度无法控制的问题, 从而提高报文的存储效 率。 The deleting module 812 is further configured to: when the second conflict entry corresponding to the keyword is found in the standby hash storage block, delete the first corresponding to the keyword Second conflict entry; When the second conflicting entry corresponding to the keyword is not found, the return is not found. The hash calculation processing apparatus provided by the embodiment of the present invention extracts a keyword in the message that needs to be hashed by the keyword extraction module, and uses the main hash function to perform the keyword on the keyword by using the main hash calculation module. In the calculation, the primary hash value corresponding to the keyword is obtained, and the first determining module determines whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a maximum number of conflicts, if the number of the first conflicting entries in the primary hash storage block is less than the maximum number of conflicts, the first conflicting entry building module is established in the primary hash storage block. The first conflicting entry corresponding to the keyword, if the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, hashing the keyword using an alternate hash function Calculating, obtaining a backup hash value corresponding to the keyword, and establishing, by the second conflict establishing module, a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value . The hash calculation processing apparatus provided by the embodiment of the present invention can solve the problem that the prior art performs hash calculation on the keywords in the message when performing hash calculation processing on the keywords in the message. The length of the hash collision chain cannot be controlled, thereby improving the storage efficiency of the message.
本发明实施例提供的哈希计算处理装置可以实现上述提供的方法实施 例, 具体功能实现请参见方法实施例中的说明, 在此不再赘述。 本发明实施 例提供的哈希计算处理方法及装置可以适用于数据通信领域或无线通信领域 的交换机路由器产品中, 但不仅限于此。  The Hash calculation processing apparatus provided by the embodiment of the present invention may implement the foregoing method embodiment. For the specific function implementation, refer to the description in the method embodiment, and details are not described herein again. The hash calculation processing method and apparatus provided by the embodiments of the present invention can be applied to the switch router products in the field of data communication or wireless communication, but are not limited thereto.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存^ "i己忆体 ( Random Access Memory, RAM )等。  A person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. In execution, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所述, 仅为本发明的具体实施方式, 但本发明的保护范围并不局限 于此, 任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保 护范围应该以权利要求的保护范围为准。 The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto, and any person skilled in the art can easily within the technical scope disclosed by the present invention. All changes or substitutions contemplated are intended to be included within the scope of the invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

权利 要求 书 Claim
1、 一种哈希计算处理方法, 其特征在于, 包括:  A hash calculation processing method, comprising:
接收报文, 提取所述报文中需要进行哈希计算的关键字;  Receiving a message, and extracting a keyword that needs to perform a hash calculation in the packet;
使用主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的 主用哈希值;  Performing a hash calculation on the keyword by using a primary hash function to obtain a primary hash value corresponding to the keyword;
判断与所述主用哈希值对应的主用哈希存储块中的第一冲突表项数是否小 于预设的最大冲突数; 其中, 所述主用哈希存储块包括至少一个所述第一冲突 表项, 每个所述第一冲突表项对应一个关键字, 每个所述第一冲突表项对应的 关键字通过所述主用哈希函数计算后得到的所述主用哈希值相同;  Determining whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein the primary hash storage block includes at least one of the first a conflicting entry, each of the first conflicting entries corresponding to a keyword, and the primary hash of each keyword of the first conflicting entry calculated by the primary hashing function The same value;
如果所述主用哈希存储块中的第一冲突表项数小于所述最大冲突数, 则在 所述主用哈希存储块中建立与所述关键字对应的第一冲突表项;  And establishing, by the primary hash storage block, a first conflicting entry corresponding to the keyword, if the number of the first conflicting entries in the primary hash storage block is smaller than the maximum number of conflicting entries;
如果所述主用哈希存储块中的第一冲突表项数不小于所述最大冲突数, 使 用备用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈 希值, 在与所述备用哈希值对应的备用哈希存储块中建立与所述关键字对应的 第二冲突表项; 其中, 所述主用哈希值与所述备用哈希值不相同, 所述备用哈 希存储块包括至少一个所述第二冲突表项, 每个所述第二冲突表项对应一个关 键字, 每个所述第二冲突表项对应的关键字通过所述备用哈希函数计算后得到 的所述备用哈希值相同。  If the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, the candidate hash function is used to perform hash calculation on the keyword to obtain an alternate hash corresponding to the keyword. a second conflict entry corresponding to the keyword is established in the standby hash storage block corresponding to the standby hash value; wherein, the primary hash value and the standby hash value are not Similarly, the standby hash storage block includes at least one of the second conflicting entries, each of the second conflicting entries corresponding to a keyword, and the keyword corresponding to each of the second conflicting entries passes the The alternate hash value obtained after the standby hash function is calculated is the same.
2、 根据权利要求 1述的方法, 其特征在于, 所述冲突表项包括: 是否使用 备用哈希函数进行哈希计算的标记、 表项有效标记以及所述关键字。  2. The method according to claim 1, wherein the conflict entry includes: a flag for hash calculation using an alternate hash function, an entry valid flag, and the keyword.
3、 根据权利要求 2所述的方法, 其特征在于, 所述哈希存储块包括: 一个 是否存在通过备用哈希函数建立的冲突表项的标志和一个备用哈希函数类型标 志。  3. The method according to claim 2, wherein the hash storage block comprises: a flag of a conflict entry established by the standby hash function and an alternate hash function type flag.
4、 根据权利要求 3所述的方法, 其特征在于, 所述使用备用哈希函数对所 述关键字进行哈希计算, 具体包括:  The method according to claim 3, wherein the hashing of the keyword by using a standby hash function includes:
判断所述主用哈希存储块中的所述备用哈希函数类型标志是否被设置, 如 果所述主用哈希存储块中的所述备用哈希函数类型标志已经被设置, 根据所述 备用哈希函数类型标志, 选择与所述备用哈希函数类型标志对应的哈希函数作 为备用哈希函数, 使用所述备用哈希函数对所述关键字进行哈希计算。 Determining whether the alternate hash function type flag in the primary hash storage block is set, such as If the standby hash function type flag in the primary hash storage block has been set, selecting a hash function corresponding to the standby hash function type flag as a backup according to the standby hash function type flag A hash function that hashes the keyword using the alternate hash function.
5、 根据权利要求 4所述的方法, 其特征在于, 还包括:  5. The method according to claim 4, further comprising:
如果所述主用哈希存储块中的所述备用哈希函数类型标志没有被设置, 选 择一个哈希函数作为备用哈希函数, 使用所述备用哈希函数对所述关键字进行 哈希计算;  If the alternate hash function type flag in the primary hash storage block is not set, selecting a hash function as a standby hash function, and hashing the keyword using the alternate hash function ;
在所述主用哈希存储块中设置所述备用哈希函数类型标志。  The alternate hash function type flag is set in the primary hash storage block.
6、 根据权利要求 5所述的方法, 其特征在于, 所述选择一个哈希函数作为 备用哈希函数, 包括:  The method according to claim 5, wherein the selecting a hash function as the standby hash function comprises:
选择一个比所述主用哈希函数产生哈希冲突少的哈希函数作为备用哈希函 数;  Selecting a hash function that produces fewer hash collisions than the primary hash function as an alternate hash function;
或者,  Or,
通过使用至少一个哈希函数对所述关键字进行哈希计算, 得到至少一个与 所述关键字对应的哈希函数值, 选择一个与所述至少一个哈希函数值对应的哈 希存储块中的冲突表项数小于所述最大冲突数的哈希函数作为备用哈希函数。  Performing a hash calculation on the keyword by using at least one hash function to obtain at least one hash function value corresponding to the keyword, and selecting a hash storage block corresponding to the at least one hash function value The hash function whose number of conflict table entries is smaller than the maximum number of conflicts is used as an alternate hash function.
7、 根据权利要求 3所述的方法, 其特征在于, 还包括:  7. The method according to claim 3, further comprising:
在所述主用哈希存储块中查找与所述关键字对应的所述第一冲突表项, 如 果在所述主用哈希存储块中查到与所述关键字对应的所述第一冲突表项, 返回 查找结果;  Locating, in the primary hash storage block, the first conflicting entry corresponding to the keyword, if the first corresponding to the keyword is found in the primary hash storage block Conflict entry, returning the search result;
如果在所述主用哈希存储块中没有查到与所述关键字对应的所述第一冲突 表项, 获得所述主用哈希存储块中的所述是否存在通过备用哈希函数建立的冲 突表项的标志和所述备用哈希函数类型标志;  If the first conflict entry corresponding to the keyword is not found in the primary hash storage block, obtaining whether the primary hash storage block exists in the primary hash storage block is established by using a standby hash function. The flag of the conflicting entry and the alternate hash function type flag;
根据所述主用哈希存储块中的所述是否存在通过备用哈希函数建立的冲突 表项的标志, 判断是否存在通过备用哈希函数建立的与所述关键字对应的所述 第二冲突表项, 如果不存在通过备用哈希函数建立的与所述关键字对应的所述 第二冲突表项, 返回没有查到; Determining, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is the second conflict corresponding to the keyword established by the standby hash function Entry, if there is no corresponding to the keyword established by the alternate hash function The second conflict entry, the return is not found;
如果存在通过备用哈希函数建立的与所述关键字对应的所述第二冲突表 项, 使用所述主用哈希存储块中的所述备用哈希函数类型标志对应的备用哈希 函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希值;  If there is the second conflict entry corresponding to the keyword established by the standby hash function, using the alternate hash function pair corresponding to the alternate hash function type flag in the primary hash storage block Performing a hash calculation on the keyword to obtain a backup hash value corresponding to the keyword;
在与所述备用哈希值对应的备用哈希存储块中查找与所述关键字对应的所 述第二冲突表项, 如果在所述备用哈希存储块中查到与所述关键字对应的所述 第二冲突表项, 返回查找结果;  Locating, in the spare hash storage block corresponding to the standby hash value, the second conflicting entry corresponding to the keyword, if the matching with the keyword is found in the spare hash storage block The second conflicting entry returns a search result;
如果在所述备用哈希存储块中没有查到与所述关键字对应的所述第二冲突 表项, 则返回没有查到。  If the second conflict entry corresponding to the keyword is not found in the spare hash storage block, the return is not found.
8、 根据权利要求 3所述的方法, 其特征在于, 还包括:  8. The method according to claim 3, further comprising:
在所述主用哈希存储块中查找与所述关键字对应的所述第一冲突表项, 如 果在所述主用哈希存储块中查到与所述关键字对应的所述第一冲突表项, 删除 所述与所述关键字对应的所述第一冲突表项。  Locating, in the primary hash storage block, the first conflicting entry corresponding to the keyword, if the first corresponding to the keyword is found in the primary hash storage block The conflicting entry deletes the first conflicting entry corresponding to the keyword.
9、 根据权利要求 8所述的方法, 其特征在于, 还包括:  9. The method according to claim 8, further comprising:
如果在所述主用哈希存储块中没有查到与所述关键字对应的所述第一冲突 表项, 获得所述主用哈希存储块中的所述是否存在通过备用哈希函数建立的冲 突表项的标志和所述备用哈希函数类型标志;  If the first conflict entry corresponding to the keyword is not found in the primary hash storage block, obtaining whether the primary hash storage block exists in the primary hash storage block is established by using a standby hash function. The flag of the conflicting entry and the alternate hash function type flag;
根据所述主用哈希存储块中的所述是否存在通过备用哈希函数建立的冲突 表项的标志, 判断是否存在通过备用哈希函数建立的与所述关键字对应的所述 第二冲突表项, 如果不存在通过备用哈希函数建立的与所述关键字对应的所述 第二冲突表项, 返回没有查到;  Determining, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is the second conflict corresponding to the keyword established by the standby hash function An entry, if there is no second conflict entry corresponding to the keyword established by the standby hash function, the return is not found;
如果存在通过备用哈希函数建立的与所述关键字对应的所述第二冲突表 项, 使用所述主用哈希存储块中的所述备用哈希函数类型标志对应的备用哈希 函数对所述关键字进行哈希计算, 得到与所述关键字对应的备用哈希值;  If there is the second conflict entry corresponding to the keyword established by the standby hash function, using the alternate hash function pair corresponding to the alternate hash function type flag in the primary hash storage block Performing a hash calculation on the keyword to obtain a backup hash value corresponding to the keyword;
在所述备用哈希值对应的备用哈希存储块中查找与所述关键字对应的第二 的冲突表项, 如果在所述备用哈希存储块中查到与所述关键字对应的所述第二 冲突表项, 删除所述与所述关键字对应的所述第二冲突表项; 应的第二的冲突表项, 则返回没有查到。 Searching, in the standby hash storage block corresponding to the standby hash value, a second conflicting entry corresponding to the keyword, if a location corresponding to the keyword is found in the spare hash storage block Second The conflicting entry deletes the second conflicting entry corresponding to the keyword; and the second conflicting entry that is included is returned.
10、 一种哈希计算处理装置, 其特征在于, 包括:  10. A hash computing processing device, comprising:
接收模块, 用于接收报文;  a receiving module, configured to receive a message;
关键字提取模块, 用于提取所述报文中需要进行哈希计算的关键字; 主用哈希计算模块, 用于使用主用哈希函数对所述关键字进行哈希计算, 得到与所述关键字对应的主用哈希值;  a keyword extraction module, configured to extract a keyword that needs to be hashed in the message; a primary hash calculation module, configured to perform hash calculation on the keyword by using a primary hash function, to obtain a context The primary hash value corresponding to the keyword;
第一判断模块, 用于判断与所述主用哈希值对应的主用哈希存储块中的第 一冲突表项数是否小于预设的最大冲突数; 其中, 所述主用哈希存储块包括至 少一个所述第一冲突表项, 每个所述第一冲突表项对应一个关键字, 每个所述 第一冲突表项对应的关键字通过所述主用哈希函数计算后得到的所述主用哈希 值相同;  a first determining module, configured to determine whether the number of the first conflicting entries in the primary hash storage block corresponding to the primary hash value is less than a preset maximum number of conflicts; wherein, the primary hash storage The block includes at least one of the first conflicting entries, each of the first conflicting entries corresponding to a keyword, and a keyword corresponding to each of the first conflicting entries is calculated by using the primary hash function. The primary hash value is the same;
第一冲突表项建立模块, 用于当所述主用哈希存储块中的第一冲突表项数 小于所述最大冲突数时, 在所述主用哈希存储块中建立与所述关键字对应的第 一冲突表项;  a first conflicting table entry establishing module, configured to establish, in the primary hash storage block, the key in the primary hash storage block when the number of the first conflicting entry in the primary hash storage block is less than the maximum conflicting number The first conflicting entry corresponding to the word;
备用哈希计算模块, 用于当所述主用哈希存储块中的第一冲突表项数不小 于所述最大冲突数时, 使用备用哈希函数对所述关键字进行哈希计算, 得到与 所述关键字对应的备用哈希值;  a backup hash calculation module, configured to: when the number of the first conflicting entries in the primary hash storage block is not less than the maximum number of conflicts, use a backup hash function to perform hash calculation on the keyword, An alternate hash value corresponding to the keyword;
第二冲突表项建立模块, 用于在与所述备用哈希值对应的备用哈希存储块 中建立与所述关键字对应的第二冲突表项; 其中, 所述主用哈希值与所述备用 哈希值不相同, 所述备用哈希存储块包括至少一个所述第二冲突表项, 每个所 述第二冲突表项对应一个关键字, 每个所述第二冲突表项对应的关键字通过所 述备用哈希函数计算后得到的所述备用哈希值相同。  a second conflict entry establishing module, configured to establish a second conflicting entry corresponding to the keyword in the standby hash storage block corresponding to the standby hash value, where the primary hash value is The standby hash value is different, the standby hash storage block includes at least one second conflicting entry, each of the second conflicting entries corresponds to a keyword, and each of the second conflicting entries The standby hash value obtained by calculating the corresponding keyword by the standby hash function is the same.
11、 根据权利要求 10所述的装置, 其特征在于, 所述冲突表项包括: 是否 使用备用哈希函数进行哈希计算的标记、 表项有效标记以及所述关键字。 The apparatus according to claim 10, wherein the conflict entry includes: a flag for performing hash calculation using an alternate hash function, an entry valid flag, and the keyword.
12、 根据权利要求 11所述的方法, 其特征在于, 所述哈希存储块包括: 一 个是否存在通过备用哈希函数建立的冲突表项的标志和一个备用哈希函数类型 标志。 The method according to claim 11, wherein the hash storage block comprises: a flag of a conflict entry established by a standby hash function and an alternate hash function type flag.
13、 根据权利要求 12所述的装置, 其特征在于, 所述主用哈希计算模块还 包括:  The device according to claim 12, wherein the primary hash calculation module further comprises:
判断单元, 用于判断所述主用哈希存储块中的所述备用哈希函数类型标志 是否被设置; 志已经被设置时, 根据所述主用哈希存储块中的所述备用哈希函数类型标志, 选择与所述备用哈希函数类型标志对应的哈希函数作为备用哈希函数;  a determining unit, configured to determine whether the standby hash function type flag in the primary hash storage block is set; when the ambiguity has been set, according to the standby hash in the primary hash storage block a function type flag, selecting a hash function corresponding to the alternate hash function type flag as an alternate hash function;
第一计算单元, 用于使用所述备用哈希函数对所述关键字进行哈希计算。 And a first calculating unit, configured to perform hash calculation on the keyword by using the standby hash function.
14、 根据权利要求 13所述的装置, 其特征在于, 所述主用哈希计算模块还 包括: 志没有被设置时, 选择一个哈希函数作为备用哈希函数; 14. The apparatus according to claim 13, wherein the primary hash calculation module further comprises: selecting a hash function as a standby hash function when the alarm is not set;
所述第一计算单元, 还用于使用所述备用哈希函数对所述关键字进行哈希 设置单元, 用于在所述主用哈希存储块中设置所述备用哈希函数类型标志。 The first calculating unit is further configured to perform, by using the standby hash function, a hash setting unit, where the keyword is used to set the standby hash function type flag in the primary hash storage block.
15、 根据权利要求 14所述的装置, 其特征在于, 所述第二选择单元还包括: 第一选择子单元, 用于选择一个比所述主用哈希函数产生哈希冲突少的哈 希函数作为备用哈希函数; The apparatus according to claim 14, wherein the second selecting unit further comprises: a first selecting subunit, configured to select a hash that generates less hash collision than the main hash function The function acts as a standby hash function;
第二选择子单元, 用于通过使用至少一个哈希函数对所述关键字进行哈希 计算, 得到至少一个与所述关键字对应的哈希函数值, 选择一个与所述至少一 个哈希函数值对应的哈希存储块中的冲突表项数小于所述最大冲突数的哈希函 数作为备用哈希函数。  a second selection subunit, configured to perform hash calculation on the keyword by using at least one hash function, to obtain at least one hash function value corresponding to the keyword, and selecting one and the at least one hash function A hash function in which the number of conflicting entries in the hash storage block corresponding to the value is smaller than the maximum number of conflicts is used as a standby hash function.
16、 根据权利要求 12所述的装置, 其特征在于, 还包括: 查找模块, 在所述主用哈希存储块中查找与所述关键字对应的所述第一冲 突表项; The device according to claim 12, further comprising: a finding module, searching, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
返回模块, 用于当在所述主用哈希存储块中查到与所述关键字对应的所述 第一冲突表项时, 返回查找结果;  a returning module, configured to return a search result when the first conflicting entry corresponding to the keyword is found in the primary hash storage block;
获得模块, 用于当在所述主用哈希存储块中没有查到与所述关键字对应的 所述第一冲突表项时 , 获得所述主用哈希存储块中的所述是否存在通过备用哈 希函数建立的冲突表项的标志和所述备用哈希函数类型标志;  An obtaining module, configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the presence or absence of the primary hash storage block a flag of the conflicting entry established by the alternate hash function and the alternate hash function type flag;
第二判断模块, 用于根据所述主用哈希存储块中的所述是否存在通过备用 哈希函数建立的冲突表项的标志, 判断是否存在通过备用哈希函数建立的与所 述关键字对应的所述第二冲突表项;  a second determining module, configured to determine, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is a key established by the standby hash function Corresponding said second conflicting entry;
所述返回模块, 用于当不存在通过备用哈希函数建立的与所述关键字对应 的所述第二冲突表项, 返回没有查到;  The returning module is configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, the return is not found;
所述备用哈希计算模块, 还用于当存在通过备用哈希函数建立的与所述关 键字对应的所述第二冲突表项时, 使用所述主用哈希存储块中的所述备用哈希 函数类型标志对应的备用哈希函数对所述关键字进行哈希计算, 得到与所述关 键字对应的备用哈希值; 与所述关键字对应的所述第二冲突表项;  The standby hash calculation module is further configured to use the backup in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by a standby hash function The standby hash function corresponding to the hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; the second conflict entry corresponding to the keyword;
所述返回模块, 还用于当在所述备用哈希存储块中查到与所述关键字对应 的所述第二冲突表项时, 返回查找结果;  The returning module is further configured to: when the second conflicting entry corresponding to the keyword is found in the standby hash storage block, return a search result;
所述返回模块, 还用于当在所述备用哈希存储块中没有查到与所述关键字 对应的所述第二冲突表项, 返回没有查到。  The returning module is further configured to: when the second conflicting entry corresponding to the keyword is not found in the standby hash storage block, the return is not found.
17、 根据权利要求 12所述的装置, 其特征在于, 还包括:  17. The device according to claim 12, further comprising:
所述查找模块, 还用于在所述主用哈希存储块中查找与所述关键字对应的 所述第一冲突表项;  The searching module is further configured to search, in the primary hash storage block, the first conflicting entry corresponding to the keyword;
删除模块, 用于当在所述主用哈希存储块中查到与所述关键字对应的所述 第一冲突表项时, 删除所述与所述关键字对应的所述第一冲突表项。 a deleting module, configured to: find, in the primary hash storage block, the corresponding to the keyword When the first conflicting entry is deleted, the first conflicting entry corresponding to the keyword is deleted.
18、 根据权利要求 17所述的装置, 其特征在于, 还包括:  The device according to claim 17, further comprising:
所述获得模块, 还用于当在所述主用哈希存储块中没有查到与所述关键字 对应的所述第一冲突表项 , 获得所述主用哈希存储块中的所述是否存在通过备 用哈希函数建立的冲突表项的标志和所述备用哈希函数类型标志;  The obtaining module is further configured to: when the first conflicting entry corresponding to the keyword is not found in the primary hash storage block, obtain the foregoing in the primary hash storage block Whether there is a flag of the conflicting table entry established by the standby hash function and the standby hash function type flag;
所述第二判断模块, 还用于根据所述主用哈希存储块中的所述是否存在通 过备用哈希函数建立的冲突表项的标志, 判断是否存在通过备用哈希函数建立 的与所述关键字对应的所述第二冲突表项;  The second determining module is further configured to determine, according to the flag of the conflicting entry established by the standby hash function in the primary hash storage block, whether there is a connection established by the standby hash function The second conflicting entry corresponding to the keyword;
所述返回模块, 还用于当不存在通过备用哈希函数建立的与所述关键字对 应的所述第二冲突表项时, 返回没有查到;  The returning module is further configured to: when there is no second conflicting entry corresponding to the keyword established by the standby hash function, the return is not found;
所述备用哈希计算模块, 还用于当存在通过备用哈希函数建立的与所述关 键字对应的所述第二冲突表项时, 使用所述主用哈希存储块中的所述备用哈希 函数类型标志对应的备用哈希函数对所述关键字进行哈希计算, 得到与所述关 键字对应的备用哈希值; 所述关键字对应的第二的冲突表项;  The standby hash calculation module is further configured to use the backup in the primary hash storage block when there is the second conflict entry corresponding to the keyword established by a standby hash function The standby hash function corresponding to the hash function type flag performs hash calculation on the keyword to obtain a standby hash value corresponding to the keyword; the second conflict entry corresponding to the keyword;
所述删除模块, 还用于当在所述备用哈希存储块中查到与所述关键字对应 的所述第二冲突表项时, 删除所述与所述关键字对应的所述第二冲突表项; 查到与所述关键字对应的第二的冲突表项时, 返回没有查到。  The deleting module is further configured to: when the second conflicting entry corresponding to the keyword is found in the standby hash storage block, deleting the second corresponding to the keyword The conflict entry; when the second conflict entry corresponding to the keyword is found, the return is not found.
PCT/CN2011/077484 2011-07-22 2011-07-22 Method and apparatus for processing hash calculations WO2012106916A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/077484 WO2012106916A1 (en) 2011-07-22 2011-07-22 Method and apparatus for processing hash calculations
CN2011800011227A CN102308296A (en) 2011-07-22 2011-07-22 Hash calculating and processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/077484 WO2012106916A1 (en) 2011-07-22 2011-07-22 Method and apparatus for processing hash calculations

Publications (1)

Publication Number Publication Date
WO2012106916A1 true WO2012106916A1 (en) 2012-08-16

Family

ID=45381254

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/077484 WO2012106916A1 (en) 2011-07-22 2011-07-22 Method and apparatus for processing hash calculations

Country Status (2)

Country Link
CN (1) CN102308296A (en)
WO (1) WO2012106916A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10708040B1 (en) * 2019-10-01 2020-07-07 Tyson York Winarski Collision resistant blockchain

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930011B (en) * 2012-10-31 2016-08-03 杭州华三通信技术有限公司 The processing method and processing device of stream forwarding list item
CN103577564A (en) * 2013-10-25 2014-02-12 盛科网络(苏州)有限公司 Method and device for reducing HASH collision through software shift
CN109656468B (en) * 2017-10-11 2022-05-27 深圳市中兴微电子技术有限公司 Method and device for realizing data storage
CN108111421B (en) * 2017-11-28 2021-02-09 苏州浪潮智能科技有限公司 Message distribution method and device based on multiple Hash
CN114710467B (en) * 2022-03-25 2024-03-12 阿里巴巴(中国)有限公司 IP address storage method and device and hardware gateway
CN114726920A (en) * 2022-06-07 2022-07-08 恒生电子股份有限公司 TCP data processing method and device
CN115065662A (en) * 2022-06-13 2022-09-16 上海亿家芯集成电路设计有限公司 Method and system for processing MAC address hash collision

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101034412A (en) * 2007-04-02 2007-09-12 华为技术有限公司 Information storing method, information search method and engine device
CN101483605A (en) * 2009-02-25 2009-07-15 北京星网锐捷网络技术有限公司 Storing, searching method and apparatus for data packet
US7840540B2 (en) * 2006-04-20 2010-11-23 Datascout, Inc. Surrogate hashing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101674234B (en) * 2009-08-21 2012-07-25 曙光信息产业(北京)有限公司 Fragments-reassembling method of IP messages and device thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7840540B2 (en) * 2006-04-20 2010-11-23 Datascout, Inc. Surrogate hashing
CN101034412A (en) * 2007-04-02 2007-09-12 华为技术有限公司 Information storing method, information search method and engine device
CN101483605A (en) * 2009-02-25 2009-07-15 北京星网锐捷网络技术有限公司 Storing, searching method and apparatus for data packet

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10708040B1 (en) * 2019-10-01 2020-07-07 Tyson York Winarski Collision resistant blockchain

Also Published As

Publication number Publication date
CN102308296A (en) 2012-01-04

Similar Documents

Publication Publication Date Title
WO2012106916A1 (en) Method and apparatus for processing hash calculations
JP6643760B2 (en) Short link processing method, device, and server
WO2018099107A1 (en) Hash table management method and device, and computer storage medium
CN107547349B (en) Virtual machine migration method and device
WO2018068524A1 (en) Routing-table establishment and ip routing lookup method, device, and storage medium
US9729669B2 (en) Method and system for fast and large-scale longest prefix matching
WO2015127721A1 (en) Data matching method and apparatus and computer storage medium
TWI659300B (en) Method and device for providing equipment identification
WO2009067915A1 (en) Method for identifying service type corresponding to message and device thereof
JP2016116215A (en) Cnn routing using hardware assisted hash tables
US11178114B2 (en) Data processing method, device, and system
WO2014012390A1 (en) Data processing method and apparatus, and shared storage device
US9294390B2 (en) Hash table storage and search methods and devices
WO2011091581A1 (en) Method and device for storing and searching keyword
WO2016066108A1 (en) Route access method, route access system and user terminal
WO2017186159A1 (en) Packet transmission
WO2020114239A1 (en) Multicast message processing method and apparatus, storage medium and processor
WO2014059889A1 (en) Method and device for updating routing search tree
WO2018121373A1 (en) Data forwarding method and apparatus based on network bridge of kernel of operating system
WO2014015808A1 (en) Method and device for pushing information
WO2015131720A1 (en) Packet processing method and device
WO2011100924A2 (en) Method and device for adding, searching for and deleting key in hash table
CN111352938B (en) Data processing method, computer device and storage medium
WO2008089616A1 (en) Servep p2p network system and method for routing and transfering the resource key assignment thereof
WO2017107683A1 (en) Data updating method and device

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180001122.7

Country of ref document: CN

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

Ref document number: 11858165

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: 11858165

Country of ref document: EP

Kind code of ref document: A1