WO2016184029A1 - 支持哈希查找和路由查找的存储、查找方法和装置、存储介质 - Google Patents
支持哈希查找和路由查找的存储、查找方法和装置、存储介质 Download PDFInfo
- Publication number
- WO2016184029A1 WO2016184029A1 PCT/CN2015/092392 CN2015092392W WO2016184029A1 WO 2016184029 A1 WO2016184029 A1 WO 2016184029A1 CN 2015092392 W CN2015092392 W CN 2015092392W WO 2016184029 A1 WO2016184029 A1 WO 2016184029A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- hash
- searched
- search
- route
- sub
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/54—Store-and-forward switching systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/745—Address table lookup; Address filtering
Definitions
- the present invention relates to network switching technologies, and in particular, to a storage, searching method and apparatus, and a storage medium that simultaneously support hash lookup and route lookup.
- the core routers used for backbone network interconnection have an interface speed of 200 Gbps.
- the main task of the network processor is to classify and forward the packets according to the keywords of the data packets.
- the search for these keywords (key values) is attributed to three main search methods: hash search and route lookup. And stream classification lookup.
- the stream classification search is implemented by tri-state content addressable memory (TCAM) because the key length is variable and there is a mask search.
- TCAM tri-state content addressable memory
- the hash search is fixed due to the key length.
- no mask can be implemented by a separate hash lookup module; route lookup because of the need for the longest mask matching, also need to use a separate route lookup module to achieve, usually route lookup can rely on TCAM to achieve.
- hash entries and routing entries that each router needs to process are also rapidly expanding.
- the hash entries and routing tables that the router needs to process The number of items is also different. In some scenarios, only a small number of hash tables are required, but a large number of routing tables are required. In other scenarios, a large number of hash entries are required and only a small number of routing entries are required. Some scenarios also require a large number of hash tables. And routing table entries.
- the embodiment of the present invention provides a storage and searching method and device for supporting hash searching and route searching, and a storage medium, which can be configured to flexibly adjust the capacity ratio of the hash table and the routing table to satisfy more. The need for multiple application scenarios.
- a plurality of hash table entry storage units and a plurality of routing table entry storage units are planned; each hash sub-table corresponds to a hash table entry storage unit, and the information to be stored of each level node of the multi-level route search corresponds to a routing entry storage unit;
- the information to be stored in each hash sub-table is stored in the corresponding hash table entry storage unit, and the information to be stored in each level node of the multi-level route search is stored in the corresponding routing entry storage unit.
- the multiple hash entry storage units and the multiple routing entry storage units are planned, including:
- the method for searching for a hash search and a route lookup is provided by the embodiment of the present invention.
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1; the search method includes:
- the hash values to be searched for in the hash search are sequentially hashed by using the hash sub-tables split by the hash table, and at the same time, the multi-level route search is performed on the key values to be searched when the route is searched. .
- the key values to be searched for in the hash search are sequentially hashed by using the hash sub-tables split by the hash table, including:
- the multi-level route search is performed on the key value to be searched when the route is searched, including:
- a multi-bit Trie tree route lookup is performed on the key value to be searched for when the route is searched.
- the key value to be searched when receiving the hash search and the key value to be searched when the route is searched include: P key values to be searched when receiving the hash search and Q keys to be searched when the route is searched a value, P and/or Q is a natural number greater than one;
- the hash value to be searched for in the hash search is sequentially hashed by using each hash sub-table split by the hash table, including: searching for the hash sequentially by using the corresponding hash sub-table The first key value to the Pth key value to be searched for hash search;
- the multi-level route search for the key value to be searched for when the route is searched includes: searching for a route of a corresponding level from the first key value to the Qth key value to be searched for when the route is searched.
- the storage device that supports the hash search and the route search is provided by the embodiment of the present invention, including: a split module, an acquisition module, and a planning module;
- Splitting the module configured to split the pre-acquired hash table into multiple hash sub-tables
- the obtaining module is configured to obtain information to be stored in each hash sub-list and information to be stored in each level node of the multi-level route search;
- a planning module configured to allocate a plurality of hash table entry storage units and a plurality of routing table entry storage units; each of the hash sub-tables corresponds to a hash table entry storage unit, and each level of the multi-level route search The information to be stored of the node corresponds to a routing entry storage unit; each hash table entry storage unit is configured to store information to be stored in the corresponding hash sub-table, and each routing entry storage unit is configured to store multi-level routing search The information to be stored of the corresponding level node.
- the planning module is further configured to determine, according to the data size of the information to be stored in each hash sub-table, the storage capacity of the corresponding hash table entry storage unit, and further configured to search for the corresponding location according to the multi-level route
- the data size of the information to be stored at each level of the node determines the storage capacity of the corresponding routing entry storage unit.
- the search device for supporting the hash search and the route search is provided by the embodiment of the present invention.
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1; the device includes: a first receiving module and First lookup module; wherein
- a first receiving module configured to receive a key value to be searched when the hash is searched and a key value to be searched when the route is searched;
- a first search module configured to perform hash search on each of the hash sub-tables split by the hash table in sequence for the key value to be searched when the hash is searched; and configured to search for the hash
- the key values to be searched are sequentially hashed by using the hash sub-tables split by the hash table, and the multi-level route search is performed on the key values to be searched when the route is searched.
- the first search module is further configured to perform hash calculation on the key value to be searched during the hash search by using at least one hash function corresponding to the jth hash sub-table, and the initial value of j is Searching for each of the hash values obtained by the hash calculation in the j-th hash sub-table; determining whether the search result of the j-th hash sub-table exists and waiting for the hash search The hashed entry matching the searched key value, if it exists, will be looked up with the hash lookup The hash table matching key value is used as the hash search result, and the current hash search process is ended. Otherwise, it is judged whether the current j value is equal to M. If yes, the current hash search fails, otherwise, the value of j is Add 1 to continue the above process.
- the first searching module is further configured to perform a multi-bit Trie tree route search on the key value to be searched when the route is searched.
- the first receiving module is configured to receive P key values to be searched when the hash is searched and Q key values to be searched when the route is searched, and P and/or Q are natural numbers greater than 1;
- the first search module is configured to perform a hash search on the first key value to the Pth key value to be searched during the hash search by using a corresponding hash sub-table, and configured to search for the route.
- the route search of the corresponding level is performed.
- the storage medium provided by the embodiment of the present invention stores a computer program for performing the foregoing storage and search methods for supporting hash search and route lookup.
- the storage, searching method and device, and storage medium for supporting hash search and route lookup provided by the embodiments of the present invention respectively allocate respective storage units for hash search and route lookup according to requirements, and can simultaneously support hash search and route lookup.
- the limited storage capacity of the router can be multiplexed to meet the different application requirements of the router for the hash table and the routing entry, and the configuration can flexibly adjust the capacity ratio of the hash table and the routing table, and reduce the router. Production costs to meet the needs of more application scenarios.
- FIG. 1 is a flowchart of a storage method supporting both hash search and route lookup according to an embodiment of the present invention
- FIG. 2 is a first flowchart of a method for searching for a hash search and a route lookup according to an embodiment of the present invention
- FIG. 3 is a second flowchart of a method for searching for a hash search and a route lookup according to an embodiment of the present invention
- FIG. 4 is a schematic structural diagram of a storage device supporting a hash search and a route lookup according to an embodiment of the present invention
- FIG. 5 is a schematic structural diagram of a device for searching for a hash search and a route lookup according to an embodiment of the present invention
- FIG. 6 is a flowchart of a first embodiment of a storage method for simultaneously supporting hash lookup and route lookup according to the present invention
- FIG. 7 is a flowchart of a second embodiment of a storage method for simultaneously supporting hash lookup and route lookup according to the present invention.
- FIG. 8 is a flowchart of a first embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention
- FIG. 9 is a flowchart of a second embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- FIG. 10 is a flowchart of a hash search in a second embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention
- 11 is a flowchart of route lookup in an embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention
- FIG. 12 is a flow chart showing a parallel search and route lookup in parallel in a first embodiment and a second embodiment of a search method for supporting hash lookup and route lookup according to the present invention
- FIG. 13 is a flowchart of a third embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- FIG. 14 is a structural block diagram of a parallel lookup in a third embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- FIG. 1 is a flowchart of a storage method for supporting hash search and route lookup according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
- Step 100 Split the pre-acquired hash table into multiple hash sub-tables.
- each hash sub-table corresponds to at least one hash function
- the acquisition of the hash table has various existing implementation schemes, which will not be described in detail herein.
- the hash table may be split into multiple hash sub-tables according to different storage locations included in the hash table; here, the storage location in the hash table represents the storage address of the corresponding key value;
- the data capacity divided into multiple hash sub-tables may be the same or different.
- Step 101 Acquire information to be stored of each hash sub-list and information to be stored of each level node of the multi-level route search.
- each hash sub-table includes a key value composed of keywords of a fixed length.
- multiple levels of route lookup processes need to be performed in sequence. After the current route search process ends, the next level of route lookup can be performed.
- Step 102 Plan a plurality of hash entry storage units and a plurality of routing entry storage units; each hash sub-table corresponds to a hash entry storage unit, and each multi-level route looks for each level of the node to be processed.
- the storage information corresponds to a routing entry storage unit.
- the storage capacity of the corresponding hash table entry storage unit may be planned according to the data size of the information to be stored in each hash sub-table; or the corresponding each-level node to be stored may be searched according to the multi-level route.
- the data size of the information determines the storage capacity of the corresponding routing entry storage unit.
- Step 103 Store the information to be stored in each hash sub-table into the corresponding hash table item storage list.
- the information to be stored in each level node of the multi-level route search is stored in the corresponding routing table entry storage unit.
- the following describes the search method for supporting hash search and route lookup in the embodiment of the present invention in two cases.
- the number of keys to be searched for when searching for hashes and the number of key values to be searched for when searching for routes are one.
- FIG. 2 is a first flowchart of a method for searching for a hash search and a route lookup according to an embodiment of the present invention. As shown in FIG. 2, the method includes:
- Step 200 Receive one key value to be searched when the hash is searched and one key value to be searched when the route is searched.
- the key value refers to a keyword
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1, and each hash sub-table corresponds to at least one hash function.
- the router may receive the key value to be searched from the client or the server.
- Step 201 Perform hash search on each hash sub-table split by the hash table in the key value to be searched in the hash search, and simultaneously perform more key values to be searched when the route is searched. Level route lookup.
- the hash values to be searched for in the hash search are sequentially hashed by using the hash table split by the hash table.
- the following methods may be used:
- Method 1 Searching for each of the hash sub-tables split by the hash table by using the hash value to be searched for in the hash search, including:
- Step A1 performing hash calculation on the key value to be searched during the hash search by using at least one hash function corresponding to the jth hash sub-table, and the initial value of j is 1; each obtained according to the hash calculation The hash value is searched in the jth hash subtable;
- Step B1 determining whether the hash of the j-th hash sub-table exists and the hash The hash table item matching the key value to be searched when searching, if present, the hash table item matching the key value to be searched at the hash search is used as a hash search result, and the current hash search is ended. Flow, otherwise, perform step C1;
- Step C1 It is judged whether the current j value is equal to M, and if so, the current hash search fails, otherwise, the value of j is incremented by 1, and the process returns to step A1.
- Method 2 performing a hash search on each of the hash sub-tables split by the hash table in the key value to be searched for in the hash search, including:
- Step A2 performing hash calculation on the key value to be searched during the hash search by using at least one hash function corresponding to the jth hash sub-table, and the initial value of j is 1; each obtained according to the hash calculation The hash value is searched in the jth hash subtable;
- Step B2 determining whether there is a hash table item matching the key value to be searched when the hash search is found in the search result of the j-th hash sub-table, and if yes, waiting for the hash search
- the searched key-value matching hash table entry is used as the hash search result of the j-th hash sub-table, and step C2 is performed, otherwise, the hash search result of the j-th hash sub-list is not, and step C2 is performed;
- Step C2 It is judged whether the current j value is equal to M. If yes, the hash search results of the respective hash sub-tables are summarized into the current hash search result; otherwise, the value of j is incremented by 1, and the process returns to step A2.
- the hash search result of each hash sub-table obtained in step C2 is a plurality of hash entries matching the key values to be searched at the hash search, then in the plurality of hash entries If the hash table matching the key value to be searched is selected, one hash table item is selected as the hash search result; if the hash search result of each hash sub-table obtained in step C2 is 1
- the hash table entry matching the key value to be searched when the hash is searched, the hash table entry matching the key value to be searched at the hash search is the current hash search result.
- performing multi-level route lookup on the key value to be searched during the route lookup includes: performing multi-bit Trie tree route lookup on the key value to be searched when the route is searched.
- FIG. 3 is a second flowchart of a method for searching for a hash search and a route lookup according to an embodiment of the present invention. As shown in FIG. 3, the process includes:
- Step 300 Receive P key values to be searched when the hash is searched and Q key values to be searched when the route is searched, and P and/or Q are natural numbers greater than 1.
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1, and each hash sub-table corresponds to at least one hash function.
- the router may receive the key value to be searched from the client or the server.
- Step 301 Perform hash search on each of the P sub-keys to be searched for by the hash table in the hash search, and at the same time, Q to be searched for the route search.
- the key value performs multi-level route lookup.
- hashing the P key values to be searched for in the hash search by using each hash sub-list includes: using the corresponding hash sub-table to sequentially search for the hash when searching The first key value to the Pth key value are hashed.
- the route search for each of the Q key values to be searched for in the route search includes: searching for the first key value to the Qth key value to be searched in the route search. Level route lookup.
- the storage device includes a split module 400, an obtaining module 401, and a planning module 402.
- the splitting module 400 is configured to split the pre-acquired hash table into a plurality of hash sub-tables, each hash sub-table corresponding to at least one hash function.
- the obtaining module 401 is configured to obtain information to be stored of each hash sub-list and information to be stored of each level node of the multi-level route search.
- the planning module 402 is configured to allocate multiple hash table entry storage units and multiple routing table entries.
- a storage unit each hash sub-table corresponds to a hash table entry storage unit, and the information to be stored of each level node of the multi-level route search corresponds to one routing table entry storage unit; each hash table entry storage unit is used for storage
- Corresponding hash table information to be stored, each routing table entry storage unit is configured to store information to be stored of the corresponding level node of the multi-level route lookup.
- the planning module 402 is further configured to determine, according to the data size of the information to be stored in each hash sub-table, the storage capacity of the corresponding hash entry storage unit, and further configured to search each of the corresponding ones according to the multi-level routing
- the data size of the information to be stored at the level node determines the storage capacity of the corresponding routing entry storage unit.
- the splitting module 400, the obtaining module 401, and the planning module 402 can all be processed by a central processing unit (CPU), a microprocessor (Micro Processor Unit, MPU), and a digital signal processing located in a router. (Digital Signal Processor, DSP), or Field Programmable Gate Array (FPGA) implementation.
- CPU central processing unit
- MPU Micro Processor Unit
- DSP Digital Signal Processor
- FPGA Field Programmable Gate Array
- FIG. 5 is a schematic structural diagram of a device for a search device that supports a hash search and a route lookup according to an embodiment of the present invention.
- the search device includes: a first receiving module 500 and a first search module 501;
- the number of keys to be searched for when searching for hashes and the number of key values to be searched for when searching for routes are one.
- the first receiving module 500 is configured to receive a key value to be searched when the hash is searched and a key value to be searched when the route is searched.
- the first search module 501 is configured to perform hash search on each of the hash sub-tables split by the hash table by using the hash value to be searched in the hash search, and configured to search for the hash
- a multi-level route search is performed on the key value to be searched when the route is searched.
- the place The hash table of the hash search is split into M hash sub-tables, M ⁇ 1, and each hash sub-table corresponds to at least one hash function.
- the first implementation of the first lookup module 501 is the first implementation of the first lookup module 501:
- the first searching module 501 is specifically configured to perform the following steps:
- Step A3 performing hash calculation on the key value to be searched when the hash search is performed by using at least one hash function corresponding to the jth hash sub-table, and the initial value of j is 1; each obtained according to the hash calculation The hash value is searched in the jth hash subtable;
- Step B3 determining whether there is a hash table item matching the key value to be searched when the hash search is found in the search result of the j-th hash sub-table, and if yes, waiting for the hash search Find the hash table matching the key value as the hash search result, and end the hash search process, otherwise, perform step C3;
- Step C3 It is judged whether the current j value is equal to M, and if so, the current hash search fails, otherwise, the value of j is incremented by 1, and the process returns to step A3.
- the first searching module 501 is specifically configured to perform the following steps:
- Step A4 performing hash calculation on the key value to be searched when the hash search is performed by using at least one hash function corresponding to the jth hash sub-table, and the initial value of j is 1; each obtained according to the hash calculation The hash value is searched in the jth hash subtable;
- Step B4 determining whether there is a hash table item matching the key value to be searched when the hash search is found in the search result of the j-th hash sub-table, and if yes, waiting for the hash search
- the searched key-value matching hash table item is used as the hash search result of the j-th hash sub-table, and step C4 is performed, otherwise, the j-th hash sub-table hash search result is none, and step C4 is performed;
- Step C4 It is judged whether the current j value is equal to M. If yes, the hash search results of the respective hash sub-tables are summarized into the current hash search result, otherwise, the value of j is incremented by 1, and the process returns to step A4.
- the number of key values to be searched for when the hash is searched is greater than 1, and/or the number of key values to be searched for when the route is searched is greater than one.
- the first receiving module 500 is configured to receive P key values to be searched when the hash is searched and Q key values to be searched when the route is searched, and P and/or Q are natural numbers greater than 1;
- the first search module 501 is configured to wait for the hash search.
- the searched P key values are sequentially hashed by using the hash sub-tables split by the hash table, and configured to sequentially use the hashes for the P key values to be searched for when the hash search is performed.
- Each hash sub-table split into a table performs hash search, and performs multi-level route search on the Q key values to be searched when the route is searched; and uses P key values to be searched when the hash is searched
- Performing a hash search on each of the hash sub-tables includes: performing hash search on the first key value to the P-th key value to be searched for when the hash search is performed by using the corresponding hash sub-table;
- Each of the Q key values to be searched for each level of route search includes: performing a route search of the corresponding level from the first key value to the Qth key value to be searched for when the route is searched.
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1, and each hash sub-table corresponds to at least one hash function.
- the first receiving module 500 and the first searching module 501 may each be a Central Processing Unit (CPU), a Micro Processor Unit (MPU), and a digital signal processor located in the router. (Digital Signal Processor, DSP), or Field Programmable Gate Array (FPGA) implementation.
- CPU Central Processing Unit
- MPU Micro Processor Unit
- DSP Digital Signal Processor
- FPGA Field Programmable Gate Array
- the apparatus for tracking the service signaling may also be stored in a computer readable storage medium if it is implemented in the form of a software function module and sold or used as a separate product.
- the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. Enabling a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention All or part of it.
- the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
- program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
- an embodiment of the present invention further provides a computer storage medium, wherein a computer program is stored, and the computer program is used to execute a storage and search method for supporting hash search and route lookup in the embodiment of the present invention.
- FIG. 6 is a flow chart of a first embodiment of a storage method for simultaneously supporting hash lookup and route lookup according to the present invention. As shown in Figure 6, the process includes:
- Step 600 Acquire a hash table, and split the obtained hash table into multiple hash sub-tables.
- each hash sub-table corresponds to at least one hash function
- the hash function may be a CRC function or other functions; when the hash function uses the CRC function, the hash functions corresponding to the hash sub-tables are Different CRC polynomials can be used.
- Step 601 Acquire information to be stored of each hash sub-list and information to be stored of each level node of the multi-bit Trie tree route search.
- the information to be stored in each hash sub-table includes a hash key value composed of keywords of a fixed length; the information to be stored of each level node of the multi-bit Trie tree route search includes corresponding nodes of the level.
- the prefix, and the child node pointer of each node of the level, the child node pointer points to the physical address of each child node with a parent-child relationship.
- each level node is compared with the upper level node, and the prefix length of the information to be stored corresponding to the level node is greater than the upper level node, that is, The shorter the prefix length of the information to be stored, the closer the node corresponding to the information to be stored is to the top of the tree.
- Step 602 Plan a plurality of hash table entry storage units and a plurality of routing table entry storage units; each hash sub-table corresponds to a hash table entry storage unit, and each multi-bit Trie tree route search finds each level node The information to be stored corresponds to a routing entry storage unit.
- the first hash entry storage unit to the Mth hash entry storage unit and the first routing entry storage unit to the Lth routing entry may be planned in physical memory or other storage.
- the storage unit, L is the number of stages of the multi-bit Trie tree route lookup, and the number of levels of the multi-bit Trie tree route lookup refers to the number of stages of the multi-bit Trie tree route lookup.
- each hash table entry storage unit/routing table entry storage unit may be a virtual logical storage area, and each hash table entry storage unit is configured to store information to be stored in the hash sub-list, and each routing entry storage unit Information to be stored for storing each level of the multi-bit Trie tree route lookup.
- the number of hash sub-tables generated by the step 600 splitting may be the same as or different from the number of levels of the multi-bit Trie tree route search.
- the storage capacity of the corresponding hash table entry storage unit may be planned according to the data size of the information to be stored in each hash sub-table; or the corresponding multi-bit Trie tree route may also be used to search for the corresponding each level node.
- the data size of the information to be stored is determined, and the storage capacity of the corresponding routing entry storage unit is determined.
- the corresponding hash table entry storage may be set according to the capacity ratio of the hash table entry and the routing entry that the router needs to process. The unit and the routing entry storage unit can better adapt to the corresponding application requirements of the router.
- the M hash sub-tables are sorted into the first hash sub-table according to the data of the information to be stored in each hash sub-table.
- M hash sub-tables if the mth hash table entry storage unit is used to store the information to be stored of the Mth hash sub-table (m takes 1 to M), then the first hash entry storage unit to the Mth.
- the storage capacity of the hash table entry storage units is arranged from small to large; for the same reason, if the kth routing table entry storage unit is used to store the information to be stored of the kth node of the multi-bit Trie tree route lookup ( k takes 1 to L), and the storage capacity of the first routing entry storage unit to the Lth routing entry storage unit is arranged from small to large.
- the physical memory register can access all the multiple hash table entry storage units and multiple routing table entry storage units, so that multiple hash entries are planned on the physical memory.
- the register may be used to dynamically adjust each of the hash table entry storage unit and each routing entry storage unit.
- the dynamic adjustment process is: adjusting each according to actual conditions.
- the hash table entry storage unit corresponding to the hash sub-table and adjust the routing table entry storage unit corresponding to the to-be-stored information of each level node of the multi-bit Trie tree route search, no matter what dynamic adjustment is made, two different The information to be stored in the hash sub-table is not in the same hash table entry storage unit, and the information to be stored in the different two-level nodes of the multi-bit Trie tree route search is not in the same routing table entry storage unit.
- each hash entry storage unit/routing entry storage unit has an independent address access bus and a separate data bus.
- the address Access to the bus and data bus are reusable.
- the address access bus and data bus between them cannot be reused.
- Step 603 The information to be stored in each hash sub-table is stored in the corresponding hash table entry storage unit, and the information to be stored in each level node of the multi-bit Trie tree route search is stored in the corresponding routing entry storage unit. .
- each hash sub-table has a one-to-one correspondence with each hash table entry storage unit, that is, the information to be stored of each hash sub-table can only be stored in one hash table entry storage unit, and each hash table entry The storage unit can only store the information to be stored in one hash sub-table; similarly, the information to be stored of the nodes of the multi-bit Trie tree route search has a one-to-one correspondence with the storage unit of each routing table item, that is, the multi-bit Trie tree
- the information to be stored at each level of the route lookup can be stored in only one routing entry storage unit, and each routing entry storage unit can only store the information to be stored in the primary node of the multi-level route lookup.
- FIG. 7 is a second embodiment of a storage method for simultaneously supporting hash lookup and route lookup according to the present invention
- the flow chart is shown in Figure 7. The process includes:
- Step 700 Obtain a hash table, and split the obtained hash table into M hash sub-tables.
- Each hash sub-table corresponds to N hash functions, and both M and N are greater than or equal to 1.
- Step 701 The first hash sub-table is used as the current target hash sub-table; the information to be stored of each hash sub-list and the information to be stored of each level node of the multi-bit Trie tree route search are obtained.
- Step 702 Plan a plurality of hash table entry storage units and a plurality of routing table entry storage units; each hash sub-table corresponds to a hash table entry storage unit, and each multi-bit Trie tree route search finds each level node The information to be stored corresponds to a routing entry storage unit.
- Step 703 Store the to-be-stored information of each level node of the multi-bit Trie tree route search into the corresponding routing table entry storage unit.
- the N hash functions corresponding to the current target hash sub-table are used to calculate the address of the information to be stored in the current target hash sub-table, and the vacancy is searched in the corresponding hash entry storage unit according to the calculated address. If found, the information to be stored in the current target hash sub-table is stored in the slot; if not found, step 704 is performed.
- Step 704 Determine whether the current target hash sub-table is the Mth hash sub-table. If yes, go to step 705. Otherwise, update the current target hash sub-table to the next hash sub-table of the current target hash sub-table, and return. Go to step 703.
- the current target hash subtable is updated to the next hash subtable of the current target hash subtable
- the current target hash subtable is updated. For the third hash subtable.
- Step 705 Determine whether the update number of the hash function of the current target hash sub-table is greater than a preset threshold. If yes, update the target hash sub-table of the current target to the previous hash sub-table of the current target hash sub-table, and re-execute In this step, otherwise, all the N hash functions corresponding to the current target hash sub-table are updated, and the process returns to step 703.
- the current target hash subtable For example, updating the target hash subtable of the current target to the current target hash subtable A hash subtable, if the current target hash subtable is the fourth hash subtable, the current target hash subtable is updated to the third hash subtable.
- steps 700 to 705 are substantially identical to steps 600 to 603, and the difference is in the update of the hash function and the storage process of the information to be stored in each hash subtable.
- the key value to be searched in a hash search is found in any one of the hash sub-tables. Matching hash entries will not find matching hash entries in other hash subtables.
- FIG. 8 is a flowchart of a first embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention. As shown in Figure 8, the process includes:
- Step 800 Simultaneously receive the key value to be searched when the hash is searched and the key value to be searched when the route is searched.
- the hash table of the hash lookup is split into M hash subtables, M ⁇ 1, and each hash subtable corresponds to at least one hash function.
- the implementation method of the split M sub-tables is the same as the implementation method of the M hash sub-tables split in the storage method of the embodiment of the present invention, and the hash function corresponding to each hash sub-table and In the storage method of the embodiment of the present invention, the hash function corresponding to each hash sub-table is the same.
- Step 801 According to the first method, the hash values to be searched for the hash search are sequentially hashed by using the M hash sub-tables split by the hash table, and at the same time, the route is searched for.
- the searched key value performs a multi-bit Trie tree route lookup.
- the hash values to be searched for the hash search are sequentially hashed by using the M hash sub-tables split by the hash table, including:
- Step A1 performing a j-th level hash calculation, that is, using at least one hash function corresponding to the j-th hash sub-table to perform hash calculation on the key value to be searched during the hash search, and the initial value of j is 1;
- the respective hash values (ie, corresponding addresses) calculated according to the hash are searched in the j-th hash sub-table.
- Step B1 performing a j-th hash search, that is, determining a search result of the j-th hash sub-table Whether there is a hash table item matching the key value to be searched when the hash is searched, and if present, the j-th level hash search result is used as the final hash search result, and the j-th stage hash search result is A hash table entry matching the key value to be searched at the hash search, and ending the hash search process. Otherwise, step C1 is performed.
- step B1 when each hash value (ie, corresponding address) obtained according to the hash calculation is searched in the j-th hash sub-table, each address obtained according to the hash is calculated at the jth The hash table is searched to obtain the corresponding hash table entry (ie, the hash key value).
- Step C1 It is judged whether the current j value is equal to M, and if so, the current hash search fails, otherwise, the value of j is incremented by 1, and the process returns to step A1.
- step 801 performing multi-bit Trie tree route lookup for the key value to be searched during the route lookup includes:
- Step a1 Performing, according to the storage information of the first-level node of the multi-bit Trie tree route search, the first-level route search for the key value to be searched when the route is searched, and obtaining the first-level route search result;
- Step b2 performing, according to the k-th route search result and the storage information of the k+1th node of the multi-bit Trie tree route search, performing the k+1th route search on the key value to be searched when the route is searched, The k+1th route search result is obtained, and the initial value of k is 1;
- Step c2 determining whether k is equal to L-1, where L is the number of levels of the multi-bit Trie tree route search; if k is equal to L-1, the obtained L-level route search result is obtained by using the longest prefix matching principle. The final route lookup result.
- Step 802 Output a hash search result and a route search result.
- FIG. 9 is a second embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention Flow chart. As shown in Figure 9, the process includes:
- the step 900 to the step 902 are substantially the same as the step 800 to the step 802. The difference is that, in the step 901, the key value to be searched for the hash search is sequentially split by the hash table according to the second method. M hash subtables for hash lookup.
- the hash values to be searched for in the hash search are sequentially hashed by using the M hash sub-tables split by the hash table, including:
- Step A2 performing a j-th level hash calculation, that is, using at least one hash function corresponding to the j-th hash sub-table to perform hash calculation on the key value to be searched during the hash search, and the initial value of j is 1; Searching, according to the hash calculation, each hash value in the j-th hash sub-table;
- Step B2 performing a j-th level hash search, that is, determining whether there is a hash table item matching the key value to be searched when the hash search is found in the search result of the j-th hash sub-table, and if yes, The hash table item matching the key value to be searched at the hash search is used as the j-th level hash search result, and step C2 is performed, otherwise, the j-th stage hash search result is not, and step C2 is performed;
- Step C2 It is judged whether the current j value is equal to M. If yes, the hash search results of the respective hash sub-tables are summarized into the current hash search result; otherwise, the value of j is incremented by 1, and the process returns to step A2.
- the hash search/route lookup adopts a serial search mode, that is, both are adopted. Multi-level search process.
- FIG. 10 is a flowchart of a hash search in a second embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- a multi-level serial search is used when performing hash search. The process, only after the hash search of the level is finished, the next level of hash search is performed until the M-th level hash search process ends; when the j-th stage hash search is performed, the j-th stage hash calculation is performed, according to The result of the j-th level hash calculation is hashed in the j-th hash sub-table to obtain the j-th level hash search result; the M-th stage hash search result is the final hash search result.
- FIG. 11 is a schematic diagram of an embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- the embodiment of the present invention adopts a multi-level serial search process when performing route lookup; and performs multi-bit Trie tree routing on the key values to be searched for when the route is searched.
- route comparison of the corresponding level that is, each key value in the storage information of the corresponding level node of the route search and the multi-bit Trie tree route search is matched according to the prefix. The principle is compared, and the corresponding level route search result is obtained.
- both the hash search and the route lookup adopt a multi-level search mode.
- it is necessary to find the storage information of each level of hash search/route lookup that is, The memory requirements of the above two lookup methods, hash lookup and route lookup, are very close. If the information to be stored of each hash sub-table and the information to be stored of each level node of the multi-bit Trie tree route search are pre-stored, respectively, the corresponding storage space is allocated for each level of hash search/route lookup, respectively.
- these two completely different lookup methods are combined under hierarchical lookup logic, reducing the extra memory overhead.
- FIG. 12 is a flow chart of parallel search and route lookup in the first embodiment and the second embodiment of the present invention, which simultaneously supports hash search and route lookup.
- the number of levels of the hash search is the same as the number of the route search, and both are M.
- the first storage area to the Mth are planned when the information to be stored of each hash sub-table and the information to be stored of each level node of the multi-bit Trie tree route search are stored in advance.
- a storage area sorting the M hash sub-tables generated by the split into the first hash sub-table to the M-th hash sub-table according to the data of the information to be stored in each hash sub-table;
- the hash table entry storage unit is configured to store the information to be stored of the Mth hash sub-table (m takes 1 to M), and the storage of the first hash entry storage unit to the Mth hash entry storage unit
- the capacity is arranged from small to large; for the same reason, if the mth routing table entry storage unit is used to store the information to be stored of the mth node of the multi-bit Trie tree route lookup (m takes 1 to M), then The storage capacity of a routing table entry storage unit to the Mth routing entry storage unit is small.
- the mth hash entry storage unit and the mth routing entry storage unit are located in the mth storage area; it can be seen that the first storage area to the Mth storage area can be arranged from small to large, thereby being reasonable Use storage space.
- FIG. 13 is a flowchart of a third embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention. As shown in Figure 13, the process includes:
- Step 1000 Receive two key values to be searched when the hash is searched and two key values to be searched when the route is searched.
- the hash table of the hash search is split into M hash sub-tables, M ⁇ 1, and each hash sub-table corresponds to at least one hash function.
- the implementation method of the split M sub-tables is the same as the implementation method of the M hash sub-tables split in the storage method of the embodiment of the present invention, and the hash function corresponding to each hash sub-table and In the storage method of the embodiment of the present invention, the hash function corresponding to each hash sub-table is the same.
- Step 1001 Perform hash search on each of the two hash keys to be searched for in the hash search by using the hash table split by the hash table, and at the same time, two to be searched for the route search.
- the key value performs a multi-bit Trie tree route lookup.
- performing hash search by using each hash sub-table for the two key values to be searched during the hash search includes: using the corresponding hash sub-table for the first key value to be searched when the hash search is performed Performing a hash search, after obtaining the hash search result of the first key value of the corresponding hash sub-table to be searched, and using the corresponding hash sub-table for the second key value to be searched during the hash search Performing a hash search, and obtaining a hash search result of the second key value to be searched for the corresponding hash sub-table, and hashing the two key values to be searched for when the hash search is performed by using the corresponding hash sub-table
- the process of searching ends, and at this time, the next hash table can be used to hash the two key values to be searched during the hash search.
- the hash search process of the first key value is completed first, and the hash search process of the second key value is paused (can be regarded as a delay) Processing), after the hash search process of the first key value is finished, the hash search of the second key value is performed.
- the first embodiment of the search method for supporting hash search and route lookup in the present invention is implemented by using the corresponding hash sub-table for hash search for each key value to be searched during the hash search. This has been explained in the second embodiment and will not be described again here.
- each level of searching includes: performing multi-bit Trie tree route lookup on the first key value to be searched when the route is searched The corresponding level of the search, after obtaining the route search result of the first key value to be searched for by the route lookup, and then performing the search for the corresponding level of the multi-bit Trie tree route search for the second key value to be searched for the route lookup
- the search process of the multi-bit Trie tree route search corresponding level is completed for the two key values to be searched during the route lookup.
- the multi-bit Trie tree route can be searched for the next level of the search for the two key values to be searched at the route lookup. That is, when performing the multi-bit Trie tree route lookup for each level of the two key values to be searched for in the route lookup, the route search process of the first key value to be found when the route lookup is completed is completed first. At the same time, the route search process of the first key value to be searched at the time of the route lookup is suspended (it can be regarded as a delay process), and after the route search process of the first key value to be searched at the route search is completed, Then, the route search of the second key value to be searched when the route search is performed is performed.
- each hash value to be searched for hash search is hashed by using each hash sub-table, or a multi-bit Trie tree route search is performed for each key value to be searched for when the route is searched.
- the serial implementation is adopted. There is no two hash search instructions to access the same hash table entry storage unit, and there are no two route lookup instructions accessing the same routing entry storage unit. This will avoid the occurrence of a lookup conflict.
- Step 1002 Output a hash search result of each key value to be searched when the hash is searched, and a route search result of each key value to be searched when the route is searched.
- FIG. 14 is a structural block diagram of a parallel lookup in a third embodiment of a search method for simultaneously supporting hash lookup and route lookup according to the present invention.
- the number of levels of hash lookup is the same as the number of ranks of route lookups.
- M when the information to be stored of each hash sub-table and the information to be stored of each level node of the multi-bit Trie tree route search are pre-stored, the first storage area to the Mth storage area are planned; the generated M is split.
- the hash sub-table is the first hash sub-table to the M-th hash sub-table, and the m-th hash table entry storage unit is used to store the information to be stored of the M-th hash sub-table (m takes 1 to M);
- the mth routing entry storage unit is configured to store the to-be-stored information of the m-th node of the multi-bit Trie tree route lookup (m takes 1 to M), the mth hash entry storage unit and the mth
- the routing entry storage unit is located in the mth storage area.
- the third embodiment of the search method supporting both hash search and route lookup according to the present invention performs hash search and route lookup in parallel;
- Each level of hash lookup/route lookup, according to the corresponding storage structure, can access the same storage area, thus reducing the extra memory overhead.
- embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例公开了同时支持哈希查找和路由查找的存储方法,将预先获取的哈希表拆分成多个哈希子表(100);获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息(101);规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元(102);将每个哈希子表的待存储信息存入对应的哈希表项存储单元,将多级路由查找的每一级结点的待存储信息存入对应的路由表项存储单元(103)。本发明实施例还公开了同时支持哈希查找和路由查找的存储装置、查找方法和查找装置、存储介质。
Description
本发明涉及网络交换技术,尤其涉及同时支持哈希查找和路由查找的存储、查找方法和装置、存储介质。
随着因特网(Internet)的迅猛发展,用于主干网络互联的核心路由器的接口速率达到200Gbps,作为路由器的心脏,网络处理器的性能决定了路由器的性能差异。网络处理器的主要工作是根据数据报文的各项关键字对报文进行分类和转发,而对这些关键字(键值)的查找归结于三种主要的查找方式:哈希查找、路由查找和流分类查找。在现有的处理方式中,流分类查找由于键值长度不定且多存在掩码查找,通常采用三态内容寻址存储器(TCAM,ternary content addressable memory)来实现;哈希查找由于键值长度固定且无掩码,可以由单独的哈希查找模块来实现;路由查找由于需要进行最长掩码匹配,也需要使用单独的路由查找模块来实现,通常路由查找可以依赖于TCAM来实现。
随着网络业务量的急速膨胀,每个路由器需要处理的哈希表项和路由表项需求也急速膨胀,而在不同的应用需求和应用环境下,路由器需要处理的哈希表项和路由表项的数量也不尽相同。有些场景下只需要少量的哈希表,但需要大量的路由表;而另一些场景下,需要大量的哈希表项而只需要少量的路由表项;也有一些场景同时需要大量的哈希表和路由表项。然而,现有技术中,缺乏针对上述不同场景并同时支持哈希查找和路由查找的实现方案。
发明内容
为解决上述技术问题,本发明实施例提供了一种同时支持哈希查找和路由查找的存储、查找方法和装置、存储介质,能够配置灵活地调整哈希表和路由表的容量比,满足更多应用场景的需求。
本发明实施例的技术方案是这样实现的:
本发明实施例提供的同时支持哈希查找和路由查找的存储方法,包括:
将预先获取的哈希表拆分成多个哈希子表;
获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息;
规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元;
将每个哈希子表的待存储信息存入对应的哈希表项存储单元,将多级路由查找的每一级结点的待存储信息存入对应的路由表项存储单元。
上述方案中,所述规划出多个哈希表项存储单元和多个路由表项存储单元,包括:
根据每个哈希子表的待存储信息的数据大小,确定对应的哈希表项存储单元的存储容量;根据所述多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
本发明实施例提供的同时支持哈希查找和路由查找的查找方法,所述哈希查找的哈希表拆分成M个哈希子表,M≥1;所述查找方法包括:
接收哈希查找时待查找的键值和路由查找时待查找的键值;
对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,同时,对所述路由查找时待查找的键值进行多级路由查找。
上述方案中,所述对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:
利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,继续执行上述流程。
上述方案中,所述对所述路由查找时待查找的键值进行多级路由查找,包括:
对所述路由查找时待查找的键值进行多比特Trie树路由查找。
上述方案中,所述接收哈希查找时待查找的键值和路由查找时待查找的键值,包括:接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数;
所述对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找;
所述对所述路由查找时待查找的键值进行多级路由查找,包括:对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。
本发明实施例提供的同时支持哈希查找和路由查找的存储装置,包括:拆分模块、获取模块和规划模块;其中,
拆分模块,配置为将预先获取的哈希表拆分成多个哈希子表;
获取模块,配置为获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息;
规划模块,配置为规划出多个哈希表项存储单元和多个路由表项存储单元;所述每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元;每个哈希表项存储单元用于存储对应的哈希子表的待存储信息,每个路由表项存储单元用于存储多级路由查找的对应级结点的待存储信息。
上述方案中,所述规划模块,还配置为根据每个哈希子表的待存储信息的数据大小,确定对应的哈希表项存储单元的存储容量;还配置为根据所述多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
本发明实施例提供的同时支持哈希查找和路由查找的查找装置,所述哈希查找的哈希表拆分成M个哈希子表,M≥1;所述装置包括:第一接收模块和第一查找模块;其中,
第一接收模块,配置为接收哈希查找时待查找的键值和路由查找时待查找的键值;
第一查找模块,配置为对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找;并配置为在对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找的同时,对所述路由查找时待查找的键值进行多级路由查找。
上述方案中,所述第一查找模块,还配置为利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的
键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,继续执行上述流程。
上述方案中,所述第一查找模块,还配置为对所述路由查找时待查找的键值进行多比特Trie树路由查找。
上述方案中,所述第一接收模块,配置为接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数;
所述第一查找模块,配置为利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找,同时配置为对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。
本发明实施例提供的存储介质,存储有计算机程序,该计算机程序用于执行上述同时支持哈希查找和路由查找的存储、查找方法。
本发明实施例提供的同时支持哈希查找和路由查找的存储、查找方法和装置、存储介质,根据需要为哈希查找和路由查找分别分配各自的存储单元,可同时支持哈希查找和路由查找,这样,能够将路由器上有限的存储容量复用,以应对路由器对哈希表项和路由表项的不同的应用需求,并能配置灵活地调整哈希表和路由表的容量比,降低路由器的生产成本,满足更多应用场景的需求。
图1为本发明实施例同时支持哈希查找和路由查找的存储方法的流程图;
图2为本发明实施例同时支持哈希查找和路由查找的查找方法的第一流程图;
图3为本发明实施例同时支持哈希查找和路由查找的查找方法的第二流程图;
图4为本发明实施例同时支持哈希查找和路由查找的存储装置的组成结构示意图;
图5为本发明实施例同时支持哈希查找和路由查找的查找装置的组成结构示意图;
图6为本发明同时支持哈希查找和路由查找的存储方法的第一实施例的流程图;
图7为本发明同时支持哈希查找和路由查找的存储方法的第二实施例的流程图;
图8为本发明同时支持哈希查找和路由查找的查找方法的第一实施例的流程图;
图9为本发明同时支持哈希查找和路由查找的查找方法的第二实施例的流程图;
图10为本发明同时支持哈希查找和路由查找的查找方法的第二实施例中哈希查找的流程图;
图11为本发明同时支持哈希查找和路由查找的查找方法的实施例中路由查找的流程图;
图12为本发明同时支持哈希查找和路由查找的查找方法的第一实施例和第二实施例中并行进行哈希查找和路由查找的流程框图;
图13为本发明同时支持哈希查找和路由查找的查找方法的第三实施例的流程图;
图14为本发明同时支持哈希查找和路由查找的查找方法的第三实施例中并行查找的结构框图。
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
图1为本发明实施例同时支持哈希查找和路由查找的存储方法的流程图,如图1所示,该方法包括:
步骤100:将预先获取的哈希表拆分成多个哈希子表。
这里,每个哈希子表对应至少一个哈希函数,哈希表的获取有多种现有的实现方案,在此不再详述。
本步骤中,可以根据哈希表内包含的不同的存储位置,将哈希表拆分成多个哈希子表;这里,哈希表内的存储位置代表了对应的键值的存储地址;拆分成多个哈希子表的数据容量大小可以相同,也可以不同。
步骤101:获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息。
这里,每个哈希子表的待存储信息包括以固定长度的关键字组成的键值。对于多级路由查找,需要依次进行多个级别的路由查找过程,在当前级的路由查找过程结束后,才能进行下一个级的路由查找。
在实际应用中,需要获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息时,有多种现有的实现方式,例如:可以在客户端上输入对应的待存储信息,然后由客户端向路由器发送相应的待存储信息。
步骤102:规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元。
在实际应用中,可以根据每个哈希子表的待存储信息的数据大小,规划对应的哈希表项存储单元的存储容量;也可以根据多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
步骤103:将每个哈希子表的待存储信息存入对应的哈希表项存储单
元,将多级路由查找的每一级结点的待存储信息存入对应的路由表项存储单元。
下面分两种情况对本发明实施例同时支持哈希查找和路由查找的查找方法进行说明。
第一种情况:哈希查找时待查找的键值和路由查找时待查找的键值的个数均为1个。
图2为本发明实施例同时支持哈希查找和路由查找的查找方法的第一流程图,如图2所示,该方法包括:
步骤200:接收哈希查找时待查找的1个键值和路由查找时待查找的1个键值。
这里,所述键值是指关键字;所述哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
本步骤中,当需要接收哈希查找时待查找的键值和路由查找时待查找的键值时,可以由路由器接收来自客户端或服务器的待查找的键值。
步骤201:对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,同时,对所述路由查找时待查找的键值进行多级路由查找。
本步骤中,对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找可以有如下几种方法:
方法一:对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:
步骤A1:利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
步骤B1:判断所述第j个哈希子表的查找结果中是否存在与所述哈希
查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,执行步骤C1;
步骤C1:判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,返回至步骤A1。
方法二:对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:
步骤A2:利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
步骤B2:判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为第j个哈希子表的哈希查找结果,并执行步骤C2,否则,令第j个哈希子表的哈希查找结果为没有,执行步骤C2;
步骤C2:判断当前的j值是否等于M,若是,将各个哈希子表的哈希查找结果汇总为本次哈希查找结果,否则,将j的值加1,返回至步骤A2。
具体地,如果在步骤C2中得出的各个哈希子表的哈希查找结果为多个与所述哈希查找时待查找的键值匹配的哈希表项,则在多个与所述哈希查找时待查找的键值匹配的哈希表项,任选一个哈希表项作为本次哈希查找结果;如果在步骤C2中得出的各个哈希子表的哈希查找结果为1个与所述哈希查找时待查找的键值匹配的哈希表项,则该与所述哈希查找时待查找的键值匹配的哈希表项为本次哈希查找结果。
在步骤201中,对所述路由查找时待查找的键值进行多级路由查找包括:对所述路由查找时待查找的键值进行多比特Trie树路由查找。
第二种情况,哈希查找时待查找的键值的个数大于1,和/或路由查找
时待查找的键值的个数大于1。
图3为本发明实施例同时支持哈希查找和路由查找的查找方法的第二流程图,如图3所示,该流程包括:
步骤300:接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数。
这里,所述哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
本步骤中,当需要接收哈希查找时待查找的键值和路由查找时待查找的键值时,可以由路由器接收来自客户端或服务器的待查找的键值。
步骤301:对所述哈希查找时待查找的P个键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,同时,对所述路由查找时待查找的Q个键值进行多级路由查找。
这里,当P大于1时,对所述哈希查找时待查找的P个键值利用每个哈希子表进行哈希查找包括:利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找。当Q大于1时,对所述路由查找时待查找的Q个键值进行每一级路由查找包括:对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。
图4为本发明实施例同时支持哈希查找和路由查找的存储装置的组成结构示意图,如图4所示,该存储装置包括拆分模块400、获取模块401和规划模块402;其中,
拆分模块400,配置为将预先获取的哈希表拆分成多个哈希子表,每个哈希子表对应至少一个哈希函数。
获取模块401,配置为获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息。
规划模块402,配置为规划出多个哈希表项存储单元和多个路由表项存
储单元;每个哈希子表对应一个哈希表项存储单元,多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元;每个哈希表项存储单元用于存储对应的哈希子表的待存储信息,每个路由表项存储单元用于存储多级路由查找的对应级结点的待存储信息。
所述规划模块402,还配置为根据每个哈希子表的待存储信息的数据大小,确定对应的哈希表项存储单元的存储容量;还配置为根据所述多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
在实际应用中,所述拆分模块400、获取模块401和规划模块402均可由位于路由器中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。
图5为本发明实施例同时支持哈希查找和路由查找的查找装置的组成结构示意图,该查找装置包括:第一接收模块500和第一查找模块501;其中,
下面分两种情况进行说明。
第一种情况:哈希查找时待查找的键值和路由查找时待查找的键值的个数均为1个。
第一接收模块500,配置为接收哈希查找时待查找的键值和路由查找时待查找的键值。
第一查找模块501,配置为对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找;并配置为在对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找的同时,对所述路由查找时待查找的键值进行多级路由查找。这里,所
述哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
下面说明所述第一查找模块501的两种实现方案。
第一查找模块501的第一种实现方案:
所述第一查找模块501,具体配置为执行以下步骤:
步骤A3:利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
步骤B3:判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,执行步骤C3;
步骤C3:判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,返回至步骤A3。
第一查找模块501的第二种实现方案:
所述第一查找模块501,具体配置为执行以下步骤:
步骤A4:利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
步骤B4:判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为第j个哈希子表的哈希查找结果,并执行步骤C4,否则,第j个哈希子表的哈希查找结果为无,执行步骤C4;
步骤C4:判断当前的j值是否等于M,若是,将各个哈希子表的哈希查找结果汇总为本次哈希查找结果,否则,将j的值加1,返回至步骤A4。
第二种情况,哈希查找时待查找的键值的个数大于1,和/或路由查找时待查找的键值的个数大于1。
第一接收模块500,配置为接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数;
当哈希查找时待查找的键值的个数大于1,和/或路由查找时待查找的键值的个数大于1时,第一查找模块501,配置为对所述哈希查找时待查找的P个键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,并配置为在对所述哈希查找时待查找的P个键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找的同时,对所述路由查找时待查找的Q个键值进行多级路由查找;对所述哈希查找时待查找的P个键值利用每个哈希子表进行哈希查找包括:利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找;对所述路由查找时待查找的Q个键值进行每一级路由查找包括:对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。这里,所述哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
在实际应用中,所述第一接收模块500和第一查找模块501均可由位于路由器中的中央处理器(Central Processing Unit,CPU)、微处理器(Micro Processor Unit,MPU)、数字信号处理器(Digital Signal Processor,DSP)、或现场可编程门阵列(Field Programmable Gate Array,FPGA)等实现。
本发明实施例上述业务信令跟踪的装置如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法
的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。
相应地,本发明实施例还提供一种计算机存储介质,其中存储有计算机程序,该计算机程序用于执行本发明实施例的同时支持哈希查找和路由查找的存储、查找方法。
下面将结合附图对本发明的具体实施例进行详细描述。
图6为本发明同时支持哈希查找和路由查找的存储方法的第一实施例的流程图。如图6所示,该流程包括:
步骤600:获取哈希表,并将获取的哈希表拆分成多个哈希子表。
本步骤中,每个哈希子表对应至少一个哈希函数,哈希函数可以是CRC函数,也可以是其他函数;当哈希函数采用CRC函数时,各个哈希子表对应的哈希函数之间可以采用不同的CRC多项式。
步骤601:获取每个哈希子表的待存储信息和多比特Trie树路由查找的每一级结点的待存储信息。
本步骤中,每个哈希子表的待存储信息包括以固定长度的关键字组成的哈希键值;多比特Trie树路由查找的每一级结点的待存储信息包括该级各个结点对应的前缀、以及该级各个结点的子结点指针,子结点指针指向了具有父子关系的各子结点的物理地址。根据多比特Trie树路由查找方法中存储信息的特点,每一级结点与上一级结点相比,该级结点对应的待存储信息中前缀长度大于上一级结点,也就是说,待存储信息中前缀长度越短,则该待存储信息对应的结点越靠近树的顶部。
步骤602:规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多比特Trie树路由查找的每一级结点的待存储信息对应一个路由表项存储单元。
实际应用中,可以在物理内存或其他存储器上规划出第1个哈希表项存储单元至第M个哈希表项存储单元、以及第1个路由表项存储单元至第L个路由表项存储单元,L为多比特Trie树路由查找的级数,多比特Trie树路由查找的级数指多比特Trie树路由查找的结点的级数。这里,每个哈希表项存储单元/路由表项存储单元可以是虚拟的逻辑存储区,每个哈希表项存储单元用于存储哈希子表的待存储信息,每个路由表项存储单元用于存储多比特Trie树路由查找的每一级结点的待存储信息。另外,根据实际需要,步骤600拆分生成的哈希子表的个数与上述多比特Trie树路由查找的级数可以相同,也可以不同。
这里,还可以根据每个哈希子表的待存储信息的数据大小,规划对应的哈希表项存储单元的存储容量;也可以根据所述多比特Trie树路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量;如此,可以根据路由器需要处理的哈希表项和路由表项的容量比,来设置规划出对应的哈希表项存储单元和路由表项存储单元,从而能够更好的适应路由器的相应应用需求。
下面以一个具体实施例进行说明,在该具体实施例中,按照各个哈希子表的待存储信息的数据由小倒大的顺序,将M个哈希子表排序为第1个哈希子表至第M个哈希子表;如果第m个哈希表项存储单元用于存储第M个哈希子表的待存储信息(m取1至M),则第1个哈希表项存储单元至第M个哈希表项存储单元的存储容量是由小到大排列的;同理,如果第k个路由表项存储单元用于存储多比特Trie树路由查找的第k级结点的待存储信息(k取1至L),则第1个路由表项存储单元至第L个路由表项存储单元的存储容量是由小到大排列的。
在实际应用中,物理内存的寄存器可以访问所有的多个哈希表项存储单元和多个路由表项存储单元,这样,在物理内存上规划出多个哈希表项
存储单元和多个路由表项存储单元之后,还可以利用寄存器来对每个哈希表项存储单元和每个路由表项存储单元进行动态调整,该动态调整的过程是:根据实际情况调整每个哈希子表对应的哈希表项存储单元,并调整多比特Trie树路由查找的每一级结点的待存储信息对应的路由表项存储单元,不管进行怎样的动态调整,两个不同的哈希子表的待存储信息不处在同一哈希表项存储单元,多比特Trie树路由查找的不同的两级结点的待存储信息不处在同一路由表项存储单元。
需要说明的是,每个哈希表项存储单元/路由表项存储单元具有独立的地址访问总线和独立的数据总线,对于每个哈希表项存储单元/路由表项存储单元而言,地址访问总线和数据总线是可以复用的。但对于任意两个哈希表项存储单元或任意两个路由表项存储单元,它们之间地址访问总线和数据总线不可以复用。当后续过程需要查找哈希表项存储单元或路由表项存储单元时,通过发送相应的地址来访问哈希表项存储单元/路由表项存储单元中对应于所发送地址处存储的数据。
步骤603:将每个哈希子表的待存储信息存入对应的哈希表项存储单元,将多比特Trie树路由查找的每一级结点的待存储信息存入对应的路由表项存储单元。
这里,各个哈希子表与各个哈希表项存储单元形成一一对应的关系,即每个哈希子表的待存储信息只能存储于一个哈希表项存储单元,而每个哈希表项存储单元只能存储一个哈希子表的待存储信息;同样,多比特Trie树路由查找的各级结点的待存储信息与各个路由表项存储单元形成一一对应的关系,即多比特Trie树路由查找的每一级结点的待存储信息只能存储于一个路由表项存储单元中,而每个路由表项存储单元只能存储多级路由查找的一级结点的待存储信息。
图7为本发明同时支持哈希查找和路由查找的存储方法的第二实施例
的流程图,如图7所示,该流程包括:
步骤700:获取哈希表,并将获取的哈希表拆分成M个哈希子表,每个哈希子表对应N个哈希函数,M和N均大于等于1。
步骤701:将第1个哈希子表作为当前的目标哈希子表;获取每个哈希子表的待存储信息和多比特Trie树路由查找的每一级结点的待存储信息。
步骤702:规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多比特Trie树路由查找的每一级结点的待存储信息对应一个路由表项存储单元。
步骤703:将多比特Trie树路由查找的每一级结点的待存储信息存入对应的路由表项存储单元。
同时,依次利用当前的目标哈希子表对应的N个哈希函数计算当前的目标哈希子表的待存储信息的地址,根据每次计算得到的地址在对应的哈希表项存储单元中查找空位,若查找到,则将当前的目标哈希子表的待存储信息存入所述空位中;若未查找到,执行步骤704。
步骤704:判断当前的目标哈希子表是否为第M个哈希子表,若是,执行步骤705,否则,将当前的目标哈希子表更新为当前的目标哈希子表的下一个哈希子表,返回至步骤703。
例如,在将当前的目标哈希子表更新为当前的目标哈希子表的下一个哈希子表时,如果当前的目标哈希子表为第2个哈希子表,则将当前的目标哈希子表更新为第3个哈希子表。
步骤705:判断当前的目标哈希子表的哈希函数的更新次数是否大于预设门限,若是,将当前目标的目标哈希子表更新为当前的目标哈希子表的上一个哈希子表,重新执行本步骤,否则,将当前的目标哈希子表对应的N个哈希函数全部更新,返回至步骤703。
例如,在将当前目标的目标哈希子表更新为当前的目标哈希子表的上
一个哈希子表,如果当前的目标哈希子表为第4个哈希子表,则将当前的目标哈希子表更新为第3个哈希子表。
这里,步骤700至步骤705与步骤600至步骤603基本一致,其区别点在于,哈希函数的更新和每个哈希子表的待存储信息的存储过程。在采用本实施例的方法对每个哈希子表的待存储信息进行存储之后,当进行后续的哈希查找时,一个哈希查找时待查找的键值如果在任意一个哈希子表中找出匹配的哈希表项,则不会在其他的哈希子表中找出匹配的哈希表项。
图8为本发明同时支持哈希查找和路由查找的查找方法的第一实施例的流程图。如图8所示,该流程包括:
步骤800:同时接收哈希查找时待查找的键值和路由查找时待查找的键值。哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
本步骤中,拆分成的M个哈希子表的实现方法与本发明实施例的存储方法中拆分成的M个哈希子表的实现方法相同,每个哈希子表对应的哈希函数与本发明实施例的存储方法中每个哈希子表对应的哈希函数相同。
步骤801:按照第一种方法对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的M个哈希子表进行哈希查找,同时,对所述路由查找时待查找的键值进行多比特Trie树路由查找。
这里,按照第一种方法对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的M个哈希子表进行哈希查找,包括:
步骤A1:进行第j级哈希计算,即利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值(即相应地址)在所述第j个哈希子表中进行查找。
步骤B1:进行第j级哈希查找,即判断所述第j个哈希子表的查找结
果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将第j级哈希查找结果作为最终哈希查找结果,第j级哈希查找结果为与所述哈希查找时待查找的键值匹配的哈希表项,并结束本次哈希查找流程,否则,执行步骤C1。
步骤B1中,在根据所述哈希计算得到的各个哈希值(即相应地址)在所述第j个哈希子表中进行查找时,根据所述哈希计算得到的各个地址在第j个哈希子表中进行查找,得出相应的哈希表项(即哈希键值)。
步骤C1:判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,返回至步骤A1。
可以看出,按照方法一进行哈希查找时,如果利用其中一个哈希子表能够查找出与待查找的键值匹配的哈希表项,则不需要利用后面的哈希子表进行哈希查找,这样,可以节省运算量并降低功耗。
具体地,在步骤801中,对所述路由查找时待查找的键值进行多比特Trie树路由查找包括:
步骤a1:根据多比特Trie树路由查找的第1级结点的存储信息,对所述路由查找时待查找的键值进行第1级路由查找,得出第1级路由查找结果;
步骤b2:根据第k级路由查找结果、以及多比特Trie树路由查找的第k+1级节点的存储信息,对所述路由查找时待查找的键值进行第k+1级路由查找,得出第k+1级路由查找结果,k的初始值为1;
步骤c2:判断k是否等于L-1,L表示多比特Trie树路由查找的级数;如果k等于L-1,则在得出的L级路由查找结果中,利用最长前缀匹配原则得出最终的路由查找结果。
步骤802:输出哈希查找结果和路由查找结果。
图9为本发明同时支持哈希查找和路由查找的查找方法的第二实施例
的流程图。如图9所示,该流程包括:
步骤900至步骤902与步骤800至步骤802基本一致,其区别在于:在步骤901中,按照第二种方法对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的M个哈希子表进行哈希查找。
具体地,按照第二种方法对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的M个哈希子表进行哈希查找,包括:
步骤A2:进行第j级哈希计算,即利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;
步骤B2:进行第j级哈希查找,即判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为第j级哈希查找结果,并执行步骤C2,否则,令第j级哈希查找结果为没有,执行步骤C2;
步骤C2:判断当前的j值是否等于M,若是,将各个哈希子表的哈希查找结果汇总为本次哈希查找结果,否则,将j的值加1,返回至步骤A2。
可以看出,在本发明同时支持哈希查找和路由查找的查找方法的第一实施例和第二实施例中,哈希查找/路由查找均采用了串行的查找方式,即都是采用了多级的查找流程。
图10为本发明同时支持哈希查找和路由查找的查找方法的第二实施例中哈希查找的流程图,如图10所示,在进行哈希查找时,采用了多级的串行查找流程,只有本级的哈希查找结束后,才进行下一级哈希查找,直至第M级哈希查找过程结束;在进行第j级哈希查找时,进行第j级哈希计算,根据第j级哈希计算的结果在第j级哈希子表中进行哈希查找,得出第j级哈希查找结果;第M级哈希查找结果为最终哈希查找结果。
图11为本发明同时支持哈希查找和路由查找的查找方法的实施例中路
由查找的流程图,如图11所示,本发明实施例在进行路由查找时,采用了多级的串行查找流程;在对所述路由查找时待查找的键值进行多比特Trie树路由查找的每级路由查找时,需要进行对应级的路由比较,即将所述路由查找时待查找的键值与多比特Trie树路由查找的对应级结点的存储信息中每个键值按照前缀匹配原则进行比较,进而得出对应级路由查找结果。
可以看出,哈希查找和路由查找均采用了多级查找方式,在进行每级哈希查找/路由查找时,均需要查找每一级哈希查找/路由查找的存储信息,也就是说,上述哈希查找和路由查找这两种查找方式的内存需求非常接近。如果在预先存储每个哈希子表的待存储信息和多比特Trie树路由查找的每一级结点的待存储信息时,分别为每级哈希查找/路由查找分配相应的存储空间,就可以在同时进行哈希查找和路由查找时,将这两种完全不同的查找方法在分层查找逻辑下融合起来,减少额外的内存开销。
下面以一个并行查找的具体实施例进行说明,图12为本发明同时支持哈希查找和路由查找的查找方法的第一实施例和第二实施例中并行进行哈希查找和路由查找的流程框图,如图12所示,在上述并行查找的具体实施例中,哈希查找的级数和路由查找的级数相同,均为M。
在上述并行查找的具体实施例中,在预先存储每个哈希子表的待存储信息和多比特Trie树路由查找的每一级结点的待存储信息时,规划出第1存储区至第M存储区;按照各个哈希子表的待存储信息的数据由小倒大的顺序,将拆分生成的M个哈希子表排序为第1个哈希子表至第M个哈希子表;如果第m个哈希表项存储单元用于存储第M个哈希子表的待存储信息(m取1至M),则第1个哈希表项存储单元至第M个哈希表项存储单元的存储容量是由小到大排列的;同理,如果第m个路由表项存储单元用于存储多比特Trie树路由查找的第m级结点的待存储信息(m取1至M),则第1个路由表项存储单元至第M个路由表项存储单元的存储容量是由小
到大排列的。第m个哈希表项存储单元和第m个路由表项存储单元位于第m存储区内;可以看出,第1存储区至第M存储区可以由小到大进行排列,由此能够合理地利用存储空间。
如图12所示,当同时接收到哈希查找指令和路由查找指令时,并行进行哈希查找和路由查找;在进行每一级哈希查找/路由查找时,根据相应的存储结构,可以访问相同的存储区,从而减少了额外的内存开销。图13为本发明同时支持哈希查找和路由查找的查找方法的第三实施例的流程图。如图13所示,该流程包括:
步骤1000:接收哈希查找时待查找的2个键值和路由查找时待查找的2个键值。所述哈希查找的哈希表拆分成M个哈希子表,M≥1,每个哈希子表对应至少一个哈希函数。
本步骤中,拆分成的M个哈希子表的实现方法与本发明实施例的存储方法中拆分成的M个哈希子表的实现方法相同,每个哈希子表对应的哈希函数与本发明实施例的存储方法中每个哈希子表对应的哈希函数相同。
步骤1001:对所述哈希查找时待查找的2个键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,同时,对所述路由查找时待查找的2个键值进行多比特Trie树路由查找。
具体地,对所述哈希查找时待查找的2个键值利用每个哈希子表进行哈希查找包括:对所述哈希查找时待查找的第1个键值利用对应的哈希子表进行哈希查找,在得到对应的哈希子表的待查找的第1个键值的哈希查找结果之后,再对所述哈希查找时待查找的第2个键值利用对应的哈希子表进行哈希查找,在得到对应的哈希子表的待查找的第2个键值的哈希查找结果时,对所述哈希查找时待查找的2个键值利用对应哈希子表进行哈希查找的过程结束,此时,就可以利用下一个哈希子表对所述哈希查找时待查找的2个键值进行哈希查找。也就是说,在对所述哈希查找时待查找
的2个键值利用每个哈希子表进行哈希查找时,先完成其中的第1个键值的哈希查找过程,同时将第2个键值的哈希查找过程暂停(可以看作延迟处理),等第1个键值的哈希查找过程结束后,再进行第2个键值的哈希查找。
本步骤中,对所述哈希查找时待查找的每个键值利用对应的哈希子表进行哈希查找的实施方式在本发明同时支持哈希查找和路由查找的查找方法的第一实施例和第二实施例中已经说明,这里不再赘述。
具体地,对所述路由查找时待查找的2个键值进行多比特Trie树路由查找每一级查找包括:对所述路由查找时待查找的第1个键值进行多比特Trie树路由查找的对应级的查找,在得到路由查找时待查找的第1个键值的路由查找结果之后,再对路由查找是待查找的第2个键值进行多比特Trie树路由查找的对应级的查找,在得到路由查找时待查找的第2个键值的路由查找结果时,对所述路由查找时待查找的2个键值进行多比特Trie树路由查找对应级的查找过程结束。此时,就可以对所述路由查找时待查找的2个键值进行多比特Trie树路由查找下一级查找。也就是说,在对所述路由查找时待查找的2个键值进行多比特Trie树路由查找每一级查找时,先完成所述路由查找时待查找的第1个键值的路由查找过程,同时将所述路由查找时待查找的第1个键值的路由查找过程暂停(可以看作延迟处理),在所述路由查找时待查找的第1个键值的路由查找过程结束后,再进行所述路由查找时待查找的第2个键值的路由查找。
本步骤中,在利用每个哈希子表对哈希查找时待查找的各个键值进行哈希查找时,或者在对所述路由查找时待查找的各个键值进行多比特Trie树路由查找每一级查找时,均采用串行实现的方式,不会同时有两个哈希查找指令访问同一哈希表项存储单元,也不会同时有两个路由查找指令访问同一路由表项存储单元,这样就可以避免查找冲突的发生。
步骤1002:输出所述哈希查找时待查找的每个键值的哈希查找结果以及路由查找时待查找的每个键值的路由查找结果。
图14为本发明同时支持哈希查找和路由查找的查找方法的第三实施例中并行查找的结构框图,如图14所示,哈希查找的级数和路由查找的级数相同,均为M,在预先存储每个哈希子表的待存储信息和多比特Trie树路由查找的每一级结点的待存储信息时,规划出第1存储区至第M存储区;拆分生成的M个哈希子表为第1个哈希子表至第M个哈希子表,第m个哈希表项存储单元用于存储第M个哈希子表的待存储信息(m取1至M);同理,第m个路由表项存储单元用于存储多比特Trie树路由查找的第m级结点的待存储信息(m取1至M),第m个哈希表项存储单元和第m个路由表项存储单元位于第m存储区内。
如图14所示,当同时接收到哈希查找指令和路由查找指令时,按照本发明同时支持哈希查找和路由查找的查找方法的第三实施例并行进行哈希查找和路由查找;在进行每一级哈希查找/路由查找时,根据相应的存储结构,可以访问相同的存储区,从而减少了额外的内存开销。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得
通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
Claims (13)
- 同时支持哈希查找和路由查找的存储方法,所述方法包括:将预先获取的哈希表拆分成多个哈希子表;获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息;规划出多个哈希表项存储单元和多个路由表项存储单元;每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元;将每个哈希子表的待存储信息存入对应的哈希表项存储单元,将多级路由查找的每一级结点的待存储信息存入对应的路由表项存储单元。
- 根据权利要求1所述方法,其中,所述规划出多个哈希表项存储单元和多个路由表项存储单元,包括:根据每个哈希子表的待存储信息的数据大小,确定对应的哈希表项存储单元的存储容量;根据所述多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
- 同时支持哈希查找和路由查找的查找方法,所述哈希查找的哈希表拆分成M个哈希子表,M≥1;所述查找方法包括:接收哈希查找时待查找的键值和路由查找时待查找的键值;对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,同时,对所述路由查找时待查找的键值进行多级路由查找。
- 根据权利要求3所述的方法,其中,所述对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈 希值在所述第j个哈希子表中进行查找;判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,继续执行上述流程。
- 根据权利要求3所述的方法,其中,所述对所述路由查找时待查找的键值进行多级路由查找,包括:对所述路由查找时待查找的键值进行多比特Trie树路由查找。
- 根据权利要求3至5任一项所述的方法,其中,所述接收哈希查找时待查找的键值和路由查找时待查找的键值,包括:接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数;所述对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找,包括:利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找;所述对所述路由查找时待查找的键值进行多级路由查找,包括:对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。
- 同时支持哈希查找和路由查找的存储装置,所述装置包括:拆分模块、获取模块和规划模块;其中,拆分模块,配置为将预先获取的哈希表拆分成多个哈希子表;获取模块,配置为获取每个哈希子表的待存储信息和多级路由查找的每一级结点的待存储信息;规划模块,配置为规划出多个哈希表项存储单元和多个路由表项存储 单元;所述每个哈希子表对应一个哈希表项存储单元,所述多级路由查找的每一级结点的待存储信息对应一个路由表项存储单元;每个哈希表项存储单元用于存储对应的哈希子表的待存储信息,每个路由表项存储单元用于存储多级路由查找的对应级结点的待存储信息。
- 根据权利要求7所述的装置,其中,所述规划模块,还配置为根据每个哈希子表的待存储信息的数据大小,确定对应的哈希表项存储单元的存储容量;还配置为根据所述多级路由查找对应的每一级结点的待存储信息的数据大小,确定对应的路由表项存储单元的存储容量。
- 同时支持哈希查找和路由查找的查找装置,所述哈希查找的哈希表拆分成M个哈希子表,M≥1;所述装置包括:第一接收模块和第一查找模块;其中,第一接收模块,配置为接收哈希查找时待查找的键值和路由查找时待查找的键值;第一查找模块,配置为对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找;并配置为在对所述哈希查找时待查找的键值依次利用所述哈希表拆分成的各个哈希子表进行哈希查找的同时,对所述路由查找时待查找的键值进行多级路由查找。
- 根据权利要求9所述的装置,其中,所述第一查找模块,还配置为利用第j个哈希子表对应的至少一个哈希函数对所述哈希查找时待查找的键值进行哈希计算,j的初始值为1;根据所述哈希计算得到的各个哈希值在所述第j个哈希子表中进行查找;判断所述第j个哈希子表的查找结果中是否存在与所述哈希查找时待查找的键值匹配的哈希表项,如果存在,则将与所述哈希查找时待查找的键值匹配的哈希表项作为哈希查找结果,并结束本次哈希查找流程,否则,判断当前的j值是否等于M,若是,则本次哈希查找失败,否则,将j的值加1,继续执行上述流程。
- 根据权利要求9所述的装置,其中,所述第一查找模块,还配置为对所述路由查找时待查找的键值进行多比特Trie树路由查找。
- 根据权利要求9至11任一项所述的装置,其中,所述第一接收模块,配置为接收哈希查找时待查找的P个键值和路由查找时待查找的Q个键值,P和/或Q为大于1的自然数;所述第一查找模块,配置为利用对应的哈希子表依次对所述哈希查找时待查找的第1个键值至第P个键值进行哈希查找,同时配置为对所述路由查找时待查找的第1个键值至第Q个键值依次进行对应级的路由查找。
- 一种存储介质,所述存储介质中存储有计算机可执行指令,该计算机可执行指令配置为执行权利要求1-6任一项所述的同时支持哈希查找和路由查找的存储、查找方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510252724.XA CN106302172A (zh) | 2015-05-18 | 2015-05-18 | 同时支持哈希查找和路由查找的存储、查找方法和装置 |
| CN201510252724.X | 2015-05-18 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2016184029A1 true WO2016184029A1 (zh) | 2016-11-24 |
Family
ID=57319232
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2015/092392 Ceased WO2016184029A1 (zh) | 2015-05-18 | 2015-10-21 | 支持哈希查找和路由查找的存储、查找方法和装置、存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106302172A (zh) |
| WO (1) | WO2016184029A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109558423A (zh) * | 2018-10-31 | 2019-04-02 | 深圳壹账通智能科技有限公司 | 一种基于键值对的数据查找方法、装置及设备 |
| CN112750040A (zh) * | 2021-01-13 | 2021-05-04 | 国泰君安证券股份有限公司 | 应用于内存交易系统实现线程安全的数据处理方法、系统、应用、装置、处理器及存储介质 |
| CN113126888A (zh) * | 2020-01-15 | 2021-07-16 | 伊姆西Ip控股有限责任公司 | 用于存储管理的方法、设备和计算机程序产品 |
| CN113726660A (zh) * | 2021-08-27 | 2021-11-30 | 西安微电子技术研究所 | 一种基于完美哈希算法的路由查找器和方法 |
| CN114884877A (zh) * | 2022-06-14 | 2022-08-09 | 电子科技大学 | 一种哈希表和HOT相结合的IPv6路由查找方法 |
| WO2023179433A1 (zh) * | 2022-03-23 | 2023-09-28 | 阿里巴巴(中国)有限公司 | 流表存储及报文转发方法、装置、计算设备及介质 |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109947762A (zh) * | 2017-08-16 | 2019-06-28 | 深圳市中兴微电子技术有限公司 | 一种哈希表管理方法及装置、计算机可读存储介质 |
| CN110968267B (zh) * | 2019-11-15 | 2024-05-31 | 北京乐我无限科技有限责任公司 | 数据管理方法、装置、服务器及系统 |
| CN111460510B (zh) * | 2020-04-17 | 2022-04-12 | 支付宝(杭州)信息技术有限公司 | 基于隐私保护确定相同业务数据的方法及装置 |
| CN112367351A (zh) * | 2020-09-29 | 2021-02-12 | 上海商泰汽车信息系统有限公司 | 用于多设备的文件共享方法及装置、目标服务器、客户端 |
| CN113946152A (zh) * | 2021-11-22 | 2022-01-18 | 中国重汽集团济南动力有限公司 | 一种全局路径规划方法、系统及低速商用无人车 |
| CN119922127B (zh) * | 2024-12-26 | 2025-11-04 | 西安空间无线电技术研究所 | 一种星载高速混合哈希路由查找方法及系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102194002A (zh) * | 2011-05-25 | 2011-09-21 | 中兴通讯股份有限公司 | 哈希表的表项添加、删除、查找方法及哈希表存储装置 |
| CN102195853A (zh) * | 2010-03-09 | 2011-09-21 | 杭州华三通信技术有限公司 | 一种保存位图的方法和装置 |
| CN102930004A (zh) * | 2012-10-29 | 2013-02-13 | 华为技术有限公司 | 哈希值存储方法、装置及芯片 |
| US20150098470A1 (en) * | 2013-10-04 | 2015-04-09 | Broadcom Corporation | Hierarchical hashing for longest prefix matching |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1173531C (zh) * | 2003-01-17 | 2004-10-27 | 清华大学 | 同时支持路由查找、ip包分类、arp查找的方法及查找系统 |
| CN1787477A (zh) * | 2004-12-09 | 2006-06-14 | 北京三星通信技术研究有限公司 | IPv6路由表的查找方法 |
| CN101094179A (zh) * | 2007-07-16 | 2007-12-26 | 中兴通讯股份有限公司 | 一种多级索引路由查找方法及装置 |
| CN101604337B (zh) * | 2009-07-13 | 2011-08-24 | 中兴通讯股份有限公司 | 一种哈希表项存储、查找装置及方法 |
| CN101692651B (zh) * | 2009-09-27 | 2014-12-31 | 中兴通讯股份有限公司 | 一种哈希查找表的方法和装置 |
| CN104426774A (zh) * | 2013-09-03 | 2015-03-18 | 中兴通讯股份有限公司 | 一种同时支持IPv4和IPv6的高速路由查找方法及装置 |
| CN105791132B (zh) * | 2014-12-17 | 2019-08-06 | 深圳市中兴微电子技术有限公司 | 一种基于多路搜索树路由查找的表项更新方法及装置 |
-
2015
- 2015-05-18 CN CN201510252724.XA patent/CN106302172A/zh active Pending
- 2015-10-21 WO PCT/CN2015/092392 patent/WO2016184029A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102195853A (zh) * | 2010-03-09 | 2011-09-21 | 杭州华三通信技术有限公司 | 一种保存位图的方法和装置 |
| CN102194002A (zh) * | 2011-05-25 | 2011-09-21 | 中兴通讯股份有限公司 | 哈希表的表项添加、删除、查找方法及哈希表存储装置 |
| CN102930004A (zh) * | 2012-10-29 | 2013-02-13 | 华为技术有限公司 | 哈希值存储方法、装置及芯片 |
| US20150098470A1 (en) * | 2013-10-04 | 2015-04-09 | Broadcom Corporation | Hierarchical hashing for longest prefix matching |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109558423A (zh) * | 2018-10-31 | 2019-04-02 | 深圳壹账通智能科技有限公司 | 一种基于键值对的数据查找方法、装置及设备 |
| CN113126888A (zh) * | 2020-01-15 | 2021-07-16 | 伊姆西Ip控股有限责任公司 | 用于存储管理的方法、设备和计算机程序产品 |
| CN113126888B (zh) * | 2020-01-15 | 2024-04-19 | 伊姆西Ip控股有限责任公司 | 用于存储管理的方法、设备和计算机程序产品 |
| CN112750040A (zh) * | 2021-01-13 | 2021-05-04 | 国泰君安证券股份有限公司 | 应用于内存交易系统实现线程安全的数据处理方法、系统、应用、装置、处理器及存储介质 |
| CN112750040B (zh) * | 2021-01-13 | 2023-07-14 | 国泰君安证券股份有限公司 | 应用于内存交易系统实现线程安全的数据处理方法、系统、应用、装置、处理器及存储介质 |
| CN113726660A (zh) * | 2021-08-27 | 2021-11-30 | 西安微电子技术研究所 | 一种基于完美哈希算法的路由查找器和方法 |
| CN113726660B (zh) * | 2021-08-27 | 2022-11-15 | 西安微电子技术研究所 | 一种基于完美哈希算法的路由查找器和方法 |
| WO2023179433A1 (zh) * | 2022-03-23 | 2023-09-28 | 阿里巴巴(中国)有限公司 | 流表存储及报文转发方法、装置、计算设备及介质 |
| CN114884877A (zh) * | 2022-06-14 | 2022-08-09 | 电子科技大学 | 一种哈希表和HOT相结合的IPv6路由查找方法 |
| CN114884877B (zh) * | 2022-06-14 | 2023-02-03 | 电子科技大学 | 一种哈希表和HOT相结合的IPv6路由查找方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106302172A (zh) | 2017-01-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2016184029A1 (zh) | 支持哈希查找和路由查找的存储、查找方法和装置、存储介质 | |
| US10257092B2 (en) | CCN routing using hardware-assisted hash tables | |
| CN102484610B (zh) | 路由表建立方法和装置及路由表查找方法和装置 | |
| CN100465947C (zh) | 用于产生和使用改进的树形位图数据结构的方法和装置 | |
| US8260799B2 (en) | Method and apparatus for creating pattern matching state machine and identifying pattern | |
| CN101604337B (zh) | 一种哈希表项存储、查找装置及方法 | |
| US20130246698A1 (en) | Hybrid Memory for Search Operations | |
| WO2015127721A1 (zh) | 数据匹配的方法、装置及计算机存储介质 | |
| CN106416152B (zh) | 一种查找装置、查找配置方法和查找方法 | |
| EP3276501B1 (en) | Traffic classification method and device, and storage medium | |
| CN108011823B (zh) | 多域流表的多级化方法及装置、多级流表查找方法及装置 | |
| CN108304460B (zh) | 一种改进数据库的定位方法及系统 | |
| CN102333036A (zh) | 一种实现高速路由查找的方法和系统 | |
| CN106789859B (zh) | 报文匹配方法及装置 | |
| CN116775701B (zh) | 数据存储方法、装置及设备 | |
| CN101022407A (zh) | 一种基于二叉树的流分类查找方法 | |
| US10771386B2 (en) | IP routing search | |
| CN118227518B (zh) | 一种表项存储、查找方法、装置、网络设备及存储介质 | |
| CN110191057B (zh) | 路由查找方法及路由设备 | |
| KR100999408B1 (ko) | 해시트리를 이용한 url 검색방법 | |
| CN106302178B (zh) | 一种路由查询方法及装置 | |
| JP2005242672A (ja) | パターンマッチング装置および方法ならびにプログラム | |
| CN108121807A (zh) | Hadoop环境下多维索引结构OBF-Index的实现方法 | |
| US12367197B2 (en) | Pipelining a binary search algorithm of a sorted table | |
| CN116248593B (zh) | 一种流表关键字匹配方法、装置、电子设备和存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 15892407 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: 15892407 Country of ref document: EP Kind code of ref document: A1 |