WO2016095450A1 - Item updating method, device and storage medium on the basis of route searching - Google Patents

Item updating method, device and storage medium on the basis of route searching Download PDF

Info

Publication number
WO2016095450A1
WO2016095450A1 PCT/CN2015/080748 CN2015080748W WO2016095450A1 WO 2016095450 A1 WO2016095450 A1 WO 2016095450A1 CN 2015080748 W CN2015080748 W CN 2015080748W WO 2016095450 A1 WO2016095450 A1 WO 2016095450A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
update
level
entry
current search
Prior art date
Application number
PCT/CN2015/080748
Other languages
French (fr)
Chinese (zh)
Inventor
程晨
李彧
张炜
徐宝魁
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2016095450A1 publication Critical patent/WO2016095450A1/en

Links

Images

Definitions

  • the present invention relates to the field of network switching technologies, and in particular, to a method, an apparatus, and a storage medium for updating an entry based on a route lookup.
  • the update performance is also an important indicator, but often in a complex algorithm, the update performance is a small bottleneck; for example, in word search
  • the algorithm of the tree (Trie) class because of the need to save the search delay, it is often necessary to operate by node copying and priority override, and this operation will significantly increase the cost of node update, because updating or adding one Nodes often need to be modified by several or even hundreds of nodes; in the routing lookup update of Ternary Content Addressable Memory (TCAM), the rearrangement of hardware node data is involved.
  • TCAM Ternary Content Addressable Memory
  • This rearrangement is not only required to be done inside the TCAM, but also needs to rearrange the result table data mapped one by one with the TCAM entries, and in order to ensure that the search is not erroneous, the rearrangement must also be performed in sequence, involving the TCAM and The result table interaction and synchronization greatly affect the update performance of the table entries.
  • B-tree multi-path search tree
  • an embodiment of the present invention is to provide a method for updating an entry based on a route lookup.
  • the device and the storage medium can improve the efficiency of data update and reduce the delay caused by data update.
  • An embodiment of the present invention provides a method for updating an entry based on a route search, where the method includes:
  • the tagged packet is discarded when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
  • the method before the determining that the control packet enters the current search level, and before the search instruction before the control packet has been processed, the method further includes:
  • the updated entry data that needs to be updated by all the search levels and the update address corresponding to the entry data includes: a tree node table part and a result table part;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result table part includes: result data that needs to be updated by all the search levels, and the result The update address corresponding to the data.
  • the method before the determining that the control packet enters the current search level, and before the search instruction before the control packet has been processed, the method further includes:
  • the control packet is inserted at the lookup instruction entry of the current lookup level.
  • the method further includes:
  • An embodiment of the present invention further provides a method for updating an entry based on a route lookup, where the method includes:
  • the search instruction after the control packet entering the current search level is unlocked.
  • the method before the control packet is detected in the current search level, the method further includes:
  • the control packet is inserted at the search instruction entry of the current search level.
  • the method when it is determined that the search instruction before the control packet enters the current search level has been processed, the method further includes:
  • the control packet is sent directly to the next lookup level.
  • the updating the tree node entry data or the result entry data of the current search level includes: reading the stored entry data of all the search levels that need to be updated, and the current search in the update address corresponding to the entry data.
  • the table item data that needs to be updated and the current search level need to be updated.
  • the update address corresponding to the entry data, and the entry data that needs to be updated by the current search level is written into the corresponding update address.
  • the embodiment of the present invention further provides an apparatus for updating an entry based on a route search, where the apparatus includes: a first update module, a cache module, an insert module, and a determining module;
  • the first update module is configured to: when the control packet enters the current search level, and the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously , triggering the Cache module;
  • the Cache module is configured to sequentially acquire a read address in a lookup instruction after the control packet, and match the read address with an update address of a current lookup level, and determine that the match is successful according to the read address. Data is replaced with data corresponding to the update address;
  • the inserting module is configured to: when the tree node entry data or the result table data update is completed, insert a markup packet at a search instruction entry of the current search level;
  • the determining module is configured to discard the tagged packet when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
  • the first update module is further configured to: read the updated entry data of all the search levels that need to be updated, and the update address corresponding to the entry data, and obtain and save the entry data that needs to be updated by the current search level. And an update address corresponding to the entry data that needs to be updated by the current search level;
  • the device further includes a first cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
  • the Cache module is further configured to store the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level.
  • the first update module is further configured to: when determining that the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level.
  • the first update module is further configured to: when detecting that an item of the current search level of the search is incorrect, storing the update data corresponding to the entry data and the entry data to the Cache a module, and sequentially acquiring a read address in the search instruction of the current search level, matching the read address with an update address of the current search level, and determining that the data obtained according to the read address is replaced with the update when the match is successful.
  • the data corresponding to the address until the error is fixed.
  • the embodiment of the present invention further provides a device for updating an entry based on a route search, where the device includes: a lock module, a second update module, and an unlocking module;
  • the locking module is configured to lock a lookup instruction after entering the control packet of the current search level when the control packet is detected in the current search level;
  • the second update module is configured to: when the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
  • the unlocking module is configured to: when determining that the tree node entry data or the result table item data of the current search level is updated, unlocking the lookup instruction after entering the control packet of the current search level.
  • the second update module is further configured to: when the current search level is the highest search level, insert the control packet at the search instruction entry of the current search level.
  • the second update module is configured to read the entry data that needs to be updated in all the search levels that are stored, and the entry data that needs to be updated in the current search level in the update address corresponding to the entry data, and the current The update address corresponding to the table item data that needs to be updated by the search level, and the table item data that needs to be updated by the current search level is written into the corresponding update address;
  • the device further includes a second cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data.
  • the second update module is further configured to send the control packet directly to the next search level.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above-mentioned route lookup based update method of the embodiment of the present invention.
  • the method and device for updating an entry based on route lookup provided by the embodiment of the present invention, and determining that the control packet enters the current search level, and the search command before the control packet has been processed, updating the tree of the current search level Node entry data or result table entry data, at the same time, sequentially acquiring the read address in the lookup instruction after the control packet, matching the read address with the update address of the current lookup level, and determining that the match is successful, The data obtained by the read address is replaced by data corresponding to the update address; when it is determined that the tree node entry data or the result entry data update is completed, a markup packet is inserted at a search instruction entry of the current search level; The tagged packet is discarded when the tagged packet is inserted into the lookup instruction before the current lookup level has been processed. In this way, while updating the tree node entry data or the result table entry data of the current search level, replacing the data acquired according to the read address with the data corresponding to the update address, the data update efficiency and the data can be improved
  • FIG. 1 is a schematic flowchart of a route search method of a B-tree
  • FIG. 2 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart b of a method for updating an entry based on route lookup according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of a storage format of an entry data that needs to be updated by all the search levels and an update address corresponding to the entry data according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 2 of the present invention
  • FIG. 6 is a schematic flowchart b of a method for updating an entry based on route lookup according to Embodiment 2 of the present invention
  • FIG. 7 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 3 of the present invention.
  • FIG. 8 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 4 of the present invention.
  • FIG. 9 is a schematic structural diagram of a device for updating an entry based on route lookup according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a device for updating an entry based on route lookup according to Embodiment 2 of the present invention.
  • the method for updating the entry based on the route search in the embodiment of the present invention is based on a B-tree route search method.
  • the B-tree route search method is briefly described.
  • B-tree is a bottom-up tree. Each layer of the tree is a search level. The bottom layer is the result table search level. The other layers are tree node search levels, that is, the actual search level. Add a result table to the layer of the tree to find the layer.
  • Each update (add, delete, update) data in the B-tree will cause one of the following operations: 1. Update only one result data; 2. Update a tree node and a result data; 3. Update a tree. Node and multiple result data; 4. Update multiple tree nodes and multiple result data.
  • the route lookup of the B-tree is a top-down lookup, and each level of the search is associated with each other. Therefore, the update of the entry in the embodiment of the present invention is also a top-down update, that is, the update process is to perform data from the top.
  • the top search level of the update starts, and is updated downwards in turn.
  • the result table search level is the last level update. In this way, after the current search level is updated, the new search request must access the updated tree node entry. Data or result table entry data.
  • Figure 1 shows the flow chart of the B-tree route lookup method. As shown in Figure 1, the logical relationship between the three levels of lookup stages is given.
  • the Nth level search level is taken as an example.
  • the Nth level search level is used. After receiving the search instruction sent by the N-1 level search level, the instruction is stored in the first in first out queue (FIFO), and when the FIFO1 is not empty, there is a seek instruction, which is located at the exit of the FIFO1.
  • FIFO first in first out queue
  • the lookup instruction will be processed, data such as key values and read addresses are stored in FIFO 2, and the lookup request and lookup address are sent to FIFO 3; here the read address in FIFO 2 is the same address as the lookup address in FIFO 3;
  • the lookup request and the lookup address are used to obtain tree node entry data in the node table; when the FIFO3 is not empty, the lookup request and lookup at the FIFO3 exit
  • the address will be sent to the node table for data lookup operation; after a certain delay, the search result will be returned to FIFO4 (204); when FIFO4 is not empty, the return result at the FIFO4 exit will be the key value at the exit of FIFO2
  • the information is simultaneously fetched; after comparing the tree node table item data in the returned result with the key value data, a lookup instruction of the next search level is generated and sent to the next search level.
  • the data in each FIFO may be temporarily stored in the FIFO because the processing speed of a certain position on the data line does not match the instruction speed; when any FIFO is almost full, the previous FIFO is streamed. Control back pressure, so there will be no loss of instructions or data.
  • the tree node entry of the current search level is updated.
  • Data or result table item data sequentially acquiring the read address in the lookup instruction after the control packet, matching the read address with the update address of the current lookup level, and determining that the match is successful, according to the read address
  • the acquired data is replaced with data corresponding to the update address; when it is determined that the tree node entry data or the result entry data update is completed, a markup packet is inserted at a search instruction entry of the current search level; and the markup packet insertion is determined.
  • the tagged packet is discarded when the lookup instructions before the current lookup level have been processed.
  • FIG. 2 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention
  • FIG. 2 and FIG. The method for updating an entry based on route lookup in the embodiment of the present invention includes:
  • Step 201 Determine that the control packet enters the current search level, and when the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously obtain the control. a read address in the lookup instruction after the packet, the read address is matched with the update address of the current search level, and when the matching is successful, the data obtained according to the read address is replaced with the data corresponding to the update address;
  • the method further includes: when determining that the current search level is the highest search level, inserting a control packet at a search instruction entry of the current search level; where the control packet is a control packet with a special mark, The transmission may be performed along with the lookup instruction stream.
  • the control packet is read out from the FIFO 1
  • the lookup address entering the FIFO 2 is an invalid address or an empty address, and correspondingly, an empty result is returned to the FIFO 4;
  • the highest lookup level is the top search level in all lookup levels that requires data updates.
  • the method before the step, further includes: reading all the item data stored by the first cache module and the update address corresponding to the item data, and acquiring and saving the current search level.
  • the current search level is the highest search level
  • the read all the search levels stored in the first cache module need to be updated and the update address corresponding to the entry data, and the current search level needs to be updated.
  • the operation of the entry data and the update address corresponding to the entry data that needs to be updated by the current search level is performed before the operation of inserting the control packet at the entry of the search instruction;
  • the method further includes: the first cache module stores all the entries that need to be updated by all the search levels written by the software, before the reading of the stored table entry data and the update address corresponding to the entry data. Data and an update address corresponding to the entry data;
  • the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data;
  • the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
  • the storage format of the tree node table portion is as shown in FIG. 4a, including: a valid tag, a search level, Updating the address and the tree node data; wherein the valid tag is a hardware identifier, marking whether the update entry is valid, the search level identifies which level of the search node the search node is in; the update address is a tree node The corresponding physical address; the tree node data is the data that needs to be written into the actual hardware memory; since the tree node is updated from top to bottom, when filling in the tree node table, it is also in accordance with the top-down Fill in the order, the node with the highest level to be updated is filled in the first line of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes can be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data.
  • the physical address, the result table data is the data that needs to be written into the actual hardware memory.
  • the sequentially acquiring the read address in the lookup instruction after the control packet, and matching the read address with the update address of the current lookup level includes:
  • the cache cache switch is enabled to sequentially acquire the read address in the lookup instruction after the control packet enters the current lookup level, and match the read address with the update address of the current lookup level stored in the Cache module.
  • the determining instructions before the determining the control packet have been processed, that is, determining that the control packet before entering the current search level has been cleared from the FIFO queue, that is, in the queue exit of the FIFO2.
  • the updating the tree node entry data or the result entry data of the current search level includes: obtaining the entry data that needs to be updated in the current search level stored in the Cache module, and the update address corresponding to the entry data, The table item data that needs to be updated by the current search level is written into the corresponding update address;
  • Step 202 When it is determined that the tree node entry data or the result entry data update is completed, insert a markup packet at a search instruction entry of the current search level;
  • the determining that the tree node entry data or the result entry data update is completed includes: determining that the entry data that needs to be updated in the current search level stored in the Cache module has been written into the entry corresponding to the entry data. Update address;
  • the markup packet is a markup packet having a special mark different from the control packet, and can be normally transmitted along with the lookup instruction stream, and the insertion of the markup package ensures that the lookup instruction after the markup packet is inserted into the current lookup level is read. All are updated tree node table entry data or result table entry data.
  • Step 203 Determine that the tagged packet is discarded when the search instruction before the tagged packet is inserted into the current search level has been processed.
  • the method further includes: disabling the Cache switch to clear the current search level stored in the Cache module needs to be updated, where the determining that the search packet is inserted into the current search level has been processed.
  • the entry data and the update address corresponding to the entry data thus, facilitating the writing of the data to be updated and the corresponding update address when the current search level performs the next update;
  • the Cache switch is disabled, that is, the lookup instruction after the tagged packet is inserted into the current search level can obtain the corresponding entry data according to the read address of the ACL, and the corresponding entry data cached in the Cache module is not required to be replaced. .
  • the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing update delay, and improving B-tree update efficiency.
  • the method further includes: detecting a table of the current search level of the lookup
  • the Cache module stores the entry data of the current search level and the corresponding update address written by the control plane, and enables the Cache switch to sequentially acquire the read address in the search instruction of the current search level. Matching the read address with the update address of the current search level, and determining that the match is successful, replacing the data acquired according to the read address with the data corresponding to the update address until the error is repaired, and the device is disabled.
  • the Cache switch is used as the temporary backup table, so that the control plane can perform corresponding fault location and fault processing.
  • the method further includes: adding a valid flag of each item data that needs to be updated in the current current search level, where the valid flag is used to identify whether the current item data is valid;
  • the following operations are required, that is, the data acquired according to the read address in the search instruction is replaced with the Cache module.
  • the data corresponding to the update address stored in the memory because the update address and its corresponding data are written to the Cache module, there may be some update data not completely written, but the read command from the FIFO 2 reads
  • the address is an address corresponding to the data that is not completely written.
  • the update address corresponding to the entry data is first written in the Cache module, and a valid tag is set. Invalid, when the entry of the entry data is completed, the valid tag is set to be valid, and the valid tags of all the entry data are When valid, the update operation is performed on the tree node entry data or the result entry data of the current search level; thus, when the data of a certain entry of the current search level is found to be incorrect, the Cache module is used as a backup table. It also does not affect the update of the tree node entry data or the result table entry data.
  • FIG. 5 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 2 of the present invention
  • FIG. 6 is a schematic flowchart of a method for updating an entry based on route search according to Embodiment 2 of the present invention
  • FIG. 5 and FIG. The method for updating an entry based on route lookup in the embodiment of the present invention includes:
  • Step 501 When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
  • the method further includes: when determining that the current search level is the highest search level, inserting a control packet at the search instruction entry of the current search level; as shown in step 1 in FIG. 6;
  • the determining that the current search level is the highest search level includes: determining that the current search level is the top search level of all search levels that need to be updated;
  • the control packet is a control packet with a special flag, which can be normally transmitted along with the lookup instruction stream.
  • the search address entering the FIFO 2 is an invalid address or an empty address, correspondingly Return to the empty result of FIFO4.
  • control packet is detected in the current lookup stage, ie the control packet is detected at the exit of the FIFO 1, ie the control packet has just been read out from the FIFO 1 for distribution; Step two is shown;
  • the search instruction after entering the control packet of the current search level is locked.
  • the search instruction in the FIFO1 is pressed in the FIFO1, and cannot be output, and the search instruction sent by the previous stage is in a later period of time. They are also sequentially pressed into the FIFO1, and the lookup instruction before the control packet enters the current search level can smoothly obtain the return data from the FIFO4, generate the next-level search instruction and enter the next stage.
  • Step 502 When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
  • the determining that the control packet enters the current search level has been processed that is, the search instruction before the control packet enters the current search level has been cleared from the FIFO queue, that is, the queue exit of the FIFO2.
  • the control packet is detected, and the read data of the control packet is also returned to the exit of the FIFO 4; as shown in step 3 in FIG. 6;
  • the updating the tree node entry data or the result entry data of the current search level includes: acquiring data that needs to be updated by all the search levels stored in the second cache module, and an address corresponding to the data The data that needs to be updated by the current search level and the update address corresponding to the data that needs to be updated by the current search level, and the data that needs to be updated by the current search level is written into the corresponding update address;
  • the method further includes: the second cache module stores the entry data that needs to be updated by all the search levels written by the software, and the update address corresponding to the entry data;
  • the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data;
  • the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
  • the storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid.
  • the search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order.
  • the top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. Physical address, the result table data needs to be written into the actual hardware. Saved data.
  • Step 503 When it is determined that the tree node entry data or the result entry data update of the current search level is completed, unlocking the lookup instruction after entering the control packet of the current search level;
  • the control packet strictly divides the lookup instruction before the control packet located in the lookup instruction stream and the lookup instruction after the control packet into an original lookup instruction and a new lookup instruction, and the original lookup instruction acquires before updating The tree node entry data or the result table entry data, and the new lookup instruction obtains the updated tree node entry data or result entry data.
  • the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing update delay, and improving B-tree update efficiency.
  • FIG. 7 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 3 of the present invention; in the embodiment of the present invention, a current search level for performing data update is a top search level in a search level that needs to be updated, as shown in FIG. As shown in FIG. 7, the method for updating an entry based on route lookup according to Embodiment 3 of the present invention includes:
  • Step 701 The first cache module stores the updated entry data of all the search levels written by the software and the update address corresponding to the entry data.
  • the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data of the result table
  • the bit width, divided into a tree node table and a result table can facilitate the division of the hardware storage unit;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: all the search levels need to be updated. Result data and an update address corresponding to the result data;
  • the storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid.
  • the search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order.
  • the top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data.
  • the physical address, the result table data is the data that needs to be written into the actual hardware memory.
  • the software only needs to perform one interaction with the first cache module, so that multiple routing entries of multiple search levels can be updated, which greatly improves the update efficiency.
  • Step 702 Insert a control packet at a search instruction entry of the current search level
  • control packet is a control packet with a special flag, which can be transmitted along with the lookup instruction stream.
  • the lookup address entering the FIFO 2 is an invalid address or empty.
  • the address correspondingly, returns a null result to FIFO 4; the highest lookup level is the topmost lookup level in all lookup stages that requires data updates.
  • Step 703 Acquire and save the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level;
  • the step includes: reading the entry data that needs to be updated by all the search levels stored by the first cache module, and the update address corresponding to the entry data, and obtaining and saving the entry data that needs to be updated by the current search level and the current search level. Update address corresponding to the updated entry data to the Cache module Piece.
  • Step 704 When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously obtain the search instruction after the control packet.
  • the read address is matched with the update address of the current search level, and when the match is successful, the data obtained according to the read address is replaced with the data corresponding to the update address;
  • the sequentially acquiring the read address in the lookup instruction after the control packet, and matching the read address with the update address of the current lookup level includes:
  • the cache cache switch is enabled to sequentially acquire the read address in the lookup instruction after the control packet enters the current lookup level, and match the read address with the update address of the current lookup level stored in the Cache module.
  • the updating the tree node entry data or the result entry data of the current search level includes: obtaining the entry data that needs to be updated by the current search level stored by the Cache module, and the update address corresponding to the entry data, where the The entry data that needs to be updated by the current search level is written into the corresponding update address;
  • Step 705 When it is determined that the tree node entry data or the result entry data update is completed, insert a markup packet at a search instruction entry of the current search level;
  • the determining that the tree node entry data or the result entry data update is completed includes: determining that the entry data that needs to be updated in the current search level stored in the Cache module has been written into the entry corresponding to the entry data. Update address;
  • the markup packet is a markup packet having a special mark different from the control packet, and can be normally transmitted along with the lookup instruction stream, and the insertion of the markup package ensures that the lookup instruction after the markup packet is inserted into the current lookup level is read. All are updated tree node table entry data or result table entry data.
  • Step 706 Determine that the tagged packet is discarded when the search packet before the tagged packet is inserted into the current search level has been processed.
  • the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing the update delay, and improving the update efficiency of the B-tree.
  • the method when the determining that the tagged packet is inserted into the current search level has been processed, the method further includes:
  • the Cache switch is enabled, and the updated entry data that needs to be updated in the current search level and the update address corresponding to the entry data are cleared.
  • the method further includes: when detecting that an item of the current search level of the search is incorrect, the Cache module stores the item data and the corresponding update address written by the control plane, and The Cache switch is enabled, and the read address in the search instruction of the current search level is sequentially acquired, and the read address is matched with the update address of the current search level, and when the matching is successful, the data acquired according to the read address is replaced. For the data corresponding to the update address, until the error is repaired, the Cache switch is disabled; thus, the Cache module is used as a temporary backup table, which facilitates the control plane to perform corresponding fault location and fault handling;
  • the method further includes: adding a valid flag of each item data that needs to be updated in the current current search level, where the valid flag is used to identify whether the current item data is valid;
  • the valid tag of each entry data stored in the Cache module is added, and the current search level needs to be updated.
  • the update address corresponding to the entry data is first written in the Cache module, and the valid flag is set to be invalid.
  • the valid flag is set to be valid.
  • the valid tags of all the entry data are valid, the tree node entry data or the result entry data of the current search level is updated. For; thus, when detecting an article of the current search level to find the data entry error, the Cache module as a backup table at the same time will not affect the update tree node data entry or table item data.
  • FIG. 8 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 4 of the present invention; in the embodiment of the present invention, a current search level for performing data update is a top search level in a search level that needs to be updated, as shown in FIG. As shown in FIG. 8, the method for updating an entry based on route lookup according to Embodiment 4 of the present invention includes:
  • Step 801 The second cache module stores the entry data that needs to be updated by all the search levels written by the software, and the update address corresponding to the entry data.
  • the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data of the result table
  • the bit width, divided into a tree node table and a result table can facilitate the division of the hardware storage unit;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: all the search levels need to be updated. Result data and an update address corresponding to the result data;
  • the storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid.
  • the search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order.
  • the top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data.
  • the physical address, the result table data is the data that needs to be written into the actual hardware memory.
  • the software only needs to perform one interaction with the second cache module, so that multiple routing entries of multiple search levels can be updated, which greatly improves the update efficiency.
  • Step 802 Insert a control packet at a search instruction entry of the current search level
  • control packet is a control packet with a special flag, which can be transmitted along with the lookup instruction stream.
  • the lookup address entering the FIFO 2 is an invalid address or empty.
  • the address correspondingly, returns a null result to FIFO 4; the highest lookup level is the topmost lookup level in all lookup stages that requires data updates.
  • Step 803 When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
  • control packet is detected in the current lookup stage, that is, the control packet is detected at the exit of the FIFO 1, that is, the control packet is just read out from the FIFO 1 for distribution; as shown in step 2 in FIG. ;
  • the search instruction after entering the control packet of the current search level is locked.
  • the search instruction in the FIFO1 is pressed in the FIFO1, and cannot be output, and the search instruction sent by the previous stage is in a later period of time. They are also sequentially pressed into the FIFO1, and the lookup instruction before the control packet enters the current search level can smoothly obtain the return data from the FIFO4, generate the next-level search instruction and enter the next stage.
  • Step 804 When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
  • the updating the tree node entry data or the result entry data of the current search level includes: acquiring data that needs to be updated by all the search levels stored in the second cache module, and data that needs to be updated in the current search level of the address corresponding to the data And the update address corresponding to the data that needs to be updated by the current search level, and the data that needs to be updated by the current search level is written into the corresponding update address.
  • Step 805 When it is determined that the tree node entry data or the result table item data of the current search level is updated, the search instruction after entering the control packet of the current search level is unlocked;
  • the control packet strictly divides the lookup instruction before the control packet located in the lookup instruction stream and the lookup instruction after the control packet into an original lookup instruction and a new lookup instruction, and the original lookup instruction acquires before updating The tree node entry data or the result table entry data, and the new lookup instruction obtains the updated tree node entry data or result entry data.
  • the method further includes: sending the control package directly Go to the next search level; in this way, the consistency of the update operation of the B-tree can be guaranteed, the update delay can be reduced, and the update efficiency of the B-tree can be improved.
  • FIG. 9 is a schematic structural diagram of a device for updating an entry based on a route search according to an embodiment of the present invention. As shown in FIG. 9 , the device for updating an entry based on a route search according to an embodiment of the present invention includes: a first update module, a Cache module, and an insertion Module and determination module; among them,
  • the first update module 91 is configured to: when the control packet enters the current search level, and the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, At the same time, the Cache module is triggered;
  • the Cache module 92 is configured to sequentially acquire the read address in the lookup instruction after the control packet, and match the read address with the update address of the current search level, and determine that the match is successful, and the read address is obtained according to the read address. Data is replaced by data corresponding to the update address;
  • the inserting module 93 is configured to: when the tree node entry data or the result table data update is completed, insert a markup packet at a search instruction entry of the current search level;
  • the determining module 94 is configured to discard the tagged packet when the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
  • the first update module 91 is further configured to: read the updated entry data of all the search levels that need to be updated and the update address corresponding to the entry data, and obtain and save the current search level to be updated.
  • the device further includes a first cache module 95 configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
  • the Cache module 92 is further configured to store the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level;
  • the stored entry data that needs to be updated by all the search levels and the update address corresponding to the entry data includes: a tree node table part and a result table part; Greater than the data bit width of the result table, dividing into the tree node table and the result table can facilitate the division of the hardware storage unit;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data;
  • the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
  • the storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid.
  • the search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order.
  • the top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data.
  • the physical address, the result table data is the data that needs to be written into the actual hardware memory.
  • the Cache module 92 sequentially acquires a read address in a lookup instruction after the control packet, and matches the read address with an update address of a current lookup level, including:
  • the Cache module 92 enables the Cache switch to sequentially acquire the read address in the lookup instruction after the control packet enters the current search level, and matches the read address with the update address of the current lookup level stored in the Cache module.
  • the updating, by the first update module 91, the tree node entry data or the result entry data of the current search level includes:
  • the first update module 91 acquires that the current search level stored by the Cache module needs to be updated.
  • the entry data and the update address corresponding to the entry data are used to write the entry data that needs to be updated by the current search level into the corresponding update address.
  • the first update module 91 is further configured to: when the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level; where the control packet is a special
  • the marked control packet can be transmitted along with the lookup instruction stream.
  • the lookup address entering the FIFO2 is an invalid address or an empty address, and correspondingly, the return to the FIFO4 is Empty result; the highest search level is the top search level in all lookup levels that needs to be updated.
  • the first update module 91 is further configured to: when it is determined that the search instruction before the tagged packet is inserted into the current search level, the Cache switch is enabled, and the Cache module is cleared.
  • the current search level stored in the file needs updated table item data and an update address corresponding to the table item data; thus, the data that needs to be updated and the corresponding update address are written by the current search level for the next update.
  • the first update module 91 is further configured to send the control packet directly to the next search level; thus, the continuity of the update operation of the B-tree can be ensured, and the update delay is reduced, and the update delay is improved.
  • the update efficiency of B-tree is further configured to send the control packet directly to the next search level; thus, the continuity of the update operation of the B-tree can be ensured, and the update delay is reduced, and the update delay is improved.
  • the first update module 91 is further configured to: when detecting that an item of the current search level of the search is incorrect, storing the item data and the update address corresponding to the item data to The Cache module enables the Cache switch to sequentially acquire the read address in the lookup instruction of the current search level, and match the read address with the update address of the current search level to determine that the match is successful according to the The data obtained by the read address is replaced with the data corresponding to the update address until the error is repaired, and the Cache switch is disabled.
  • the Cache module is used as a temporary backup table, which facilitates the control plane to perform corresponding fault location. And fault handling;
  • the first update module 91 is further configured to add a valid tag of each entry data that needs to be updated by the current current search level, where the valid tag is used to identify the current entry. Whether the data is valid;
  • the following operations are required, that is, the data acquired according to the read address in the lookup instruction is replaced with the Cache module.
  • the data corresponding to the update address stored in the memory because the update address and its corresponding data are written to the Cache module, there may be some update data not completely written, but the read command from the FIFO 2 reads
  • the address is the address corresponding to the data that is not completely written.
  • the update module 91 adds the valid tag of each entry data stored by the Cache module, and obtains the update address corresponding to the entry data in the Cache module after acquiring the data and the corresponding address that need to be updated by the current search level. And set the valid flag to be invalid.
  • set the valid tag to be valid, and wait for all the entry data.
  • the valid tag is valid, the tree node entry data or the result table entry data of the current search level is updated; thus, when the data of a certain item of the current search level is found to be incorrect, the cache is detected.
  • the module as a backup table does not affect the update of the tree node entry data or the result table entry data.
  • the device for updating an entry based on a route search includes: a lock module 11 and a second update module. 12 and an unlocking module 13; wherein
  • the locking module 11 is configured to lock a lookup instruction after entering the control packet of the current search level when the control packet is detected in the current search level;
  • the second update module 12 is configured to: when the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
  • the unlocking module 13 is configured to: when it is determined that the tree node entry data or the result table data of the current search level is updated, the search finger after the control packet entering the current search level is unlocked make.
  • the second update module 12 is further configured to: when determining that the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level;
  • the determining, by the second update module 12, that the current search level is the highest search level includes: determining that the current search level is the top search level of all the search levels that need to be updated;
  • the control packet is a control packet with a special flag, which can be normally transmitted along with the lookup instruction stream.
  • the search address entering the FIFO 2 is an invalid address or an empty address, correspondingly Return to the empty result of FIFO4.
  • the second update module 12 determines that the search instruction before the control packet enters the current search level has been processed, that is, the search instruction before the control packet enters the current search level has been obtained from the FIFO.
  • the queue is emptied, that is, the control packet is detected at the queue exit of the FIFO 2, and the read-empty data of the control packet is also returned to the exit of the FIFO 4; as shown in step 3 in FIG. 6;
  • the updating, by the second update module 12, the tree node entry data or the result entry data of the current search level includes:
  • the second update module 12 reads the table item data that needs to be updated in all the search levels that are stored, and the table item data that needs to be updated in the current search level in the update address corresponding to the item data, and the table that needs to be updated in the current search level. An update address corresponding to the item data, and the table item data that needs to be updated by the current search level is written into the corresponding update address;
  • the device further includes a second cache module 14 configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
  • the obtaining all the search levels stored in the second cache module 14 needs updated data.
  • the method further includes: the second cache module 14 stores all the search levels written by the software, before the data corresponding to the data needs to be updated by the current search level and the update address corresponding to the data that needs to be updated by the current search level. The updated item data and the updated address corresponding to the item data;
  • the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
  • the tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data;
  • the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
  • the storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid.
  • the search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order.
  • the top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
  • the storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data.
  • the physical address, the result table data is the data that needs to be written into the actual hardware memory.
  • the second update module 12 is further configured to directly send the control packet to the next search level; thus, the continuity of the update operation of the B-tree can be ensured, and the update is reduced. Delay, improve the update efficiency of B-tree.
  • the first update module, the Cache module, the insert module, the determination module, the lock module, the second update module, and the unlock module may all be implemented by a processor, and may also pass through a specific logic circuit.
  • the processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.; the first cache module and The second cache module can be implemented by a memory.
  • the foregoing route search-based entry update method is implemented in the form of a software function module and is sold or used as a stand-alone product, it may also be stored in a computer readable storage medium.
  • 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.
  • a computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention.
  • 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.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above-mentioned route lookup based update method of the embodiment of the present invention.

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

An item updating method on the basis of route searching is disclosed in the present invention. Tree node item data or result item data of a current searching level is updated when it is determined that a control packet enters into the current searching level and all searching instructions before the control packet have been processed; meanwhile, read addresses of the searching instructions after the control packet are acquired in sequence, the read addresses are matched with the updating address of the current searching level, and the data acquired according to the read address is replaced by the data corresponding to the updating address when it is determined that the matching is successful; a labeled packet is inserted into the entry of the searching instructions of the current searching level when it is determined that the updating of the tree node item data or the result item data has been completed; the labeled packet is discarded when it is determined that the searching instructions before the labeled packet being inserted into the current searching level have been all processed. An item updating device and a storage medium on the basis of route searching are also disclosed in the present invention.

Description

一种基于路由查找的表项更新方法、装置及存储介质Method, device and storage medium for updating table items based on route lookup 技术领域Technical field
本发明涉及网络交换技术领域,尤其涉及一种基于路由查找的表项更新方法、装置及存储介质。The present invention relates to the field of network switching technologies, and in particular, to a method, an apparatus, and a storage medium for updating an entry based on a route lookup.
背景技术Background technique
在大容量路由查找装置的应用场景中,不仅要求了容量和查找性能,更新性能也是同样重要的一个指标,但是往往在复杂的算法中,更新性能会是一个不小的瓶颈;例如在单词查找树(Trie)类的算法中,由于需要节省查找延时,往往需要采用结点复制和优先级覆盖的方式来操作,而这种操作会显著增加结点更新时的代价,因为更新或增加一个结点往往需要涉及数个乃至上百个结点的修改;而在三态内容寻址存储器(TCAM,Ternary Content Addressable Memory)的路由查找更新中,会涉及到硬件结点数据的重排,而这种重排不仅仅在TCAM内部需要做,还需要重排与TCAM条目一一映射的结果表数据,并且为了保证查找不出错,这种重排还必须是顺序交替进行的,涉及到TCAM和结果表交互和同步,大大影响了表项的更新性能。In the application scenario of the large-capacity route finder, not only the capacity and the search performance are required, but the update performance is also an important indicator, but often in a complex algorithm, the update performance is a small bottleneck; for example, in word search In the algorithm of the tree (Trie) class, because of the need to save the search delay, it is often necessary to operate by node copying and priority override, and this operation will significantly increase the cost of node update, because updating or adding one Nodes often need to be modified by several or even hundreds of nodes; in the routing lookup update of Ternary Content Addressable Memory (TCAM), the rearrangement of hardware node data is involved. This rearrangement is not only required to be done inside the TCAM, but also needs to rearrange the result table data mapped one by one with the TCAM entries, and in order to ensure that the search is not erroneous, the rearrangement must also be performed in sequence, involving the TCAM and The result table interaction and synchronization greatly affect the update performance of the table entries.
传统的多路搜索树(B-tree)数据结构的更新中,既不不存在数据的复制,也不存在结果表与结点表的交互,性能优于Trie及TCAM的路由查找更新,然而对于优化的B-tree路由查找方法(参见201310396381.5),则需要有相应的特殊的更新流程,以提高数据更新的效率,降低数据更新带来的时延。In the traditional multi-path search tree (B-tree) data structure update, there is no data replication, and there is no interaction between the result table and the node table. The performance is better than the route lookup update of Trie and TCAM. The optimized B-tree route lookup method (see 201310396381.5) requires a special update process to improve the efficiency of data update and reduce the delay caused by data update.
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种基于路由查找的表项更新方法、 装置及存储介质,能够提高数据更新的效率,降低数据更新带来的时延。In view of this, an embodiment of the present invention is to provide a method for updating an entry based on a route lookup. The device and the storage medium can improve the efficiency of data update and reduce the delay caused by data update.
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种基于路由查找的表项更新方法,所述方法包括:An embodiment of the present invention provides a method for updating an entry based on a route search, where the method includes:
确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;Determining that the control packet enters the current search level, and the search instruction before the control packet has been processed, updating the tree node entry data or the result entry data of the current search level, and simultaneously acquiring the control packet Searching for a read address in the instruction, matching the read address with the update address of the current search level, and determining that the data obtained according to the read address is replaced with the data corresponding to the update address when the match is successful;
确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;Determining that the tree node entry data or the result table item data update is completed, inserting a markup packet at a search instruction entry of the current search level;
确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。The tagged packet is discarded when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
上述方案中,所述确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成之前,所述方法还包括:In the above solution, before the determining that the control packet enters the current search level, and before the search instruction before the control packet has been processed, the method further includes:
读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址。Reading the updated table entry data and the update address corresponding to the entry data, and obtaining and saving the entry data that needs to be updated by the current search level and the entry data that needs to be updated by the current search level. Update the address.
上述方案中,所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;In the above solution, the updated entry data that needs to be updated by all the search levels and the update address corresponding to the entry data includes: a tree node table part and a result table part;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果表部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址。The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result table part includes: result data that needs to be updated by all the search levels, and the result The update address corresponding to the data.
上述方案中,所述确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成之前,所述方法还包括: In the above solution, before the determining that the control packet enters the current search level, and before the search instruction before the control packet has been processed, the method further includes:
确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入所述控制包。When it is determined that the current lookup level is the highest lookup level, the control packet is inserted at the lookup instruction entry of the current lookup level.
上述方案中,所述方法还包括:In the above solution, the method further includes:
检测到查找的当前查找级的某条表项数据错误时,存储所述表项数据及所述表项数据对应的更新地址,并依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复。When detecting that the data of a certain item of the current search level is incorrect, storing the item data and the update address corresponding to the item data, and sequentially acquiring the read address in the search instruction of the current search level, The read address is matched with the update address of the current search level. When the match is successful, the data obtained according to the read address is replaced with the data corresponding to the update address until the error is repaired.
本发明实施例还提供了一种基于路由查找的表项更新方法,所述方法包括:An embodiment of the present invention further provides a method for updating an entry based on a route lookup, where the method includes:
在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;Determining, when the processing instruction before the control packet enters the current search level, that the search instruction has been processed, updating the tree node entry data or the result entry data of the current search level;
确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令。When it is determined that the tree node entry data or the result entry data update of the current search level is completed, the search instruction after the control packet entering the current search level is unlocked.
上述方案中,在当前查找级中检测到控制包之前,所述方法还包括:In the foregoing solution, before the control packet is detected in the current search level, the method further includes:
确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包。When it is determined that the current search level is the highest search level, the control packet is inserted at the search instruction entry of the current search level.
上述方案中,确定所述控制包进入当前查找级之前的查找指令均已处理完成时,所述方法还包括:In the foregoing solution, when it is determined that the search instruction before the control packet enters the current search level has been processed, the method further includes:
将所述控制包直接送入下一个查找级。The control packet is sent directly to the next lookup level.
上述方案中,所述更新当前查找级的树结点表项数据或结果表项数据包括:读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址中当前查找级需要更新的表项数据及所述当前查找级需要更新的 表项数据对应的更新地址,并将所述当前查找级需要更新的表项数据写入对应的更新地址中。In the above solution, the updating the tree node entry data or the result entry data of the current search level includes: reading the stored entry data of all the search levels that need to be updated, and the current search in the update address corresponding to the entry data. The table item data that needs to be updated and the current search level need to be updated. The update address corresponding to the entry data, and the entry data that needs to be updated by the current search level is written into the corresponding update address.
本发明实施例还提供了一种基于路由查找的表项更新装置,所述装置包括:第一更新模块、高速缓存(Cache)模块、插入模块及确定模块;其中,The embodiment of the present invention further provides an apparatus for updating an entry based on a route search, where the apparatus includes: a first update module, a cache module, an insert module, and a determining module;
所述第一更新模块,配置为确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,触发Cache模块;The first update module is configured to: when the control packet enters the current search level, and the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously , triggering the Cache module;
所述Cache模块,配置为依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;The Cache module is configured to sequentially acquire a read address in a lookup instruction after the control packet, and match the read address with an update address of a current lookup level, and determine that the match is successful according to the read address. Data is replaced with data corresponding to the update address;
所述插入模块,配置为确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;The inserting module is configured to: when the tree node entry data or the result table data update is completed, insert a markup packet at a search instruction entry of the current search level;
所述确定模块,配置为确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。The determining module is configured to discard the tagged packet when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
上述方案中,所述第一更新模块,还配置为读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址;In the above solution, the first update module is further configured to: read the updated entry data of all the search levels that need to be updated, and the update address corresponding to the entry data, and obtain and save the entry data that needs to be updated by the current search level. And an update address corresponding to the entry data that needs to be updated by the current search level;
相应的,所述装置还包括第一缓存模块,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Correspondingly, the device further includes a first cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
所述Cache模块,还配置为存储当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址。The Cache module is further configured to store the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level.
上述方案中,所述第一更新模块,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包。 In the above solution, the first update module is further configured to: when determining that the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level.
上述方案中,所述第一更新模块,还配置为检测到查找的当前查找级的某条表项数据错误时,存储所述表项数据及所述表项数据对应的更新地址至所述Cache模块,并依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复。In the above solution, the first update module is further configured to: when detecting that an item of the current search level of the search is incorrect, storing the update data corresponding to the entry data and the entry data to the Cache a module, and sequentially acquiring a read address in the search instruction of the current search level, matching the read address with an update address of the current search level, and determining that the data obtained according to the read address is replaced with the update when the match is successful. The data corresponding to the address until the error is fixed.
本发明实施例还提供了一种基于路由查找的表项更新装置,所述装置包括:加锁模块、第二更新模块及解锁模块;其中,The embodiment of the present invention further provides a device for updating an entry based on a route search, where the device includes: a lock module, a second update module, and an unlocking module;
所述加锁模块,配置为在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;The locking module is configured to lock a lookup instruction after entering the control packet of the current search level when the control packet is detected in the current search level;
所述第二更新模块,配置为确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;The second update module is configured to: when the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
所述解锁模块,配置为确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令。The unlocking module is configured to: when determining that the tree node entry data or the result table item data of the current search level is updated, unlocking the lookup instruction after entering the control packet of the current search level.
上述方案中,所述第二更新模块,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入所述控制包。In the above solution, the second update module is further configured to: when the current search level is the highest search level, insert the control packet at the search instruction entry of the current search level.
上述方案中,所述第二更新模块,配置为读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址中当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址,并将所述当前查找级需要更新的表项数据写入对应的更新地址中;In the above solution, the second update module is configured to read the entry data that needs to be updated in all the search levels that are stored, and the entry data that needs to be updated in the current search level in the update address corresponding to the entry data, and the current The update address corresponding to the table item data that needs to be updated by the search level, and the table item data that needs to be updated by the current search level is written into the corresponding update address;
相应的,所述装置还包括第二缓存模块,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址。Correspondingly, the device further includes a second cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data.
上述方案中,所述第二更新模块,还配置为将所述控制包直接送入下一个查找级。 In the above solution, the second update module is further configured to send the control packet directly to the next search level.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,该计算机程序用于执行本发明实施例的上述基于路由查找的表项更新方法。The embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above-mentioned route lookup based update method of the embodiment of the present invention.
本发明实施例所提供的基于路由查找的表项更新方法、装置及存储介质,确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。如此,在更新当前查找级的树结点表项数据或结果表项数据的同时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,能够提高数据更新的效率,降低数据更新带来的时延。The method and device for updating an entry based on route lookup provided by the embodiment of the present invention, and determining that the control packet enters the current search level, and the search command before the control packet has been processed, updating the tree of the current search level Node entry data or result table entry data, at the same time, sequentially acquiring the read address in the lookup instruction after the control packet, matching the read address with the update address of the current lookup level, and determining that the match is successful, The data obtained by the read address is replaced by data corresponding to the update address; when it is determined that the tree node entry data or the result entry data update is completed, a markup packet is inserted at a search instruction entry of the current search level; The tagged packet is discarded when the tagged packet is inserted into the lookup instruction before the current lookup level has been processed. In this way, while updating the tree node entry data or the result table entry data of the current search level, replacing the data acquired according to the read address with the data corresponding to the update address, the data update efficiency and the data can be improved. The delay caused by the update.
附图说明DRAWINGS
图1为B-tree的路由查找方法流程示意图;FIG. 1 is a schematic flowchart of a route search method of a B-tree;
图2为本发明实施例一基于路由查找的表项更新方法流程示意图a;2 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention;
图3为本发明实施例一基于路由查找的表项更新方法流程示意图b;3 is a schematic flowchart b of a method for updating an entry based on route lookup according to an embodiment of the present invention;
图4为本发明实施例所有查找级需要更新的表项数据及所述表项数据对应的更新地址的存储格式示意图;4 is a schematic diagram of a storage format of an entry data that needs to be updated by all the search levels and an update address corresponding to the entry data according to an embodiment of the present invention;
图5为本发明实施例二基于路由查找的表项更新方法流程示意图a;5 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 2 of the present invention;
图6为本发明实施例二基于路由查找的表项更新方法流程示意图b;6 is a schematic flowchart b of a method for updating an entry based on route lookup according to Embodiment 2 of the present invention;
图7为本发明实施例三基于路由查找的表项更新方法流程示意图;FIG. 7 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 3 of the present invention;
图8为本发明实施例四基于路由查找的表项更新方法流程示意图;FIG. 8 is a schematic flowchart of a method for updating an entry based on route lookup according to Embodiment 4 of the present invention; FIG.
图9为本发明实施例一基于路由查找的表项更新装置组成结构示意图; FIG. 9 is a schematic structural diagram of a device for updating an entry based on route lookup according to an embodiment of the present invention; FIG.
图10为本发明实施例二基于路由查找的表项更新装置组成结构示意图。FIG. 10 is a schematic structural diagram of a device for updating an entry based on route lookup according to Embodiment 2 of the present invention.
具体实施方式detailed description
本发明实施例所述基于路由查找的表项更新方法基于一种B-tree路由查找方法,为了更清楚的理解本发明实施例,现对所述B-tree路由查找方法进行简要描述。The method for updating the entry based on the route search in the embodiment of the present invention is based on a B-tree route search method. For a clear understanding of the embodiment of the present invention, the B-tree route search method is briefly described.
B-tree是一种自底向上生长的树,树的每一层为一个查找级,最下面一层为结果表查找级,其余各层均为树结点查找级,即实际的查找级数为树的层数加结果表查找层。B-tree is a bottom-up tree. Each layer of the tree is a search level. The bottom layer is the result table search level. The other layers are tree node search levels, that is, the actual search level. Add a result table to the layer of the tree to find the layer.
B-tree中每更新(增加、删除、更新)一次数据,会引起如下操作中的一种:1、仅更新一条结果数据;2、更新一个树结点和一条结果数据;3、更新一个树结点和多条结果数据;4、更新多个树结点和多条结果数据。Each update (add, delete, update) data in the B-tree will cause one of the following operations: 1. Update only one result data; 2. Update a tree node and a result data; 3. Update a tree. Node and multiple result data; 4. Update multiple tree nodes and multiple result data.
B-tree的路由查找为自上而下的查找,每级查找之间存在相互关联,因此,本发明实施例所述表项更新也是自上而下的更新,即更新过程为从需要进行数据更新的最上面一个查找级开始,依次向下更新,结果表查找级为最后一级更新,如此,可以保证当前查找级进行数据更新后,新的查找请求一定访问更新过的树结点表项数据或结果表项数据。The route lookup of the B-tree is a top-down lookup, and each level of the search is associated with each other. Therefore, the update of the entry in the embodiment of the present invention is also a top-down update, that is, the update process is to perform data from the top. The top search level of the update starts, and is updated downwards in turn. The result table search level is the last level update. In this way, after the current search level is updated, the new search request must access the updated tree node entry. Data or result table entry data.
图1所示为B-tree的路由查找方法流程示意图,如图1所示,图中给出了三级查找级之间的逻辑关系,以第N级查找级为例,第N级查找级接收到第N-1级查找级送出的查找指令后,将指令存入先入先出队列(FIFO,First In First Out)1,当FIFO1中非空,即存有查找指令时,位于FIFO1出口的查找指令将会被处理,键值和读地址等数据被存储至FIFO2中,查找请求和查找地址被发送到FIFO3中;这里所述FIFO2中的读地址与FIFO3中的查找地址为相同的地址;所述查找请求和查找地址用于获取结点表中的树结点表项数据;当FIFO3非空时,处于FIFO3出口的查找请求和查找 地址会被发送到结点表中进行数据查找操作;一定时延后,查找结果会返回到FIFO4(204)中;当FIFO4非空时,处于FIFO4出口的返回结果会与处于FIFO2出口的键值等信息同时被取出;经过对返回结果中的树结点表项数据和所述键值数据的比较后生成下一查找级的查找指令,送入下一查找级。Figure 1 shows the flow chart of the B-tree route lookup method. As shown in Figure 1, the logical relationship between the three levels of lookup stages is given. The Nth level search level is taken as an example. The Nth level search level is used. After receiving the search instruction sent by the N-1 level search level, the instruction is stored in the first in first out queue (FIFO), and when the FIFO1 is not empty, there is a seek instruction, which is located at the exit of the FIFO1. The lookup instruction will be processed, data such as key values and read addresses are stored in FIFO 2, and the lookup request and lookup address are sent to FIFO 3; here the read address in FIFO 2 is the same address as the lookup address in FIFO 3; The lookup request and the lookup address are used to obtain tree node entry data in the node table; when the FIFO3 is not empty, the lookup request and lookup at the FIFO3 exit The address will be sent to the node table for data lookup operation; after a certain delay, the search result will be returned to FIFO4 (204); when FIFO4 is not empty, the return result at the FIFO4 exit will be the key value at the exit of FIFO2 The information is simultaneously fetched; after comparing the tree node table item data in the returned result with the key value data, a lookup instruction of the next search level is generated and sent to the next search level.
在进行上述路由查找过程中,每一个FIFO中的数据可能因为数据线上某个位置的处理速度与指令速度不匹配暂存在FIFO中;当任何一个FIFO快满时会对前一级FIFO进行流控反压,所以不会出现丢失指令或数据的情况。During the above route lookup process, the data in each FIFO may be temporarily stored in the FIFO because the processing speed of a certain position on the data line does not match the instruction speed; when any FIFO is almost full, the previous FIFO is streamed. Control back pressure, so there will be no loss of instructions or data.
基于上述B-tree的路由查找方法,在本发明实施例中,确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。In the embodiment of the present invention, in the embodiment of the present invention, when the control packet is determined to enter the current search level, and the search command before the control packet has been processed, the tree node entry of the current search level is updated. Data or result table item data, at the same time, sequentially acquiring the read address in the lookup instruction after the control packet, matching the read address with the update address of the current lookup level, and determining that the match is successful, according to the read address The acquired data is replaced with data corresponding to the update address; when it is determined that the tree node entry data or the result entry data update is completed, a markup packet is inserted at a search instruction entry of the current search level; and the markup packet insertion is determined. The tagged packet is discarded when the lookup instructions before the current lookup level have been processed.
图2为本发明实施例一基于路由查找的表项更新方法流程示意图a;图3为本发明实施例一基于路由查找的表项更新方法流程示意图b;如图2、图3所示,本发明实施例基于路由查找的表项更新方法流程包括:2 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention; FIG. 3 is a schematic flowchart of a method for updating an entry based on route lookup according to an embodiment of the present invention; FIG. 2 and FIG. The method for updating an entry based on route lookup in the embodiment of the present invention includes:
步骤201:确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据; Step 201: Determine that the control packet enters the current search level, and when the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously obtain the control. a read address in the lookup instruction after the packet, the read address is matched with the update address of the current search level, and when the matching is successful, the data obtained according to the read address is replaced with the data corresponding to the update address;
这里,本步骤之前,所述方法还包括:确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包;这里,所述控制包为一个具有特殊标记的控制包,可以随着查找指令流一起进行传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果;所述最高查找级为所有查找级中需要进行数据更新的最上面一个查找级。Here, before the step, the method further includes: when determining that the current search level is the highest search level, inserting a control packet at a search instruction entry of the current search level; where the control packet is a control packet with a special mark, The transmission may be performed along with the lookup instruction stream. When the control packet is read out from the FIFO 1, the lookup address entering the FIFO 2 is an invalid address or an empty address, and correspondingly, an empty result is returned to the FIFO 4; The highest lookup level is the top search level in all lookup levels that requires data updates.
在一实施例中,本步骤之前,所述方法还包括:读取第一缓存模块存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址至所述Cache模块;In an embodiment, before the step, the method further includes: reading all the item data stored by the first cache module and the update address corresponding to the item data, and acquiring and saving the current search level. The updated item address and the update address corresponding to the updated item data of the current search level to the Cache module;
这里,若当前查找级为最高查找级,则所述读取第一缓存模块存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址的操作,在查找指令入口处插入控制包的操作之前执行;Here, if the current search level is the highest search level, the read all the search levels stored in the first cache module need to be updated and the update address corresponding to the entry data, and the current search level needs to be updated. The operation of the entry data and the update address corresponding to the entry data that needs to be updated by the current search level is performed before the operation of inserting the control packet at the entry of the search instruction;
所述读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址之前,所述方法还包括:第一缓存模块存储软件写入的所有查找级需要更新的表项数据及所述表项数据对应的更新地址;The method further includes: the first cache module stores all the entries that need to be updated by all the search levels written by the software, before the reading of the stored table entry data and the update address corresponding to the entry data. Data and an update address corresponding to the entry data;
所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;The stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、 更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table portion is as shown in FIG. 4a, including: a valid tag, a search level, Updating the address and the tree node data; wherein the valid tag is a hardware identifier, marking whether the update entry is valid, the search level identifies which level of the search node the search node is in; the update address is a tree node The corresponding physical address; the tree node data is the data that needs to be written into the actual hardware memory; since the tree node is updated from top to bottom, when filling in the tree node table, it is also in accordance with the top-down Fill in the order, the node with the highest level to be updated is filled in the first line of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes can be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. The physical address, the result table data is the data that needs to be written into the actual hardware memory.
在一实施例中,所述依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配包括:In an embodiment, the sequentially acquiring the read address in the lookup instruction after the control packet, and matching the read address with the update address of the current lookup level includes:
使能高速缓存Cache开关,依次获取所述控制包进入当前查找级之后的查找指令中的读地址,并将所述读地址与Cache模块中存储的当前查找级的更新地址进行匹配。The cache cache switch is enabled to sequentially acquire the read address in the lookup instruction after the control packet enters the current lookup level, and match the read address with the update address of the current lookup level stored in the Cache module.
在一实施例中,所述确定所述控制包之前的查找指令均已处理完成,即确定所述控制包进入当前查找级之前的查找指令均已从FIFO队列中清空,即在FIFO2的队列出口处检测到所述控制包时;In an embodiment, the determining instructions before the determining the control packet have been processed, that is, determining that the control packet before entering the current search level has been cleared from the FIFO queue, that is, in the queue exit of the FIFO2. When the control packet is detected;
所述更新当前查找级的树结点表项数据或结果表项数据包括:获取所述Cache模块中存储的当前查找级需要更新的表项数据及所述表项数据对应的更新地址,将所述当前查找级需要更新的表项数据写入对应的更新地址中;The updating the tree node entry data or the result entry data of the current search level includes: obtaining the entry data that needs to be updated in the current search level stored in the Cache module, and the update address corresponding to the entry data, The table item data that needs to be updated by the current search level is written into the corresponding update address;
将依据所述读地址获取的表项数据替换为所述更新地址对应的表项数据,而忽略实际查找的数据,如此,从查找现象上,相应更新地址的数据 已经完成了更新操作,虽然实际表项数据可能尚未写入树结点表或结果表中,加速了现象上的路由更新速度,同时对于实际表项数据,可以“慢慢地”进行更新操作。Substituting the entry data obtained according to the read address with the entry data corresponding to the update address, and ignoring the actually searched data, so, from the lookup phenomenon, correspondingly updating the address data The update operation has been completed. Although the actual entry data may not be written to the tree node table or the result table, the speed of the route update on the phenomenon is accelerated, and the update operation can be performed "slowly" for the actual entry data.
步骤202:确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;Step 202: When it is determined that the tree node entry data or the result entry data update is completed, insert a markup packet at a search instruction entry of the current search level;
这里,所述确定所述树结点表项数据或结果表项数据更新完成包括:确定所述Cache模块中存储的当前查找级需要更新的表项数据均已写入所述表项数据对应的更新地址;Here, the determining that the tree node entry data or the result entry data update is completed includes: determining that the entry data that needs to be updated in the current search level stored in the Cache module has been written into the entry corresponding to the entry data. Update address;
所述标记包为不同于所述控制包的具有特殊标记的标记包,可以随着查找指令流正常传输,标记包的插入保证了在所述标记包插入当前查找级之后的查找指令,读取的都是更新后的树结点表项数据或结果表项数据。The markup packet is a markup packet having a special mark different from the control packet, and can be normally transmitted along with the lookup instruction stream, and the insertion of the markup package ensures that the lookup instruction after the markup packet is inserted into the current lookup level is read. All are updated tree node table entry data or result table entry data.
步骤203:确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包;Step 203: Determine that the tagged packet is discarded when the search instruction before the tagged packet is inserted into the current search level has been processed.
这里,所述确定所述标记包插入当前查找级之前的查找指令均已处理完成时,所述方法还包括:去使能所述Cache开关,清空所述Cache模块中存储的当前查找级需要更新的表项数据及所述表项数据对应的更新地址;如此,方便了当前查找级进行下一次更新时需要更新的数据及相应更新地址的写入;The method further includes: disabling the Cache switch to clear the current search level stored in the Cache module needs to be updated, where the determining that the search packet is inserted into the current search level has been processed. The entry data and the update address corresponding to the entry data; thus, facilitating the writing of the data to be updated and the corresponding update address when the current search level performs the next update;
去使能所述Cache开关,即所述标记包插入当前查找级之后的查找指令可以正常的依据自身的读地址获取对应的表项数据,无须所述Cache模块中缓存的对应的表项数据代替。The Cache switch is disabled, that is, the lookup instruction after the tagged packet is inserted into the current search level can obtain the corresponding entry data according to the read address of the ACL, and the corresponding entry data cached in the Cache module is not required to be replaced. .
在一实施例中,本步骤之后,所述方法还包括:将所述控制包直接送入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新时延,提高了B-tree的更新效率。In an embodiment, after the step, the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing update delay, and improving B-tree update efficiency.
在一实施例中,所述方法还包括:检测到查找的当前查找级的某条表 项数据错误时,所述Cache模块存储控制面写入的所述当前查找级的表项数据及相应的更新地址,并使能所述Cache开关,依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复,去使能所述Cache开关;如此,所述Cache模块作为临时备份表被使用,便于控制面进行相应的故障定位和故障处理;In an embodiment, the method further includes: detecting a table of the current search level of the lookup When the item data is incorrect, the Cache module stores the entry data of the current search level and the corresponding update address written by the control plane, and enables the Cache switch to sequentially acquire the read address in the search instruction of the current search level. Matching the read address with the update address of the current search level, and determining that the match is successful, replacing the data acquired according to the read address with the data corresponding to the update address until the error is repaired, and the device is disabled. The Cache switch is used as the temporary backup table, so that the control plane can perform corresponding fault location and fault processing.
在一实施例中,所述方法还包括:增加另存的当前查找级需要更新的每条表项数据的有效标记,所述有效标记用于标识当前表项数据是否有效;In an embodiment, the method further includes: adding a valid flag of each item data that needs to be updated in the current current search level, where the valid flag is used to identify whether the current item data is valid;
当检测到查找的当前查找级的某条表项数据错误,且当前查找级需要进行数据更新时,需要执行如下操作,即依据查找指令中的读地址获取的数据将被替换为所述Cache模块中存储的更新地址对应的数据,由于所述更新地址及其对应的数据在写入所述Cache模块时,可能存在某条更新数据未完全写入,但从FIFO2中出来的查找指令中的读地址为所述未完全写入的数据对应的地址,此时,当所述Cache模块中存储的更新地址对应的数据替换依据查找指令中的读地址获取的数据的操作将会出错,因此,增加所述Cache模块存储的每条表项数据的有效标记,获取当前查找级需要更新的数据及相应的地址后,首先在所述Cache模块中写入表项数据对应的更新地址,并设置有效标记为无效,待所述表项数据写入完成时,设置所述有效标记为有效,待所有表项数据的有效标记均为有效时,再对当前查找级的树结点表项数据或结果表项数据进行更新操作;如此,当检测到查找的当前查找级的某条表项数据错误时,所述Cache模块作为备份表的同时也不会影响对树结点表项数据或结果表项数据的更新。When it is detected that the data of a certain item of the current search level of the search is incorrect, and the current search level needs to perform data update, the following operations are required, that is, the data acquired according to the read address in the search instruction is replaced with the Cache module. The data corresponding to the update address stored in the memory, because the update address and its corresponding data are written to the Cache module, there may be some update data not completely written, but the read command from the FIFO 2 reads The address is an address corresponding to the data that is not completely written. At this time, when the data corresponding to the update address stored in the Cache module replaces the data acquired according to the read address in the search instruction, the operation will be wrong, and therefore, the operation is increased. After the valid tag of each entry data stored by the Cache module is obtained, and the data that needs to be updated by the current search level and the corresponding address are obtained, the update address corresponding to the entry data is first written in the Cache module, and a valid tag is set. Invalid, when the entry of the entry data is completed, the valid tag is set to be valid, and the valid tags of all the entry data are When valid, the update operation is performed on the tree node entry data or the result entry data of the current search level; thus, when the data of a certain entry of the current search level is found to be incorrect, the Cache module is used as a backup table. It also does not affect the update of the tree node entry data or the result table entry data.
图5为本发明实施例二基于路由查找的表项更新方法流程示意图a;图6为本发明实施例二基于路由查找的表项更新方法流程示意图b;如图5、图6所示,本发明实施例基于路由查找的表项更新方法流程包括: FIG. 5 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 2 of the present invention; FIG. 6 is a schematic flowchart of a method for updating an entry based on route search according to Embodiment 2 of the present invention; FIG. 5 and FIG. The method for updating an entry based on route lookup in the embodiment of the present invention includes:
步骤501:在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;Step 501: When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
本步骤之前,所述方法还包括:确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包;如图6中步骤一所示;Before the step, the method further includes: when determining that the current search level is the highest search level, inserting a control packet at the search instruction entry of the current search level; as shown in step 1 in FIG. 6;
其中,所述确定当前查找级为最高查找级包括:确定当前查找级为所有查找级中需要进行数据更新的最上面一个查找级;The determining that the current search level is the highest search level includes: determining that the current search level is the top search level of all search levels that need to be updated;
所述控制包为一个具有特殊标记的控制包,可以随着查找指令流正常传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果。The control packet is a control packet with a special flag, which can be normally transmitted along with the lookup instruction stream. When the control packet is read from the FIFO1 and processed, the search address entering the FIFO 2 is an invalid address or an empty address, correspondingly Return to the empty result of FIFO4.
在一实施例中,在当前查找级中检测到控制包,即在FIFO1的出口处检测到所述控制包,即所述控制包刚从所述FIFO1中被读出分发时;如图6中步骤二所示;In an embodiment, the control packet is detected in the current lookup stage, ie the control packet is detected at the exit of the FIFO 1, ie the control packet has just been read out from the FIFO 1 for distribution; Step two is shown;
对进入当前查找级的所述控制包之后的查找指令加锁,此时,FIFO1中的查找指令被压在FIFO1中,无法输出,且在后面的一段时间内,前一级发送过来的查找指令也都被顺序压在FIFO1中,而所述控制包进入当前查找级之前的查找指令则可以顺利的从FIFO4中获得返回数据,生成下一级查找指令并进入下一级中。The search instruction after entering the control packet of the current search level is locked. At this time, the search instruction in the FIFO1 is pressed in the FIFO1, and cannot be output, and the search instruction sent by the previous stage is in a later period of time. They are also sequentially pressed into the FIFO1, and the lookup instruction before the control packet enters the current search level can smoothly obtain the return data from the FIFO4, generate the next-level search instruction and enter the next stage.
步骤502:确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;Step 502: When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
这里,所述确定所述控制包进入当前查找级之前的查找指令均已处理完成,即确定所述控制包进入当前查找级之前的查找指令均已从FIFO队列中清空,即在FIFO2的队列出口处检测到所述控制包,同时所述控制包的读空数据也返回至FIFO4的出口时;如图6中步骤三所示;Here, the determining that the control packet enters the current search level has been processed, that is, the search instruction before the control packet enters the current search level has been cleared from the FIFO queue, that is, the queue exit of the FIFO2. The control packet is detected, and the read data of the control packet is also returned to the exit of the FIFO 4; as shown in step 3 in FIG. 6;
所述更新当前查找级的树结点表项数据或结果表项数据包括:获取第二缓存模块中存储的所有查找级需要更新的数据及所述数据对应的地址中 当前查找级需要更新的数据及所述当前查找级需要更新的数据对应的更新地址,将当前查找级需要更新的数据写入对应的更新地址中;The updating the tree node entry data or the result entry data of the current search level includes: acquiring data that needs to be updated by all the search levels stored in the second cache module, and an address corresponding to the data The data that needs to be updated by the current search level and the update address corresponding to the data that needs to be updated by the current search level, and the data that needs to be updated by the current search level is written into the corresponding update address;
这里,所述获取第二缓存模块中存储的所有查找级需要更新的数据及所述数据对应的地址中当前查找级需要更新的数据及所述当前查找级需要更新的数据对应的更新地址之前,所述方法还包括:第二缓存模块存储软件写入的所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Here, before the data that needs to be updated in all the search levels stored in the second cache module and the update address corresponding to the current search level and the update address corresponding to the current search level in the address corresponding to the data, The method further includes: the second cache module stores the entry data that needs to be updated by all the search levels written by the software, and the update address corresponding to the entry data;
所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;The stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid. The search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order. The top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内 存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. Physical address, the result table data needs to be written into the actual hardware. Saved data.
步骤503:确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令;Step 503: When it is determined that the tree node entry data or the result entry data update of the current search level is completed, unlocking the lookup instruction after entering the control packet of the current search level;
这里,所述解锁所述进入当前查找级的所述控制包之后的查找指令,以使之前被压在FIFO1中的查找指令可以被正常分发;如图6中步骤四所示;Here, the unlocking the lookup instruction after entering the control packet of the current search level, so that the lookup instruction previously pressed in the FIFO1 can be normally distributed; as shown in step 4 in FIG. 6;
所述控制包将位于查找指令流中的所述控制包之前的查找指令和所述控制包之后的查找指令严格的分成了原查找指令和新查找指令,所述原查找指令获取的是更新前的树结点表项数据或结果表项数据,所述新查找指令获取的是更新后的树结点表项数据或结果表项数据。The control packet strictly divides the lookup instruction before the control packet located in the lookup instruction stream and the lookup instruction after the control packet into an original lookup instruction and a new lookup instruction, and the original lookup instruction acquires before updating The tree node entry data or the result table entry data, and the new lookup instruction obtains the updated tree node entry data or result entry data.
在一实施例中,本步骤之后,所述方法还包括:将所述控制包直接送入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新时延,提高了B-tree的更新效率。In an embodiment, after the step, the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing update delay, and improving B-tree update efficiency.
图7为本发明实施例三基于路由查找的表项更新方法流程示意图;在本发明实施例中进行数据更新的当前查找级为需要进行数据更新的查找级中最上面一层查找级,如图7所示,本发明实施例三基于路由查找的表项更新方法包括:FIG. 7 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 3 of the present invention; in the embodiment of the present invention, a current search level for performing data update is a top search level in a search level that needs to be updated, as shown in FIG. As shown in FIG. 7, the method for updating an entry based on route lookup according to Embodiment 3 of the present invention includes:
步骤701:第一缓存模块存储软件写入的所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Step 701: The first cache module stores the updated entry data of all the search levels written by the software and the update address corresponding to the entry data.
这里,所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;Here, the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data of the result table The bit width, divided into a tree node table and a result table can facilitate the division of the hardware storage unit;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的 结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: all the search levels need to be updated. Result data and an update address corresponding to the result data;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid. The search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order. The top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. The physical address, the result table data is the data that needs to be written into the actual hardware memory.
在本发明实施例中,软件仅需与所述第一缓存模块进行一次交互,便可实现多个查找级的多条路由表项的更新,大大提高了更新效率。In the embodiment of the present invention, the software only needs to perform one interaction with the first cache module, so that multiple routing entries of multiple search levels can be updated, which greatly improves the update efficiency.
步骤702:在当前查找级的查找指令入口处插入控制包;Step 702: Insert a control packet at a search instruction entry of the current search level;
这里,所述控制包为一个具有特殊标记的控制包,可以随着查找指令流一起进行传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果;所述最高查找级为所有查找级中需要进行数据更新的最上面一个查找级。Here, the control packet is a control packet with a special flag, which can be transmitted along with the lookup instruction stream. When the control packet is read from the FIFO1 and processed, the lookup address entering the FIFO 2 is an invalid address or empty. The address, correspondingly, returns a null result to FIFO 4; the highest lookup level is the topmost lookup level in all lookup stages that requires data updates.
步骤703:获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址;Step 703: Acquire and save the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level;
本步骤包括:读取第一缓存模块存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址至Cache模 块。The step includes: reading the entry data that needs to be updated by all the search levels stored by the first cache module, and the update address corresponding to the entry data, and obtaining and saving the entry data that needs to be updated by the current search level and the current search level. Update address corresponding to the updated entry data to the Cache module Piece.
步骤704:确定控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;Step 704: When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously obtain the search instruction after the control packet. The read address is matched with the update address of the current search level, and when the match is successful, the data obtained according to the read address is replaced with the data corresponding to the update address;
这里,所述依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配包括:Here, the sequentially acquiring the read address in the lookup instruction after the control packet, and matching the read address with the update address of the current lookup level includes:
使能高速缓存Cache开关,依次获取所述控制包进入当前查找级之后的查找指令中的读地址,并将所述读地址与Cache模块中存储的当前查找级的更新地址进行匹配。The cache cache switch is enabled to sequentially acquire the read address in the lookup instruction after the control packet enters the current lookup level, and match the read address with the update address of the current lookup level stored in the Cache module.
在一实施例中,所述确定控制包进入当前查找级之前的查找指令均已处理完成时,即所述控制包进入当前查找级之前的查找指令均已从FIFO队列中清空时,即在FIFO2的队列出口处检测到所述控制包时;In an embodiment, when the determining that the control packet has entered the current search level has been processed, that is, when the control packet before the current search level has been cleared from the FIFO queue, that is, in the FIFO2 When the control packet is detected at the queue exit;
所述更新当前查找级的树结点表项数据或结果表项数据包括:获取所述Cache模块存储的当前查找级需要更新的表项数据及所述表项数据对应的更新地址,将所述当前查找级需要更新的表项数据写入对应的更新地址中;The updating the tree node entry data or the result entry data of the current search level includes: obtaining the entry data that needs to be updated by the current search level stored by the Cache module, and the update address corresponding to the entry data, where the The entry data that needs to be updated by the current search level is written into the corresponding update address;
将依据所述读地址获取的表项数据替换为所述更新地址对应的表项数据,而忽略实际查找的数据,如此,从查找现象上,相应更新地址的数据已经完成了更新操作,虽然实际表项数据可能尚未写入树结点表或结果表中,加速了现象上的路由更新速度,同时对于实际表项数据,可以“慢慢地”进行更新操作。Replace the entry data obtained according to the read address with the entry data corresponding to the update address, and ignore the actually searched data. Thus, from the lookup phenomenon, the data of the corresponding update address has been updated, although the actual The entry data may not be written in the tree node table or the result table, which speeds up the update of the route on the phenomenon, and can update the data slowly and slowly.
步骤705:确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包; Step 705: When it is determined that the tree node entry data or the result entry data update is completed, insert a markup packet at a search instruction entry of the current search level;
这里,所述确定所述树结点表项数据或结果表项数据更新完成包括:确定所述Cache模块中存储的当前查找级需要更新的表项数据均已写入所述表项数据对应的更新地址;Here, the determining that the tree node entry data or the result entry data update is completed includes: determining that the entry data that needs to be updated in the current search level stored in the Cache module has been written into the entry corresponding to the entry data. Update address;
所述标记包为不同于所述控制包的具有特殊标记的标记包,可以随着查找指令流正常传输,标记包的插入保证了在所述标记包插入当前查找级之后的查找指令,读取的都是更新后的树结点表项数据或结果表项数据。The markup packet is a markup packet having a special mark different from the control packet, and can be normally transmitted along with the lookup instruction stream, and the insertion of the markup package ensures that the lookup instruction after the markup packet is inserted into the current lookup level is read. All are updated tree node table entry data or result table entry data.
步骤706:确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包;Step 706: Determine that the tagged packet is discarded when the search packet before the tagged packet is inserted into the current search level has been processed.
本步骤之后,所述方法还包括:将所述控制包直接送入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新时延,提高了B-tree的更新效率。After the step, the method further includes: directly sending the control packet to the next search level; thus, ensuring consistency of the update operation of the B-tree, reducing the update delay, and improving the update efficiency of the B-tree. .
在一实施例中,所述确定所述标记包插入当前查找级之前的查找指令均已处理完成时,所述方法还包括:In an embodiment, when the determining that the tagged packet is inserted into the current search level has been processed, the method further includes:
去使能所述Cache开关,并清空存储的当前查找级需要更新的表项数据及所述表项数据对应的更新地址。The Cache switch is enabled, and the updated entry data that needs to be updated in the current search level and the update address corresponding to the entry data are cleared.
在一实施例中,所述方法还包括:检测到查找的当前查找级的某条表项数据错误时,所述Cache模块存储控制面写入的所述表项数据及相应的更新地址,并使能所述Cache开关,依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复,去使能所述Cache开关;如此,所述Cache模块作为临时备份表被使用,便于控制面进行相应的故障定位和故障处理;In an embodiment, the method further includes: when detecting that an item of the current search level of the search is incorrect, the Cache module stores the item data and the corresponding update address written by the control plane, and The Cache switch is enabled, and the read address in the search instruction of the current search level is sequentially acquired, and the read address is matched with the update address of the current search level, and when the matching is successful, the data acquired according to the read address is replaced. For the data corresponding to the update address, until the error is repaired, the Cache switch is disabled; thus, the Cache module is used as a temporary backup table, which facilitates the control plane to perform corresponding fault location and fault handling;
在一实施例中,所述方法还包括:增加另存的当前查找级需要更新的每条表项数据的有效标记,所述有效标记用于标识当前表项数据是否有效;In an embodiment, the method further includes: adding a valid flag of each item data that needs to be updated in the current current search level, where the valid flag is used to identify whether the current item data is valid;
当检测到查找的当前查找级的某条表项数据错误,且当前查找级需要 进行数据更新时,需要执行以下操作,即依据查找指令中的读地址获取的数据将被替换为所述Cache模块中存储的更新地址对应的数据,由于所述更新地址及其对应的数据在写入所述Cache模块时,可能存在某条更新数据未完全写入,但从FIFO2中出来的查找指令中的读地址为所述未完全写入的数据对应的地址,此时,所述Cache模块中存储的更新地址对应的数据替换依据查找指令中的读地址获取的数据的操作将会出错,因此,增加所述Cache模块存储的每条表项数据的有效标记,获取当前查找级需要更新的数据及相应的地址后,首先在所述Cache模块中写入表项数据对应的更新地址,并设置有效标记为无效,待所述表项数据写入完成时,设置所述有效标记为有效,待所有表项数据的有效标记均为有效时,再对当前查找级的树结点表项数据或结果表项数据进行更新操作;如此,当检测到查找的当前查找级的某条表项数据错误时,所述Cache模块作为备份表的同时也不会影响对树结点表项数据或结果表项数据的更新。When it is detected that the data of an item of the current search level of the search is incorrect, and the current search level needs When performing data update, the following operations are required, that is, data acquired according to the read address in the lookup instruction is replaced with data corresponding to the update address stored in the Cache module, because the update address and its corresponding data are written. When the Cache module is entered, there may be some update data that is not completely written, but the read address in the lookup instruction from the FIFO 2 is the address corresponding to the incompletely written data. At this time, the Cache module The operation of replacing the data corresponding to the update address in the search instruction by the data stored in the search instruction will be erroneous. Therefore, the valid tag of each entry data stored in the Cache module is added, and the current search level needs to be updated. After the data and the corresponding address, the update address corresponding to the entry data is first written in the Cache module, and the valid flag is set to be invalid. When the entry of the entry is completed, the valid flag is set to be valid. When the valid tags of all the entry data are valid, the tree node entry data or the result entry data of the current search level is updated. For; thus, when detecting an article of the current search level to find the data entry error, the Cache module as a backup table at the same time will not affect the update tree node data entry or table item data.
图8为本发明实施例四基于路由查找的表项更新方法流程示意图;在本发明实施例中进行数据更新的当前查找级为需要进行数据更新的查找级中最上面一层查找级,如图8所示,本发明实施例四基于路由查找的表项更新方法包括:FIG. 8 is a schematic flowchart of a method for updating an entry based on a route search according to Embodiment 4 of the present invention; in the embodiment of the present invention, a current search level for performing data update is a top search level in a search level that needs to be updated, as shown in FIG. As shown in FIG. 8, the method for updating an entry based on route lookup according to Embodiment 4 of the present invention includes:
步骤801:第二缓存模块存储软件写入的所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Step 801: The second cache module stores the entry data that needs to be updated by all the search levels written by the software, and the update address corresponding to the entry data.
这里,所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;Here, the stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data of the result table The bit width, divided into a tree node table and a result table can facilitate the division of the hardware storage unit;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的 结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: all the search levels need to be updated. Result data and an update address corresponding to the result data;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid. The search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order. The top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. The physical address, the result table data is the data that needs to be written into the actual hardware memory.
在本发明实施例中,软件仅需与所述第二缓存模块进行一次交互,便可实现多个查找级的多条路由表项的更新,大大提高了更新效率。In the embodiment of the present invention, the software only needs to perform one interaction with the second cache module, so that multiple routing entries of multiple search levels can be updated, which greatly improves the update efficiency.
步骤802:在当前查找级的查找指令入口处插入控制包;Step 802: Insert a control packet at a search instruction entry of the current search level;
这里,所述控制包为一个具有特殊标记的控制包,可以随着查找指令流一起进行传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果;所述最高查找级为所有查找级中需要进行数据更新的最上面一个查找级。Here, the control packet is a control packet with a special flag, which can be transmitted along with the lookup instruction stream. When the control packet is read from the FIFO1 and processed, the lookup address entering the FIFO 2 is an invalid address or empty. The address, correspondingly, returns a null result to FIFO 4; the highest lookup level is the topmost lookup level in all lookup stages that requires data updates.
步骤803:在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;Step 803: When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
这里,在当前查找级中检测到控制包,即在FIFO1的出口处检测到所述控制包,即所述控制包刚从所述FIFO1中被读出分发时;如图6中步骤二所示; Here, the control packet is detected in the current lookup stage, that is, the control packet is detected at the exit of the FIFO 1, that is, the control packet is just read out from the FIFO 1 for distribution; as shown in step 2 in FIG. ;
对进入当前查找级的所述控制包之后的查找指令加锁,此时,FIFO1中的查找指令被压在FIFO1中,无法输出,且在后面的一段时间内,前一级发送过来的查找指令也都被顺序压在FIFO1中,而所述控制包进入当前查找级之前的查找指令则可以顺利的从FIFO4中获得返回数据,生成下一级查找指令并进入下一级中。The search instruction after entering the control packet of the current search level is locked. At this time, the search instruction in the FIFO1 is pressed in the FIFO1, and cannot be output, and the search instruction sent by the previous stage is in a later period of time. They are also sequentially pressed into the FIFO1, and the lookup instruction before the control packet enters the current search level can smoothly obtain the return data from the FIFO4, generate the next-level search instruction and enter the next stage.
步骤804:确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;Step 804: When it is determined that the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
这里,所述确定所述控制包进入当前查找级之前的查找指令均已处理完成时,即确定所述控制包进入当前查找级之前的查找指令均已从FIFO队列中清空时,即在FIFO2的队列出口处检测到所述控制包,同时所述控制包的读空数据也返回至FIFO4的出口时;如图6中步骤三所示;Here, when it is determined that the search instruction before the control packet enters the current search level has been processed, that is, when the search instruction before the control packet enters the current search level has been cleared from the FIFO queue, that is, in the FIFO2 The control packet is detected at the queue exit, and the read-empty data of the control packet is also returned to the exit of the FIFO 4; as shown in step 3 in FIG. 6;
所述更新当前查找级的树结点表项数据或结果表项数据包括:获取第二缓存模块中存储的所有查找级需要更新的数据及所述数据对应的地址中当前查找级需要更新的数据及所述当前查找级需要更新的数据对应的更新地址,将当前查找级需要更新的数据写入对应的更新地址中。The updating the tree node entry data or the result entry data of the current search level includes: acquiring data that needs to be updated by all the search levels stored in the second cache module, and data that needs to be updated in the current search level of the address corresponding to the data And the update address corresponding to the data that needs to be updated by the current search level, and the data that needs to be updated by the current search level is written into the corresponding update address.
步骤805:确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令;Step 805: When it is determined that the tree node entry data or the result table item data of the current search level is updated, the search instruction after entering the control packet of the current search level is unlocked;
这里,所述解锁所述进入当前查找级的所述控制包之后的查找指令,以使之前被压在FIFO1中的查找指令可以被正常分发;如图6中步骤四所示;Here, the unlocking the lookup instruction after entering the control packet of the current search level, so that the lookup instruction previously pressed in the FIFO1 can be normally distributed; as shown in step 4 in FIG. 6;
所述控制包将位于查找指令流中的所述控制包之前的查找指令和所述控制包之后的查找指令严格的分成了原查找指令和新查找指令,所述原查找指令获取的是更新前的树结点表项数据或结果表项数据,所述新查找指令获取的是更新后的树结点表项数据或结果表项数据。The control packet strictly divides the lookup instruction before the control packet located in the lookup instruction stream and the lookup instruction after the control packet into an original lookup instruction and a new lookup instruction, and the original lookup instruction acquires before updating The tree node entry data or the result table entry data, and the new lookup instruction obtains the updated tree node entry data or result entry data.
在一实施例中,本步骤之后,所述方法还包括:将所述控制包直接送 入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新时延,提高了B-tree的更新效率。In an embodiment, after the step, the method further includes: sending the control package directly Go to the next search level; in this way, the consistency of the update operation of the B-tree can be guaranteed, the update delay can be reduced, and the update efficiency of the B-tree can be improved.
图9为本发明实施例一基于路由查找的表项更新装置组成结构示意图;如图9所示,本发明实施例基于路由查找的表项更新装置组成包括:第一更新模块、Cache模块、插入模块及确定模块;其中,FIG. 9 is a schematic structural diagram of a device for updating an entry based on a route search according to an embodiment of the present invention; as shown in FIG. 9 , the device for updating an entry based on a route search according to an embodiment of the present invention includes: a first update module, a Cache module, and an insertion Module and determination module; among them,
所述第一更新模块91,配置为确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,触发所述Cache模块;The first update module 91 is configured to: when the control packet enters the current search level, and the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, At the same time, the Cache module is triggered;
所述Cache模块92,配置为依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;The Cache module 92 is configured to sequentially acquire the read address in the lookup instruction after the control packet, and match the read address with the update address of the current search level, and determine that the match is successful, and the read address is obtained according to the read address. Data is replaced by data corresponding to the update address;
所述插入模块93,配置为确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;The inserting module 93 is configured to: when the tree node entry data or the result table data update is completed, insert a markup packet at a search instruction entry of the current search level;
所述确定模块94,配置为确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。The determining module 94 is configured to discard the tagged packet when the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
在一实施例中,所述第一更新模块91,还配置为读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址;In an embodiment, the first update module 91 is further configured to: read the updated entry data of all the search levels that need to be updated and the update address corresponding to the entry data, and obtain and save the current search level to be updated. The entry data and the update address corresponding to the entry data that needs to be updated by the current search level;
相应的,所述装置还包括第一缓存模块95,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Correspondingly, the device further includes a first cache module 95 configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
所述Cache模块92,还配置为存储当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址;The Cache module 92 is further configured to store the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level;
这里,所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远 大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;Here, the stored entry data that needs to be updated by all the search levels and the update address corresponding to the entry data includes: a tree node table part and a result table part; Greater than the data bit width of the result table, dividing into the tree node table and the result table can facilitate the division of the hardware storage unit;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid. The search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order. The top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. The physical address, the result table data is the data that needs to be written into the actual hardware memory.
在一实施例中,所述Cache模块92依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配包括:In an embodiment, the Cache module 92 sequentially acquires a read address in a lookup instruction after the control packet, and matches the read address with an update address of a current lookup level, including:
所述Cache模块92使能Cache开关,依次获取所述控制包进入当前查找级之后的查找指令中的读地址,并将所述读地址与Cache模块中存储的当前查找级的更新地址进行匹配。The Cache module 92 enables the Cache switch to sequentially acquire the read address in the lookup instruction after the control packet enters the current search level, and matches the read address with the update address of the current lookup level stored in the Cache module.
在一实施例中,所述第一更新模块91更新当前查找级的树结点表项数据或结果表项数据包括:In an embodiment, the updating, by the first update module 91, the tree node entry data or the result entry data of the current search level includes:
所述第一更新模块91获取所述Cache模块存储的当前查找级需要更新 的表项数据及所述表项数据对应的更新地址,将所述当前查找级需要更新的表项数据写入对应的更新地址中。The first update module 91 acquires that the current search level stored by the Cache module needs to be updated. The entry data and the update address corresponding to the entry data are used to write the entry data that needs to be updated by the current search level into the corresponding update address.
在一实施例中,所述第一更新模块91,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包;这里,所述控制包为一个具有特殊标记的控制包,可以随着查找指令流一起进行传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果;所述最高查找级为所有查找级中需要进行数据更新的最上面一个查找级。In an embodiment, the first update module 91 is further configured to: when the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level; where the control packet is a special The marked control packet can be transmitted along with the lookup instruction stream. When the control packet is read out from the FIFO1, the lookup address entering the FIFO2 is an invalid address or an empty address, and correspondingly, the return to the FIFO4 is Empty result; the highest search level is the top search level in all lookup levels that needs to be updated.
在一实施例中,所述第一更新模块91,还配置为确定所述标记包插入当前查找级之前的查找指令均已处理完成时,去使能所述Cache开关,并清空所述Cache模块中存储的当前查找级需要更新的表项数据及所述表项数据对应的更新地址;如此,方便了当前查找级进行下一次更新时需要更新的数据及相应更新地址的写入。In an embodiment, the first update module 91 is further configured to: when it is determined that the search instruction before the tagged packet is inserted into the current search level, the Cache switch is enabled, and the Cache module is cleared. The current search level stored in the file needs updated table item data and an update address corresponding to the table item data; thus, the data that needs to be updated and the corresponding update address are written by the current search level for the next update.
在一实施例中,所述第一更新模块91,还配置为将所述控制包直接送入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新时延,提高了B-tree的更新效率。In an embodiment, the first update module 91 is further configured to send the control packet directly to the next search level; thus, the continuity of the update operation of the B-tree can be ensured, and the update delay is reduced, and the update delay is improved. The update efficiency of B-tree.
在一实施例中,所述第一更新模块91,还配置为检测到查找的当前查找级的某条表项数据错误时,存储所述表项数据及所述表项数据对应的更新地址至所述Cache模块,并使能所述Cache开关,依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复,去使能所述Cache开关;如此,所述Cache模块作为临时备份表被使用,便于控制面进行相应的故障定位和故障处理;In an embodiment, the first update module 91 is further configured to: when detecting that an item of the current search level of the search is incorrect, storing the item data and the update address corresponding to the item data to The Cache module enables the Cache switch to sequentially acquire the read address in the lookup instruction of the current search level, and match the read address with the update address of the current search level to determine that the match is successful according to the The data obtained by the read address is replaced with the data corresponding to the update address until the error is repaired, and the Cache switch is disabled. Thus, the Cache module is used as a temporary backup table, which facilitates the control plane to perform corresponding fault location. And fault handling;
在一实施例中,所述第一更新模块91,还配置为增加另存的当前查找级需要更新的每条表项数据的有效标记,所述有效标记用于标识当前表项 数据是否有效;In an embodiment, the first update module 91 is further configured to add a valid tag of each entry data that needs to be updated by the current current search level, where the valid tag is used to identify the current entry. Whether the data is valid;
当检测到查找的当前查找级的某条表项数据错误,且当前查找级需要进行数据更新时,需要执行以下操作,即依据查找指令中的读地址获取的数据将被替换为所述Cache模块中存储的更新地址对应的数据,由于所述更新地址及其对应的数据在写入所述Cache模块时,可能存在某条更新数据未完全写入,但从FIFO2中出来的查找指令中的读地址为所述未完全写入的数据对应的地址,此时,所述Cache模块中存储的更新地址对应的数据替换依据查找指令中的读地址获取的数据的操作将会出错,因此,第一更新模块91增加所述Cache模块存储的每条表项数据的有效标记,获取当前查找级需要更新的数据及相应的地址后,首先在所述Cache模块中写入表项数据对应的更新地址,并设置有效标记为无效,待所述表项数据写入完成时,设置所述有效标记为有效,待所有表项数据的有效标记均为有效时,再对当前查找级的树结点表项数据或结果表项数据进行更新操作;如此,当检测到查找的当前查找级的某条表项数据错误时,所述Cache模块作为备份表的同时也不会影响对树结点表项数据或结果表项数据的更新。When it is detected that the data of a certain item of the current search level of the search is incorrect, and the current search level needs to perform data update, the following operations are required, that is, the data acquired according to the read address in the lookup instruction is replaced with the Cache module. The data corresponding to the update address stored in the memory, because the update address and its corresponding data are written to the Cache module, there may be some update data not completely written, but the read command from the FIFO 2 reads The address is the address corresponding to the data that is not completely written. At this time, the operation of replacing the data corresponding to the read address in the search instruction by the data corresponding to the update address stored in the Cache module will be an error, and therefore, the first The update module 91 adds the valid tag of each entry data stored by the Cache module, and obtains the update address corresponding to the entry data in the Cache module after acquiring the data and the corresponding address that need to be updated by the current search level. And set the valid flag to be invalid. When the data of the entry is completed, set the valid tag to be valid, and wait for all the entry data. When the valid tag is valid, the tree node entry data or the result table entry data of the current search level is updated; thus, when the data of a certain item of the current search level is found to be incorrect, the cache is detected. The module as a backup table does not affect the update of the tree node entry data or the result table entry data.
图10为本发明实施例二基于路由查找的表项更新装置组成结构示意图;如图10所示,本发明实施例基于路由查找的表项更新装置组成包括:加锁模块11、第二更新模块12及解锁模块13;其中,10 is a schematic structural diagram of a device for updating an entry based on a route search according to a second embodiment of the present invention; as shown in FIG. 10, the device for updating an entry based on a route search includes: a lock module 11 and a second update module. 12 and an unlocking module 13; wherein
所述加锁模块11,配置为在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;The locking module 11 is configured to lock a lookup instruction after entering the control packet of the current search level when the control packet is detected in the current search level;
所述第二更新模块12,配置为确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;The second update module 12 is configured to: when the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
所述解锁模块13,配置为确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指 令。The unlocking module 13 is configured to: when it is determined that the tree node entry data or the result table data of the current search level is updated, the search finger after the control packet entering the current search level is unlocked make.
在一实施例中,所述第二更新模块12,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包;In an embodiment, the second update module 12 is further configured to: when determining that the current search level is the highest search level, insert a control packet at a search instruction entry of the current search level;
这里,所述第二更新模块12确定当前查找级为最高查找级包括:确定当前查找级为所有查找级中需要进行数据更新的最上面一个查找级;Here, the determining, by the second update module 12, that the current search level is the highest search level includes: determining that the current search level is the top search level of all the search levels that need to be updated;
所述控制包为一个具有特殊标记的控制包,可以随着查找指令流正常传输,当所述控制包从FIFO1中被读出被处理时,进入FIFO2的查找地址为无效地址或空地址,相应的,返回至FIFO4的为空结果。The control packet is a control packet with a special flag, which can be normally transmitted along with the lookup instruction stream. When the control packet is read from the FIFO1 and processed, the search address entering the FIFO 2 is an invalid address or an empty address, correspondingly Return to the empty result of FIFO4.
在一实施例中,所述第二更新模块12确定所述控制包进入当前查找级之前的查找指令均已处理完成时,即确定所述控制包进入当前查找级之前的查找指令均已从FIFO队列中清空时,即在FIFO2的队列出口处检测到所述控制包,同时所述控制包的读空数据也返回至FIFO4的出口时;如图6中步骤三所示;In an embodiment, the second update module 12 determines that the search instruction before the control packet enters the current search level has been processed, that is, the search instruction before the control packet enters the current search level has been obtained from the FIFO. When the queue is emptied, that is, the control packet is detected at the queue exit of the FIFO 2, and the read-empty data of the control packet is also returned to the exit of the FIFO 4; as shown in step 3 in FIG. 6;
在一实施例中,所述第二更新模块12更新当前查找级的树结点表项数据或结果表项数据包括:In an embodiment, the updating, by the second update module 12, the tree node entry data or the result entry data of the current search level includes:
所述第二更新模块12读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址中当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址,并将所述当前查找级需要更新的表项数据写入对应的更新地址中;The second update module 12 reads the table item data that needs to be updated in all the search levels that are stored, and the table item data that needs to be updated in the current search level in the update address corresponding to the item data, and the table that needs to be updated in the current search level. An update address corresponding to the item data, and the table item data that needs to be updated by the current search level is written into the corresponding update address;
相应的,所述装置还包括第二缓存模块14,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Correspondingly, the device further includes a second cache module 14 configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
获取第二缓存模块14中存储的所有查找级需要更新的数据及所述数据对应的地址中当前查找级需要更新的数据及所述当前查找级需要更新的数据对应的更新地址,将当前查找级需要更新的数据写入对应的更新地址中;Obtaining the data that needs to be updated in all the search levels stored in the second cache module 14 and the update data corresponding to the data that the current search level needs to update in the address corresponding to the data, and the update address corresponding to the data that needs to be updated by the current search level, and the current search level The data that needs to be updated is written into the corresponding update address;
这里,所述获取第二缓存模块14中存储的所有查找级需要更新的数据 及所述数据对应的地址中当前查找级需要更新的数据及所述当前查找级需要更新的数据对应的更新地址之前,所述方法还包括:第二缓存模块14存储软件写入的所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Here, the obtaining all the search levels stored in the second cache module 14 needs updated data. And the method further includes: the second cache module 14 stores all the search levels written by the software, before the data corresponding to the data needs to be updated by the current search level and the update address corresponding to the data that needs to be updated by the current search level. The updated item data and the updated address corresponding to the item data;
所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;由于结点的数据位宽远大于结果表的数据位宽,分成树结点表及结果表两部分可以有利于硬件存储单元的划分;The stored update table entry data and the update address corresponding to the entry data include: a tree node table portion and a result table portion; since the data bit width of the node is far greater than the data bit width of the result table Dividing into a tree node table and a result table can facilitate the division of hardware storage units;
其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址;The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result part includes: result data that needs to be updated by all the search levels, and the result data Corresponding update address;
所述树结点表部分的存储格式如图4a所示,包括:有效标记、查找级、更新地址及树结点数据;其中,所述有效标记为硬件标识,标记该条更新表项是否有效,查找级标识了该条结点是处于哪一级查找级中;更新地址为树结点对应的物理地址;树结点数据即需要写入实际硬件内存的数据;由于更新树结点时为自上而下的更新,因此,在填写树结点表时,也是按照自上而下的顺序填写,最上一层需要更新的结点填写在结点缓存的第一行,然后顺序向下填写,若某一层需要更新多个结点,该层结点数据间可以不分顺序;The storage format of the tree node table part is as shown in FIG. 4a, and includes: a valid tag, a search level, an update address, and a tree node data; wherein the valid tag is a hardware identifier, and marking whether the update entry is valid. The search level identifies which level of the search level the node is in; the update address is the physical address corresponding to the tree node; the tree node data is the data that needs to be written into the actual hardware memory; Top-down updates, therefore, when filling in the tree node table, it is also filled in the top-down order. The top layer that needs to be updated is filled in the first row of the node cache, and then filled in sequentially. If a layer needs to update multiple nodes, the data of the layer nodes may be in no order;
所述结果部分的存储格式如图4b所示,包括:有效标记、更新地址和结果表项数据;其中,所述有效标记指示该条更新表项是否有效,更新地址为结果表项数据对应的物理地址,结果表项数据即需要写入实际硬件内存的数据。The storage format of the result part is as shown in FIG. 4b, and includes: a valid tag, an update address, and a result entry data; wherein the valid tag indicates whether the update entry is valid, and the update address is corresponding to the result entry data. The physical address, the result table data is the data that needs to be written into the actual hardware memory.
在一实施例中,所述第二更新模块12,还配置为将所述控制包直接送入下一个查找级;如此,可以保证B-tree的更新操作的连贯性,减少更新 时延,提高了B-tree的更新效率。In an embodiment, the second update module 12 is further configured to directly send the control packet to the next search level; thus, the continuity of the update operation of the B-tree can be ensured, and the update is reduced. Delay, improve the update efficiency of B-tree.
本发明实施例中提出的所述第一更新模块、Cache模块、插入模块、确定模块、加锁模块、第二更新模块及解锁模块都可以通过处理器来实现,当然也可通过具体的逻辑电路实现;在实际应用中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等;所述第一缓存模块及第二缓存模块均可由存储器实现。The first update module, the Cache module, the insert module, the determination module, the lock module, the second update module, and the unlock module provided in the embodiment of the present invention may all be implemented by a processor, and may also pass through a specific logic circuit. In practical applications, the processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA), etc.; the first cache module and The second cache module can be implemented by a memory.
本发明实施例中,如果以软件功能模块的形式实现上述基于路由查找的表项更新方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。In the embodiment of the present invention, if the foregoing route search-based entry update method is implemented in the form of a software function module and is sold or used as a stand-alone product, it may also be stored in a computer readable storage medium. Based on such understanding, 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. A computer device (which may be a personal computer, server, or network device, etc.) is caused to perform all or part of the methods described in various embodiments of the present invention. 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. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
相应地,本发明实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机程序,该计算机程序用于执行本发明实施例的上述基于路由查找的表项更新方法。Correspondingly, the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above-mentioned route lookup based update method of the embodiment of the present invention.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。 The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.

Claims (19)

  1. 一种基于路由查找的表项更新方法,所述方法包括:A method for updating an entry based on a route lookup, the method comprising:
    确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;Determining that the control packet enters the current search level, and the search instruction before the control packet has been processed, updating the tree node entry data or the result entry data of the current search level, and simultaneously acquiring the control packet Searching for a read address in the instruction, matching the read address with the update address of the current search level, and determining that the data obtained according to the read address is replaced with the data corresponding to the update address when the match is successful;
    确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;Determining that the tree node entry data or the result table item data update is completed, inserting a markup packet at a search instruction entry of the current search level;
    确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。The tagged packet is discarded when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
  2. 根据权利要求1所述方法,其中,所述确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成之前,所述方法还包括:The method of claim 1, wherein the method further comprises: before the determining that the control packet enters the current lookup level, and the lookup instructions before the control packet have been processed, the method further comprising:
    读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址。Reading the updated table entry data and the update address corresponding to the entry data, and obtaining and saving the entry data that needs to be updated by the current search level and the entry data that needs to be updated by the current search level. Update the address.
  3. 根据权利要求2所述方法,其中,所述存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址包括:树结点表部分及结果表部分;The method according to claim 2, wherein the stored list item data that needs to be updated and the update address corresponding to the item data include: a tree node table part and a result table part;
    其中,所述树结点表部分包括:所有查找级需要更新的结点数据及所述结点数据对应的更新地址;所述结果表部分包括:所有查找级需要更新的结果数据及所述结果数据对应的更新地址。The tree node table part includes: node data that needs to be updated by all the search levels and an update address corresponding to the node data; the result table part includes: result data that needs to be updated by all the search levels, and the result The update address corresponding to the data.
  4. 根据权利要求1或2所述方法,其中,所述确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成之前,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises: before the determining that the control packet enters the current lookup level, and before the lookup instructions before the control packet have been processed, the method further comprises:
    确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插 入所述控制包。When the current search level is determined to be the highest search level, the search command entry at the current search level is inserted. Enter the control package.
  5. 根据权利要求1或2所述方法,其中,所述方法还包括:The method of claim 1 or 2, wherein the method further comprises:
    检测到查找的当前查找级的错误表项数据时,存储所述错误表项数据及所述错误表项数据对应的更新地址,并依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复。When the error table entry data of the current search level is found, the error table entry data and the update address corresponding to the error table entry data are stored, and the read address in the search instruction of the current search level is sequentially obtained, and the The read address is matched with the update address of the current search level. When the match is successful, the data obtained according to the read address is replaced with the data corresponding to the update address until the error is repaired.
  6. 一种基于路由查找的表项更新方法,所述方法包括:A method for updating an entry based on a route lookup, the method comprising:
    在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;When the control packet is detected in the current search level, the search instruction after entering the control packet of the current search level is locked;
    确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;Determining, when the processing instruction before the control packet enters the current search level, that the search instruction has been processed, updating the tree node entry data or the result entry data of the current search level;
    确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令。When it is determined that the tree node entry data or the result entry data update of the current search level is completed, the search instruction after the control packet entering the current search level is unlocked.
  7. 根据权利要求6所述方法,其中,在当前查找级中检测到控制包之前,所述方法还包括:The method of claim 6 wherein before the control packet is detected in the current lookup stage, the method further comprises:
    确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包。When it is determined that the current search level is the highest search level, the control packet is inserted at the search instruction entry of the current search level.
  8. 根据权利要求6或7所述方法,其中,确定所述控制包进入当前查找级之前的查找指令均已处理完成时,所述方法还包括:The method according to claim 6 or 7, wherein, when it is determined that the search instruction before the control packet enters the current search level has been processed, the method further includes:
    将所述控制包直接送入下一个查找级。The control packet is sent directly to the next lookup level.
  9. 根据权利要求6或7所述方法,其中,所述更新当前查找级的树结点表项数据或结果表项数据包括:The method according to claim 6 or 7, wherein the updating the tree node entry data or the result entry data of the current search level comprises:
    读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址中当前查找级需要更新的表项数据及所述当前查找级需要更新的表 项数据对应的更新地址,并将所述当前查找级需要更新的表项数据写入对应的更新地址中。Reading the table item data that needs to be updated in all the search levels that are stored, and the table item data that needs to be updated in the current search level in the update address corresponding to the table item data, and the table that needs to be updated in the current search level. The update address corresponding to the item data, and the table item data that needs to be updated by the current search level is written into the corresponding update address.
  10. 一种基于路由查找的表项更新装置,所述装置包括:第一更新模块、Cache模块、插入模块及确定模块;其中,An apparatus for updating an item based on a route search, the apparatus comprising: a first update module, a Cache module, an insert module, and a determining module; wherein
    所述第一更新模块,配置为确定控制包进入当前查找级,且所述控制包之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据,同时,触发Cache模块;The first update module is configured to: when the control packet enters the current search level, and the search instruction before the control packet has been processed, update the tree node entry data or the result entry data of the current search level, and simultaneously , triggering the Cache module;
    所述Cache模块,配置为依次获取所述控制包之后的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据;The Cache module is configured to sequentially acquire a read address in a lookup instruction after the control packet, and match the read address with an update address of a current lookup level, and determine that the match is successful according to the read address. Data is replaced with data corresponding to the update address;
    所述插入模块,配置为确定所述树结点表项数据或结果表项数据更新完成时,在当前查找级的查找指令入口处插入标记包;The inserting module is configured to: when the tree node entry data or the result table data update is completed, insert a markup packet at a search instruction entry of the current search level;
    所述确定模块,配置为确定所述标记包插入当前查找级之前的查找指令均已处理完成时,丢弃所述标记包。The determining module is configured to discard the tagged packet when it is determined that the lookup instruction before the tagged packet is inserted into the current lookup stage has been processed.
  11. 根据权利要求10所述装置,其中,所述第一更新模块,还配置为读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址,获取并另存当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址;The device according to claim 10, wherein the first update module is further configured to: read the updated entry data of all the search levels that need to be updated and the update address corresponding to the entry data, and obtain and save the current search level. The updated item address and the updated address corresponding to the item data to be updated by the current search level;
    相应的,所述装置还包括第一缓存模块,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址;Correspondingly, the device further includes a first cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data;
    所述Cache模块,还配置为存储当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址。The Cache module is further configured to store the entry data that needs to be updated by the current search level and the update address corresponding to the entry data that needs to be updated by the current search level.
  12. 根据权利要求10或11所述装置,其中,所述第一更新模块,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入控制包。 The apparatus according to claim 10 or 11, wherein said first update module is further configured to: when the current lookup level is determined to be the highest lookup level, insert a control packet at a lookup instruction entry of the current lookup level.
  13. 根据权利要求10或11所述装置,其中,所述第一更新模块,还配置为检测到查找的当前查找级的错误表项数据时,存储所述错误表项数据及所述错误表项数据对应的更新地址至所述Cache模块,并依次获取当前查找级的查找指令中的读地址,将所述读地址与当前查找级的更新地址进行匹配,确定匹配成功时,将依据所述读地址获取的数据替换为所述更新地址对应的数据,直至所述错误修复。The device according to claim 10 or 11, wherein the first update module is further configured to store the error table entry data and the error table entry data when detecting the error table entry data of the current search level of the search Corresponding update address to the Cache module, and sequentially acquiring the read address in the search instruction of the current search level, matching the read address with the update address of the current search level, and determining that the match is successful, according to the read address The acquired data is replaced with the data corresponding to the update address until the error is fixed.
  14. 一种基于路由查找的表项更新装置,所述装置包括:加锁模块、第二更新模块及解锁模块;其中,An apparatus for updating an item based on a route search, the apparatus comprising: a lock module, a second update module, and an unlocking module;
    所述加锁模块,配置为在当前查找级中检测到控制包时,对进入当前查找级的所述控制包之后的查找指令加锁;The locking module is configured to lock a lookup instruction after entering the control packet of the current search level when the control packet is detected in the current search level;
    所述第二更新模块,配置为确定所述控制包进入当前查找级之前的查找指令均已处理完成时,更新当前查找级的树结点表项数据或结果表项数据;The second update module is configured to: when the search instruction before the control packet enters the current search level has been processed, update the tree node entry data or the result entry data of the current search level;
    所述解锁模块,配置为确定当前查找级的树结点表项数据或结果表项数据更新完成时,解锁所述进入当前查找级的所述控制包之后的查找指令。The unlocking module is configured to: when determining that the tree node entry data or the result table item data of the current search level is updated, unlocking the lookup instruction after entering the control packet of the current search level.
  15. 根据权利要求14所述装置,其中,所述第二更新模块,还配置为确定当前查找级为最高查找级时,在当前查找级的查找指令入口处插入所述控制包。The apparatus of claim 14, wherein the second update module is further configured to determine that the current lookup level is the highest lookup level, the control packet being inserted at a lookup instruction entry of the current lookup level.
  16. 根据权利要求14或15所述装置,其中,所述第二更新模块,配置为读取存储的所有查找级需要更新的表项数据及所述表项数据对应的更新地址中当前查找级需要更新的表项数据及所述当前查找级需要更新的表项数据对应的更新地址,并将所述当前查找级需要更新的表项数据写入对应的更新地址中;The device according to claim 14 or 15, wherein the second update module is configured to read the updated entry data of all the search levels that are required to be stored, and the current search level in the update address corresponding to the entry data needs to be updated. The entry data and the update address corresponding to the updated entry data of the current search level, and write the entry data that needs to be updated by the current search level into the corresponding update address;
    相应的,所述装置还包括第二缓存模块,配置为存储所有查找级需要更新的表项数据及所述表项数据对应的更新地址。 Correspondingly, the device further includes a second cache module configured to store the entry data that needs to be updated by all the search levels and the update address corresponding to the entry data.
  17. 根据权利要求14或15所述装置,其中,所述第二更新模块,还配置为将所述控制包直接送入下一个查找级。The apparatus of claim 14 or 15, wherein said second update module is further configured to send said control packet directly to a next lookup stage.
  18. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令用于执行权利要求1至5任一项所述的基于路由查找的表项更新方法。A computer storage medium having stored therein computer executable instructions for performing a route lookup based entry update method according to any one of claims 1 to 5.
  19. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令用于执行权利要求6至9任一项所述的基于路由查找的表项更新方法。 A computer storage medium having stored therein computer executable instructions for performing a route lookup based entry update method according to any one of claims 6 to 9.
PCT/CN2015/080748 2014-12-17 2015-06-04 Item updating method, device and storage medium on the basis of route searching WO2016095450A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410790117.4A CN105791132B (en) 2014-12-17 2014-12-17 A kind of list item update method and device based on multi-path search tree route querying
CN201410790117.4 2014-12-17

Publications (1)

Publication Number Publication Date
WO2016095450A1 true WO2016095450A1 (en) 2016-06-23

Family

ID=56125786

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080748 WO2016095450A1 (en) 2014-12-17 2015-06-04 Item updating method, device and storage medium on the basis of route searching

Country Status (2)

Country Link
CN (1) CN105791132B (en)
WO (1) WO2016095450A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110100214A (en) * 2017-01-27 2019-08-06 三菱电机株式会社 Managing device and management method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302172A (en) * 2015-05-18 2017-01-04 深圳市中兴微电子技术有限公司 Support Hash lookup and the storage of route querying, lookup method and device simultaneously
CN111131015B (en) * 2019-12-27 2021-09-03 芯启源(南京)半导体科技有限公司 Method for dynamically updating route based on PC-Trie

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585358A (en) * 2003-08-19 2005-02-23 华为技术有限公司 Route searching method and system
CN1964311A (en) * 2005-11-10 2007-05-16 中国科学院计算技术研究所 A method to quickly search and update IPv6 routing list
CN103384223A (en) * 2013-07-23 2013-11-06 迈普通信技术股份有限公司 Flow entry updating method and device
CN103780490A (en) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 Method and device for updating routing lookup tree

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8385341B2 (en) * 2008-10-02 2013-02-26 Telefonaktiebolaget L M Ericsson (Publ) Ethernet frame broadcast emulation
CN102307149B (en) * 2011-09-23 2014-05-07 中国科学院计算技术研究所 IP (internet protocol) lookup method and device and route updating method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585358A (en) * 2003-08-19 2005-02-23 华为技术有限公司 Route searching method and system
CN1964311A (en) * 2005-11-10 2007-05-16 中国科学院计算技术研究所 A method to quickly search and update IPv6 routing list
CN103780490A (en) * 2012-10-17 2014-05-07 中兴通讯股份有限公司 Method and device for updating routing lookup tree
CN103384223A (en) * 2013-07-23 2013-11-06 迈普通信技术股份有限公司 Flow entry updating method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110100214A (en) * 2017-01-27 2019-08-06 三菱电机株式会社 Managing device and management method

Also Published As

Publication number Publication date
CN105791132A (en) 2016-07-20
CN105791132B (en) 2019-08-06

Similar Documents

Publication Publication Date Title
US8868926B2 (en) Cryptographic hash database
EP3035613B1 (en) Ccn routing using hardware-assisted hash tables
JP6764359B2 (en) Deduplication DRAM memory module and its memory deduplication method
WO2018064962A1 (en) Data storage method, electronic device and computer non-volatile storage medium
US8219587B2 (en) Method for searching a tree structure
US9495398B2 (en) Index for hybrid database
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
US9361238B2 (en) Memory addressing mechanism using a buffer of a hierarchy of collision free hash tables
US7805427B1 (en) Integrated search engine devices that support multi-way search trees having multi-column nodes
CN103780490B (en) A kind of method and device for updating route querying tree
US20150143065A1 (en) Data Processing Method and Apparatus, and Shared Storage Device
JP5842768B2 (en) Deduplication apparatus, deduplication method, and deduplication program
CN106599091B (en) RDF graph structure storage and index method based on key value storage
CN112632079B (en) Query method and device for data stream identification
WO2016095450A1 (en) Item updating method, device and storage medium on the basis of route searching
US11838222B2 (en) In-line data identification on network
US8180958B2 (en) Key selection device and process for content-addressable memory
US20170277811A1 (en) Efficient conditional state mapping in a pattern matching automaton
CN113377689B (en) Routing table item searching and storing method and network chip
Kuo et al. A memory-efficient TCAM coprocessor for IPv4/IPv6 routing table update
US9396286B2 (en) Lookup with key sequence skip for radix trees
US20170278001A1 (en) Improved pattern matching
JPH1166095A (en) Data managing device
WO2019126154A1 (en) System and method for data storage management
CN115633097B (en) ACL (access control list) compression method and device

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

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

Country of ref document: EP

Kind code of ref document: A1