A low-complexity hash table generation method, system and medium
By generating a hardware hash table using a dual hash value mapping strategy, the collision problem of hardware hash tables under high load factors is resolved, achieving more efficient resource utilization and search performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI KEPU INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-05-15
- Publication Date
- 2026-06-12
AI Technical Summary
Existing hardware hash tables are prone to collisions under high load factors, leading to resource waste and low lookup efficiency.
A dual-hash value mapping dual-target address filling strategy is adopted. By constructing the core parameter information of the hardware hash table, two hash functions are used to generate independent filling paths, reducing the risk of collisions caused by a single address entry being full.
It effectively reduces the probability of collisions under the same storage capacity, reduces resource waste, and improves search efficiency.
Smart Images

Figure CN122197842A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of hash table generation technology, and more specifically, to a low-complexity hash table generation method, system, and medium. Background Technology
[0002] In many hardware forwarding table designs, a circuit structure is needed to quickly find matching entries. When the matching content is large and cannot be compared one by one, a hash table structure is a common approach.
[0003] Taking a 1k-depth MAC forwarding table as an example, the principle of a commonly used hash table is as follows.
[0004] When a message is received in the hardware and a table lookup is required:
[0005] The key (DMAC, 48 bits) is fed into the hash function to obtain a hash value (10 bits).
[0006] Access the corresponding RAM using the hash value as the address, and retrieve the key, action, and valid identifier of the table entry stored in the RAM;
[0007] If the table entry is valid, compare it with the key. If it is the same as the current key, the table entry is considered to be matched, the table lookup is successful, and the action is obtained.
[0008] When the software needs to add a matching entry and requires filling in the form:
[0009] Calculate the hash value (10 bits) of the key;
[0010] Query the content at the address corresponding to the hash value in RAM to obtain the key, action, and valid identifier of the table entry stored in RAM;
[0011] If an entry in RAM is invalid, store the key and action in RAM and raise the entry's valid flag.
[0012] This structure increases the probability of hash collisions as the load factor (the ratio of the number of filled entries to the total RAM space of the entries) gradually increases.
[0013] To resolve hash collisions, common methods include open addressing and chaining. However, hardware design often limits the number of attempts while ensuring an extremely low probability of unmanageable collisions. Two common approaches are: 1) reducing the load factor, and 2) increasing the number of hashes.
[0014] Typical hash bucket structures achieve this by increasing the number of hashes and decreasing the load factor. Therefore, to ensure that collisions are not frequently encountered, hardware hash table structures often need to increase the actual number of entries in the hash table, which requires significant circuit resources. Summary of the Invention
[0015] The purpose of this application is to provide a low-complexity hash table generation method, system, and medium. By adopting a filling strategy of mapping dual hash values to dual target addresses, two independent filling paths are generated, reducing the risk of collisions caused by a single address entry being full. By dividing the entries of a single hash bucket RAM into multiple independent regions, and trying the filling addresses corresponding to multiple hash results in sequence according to the regions, the probability of collisions under the same storage capacity is reduced.
[0016] This application embodiment also provides a low-complexity HASH table generation method, including: constructing core parameter information for a hardware hash table, wherein the core parameter information includes hash bucket RAM, key-value action RAM, and hash function;
[0017] Configure the operation rules of the hash function;
[0018] Get the input key Key, calculate the input key Key based on the operation rules, and get at least two hash results, namely the first hash value hash_1 and the second hash value hash_2;
[0019] Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results;
[0020] Configure the lookup rules for the hash table, and query the populated results based on the lookup rules to generate a hardware hash table.
[0021] Optionally, in the low-complexity HASH table generation method described in the embodiments of this application, the key-value action RAM is used to independently store key-value pairs, the key-value pairs are {Key, Action}, and each key-value pair is configured with unique index information;
[0022] The index information includes a key index key_idx and an action index action_idx;
[0023] The hash bucket RAM is used to store entry structures, which include {key_idx, action_idx, hash identifier}.
[0024] Optionally, in the low-complexity hash table generation method described in this application embodiment, the address mapping rules specifically include:
[0025] The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function;
[0026] The hash identifier in the entry structure is another hash result calculated by the hash function.
[0027] Optionally, in the low-complexity hash table generation method described in the embodiments of this application, the table entry filling rules specifically include:
[0028] The first target address of the hash bucket RAM is obtained by mapping based on the first hash value hash_1.
[0029] If the number of free entries corresponding to the first target address meets the preset condition, then the entry containing the key index key_idx, the action index action_idx, and the second hash value hash_2 will be filled into the corresponding free entry;
[0030] If the number of free entries corresponding to the first target address does not meet the preset condition, the second target address of the hash bucket RAM is obtained based on the second hash value hash_2.
[0031] If the number of free entries corresponding to the second target address meets the preset condition, then the entry containing the key index key_idx, action index action_idx and the first hash value hash_1 will be filled into the corresponding free entry;
[0032] If none of the conditions are met, the entries will be filled into the escape bucket.
[0033] Optionally, in the low-complexity hash table generation method described in the embodiments of this application, the lookup rules specifically include:
[0034] The first hash value hash_1 and the second hash value hash_2 are calculated based on the input key.
[0035] Locate the first address of the hash bucket RAM based on hash_1, read all entries, and filter out entries whose hash identifiers match hash_2;
[0036] The filtered entries are compared with the input key to analyze whether they match.
[0037] If they match, the corresponding Action is obtained;
[0038] If there is a discrepancy, the read entries will be re-filtered or the escape bucket will be queried.
[0039] Optionally, in the low-complexity hash table generation method described in the embodiments of this application, the setting of the preset conditions includes:
[0040] The entries corresponding to each address in the hash bucket RAM are divided into two groups according to a preset number p, and the maximum number of entries in each group is set to p / 2. The preset condition is that the number of filled entries in the group corresponding to the target address is less than p / 2.
[0041] Secondly, embodiments of this application provide a low-complexity hash table generation system, which includes: a memory and a processor. The memory includes a program for a low-complexity hash table generation method. When the program for the low-complexity hash table generation method is executed by the processor, it performs the following steps:
[0042] The core parameter information for constructing a hardware hash table includes hash bucket RAM, key-value action RAM, and hash function.
[0043] Configure the operation rules of the hash function;
[0044] Get the input key Key, calculate the input key Key based on the operation rules, and get at least two hash results, namely the first hash value hash_1 and the second hash value hash_2;
[0045] Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results;
[0046] Configure the lookup rules for the hash table, and query the populated results based on the lookup rules to generate a hardware hash table.
[0047] Optionally, in the low-complexity HASH table generation system described in this application embodiment, the key-value action RAM is used to independently store key-value pairs, the key-value pairs being {Key, Action}, and each key-value pair is configured with unique index information;
[0048] The index information includes a key index key_idx and an action index action_idx;
[0049] The hash bucket RAM is used to store entry structures, which include {key_idx, action_idx, hash identifier}.
[0050] Optionally, in the low-complexity hash table generation system described in this application embodiment, the address mapping rules specifically include:
[0051] The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function;
[0052] The hash identifier in the entry structure is another hash result calculated by the hash function.
[0053] Thirdly, embodiments of this application also provide a computer-readable storage medium, which includes a low-complexity hash table generation method program. When the low-complexity hash table generation method program is executed by a processor, it implements the steps of the low-complexity hash table generation method as described in any of the preceding claims.
[0054] As can be seen from the above, the low-complexity hash table generation method, system, and medium provided in this application embodiment constructs the core parameter information of the hardware hash table, which includes a hash bucket RAM, a key-value action RAM, and a hash function; configures the operation rules of the hash function; obtains the input key, calculates the input key based on the operation rules, and obtains at least two hash results; sets the address mapping rules and table entry filling rules of the hash bucket RAM to obtain the filling results; configures the lookup rules of the hash table, queries the filling results based on the lookup rules, and generates the hardware hash table; adopts a dual-hash-value mapping dual-target-address filling strategy to generate two independent filling paths, reducing the risk of collisions caused by a single address entry being full; and reduces the probability of collisions under the same storage capacity by dividing the entries of a single hash bucket RAM into multiple independent regions and trying the filling addresses corresponding to multiple hash results sequentially according to the region. Attached Figure Description
[0055] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0056] Figure 1 A flowchart illustrating the low-complexity hash table generation method provided in this application embodiment;
[0057] Figure 2 A structural block diagram of the hardware hash table for the low-complexity hash table generation method provided in this application embodiment;
[0058] Figure 3 A schematic diagram of a single hash bucket storage method for generating a low-complexity hash table provided in this application embodiment;
[0059] Figure 4 A schematic diagram of the dual-hash bucket storage method for the low-complexity HASH table generation method provided in the embodiments of this application;
[0060] Figure 5 This is an illustration of the partition-filled hash representation of the low-complexity HASH table generation method provided in the embodiments of this application. Detailed Implementation
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0062] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, the terms "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0063] Please refer to Figures 1-5 As shown, this low-complexity hash table generation method is used in terminal devices. The low-complexity hash table generation method includes the following steps:
[0064] S101, the core parameter information for building a hardware hash table, including hash bucket RAM, key-value action RAM and hash function;
[0065] S102, Configure the hash function's operation rules;
[0066] S103, obtain the input key Key, calculate the input key Key based on the operation rules, and obtain at least two hash results, namely the first hash value hash_1 and the second hash value hash_2;
[0067] S104, Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results;
[0068] S105: Configure the lookup rules for the hash table, query the filling results based on the lookup rules, and generate a hardware hash table.
[0069] It should be noted that by improving the structure of the hardware hash table, the content of each entry is stored in a separate RAM, and the address of the entry in that RAM replaces the original entry content in the hash table. Furthermore, the average number of table lookups is reduced by storing and comparing another hash result. A block diagram of a classic hardware hash table is shown below. Figure 2 As shown.
[0070] The entries are grouped into p groups and stored in the addresses of q hash tables. The total number of entries in the hash tables is p*q, the total number of entries to be filled is k, and the number of hash operations is n.
[0071] The table fields are filled in as follows:
[0072] After calculating hash_1, if the number of entries already filled into the address corresponding to the HASH table ram is less than p, then the empty position is successfully filled and no further steps are executed.
[0073] The remaining hashes, such as hash_2, are calculated sequentially, and attempts are made to fill them into the corresponding addresses in the hash table RAM.
[0074] If all addresses corresponding to hash_1 to hash_n cannot be filled, it is considered that an unmanageable hash collision has occurred, and the entries are filled into the escape bucket.
[0075] Because hardware hash tables need to ensure that the probability of failing to fill k entries into the hash table is very small, the total number of entries in the hash table, p*q, generally needs to be greater than k. In the case of two hashes, at least 2*k entries are required, which wastes resources because half of the space is actually unused.
[0076] According to an embodiment of the present invention, the key-value action RAM is used to independently store key-value pairs, where the key-value pair is {Key, Action}, and each key-value pair is configured with unique index information;
[0077] The index information includes the key index key_idx and the action index action_idx;
[0078] The hash bucket RAM is used to store the entry structure, which includes {key_idx, action_idx, hash identifier}.
[0079] According to an embodiment of the present invention, the address mapping rules specifically include:
[0080] The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function;
[0081] The hash identifier in the entry structure is another hash result calculated by the hash function.
[0082] According to an embodiment of the present invention, the table entry filling rules specifically include:
[0083] The first target address of the hash bucket RAM is obtained by mapping based on the first hash value hash_1.
[0084] If the number of free entries corresponding to the first target address meets the preset condition, then the entry containing the key index key_idx, the action index action_idx, and the second hash value hash_2 will be filled into the corresponding free entry;
[0085] If the number of free entries corresponding to the first target address does not meet the preset condition, the second target address of the hash bucket RAM is obtained based on the second hash value hash_2.
[0086] If the number of free entries corresponding to the second target address meets the preset condition, then the entry containing the key index key_idx, action index action_idx and the first hash value hash_1 will be filled into the corresponding free entry;
[0087] If none of the conditions are met, the entries will be filled into the escape bucket.
[0088] According to an embodiment of the present invention, the table lookup rules specifically include:
[0089] The first hash value hash_1 and the second hash value hash_2 are calculated based on the input key.
[0090] Locate the first address of the hash bucket RAM based on hash_1, read all entries, and filter out entries whose hash identifiers match hash_2;
[0091] The filtered entries are compared with the input key to analyze whether they match.
[0092] If they match, the corresponding Action is obtained;
[0093] If there is a discrepancy, the read entries will be re-filtered or the escape bucket will be queried.
[0094] According to an embodiment of the present invention, the setting of preset conditions includes:
[0095] Divide the entries corresponding to each address in the hash bucket RAM into two groups according to a preset number p, with the maximum number of entries in each group set to p / 2. The preset condition is that the number of filled entries in the group corresponding to the target address is less than p / 2.
[0096] According to embodiments of the present invention, such as Figure 3 As shown, replace {key, action} stored in the hardware HASH table with {key_idx, action_idx, hash_2}, and add a RAM to store {key, action}, named -- the provincial key hash table.
[0097] The purpose of adding hash_2 is to reduce the average number of accesses to the key_action RAM. Without hash_2, the key_action RAM needs to be accessed p times to match a key. After storing hash_2, only entries corresponding to keys for which both hash_1 and hash_2 results are the same require further key matching. Only the keys in those entries with the same hash_2 result need to be compared; the hash_2 comparison process is similar to a coarse screening. The probability of entries with the same hash_2 result but different keys is very small, thus significantly reducing the average number of accesses to the key_action RAM.
[0098] The hash bucket RAM still stores p*q entries of {key_idx, action_idx, hash_1}, but the newly added storage RAM only stores k {key, action} entries. Therefore, although there is still unused space in the hash bucket RAM, storage resources can be significantly saved when the bit width of {key_idx, action_idx, hash_1} is much smaller than the actual entry bit width (i.e., {key, action}).
[0099] Figure 3 For the case of having only one hash bucket and hashing once, Figure 4 A structure is presented that uses two hash buckets and alternates between two hash functions.
[0100] like Figure 4 As shown, hash bucket 1 uses hash_1 as the address and stores hash_2 in the entry for coarse filtering. Hash bucket 2 uses hash_2 as the address and stores hash_1 in the entry for coarse filtering. Because two hashes are used, the collision probability is lower than with a single hash.
[0101] The table fields are filled in as follows:
[0102] After calculating hash_1 and hash_2, if the number of entries already filled in the address corresponding to hash_ in the HASH table ram 1 (hash bucket 1) is less than p / 2, then the empty position is successfully filled, and hash_2 is filled in the hash in {key_action_idx, hash}, and the subsequent steps are not executed.
[0103] If the number of entries already filled in the address corresponding to hash_2 in the HASH table ram 2 (hash bucket 2) is less than p / 2, then the empty position is successfully filled, and hash_1 is filled in {key_action_idx, hash}, and subsequent steps are not executed.
[0104] If neither hash bucket 1 nor 2 can be filled, it is considered that an unmanageable hash collision has occurred, and the entry is filled into the escape bucket.
[0105] The above improvements, after optimizing resources, use another hash result for coarse filtering to reduce the average number of queries for {key, action}. However, in the worst case, coarse filtering cannot exclude any table entries, so in the worst case, it is necessary to query {key, action} ram p times, which may not meet the requirements in some scenarios.
[0106] To address this problem, this invention proposes another method for optimizing resources—partitioning and filling hash tables. For example... Figure 5 As shown, compared to traditional multi-hash buckets, this structure divides the hash bucket horizontally into two regions, A and B, meaning that p = p_a + p_b entries are stored at one address in the hash bucket. This approach doesn't differ significantly in hardware implementation; the main difference lies in using a new padding method to reduce the probability of collisions.
[0107] The table fields are filled in as follows:
[0108] Try filling hash_1, hash_2, and hash_n into area A in sequence. If there is space, do not try the other hash results and write them.
[0109] Try filling hash_1, hash_2, and hash_n into area B in sequence. If there is space, do not try the other hash results and write them.
[0110] If neither area A nor area B can be filled, it is considered that an unmanageable hash collision has occurred, and the entry is filled into the escape bucket.
[0111] The software simulated filling in 1024 entries, and the probability of collisions was calculated independently multiple times. The results are shown in the table below.
[0112]
[0113] The comparison reveals that, with the same number of hashes in the hash buckets and the same total number of entries, the collision probability of partitioning to fill the hash table is significantly reduced. When the collision probability is close to that of a single-bucket double hash, the key-saving hash table achieves a smaller implementation area.
[0114] In this application, the HASH table is an efficient data structure for storing key-value pairs. It uses a hash function to map keys to a specific position in an array, thereby enabling fast insertion, deletion, and lookup operations.
[0115] HASH, where hash stands for hash function, is a type of hashing function.
[0116] Key is the key, the content to be matched when matching entries, and also the input for the hash function calculation;
[0117] Action refers to the action performed to match entries, which is the purpose of hash table matching;
[0118] Key_idx is the address where the key is stored; the key can be obtained by looking up the corresponding RAM.
[0119] action_idx is the address where the action is stored. The action can be obtained by looking up the corresponding RAM.
[0120] The escape bucket is a structure for storing entries when an unmanageable hash collision occurs. It has a limited size, so the frequency of filling the escape bucket should be minimized.
[0121] Secondly, embodiments of this application provide a low-complexity hash table generation system. The system includes a memory and a processor. The memory includes a program for a low-complexity hash table generation method. When the program for the low-complexity hash table generation method is executed by the processor, it performs the following steps:
[0122] The core parameter information for constructing a hardware hash table includes the hash bucket RAM, the key-value action RAM, and the hash function.
[0123] Configure the hash function's operation rules;
[0124] Get the input key Key, calculate the input key Key based on the operation rules, and get at least two hash results, namely the first hash value hash_1 and the second hash value hash_2;
[0125] Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results;
[0126] Configure the lookup rules for the hash table, and query the populated results based on the lookup rules to generate a hardware hash table.
[0127] According to an embodiment of the present invention, the key-value action RAM is used to independently store key-value pairs, where the key-value pair is {Key, Action}, and each key-value pair is configured with unique index information;
[0128] The index information includes the key index key_idx and the action index action_idx;
[0129] The hash bucket RAM is used to store the entry structure, which includes {key_idx, action_idx, hash identifier}.
[0130] According to an embodiment of the present invention, the address mapping rules specifically include:
[0131] The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function;
[0132] The hash identifier in the entry structure is another hash result calculated by the hash function.
[0133] A third aspect of the present invention provides a computer-readable storage medium including a low-complexity hash table generation method program, which, when executed by a processor, implements the steps of the low-complexity hash table generation method as described above.
[0134] This invention discloses a low-complexity hash table generation method, system, and medium. It constructs core parameter information for a hardware hash table, including a hash bucket RAM, a key-value action RAM, and a hash function. The method involves configuring the hash function's operation rules; obtaining an input key; calculating at least two hash results based on the operation rules; setting address mapping rules and entry filling rules for the hash bucket RAM to obtain filling results; configuring lookup rules for the hash table; querying the filling results based on the lookup rules to generate the hardware hash table; and employing a dual-hash-value mapping dual-target-address filling strategy to generate two independent filling paths, reducing the risk of collisions caused by a single address entry being full. Furthermore, by dividing the entries in a single hash bucket RAM into multiple independent regions and sequentially trying filling addresses corresponding to multiple hash results for each region, the probability of collisions under the same storage capacity is reduced.
[0135] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0136] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0137] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0138] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0139] Alternatively, if the integrated units of the present invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
Claims
1. A method for generating a low-complexity hash table, characterized in that, include: The core parameter information for constructing a hardware hash table includes hash bucket RAM, key-value action RAM, and hash function. Configure the operation rules of the hash function; Get the input key Key, calculate the input key Key based on the operation rules, and get at least two hash results, namely the first hash value hash_1 and the second hash value hash_2; Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results; Configure the lookup rules for the hash table, and query the populated results based on the lookup rules to generate a hardware hash table.
2. The low-complexity hash table generation method according to claim 1, characterized in that, The key-value action RAM is used to independently store key-value pairs, where each key-value pair is {Key, Action}, and each key-value pair is configured with unique index information. The index information includes a key index key_idx and an action index action_idx; The hash bucket RAM is used to store entry structures, which include {key_idx, action_idx, hash identifier}.
3. The low-complexity hash table generation method according to claim 2, characterized in that, The address mapping rules specifically include: The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function; The hash identifier in the entry structure is another hash result calculated by the hash function.
4. The low-complexity hash table generation method according to claim 3, characterized in that, The table entry filling rules specifically include: The first target address of the hash bucket RAM is obtained by mapping based on the first hash value hash_1. If the number of free entries corresponding to the first target address meets the preset condition, then the entry containing the key index key_idx, the action index action_idx, and the second hash value hash_2 will be filled into the corresponding free entry; If the number of free entries corresponding to the first target address does not meet the preset condition, the second target address of the hash bucket RAM is obtained based on the second hash value hash_2. If the number of free entries corresponding to the second target address meets the preset condition, then the entry containing the key index key_idx, action index action_idx and the first hash value hash_1 will be filled into the corresponding free entry; If none of the conditions are met, the entries will be filled into the escape bucket.
5. The low-complexity hash table generation method according to claim 4, characterized in that, The table lookup rules specifically include: The first hash value hash_1 and the second hash value hash_2 are calculated based on the input key. Locate the first address of the hash bucket RAM based on hash_1, read all entries, and filter out entries whose hash identifiers match hash_2; The filtered entries are compared with the input key to analyze whether they match. If they match, the corresponding Action is obtained; If there is a discrepancy, the read entries will be re-filtered or the escape bucket will be queried.
6. The low-complexity hash table generation method according to claim 5, characterized in that, The preset conditions include: The entries corresponding to each address in the hash bucket RAM are divided into two groups according to a preset number p, and the maximum number of entries in each group is set to p / 2. The preset condition is that the number of filled entries in the group corresponding to the target address is less than p / 2.
7. A low-complexity hash table generation system, characterized in that, The system includes a memory and a processor. The memory contains a program for generating a low-complexity hash table. When the processor executes the program for generating the low-complexity hash table, it performs the following steps: The core parameter information for constructing a hardware hash table includes hash bucket RAM, key-value action RAM, and hash function. Configure the operation rules of the hash function; Get the input key Key, calculate the input key Key based on the operation rules, and get at least two hash results, namely the first hash value hash_1 and the second hash value hash_2; Set the address mapping rules and entry filling rules for the hash bucket RAM, and obtain the filling results; Configure the lookup rules for the hash table, and query the populated results based on the lookup rules to generate a hardware hash table.
8. The low-complexity hash table generation system according to claim 7, characterized in that, The key-value action RAM is used to independently store key-value pairs, where each key-value pair is {Key, Action}, and each key-value pair is configured with unique index information. The index information includes a key index key_idx and an action index action_idx; The hash bucket RAM is used to store entry structures, which include {key_idx, action_idx, hash identifier}.
9. The low-complexity hash table generation system according to claim 8, characterized in that, The address mapping rules specifically include: The address of the hash bucket RAM is generated by mapping one of the hash results calculated by the hash function; The hash identifier in the entry structure is another hash result calculated by the hash function.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a low-complexity hash table generation method program, which, when executed by a processor, implements the steps of the low-complexity hash table generation method as described in any one of claims 1 to 6.