CN116975061A - Data processing device, method and chip - Google Patents

Data processing device, method and chip Download PDF

Info

Publication number
CN116975061A
CN116975061A CN202310961328.9A CN202310961328A CN116975061A CN 116975061 A CN116975061 A CN 116975061A CN 202310961328 A CN202310961328 A CN 202310961328A CN 116975061 A CN116975061 A CN 116975061A
Authority
CN
China
Prior art keywords
target
index address
storage unit
service type
content addressing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310961328.9A
Other languages
Chinese (zh)
Inventor
张学利
张健源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yunbao Intelligent Co ltd
Original Assignee
Shenzhen Yunbao Intelligent Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yunbao Intelligent Co ltd filed Critical Shenzhen Yunbao Intelligent Co ltd
Priority to CN202310961328.9A priority Critical patent/CN116975061A/en
Publication of CN116975061A publication Critical patent/CN116975061A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30098Register arrangements

Abstract

The application relates to a data processing device, a method and a chip. The device stores the corresponding relation between the service type and the index address in the first storage unit, so that the control unit can search in the first storage unit according to the acquired target service type when searching data, and the first target index address of the tri-state content addressing unit is acquired. This is equivalent to screening the entries stored in the ternary content addressing unit, and when the subsequent control unit performs entry matching in the ternary content addressing unit according to the obtained target key, only the target key may be matched with the entries stored at the first target index address, and other entries may be skipped directly. Therefore, the situation that the matched table item is not the table item applicable to the target service type due to the fact that the table items are not differentiated among the service types can be improved, and accordingly matching accuracy is improved.

Description

Data processing device, method and chip
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing apparatus, a data processing method, and a data processing chip.
Background
The state of each bit in the ternary content addressable memory (Ternary Content Addressable Memory, TCAM) can be either a "0" or a "1" or a third state, the "don't care", and therefore referred to as "tri-state", which provides the TCAM with a screening function for the bit fields of the data sought. This allows both exact match and fuzzy match searches, whereas CAM has no third state, so exact match searches are only possible. In addition, all the entries in the TCAM table can be accessed in parallel, for example, if the TCAM has 100 table entries, the 100 table entries can be compared at one time, and compared with the common polling searching method, the searching speed is improved.
In the related art, when a TCAM table is searched through a key, a plurality of entries in the TCAM table may be hit. Each table entry corresponds to an index address, and typically, the TCAM only returns the table entry with the smallest index address as the final matching table entry. However, what is required for the actual traffic scenario may not be the entry with the smallest index address, which results in insufficiently accurate matching.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a stored data processing apparatus, method, and chip that can improve matching accuracy.
In one aspect, the present application provides a data processing apparatus comprising:
the device comprises a first storage unit, a three-state content addressing unit, a second storage unit and a control unit;
the first storage unit is used for storing the corresponding relation between the service type and the index address;
the three-state content addressing unit is used for storing the table entries according to the index addresses;
a second storage unit for storing data according to the index address;
the control unit is used for acquiring the target service type and the target key; searching a first storage unit according to the target service type to obtain a first target index address of the three-state content addressing unit; according to the first target index address and the target key, matching the table items stored in the three-state content addressing unit to obtain a second target index address aiming at a second storage unit; and acquiring the data stored at the second target index address in the second storage unit.
In one embodiment, the first storage unit stores data through a two-dimensional table, rows in the two-dimensional table are used for representing index addresses of the three-state content addressing unit, and columns in the two-dimensional table are used for representing service types; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
In one embodiment, the two-dimensional table is a two-dimensional bit table, and data stored in the two-dimensional bit table is divided into two values of 1 and 0;
wherein, a value of 1 is used for representing that a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column, and a value of 0 is used for representing that no corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
In one embodiment, the control unit is specifically configured to obtain, for a target column corresponding to a target service type in the two-dimensional bit table, a target column vector corresponding to the target column; and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
In one embodiment, the control unit is specifically configured to traverse the ternary content addressing unit according to the index address, match an entry stored in the ternary content addressing unit at the first target index address with the target key when traversing to the first target index address, and use the first target index address as the second target index address for the second storage unit when the matching is passed.
In one embodiment, the apparatus further comprises: a third storage unit;
the control unit is further configured to send configuration information to the third storage unit, where the configuration information carries an item to be configured, data to be configured, a service type corresponding to the item to be configured, and an index address corresponding to the item to be configured and the data to be configured;
on the other hand, the application also provides a data processing method, which is applied to a data processing system, wherein the data processing system at least comprises a first storage unit, a three-state content addressing unit, a second storage unit and a control unit, and the method comprises the following steps:
the control unit acquires a target service type and a target key;
searching a first storage unit according to the target service type to obtain a first target index address aiming at the content addressing unit, wherein the first storage unit is pre-stored with a corresponding relation between the service type and the index address;
according to the first target index address and the target key, matching the table items stored in the three-state content addressing unit to obtain a second target index address aiming at a second storage unit;
and acquiring the data stored at the second target index address in the second storage unit.
In one embodiment, the first storage unit stores data through a two-dimensional table, rows in the two-dimensional table are used for representing index addresses of the three-state content addressing unit, and columns in the two-dimensional table are used for representing service types; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
In one embodiment, the two-dimensional table is a two-dimensional bit table, and data stored in the two-dimensional bit table is divided into two values of 1 and 0;
wherein, a value of 1 is used for representing that a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column, and a value of 0 is used for representing that no corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
In one embodiment, searching the first storage unit according to the target service type to obtain the corresponding first target index address includes:
aiming at a corresponding target column of the target service type in a two-dimensional bit table, obtaining a corresponding target column vector of the target column;
and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
In one embodiment, matching the table entry stored in the content addressing unit according to the first target index address and the target key to obtain a second target index address for the second storage unit includes:
traversing the content addressing unit according to the index address, and skipping the traversed index address under the condition of traversing to a non-first target index address;
And under the condition of traversing to the first target index address, matching the table item stored at the first target index address in the content addressing unit with the target key, and under the condition that the matching is passed, taking the first target index address as a second target index address aiming at the second storage unit.
In one embodiment, the pre-configuration process of each of the first storage unit, the content addressing unit, and the second storage unit includes:
the configuration information is sent to a third storage unit, wherein the configuration information carries the to-be-configured table item, the to-be-configured data, the service type corresponding to the to-be-configured table item and the index address corresponding to the to-be-configured table item and the to-be-configured data;
writing the to-be-configured table item into the content addressing unit from the third storage unit according to the index address, and writing the to-be-configured data into the second storage unit from the third storage unit;
and writing the corresponding relation between the index address and the service type into the first storage unit by the third storage unit.
In another aspect, the application also provides a chip comprising the data processing device mentioned above.
According to the storage data processing device, the method and the chip, the corresponding relation between the service type and the index address is stored in the first storage unit, so that the control unit can search in the first storage unit according to the acquired target service type when searching data, and the first target index address of the three-state content addressing unit is acquired. This is equivalent to screening the entries stored in the ternary content addressing unit, and when the subsequent control unit performs entry matching in the ternary content addressing unit according to the obtained target key, only the target key may be matched with the entries stored at the first target index address, and other entries may be skipped directly.
This improves the situation in the previous scheme that the matched table entry is not the table entry applicable to the target service type because the table entry is not differentiated among the service types, and improves the matching precision. Furthermore, for a service type, corresponding first target index addresses of the service type in the first storage unit can be matched with the target keys according to corresponding table entries of each first target index address, so that a plurality of second target index addresses can be obtained as long as a plurality of matching exists, the possibility of failure in matching is reduced, and the matching success rate is improved.
Also, since software function intervention is not required for control, the subsequent search process is guided by the content searched in the first storage unit, so that the complexity of the overall process can be reduced. Finally, since the table entry and the information bit in the key are not occupied to represent the service type in the whole process, the situation that the effective coverage of the matching process is affected due to the occupation of the information bit in the key in the previous scheme can be improved, so that the information bit in the key can be released, and the matching precision can be relatively improved.
Drawings
FIG. 1 is a block diagram of a data processing apparatus in one embodiment;
FIG. 2 is a block diagram of a data processing apparatus in another embodiment;
FIG. 3 is a flow diagram of a data processing method in one embodiment;
FIG. 4 is a schematic diagram of a 2-dimensional bitmap according to an embodiment;
FIG. 5 is a flow chart of a data processing method in yet another embodiment;
FIG. 6 is a schematic diagram of a storage structure of configuration information in one embodiment;
FIG. 7 is a schematic diagram of a storage structure supporting a service field in one embodiment;
FIG. 8 is a flow diagram of an entry configuration process in one embodiment;
FIG. 9 is a flow diagram of an overall configuration and matching process in one embodiment;
fig. 10 is an internal structural view of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
In the related art, when a TCAM table is searched through a key, a plurality of entries in the TCAM table may be hit. Each table entry corresponds to an index address, and typically, the TCAM only returns the table entry with the smallest index address as the final matching table entry. However, what is required for the actual traffic scenario may not be the entry with the smallest index address, which results in insufficiently accurate matching. For example, the entry returned by the TCAM with the smallest index address may be applicable to service type 1, but the service type corresponding to the actual service scenario is service type 2, where software intervention of the control plane is usually required to intervene in the entry.
Further, if the control is interposed by a software function, such as setting other entries having index addresses lower than the required entry in the plurality of entries to be invalid, although there is an entry that may enable the returned index address to be the minimum in the actual service scenario as the required entry, the overall control is still not controllable, and the complexity of the overall processing is increased by the software control.
Or, through software function intervention control, the required table entry is written into a position with a lower index address in advance before searching, so that the searching process can be involved in an additional software control process, and the complexity of overall processing is increased; and writing the desired entry at up to a low index address is also not controllable.
Or, if the Key carries the service type to distinguish in the matching, to characterize the service scenario for which the current searching process is specific. In the case where the Key is of a given length, this occupies the information bits of the Key to characterize the actual traffic type by the occupied information bits. It will be appreciated that this reduces the effective length of the key when subsequently matching with the TCAM entry, which can affect the effective coverage of the matching process and reduce the accuracy of the matching. For example, assuming that the length of Key used in matching is 128bits, and the entire TCAM supports 4 service types, at least 2bits are needed in Key to distinguish services, and the real Key used is only 126bits.
In order to solve the problems mentioned above, in one embodiment, a data processing apparatus is provided. Before describing embodiments of the present application, concepts that may be related to the embodiments of the present application will now be described:
TCAM: the ternary content addressing memory is mainly used for quickly searching list items such as ACL, route and the like.
TCAM entry: entries or entries in the TCAM table.
NP: a network processor is a programmable device that is specifically adapted for various tasks in the communications field, such as packet processing, protocol analysis, route lookup, voice/data aggregation, firewall or QoS, etc.
Key: the method refers to information which is extracted from a message header by a network processor NP and needs to be searched, and the information needs to be arranged into a format consistent with the table entry stored in a TCAM, which is called key.
CSR: control Status Register, i.e. control status registers, are used to configure or record the status of some operations.
SRAM: static Random-Access Memory, i.e., static Random Access Memory, is one type of Random Access Memory. By "static", it is meant that such memory is constantly maintained for data stored therein as long as it remains powered on. In contrast, data stored in Dynamic Random Access Memory (DRAM) needs to be periodically updated.
Bitmap: a data storage method in which a bit state is used to represent a state of a certain characteristic; by defining the length and width of the graph, a corresponding number of storage spaces can be defined, each of which can store a value of 0 or 1.
APB bus: advanced Peripheral Bus, i.e. the advanced peripheral bus, is mainly used for connections between low bandwidth peripheral peripherals.
Addr: an address; in the embodiment of the application, index addresses are referred to.
In combination with the above conceptual description, an embodiment of the present application provides a data processing apparatus, which can be applied to a chip such as DPU (Data Processing Unit). Based on the above description, as shown in fig. 1, the apparatus includes: a first memory unit 102, a ternary content addressing unit 104, a second memory unit 106, and a control unit 108;
a first storage unit 102 for storing a correspondence between the service type and the index address of the ternary content addressing unit;
a ternary content addressing unit 104, configured to store entries according to index addresses;
a second storage unit 106 for storing data according to the index address;
a control unit 108, configured to obtain a target service type and a target key; searching the first storage unit 102 according to the target service type to obtain a first target index address of the ternary content addressing unit 104; according to the first target index address and the target key, matching the table items stored in the ternary content addressing unit 104 to obtain a second target index address for the second storage unit 106; the data stored in the second storage unit 106 at the second target index address is retrieved.
The first storage unit 102 may store data in advance, where the stored data is mainly used to characterize which service types are involved, and which index addresses corresponding to each service type are involved. In an actual implementation process, the data structure adopted by the first storage unit 102 when pre-storing data may be a data table, further may be a two-dimensional bit table bitmap, or may be a array structure, which is not limited in particular in the embodiment of the present application.
The ternary content addressing unit 104 is mainly configured to store entries according to index addresses, and may perform a lookup process for the entries based on the key when the key is subsequently arrived. Each entry stored in the ternary content addressing unit 104 corresponds to an index address, that is, the storage address of the entry in the ternary content storage unit 104, and content matching is performed between the entry and the stored entry through a key, so that under the condition that matching is successful (that is, searching hit), a second target index address corresponding to the hit entry, that is, the content addressing process, is obtained.
The entries are stored in the ternary content addressing unit 104. It will be appreciated that for a certain service type, some of the entries stored in the ternary content addressing unit 104 may not be applicable to that service type, and that applicable entries may be referred to as valid entries for that service type. In practical implementations, the active entries may be used exclusively by the service type, i.e. exclusive; other service types are also possible, i.e. common, to be used together with the service type.
For the exclusive entry of the service type, the storage space correspondingly occupied by the exclusive entry in the ternary content addressing unit 104 may be referred to as a private area of the service type. For a common entry between that service type and other service types, the storage space that the common entry occupies in the ternary content addressing unit 104, respectively, may be referred to as a common region in the ternary content addressing unit 104.
As can be seen from the foregoing, the index address is the storage address of the entry in the ternary content addressing unit 104. After determining the first target index address corresponding to the target service type, each index address may be traversed one by one according to the sequence of the index addresses in the ternary content addressing unit 104, so as to match the target key with the table entry stored in each index address correspondingly.
Because the first target index address corresponding to the target service type is determined before, in the process of performing item matching according to the sequence of the index addresses, if the traversed index address is not the first target index address of the target service type, the item corresponding to the index address can be skipped. If the traversed index address is the first target index address of the target service type, the corresponding stored table entry of the index address can be matched with the target key.
In the process of matching the ternary content addressing unit 104 with the target key, if matching is performed, the control unit 108 may determine the first target index address corresponding to the matched table entry as the second target index address for the second storage unit. In obtaining the second target index address for the second storage unit 106, the data stored at the second target index address may be looked up in the second storage unit 106 that actually stores the data. After the data is obtained, the data may be returned to the command requester, such as a Master.
In the above embodiment, by storing the correspondence between the service type and the index address in the first storage unit 102, when the control unit 108 searches the data, it may first search the first storage unit 102 according to the obtained target service type to obtain the first target index address of the ternary content addressing unit 104. This is equivalent to screening the entries stored in the ternary content addressing unit 104, and when the subsequent control unit 108 performs entry matching in the ternary content addressing unit 104 according to the obtained target key, only the target key may be matched with the entries stored at the first target index address, and other entries may be skipped directly.
This improves the situation in the previous scheme that the matched table entry is not the table entry applicable to the target service type because the table entry is not differentiated among the service types, and improves the matching precision. Furthermore, for a service type, corresponding first target index addresses of the service type in the first storage unit can be matched with the target keys according to corresponding table entries of each first target index address, so that a plurality of second target index addresses can be obtained as long as a plurality of matching exists, the possibility of failure in matching is reduced, and the matching success rate is improved.
Also, since software function intervention is not required for control, the subsequent search process is guided by the content searched in the first storage unit, so that the complexity of the overall process can be reduced. Finally, since the table entry and the information bit in the key are not occupied to represent the service type in the whole process, the situation that the effective coverage of the matching process is affected due to the occupation of the information bit in the key in the previous scheme can be improved, so that the information bit in the key can be released, and the matching precision can be relatively improved.
In some embodiments, the first storage unit stores data via a two-dimensional table; the rows in the two-dimensional table are used for representing index addresses of the three-state content addressing units, and the columns in the two-dimensional table are used for representing service types; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
Specifically, each row in the two-dimensional table may correspond to an index address, and each column may correspond to a service type. The index address order corresponding to each row may be consistent with the traversal order in which the index addresses in the ternary content addressable units are traversed. For example, if the index addresses corresponding to the entries stored in the ternary content addressing unit are addr1023, addr1022, … …, and addr0 in order, the first row in the two-dimensional table may correspond to addr1023, the second row may correspond to addr1022, … …, and the last row may correspond to addr0. The first column in the two-dimensional table may correspond to service 0, the second column may correspond to service 1, and so on. Of course, in actual implementation, the reverse may be also possible, that is, the row corresponds to the service type, the column corresponds to the index address, which is not limited in particular in the embodiment of the present application.
It can be seen that the dimension of the two-dimensional table may be related to the total number of service types and the total number of index addresses, for example, the total number of service types is m, and the total number of index addresses is n, and the dimension of the two-dimensional table is m×n, that is, the two-dimensional table stores m×n numbers. The data stored in the two-dimensional table is used for representing the index address corresponding to the row to which the data belongs and whether the data is the index address corresponding to the service type corresponding to the column to which the data belongs. The characters may be defined in advance, or the numerals may be defined, which is not particularly limited in the embodiment of the present application.
For example, for the data of the a-th row and the b-th column, if the data is 1, because 1 is defined as the index address corresponding to the row and the index address corresponding to the service type corresponding to the column in advance, the index address corresponding to the a-th row and the index address corresponding to the service type corresponding to the b-th column can be determined.
In the above embodiment, the index addresses corresponding to the service types are stored by the two-dimensional table in the first storage unit, and only the mapping relationship between the two is stored, so that the storage space can be saved. In addition, when the tri-state content addressing unit searches later, other table entries can be skipped by utilizing the two-dimensional table aiming at the target service type, and only the table entry at the first target index address corresponding to the target service type is matched. This improves the situation in the previous scheme that the matched table entry is not the table entry applicable to the target service type because the table entry is not differentiated among the service types, and improves the matching precision.
As can be seen from the foregoing, for each row in the two-dimensional table, if there are multiple identical data in the row vector corresponding to the current row and multiple identical data are used to indicate that there is a correspondence between the corresponding service type and the index address corresponding to the current row, then multiple service types corresponding to the multiple identical data are all corresponding to the same first target index address. Therefore, the table items applicable to the plurality of service types in the three-state content addressing unit are the same, and are all the table items stored in the three-state content addressing unit at the same first target index address. It is known that an entry is stored in a memory space in a ternary content addressable unit. Based on the above situation, the storage mode can be optimized in the process of pre-storing the table entries.
Thus, in some embodiments, for any row in the two-dimensional table, when there is a plurality of identical data in a row vector corresponding to the row and a correspondence exists between a corresponding service type and an index address corresponding to the row, only one set of table entry storage unit space is allocated to store a table entry corresponding to the row when the table entry corresponding to the row is stored in the ternary content addressing unit. That is, there are a plurality of identical data in the row, which means that for the index address corresponding to the ternary content addressing unit of the row, there are entries stored at the index address in common for a plurality of service types.
For ease of understanding, the data in the two-dimensional table is described as being divided into 1 and 0, with dimensions 1024×4 of the two-dimensional table. Wherein, the data is 1, representing the index address corresponding to the row and the index address corresponding to the business type corresponding to the column; the data is 0 to represent the corresponding index address of the row and the corresponding index address of the business type of the column.
Based on the above description, for a certain row corresponding to a certain index address, the row may form a row vector. It will be appreciated that there may be multiple identical data in the row vector, such as multiple 1 s or multiple 0 s. For example, if the first, second, and third columns are 1, the fourth column is 0, and the first to fourth columns respectively represent traffic 0 to traffic 3, it may be determined that the index address is an index address corresponding to traffic 0 to traffic 2, but not an index address corresponding to traffic 3.
Thus, it can be determined that a plurality of service types corresponding to a plurality of identical data (i.e., a plurality of identical 1) are service 0 to service 2, respectively. That is, the index addresses corresponding to traffic 0 to traffic 2 are the same, that is, correspond to the same entry. At this time, if the storage spaces are respectively allocated to the services 0 to 2 in the content addressing space to store the same table entry, 3 table entry storage unit spaces are occupied to store one same table entry, and the storage space is wasted. If the storage space is not allocated to the service 0 to the service 2, but only one table entry storage unit space is allocated to store the table entry, the storage space can be saved.
At this time, only one memory space allocated corresponds to the concept "common area in the tristate content addressing unit" mentioned before. If an entry in the allocated storage space is exclusively used, i.e. exclusive, by a certain service type, the allocated storage space corresponds to the concept "private area in a ternary content addressable unit" mentioned in the foregoing.
In the above embodiment, in the process of pre-storing the table entries in the ternary content addressing unit, a part of storage space may be used for storing the common table entries for a plurality of service types applicable to the same table entry, so that the storage space can be saved.
In some embodiments, the two-dimensional table is a two-dimensional bit table, and the data stored in the two-dimensional bit table is divided into two values of 1 and 0; wherein, a value of 1 is used for representing that a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column, and a value of 0 is used for representing that no corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
In the above embodiment, since the two-dimensional bit table is used to characterize the index address corresponding to the service type, and the column vector is further used to characterize the index address corresponding to a certain service type, the storage space can be saved.
In some embodiments, the control unit is specifically configured to obtain, for a target column corresponding to a target service type in the two-dimensional bit table, a target column vector corresponding to the target column; and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
From the foregoing, it is known that, for a row corresponding to an index address, the row may form a row vector, and data in the row vector may be used to characterize the index address, which of all columns correspond to the corresponding service types. And a column corresponding to a certain service type can form a column vector, and data in the column vector can be used for representing corresponding index addresses of which rows are index addresses corresponding to the service type.
Therefore, in the embodiment of the application, the corresponding target column vector of the target service type in the two-dimensional bit table can be obtained. Meanwhile, as the two-dimensional table is a two-dimensional bit table, the obtained target column vector is composed of 1 and 0, and the target column vector can be used for guiding the searching process in the three-state content addressing unit based on the target key. Specifically, for the elements with the value of 1 in the target column vector, the index addresses corresponding to the rows to which the elements belong can be used as the first target index address, so that the target key can be matched with the table entry stored at the first target index address in the ternary content addressing unit later.
In the above embodiment, when the target service type is searched in the ternary content addressing unit, other entries can be skipped by using the corresponding column vector, and only the entries stored at the index address corresponding to the target service type are matched, so that the matching accuracy can be improved.
In some embodiments, the control unit is specifically configured to traverse the ternary content addressing unit according to the index address, match an entry stored in the ternary content addressing unit at the first target index address with the target key when traversing to the first target index address, and use the first target index address as the second target index address for the second storage unit when the matching is passed.
As can be seen from the foregoing, each row in the two-dimensional bit table may correspond to an index address and each column may correspond to a traffic type. The index address order corresponding to each row may be consistent with the traversal order in which the index addresses in the ternary content addressable units are traversed. For example, if the index addresses corresponding to the entries stored in the ternary content addressing unit are addr1023, addr1022, … …, and addr0 in order, the first row in the two-dimensional bit table may correspond to addr1023, the second row may correspond to addr1022, … …, and the last row may correspond to addr0.
Therefore, in the actual searching process, the target key can be matched with the table entry stored at the addr1023 index address. Before matching, the first index address is used to obtain the first line data (the index address corresponding to the first line is addr 1023) in the target column vector, so as to guide the matching process.
Specifically, if the data is 1, it indicates that the first index address is the index address corresponding to the target service type, so that the table entry stored at the first index address can be matched with the target key. In the event that a match passes, it is determined that the entry is found to hit, then the first index address may be taken as the second target index address for the second storage unit. If the match fails, it is indicated that the first index address is not the second target index address for the second storage unit. If the data is 0, it indicates that the first index address is not the index address corresponding to the target service type, so that the first index address can be skipped, that is, the entry stored at the first index address can be skipped.
If the first index address is skipped, the second row data (addr 1022 is the index address corresponding to the second row) may be obtained from the target column vector to be used for guiding the matching process, and the following specific matching process may refer to the previous description for the first row. Each index address can refer to the previous process, and the searching process for the tri-state content addressing unit can be completed through the previous process.
In the above embodiment, when searching in the ternary content addressing unit, for the target service type, other entries can be skipped by using the corresponding column vector, and only the entries at the index address corresponding to the target service type are matched, so that the data processing amount can be reduced, and the matching efficiency in the searching process can be improved.
It can be appreciated that the data stored in the first storage unit, the ternary content addressing unit and the second storage unit can be configured in advance to implement the subsequent respective data searching process. Thus, in some embodiments, as shown in FIG. 2, the data processing apparatus further comprises a third storage unit 110;
the control unit is further configured to send configuration information to the third storage unit 110, where the configuration information carries an entry to be configured, data to be configured, a service type corresponding to the entry to be configured, and an index address corresponding to the entry to be configured and the data to be configured;
Writing the list item to be configured into a three-state content addressing unit from a third storage unit 110 according to the index address, and writing the data to be configured into a second storage unit from the third storage unit 110;
the corresponding relation between the index address and the service type is written into the first storage unit by the third storage unit 110.
Specifically, the third storage unit 110 may be used for a memory of a configuration state, such as CSR, which is not limited in detail in the embodiment of the present application. The data plane Master may send the configuration information to the third storage unit 110 through a transmission channel. Wherein each configuration information may be used to configure an entry.
Because the tri-state content addressing unit needs to store the table entry according to the index address, the second storage unit also needs to store data according to the index address, and the first storage unit naturally also relates to the index address because of the index address corresponding to the service type, so that for a certain table entry to be configured, the configuration information can carry the index address to be configured corresponding to the table entry to be configured.
And because the configuration of the table items is needed to be carried out in the tri-state content addressing unit, the configuration information can carry the table items to be configured. Similarly, because the data for representing the corresponding relation between the service type and the index address needs to be configured in the first storage unit, the configuration information can carry the service type corresponding to the to-be-configured table item besides the to-be-configured index address. The data configuration is required to be performed in the second storage unit, so that the configuration information can carry the data to be configured.
It is understood that the configuration information may be stored in a certain format when stored in the third storage unit 110. For example, it is required to determine where each item of information (such as data to be configured, a service type corresponding to an item to be configured, etc.) is stored, how much space is occupied by each item of information, etc. In practical implementation, the storage format may not be limited, for example, the to-be-configured table entry, the to-be-configured data, the to-be-configured index address, and the support service field may be sequentially stored in the third storage unit 110. The support service field is used for characterizing which service types the index address to be configured corresponds to. The number of storage space bits occupied by each item of information can be the same or different, and can be specifically set according to the size of the information.
The format of the supporting service field may also be a bit vector, for example, a bit line vector, which is used to characterize the corresponding relationship between the index address to be configured and the service type corresponding to the table entry to be configured. Wherein each column represents a type of traffic. If the index address to be configured is the index address corresponding to a certain column of the corresponding service type, the numerical value of the column can be 1; conversely, it may be 0. Of course, in practical implementation, the supporting service field may also take other formats, which are not limited in particular by the embodiment of the present application. After the configuration information is issued to the third storage unit 110, the configuration information may be written according to the data requirements of the first storage unit, the ternary content addressing unit, and the second storage unit, respectively.
In the above embodiment, before the matching process is searched, the first storage unit, the ternary content addressing unit and the second storage unit may be preconfigured first, so that when the ternary content addressing unit is searched later, other table entries can be skipped for the target service type by combining the configuration process with the searching process, and only the table entry stored at the index address corresponding to the target service type is matched, thereby improving the matching accuracy.
The foregoing is mainly for explaining the data processing apparatus provided by the embodiment of the present application from a product perspective. In practical implementation, the embodiment of the application also provides a method which is applied to a data processing system, wherein the data processing system at least comprises a first storage unit, a three-state content addressing unit, a second storage unit and a control unit. The method may be performed by a control unit, referring to fig. 3, the method comprising:
step 302, the control unit acquires the target service type and the target key.
The control unit may acquire the target service type and the target key by acquiring a matching command carrying the target service type and the target key. Specific procedures are referred to in the foregoing description and will not be repeated here.
Step 304, searching a first storage unit according to the target service type to obtain a first target index address for the content addressing unit, wherein the first storage unit is pre-stored with the corresponding relation between the service type and the index address.
The first storage unit may store data in advance, where the stored data is mainly used to characterize which service types are involved, and which index addresses corresponding to each service type are involved. The specific process of searching may be referred to in the foregoing description, and will not be described herein.
And 306, matching the table entries stored in the ternary content addressing unit according to the first target index address and the target key to obtain a second target index address aiming at the second storage unit.
The ternary content addressing unit is mainly used for storing table entries according to index addresses, and can perform a lookup process for the table entries based on the key when the key arrives subsequently. Each table item stored in the ternary content addressing unit 1 is corresponding to an index address, namely, the storage address of the table item in the ternary content storage unit, and content matching can be carried out on the stored table item through a key. The matching procedure may be referred to in the foregoing, and will not be described in detail herein.
Step 308, obtaining the data stored at the second target index address in the second storage unit.
The control unit obtains a second target index address, and reads the data from the second storage unit according to the second target index address. After the data is obtained, the data may be returned to the data plane Master mentioned previously.
In the above embodiment, the corresponding relationship between the service type and the index address is stored in the first storage unit, so that when the control unit searches the data, the control unit may first search the first storage unit according to the obtained target service type to obtain the first target index address of the ternary content addressing unit. This is equivalent to screening the entries stored in the ternary content addressing unit, and when the subsequent control unit performs entry matching in the ternary content addressing unit according to the obtained target key, only the target key may be matched with the entries stored at the first target index address, and other entries may be skipped directly.
This improves the situation in the previous scheme that the matched table entry is not the table entry applicable to the target service type because the table entry is not differentiated among the service types, and improves the matching precision. Furthermore, for a service type, corresponding first target index addresses of the service type in the first storage unit can be matched with the target keys according to corresponding table entries of each first target index address, so that a plurality of second target index addresses can be obtained as long as a plurality of matching exists, the possibility of failure in matching is reduced, and the matching success rate is improved.
Also, since software function intervention is not required for control, the subsequent search process is guided by the content searched in the first storage unit, so that the complexity of the overall process can be reduced. Finally, since the table entry and the information bit in the key are not occupied to represent the service type in the whole process, the situation that the effective coverage of the matching process is affected due to the occupation of the information bit in the key in the previous scheme can be improved, so that the information bit in the key can be released, and the matching precision can be relatively improved.
In some embodiments, the first storage unit stores data via a two-dimensional table, rows in the two-dimensional table being used to characterize the index address of the ternary content addressing unit, columns in the two-dimensional table being used to characterize the traffic type; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
For specific explanation, reference is made to the foregoing, and no further description is given here.
In the above embodiment, the index addresses corresponding to the service types are stored by the two-dimensional table in the first storage unit, and only the mapping relationship between the two is stored, so that the storage space can be saved. In addition, when the tri-state content addressing unit searches later, other table entries can be skipped by utilizing the two-dimensional table aiming at the target service type, and only the table entry at the first target index address corresponding to the target service type is matched. This improves the situation in the previous scheme that the matched table entry is not the table entry applicable to the target service type because the table entry is not differentiated among the service types, and improves the matching precision.
In some embodiments, the two-dimensional table is a two-dimensional bit table, and the data stored in the two-dimensional bit table is divided into two values of 1 and 0; the value of 1 is used for representing that the corresponding index address of the row and the corresponding service type of the column have a corresponding relation, and the value of 0 is used for representing that the corresponding index address of the row and the corresponding service type of the column have no corresponding relation.
For specific explanation, reference is made to the foregoing, and no further description is given here.
In the above embodiment, since the two-dimensional bit table is used to characterize the index address corresponding to the service type, and the column vector is further used to characterize the index address corresponding to a certain service type, the storage space can be saved. In addition, when the target service type is searched in the tri-state content addressing unit later, other table entries can be skipped by utilizing the corresponding column vector, and only the table entries stored at the index address corresponding to the target service type are matched, so that the matching precision can be improved.
In some embodiments, searching the first storage unit according to the target service type to obtain a corresponding first target index address includes: aiming at a corresponding target column of the target service type in a two-dimensional bit table, obtaining a corresponding target column vector of the target column; and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
For specific explanation, reference is made to the foregoing, and no further description is given here.
In the above embodiment, when the target service type is searched in the ternary content addressing unit, other entries can be skipped by using the corresponding column vector, and only the entries stored at the index address corresponding to the target service type are matched, so that the matching accuracy can be improved.
In some embodiments, matching the entries stored in the content addressing unit according to the first target index address and the target key to obtain a second target index address for the second storage unit includes:
traversing the content addressing unit according to the index address, and skipping the traversed index address under the condition of traversing to a non-first target index address; and under the condition of traversing to the first target index address, matching the table item stored at the first target index address in the content addressing unit with the target key, and under the condition that the matching is passed, taking the first target index address as a second target index address aiming at the second storage unit.
For specific explanation, reference is made to the foregoing, and no further description is given here.
When searching in the three-state content addressing unit, other table items can be skipped by utilizing the corresponding column vector aiming at the target service type, and only the table item at the index address corresponding to the target service type is matched, so that the data processing amount can be reduced, and the matching efficiency in the searching process can be improved.
In some embodiments, the pre-configuration process of each of the first storage unit, the content addressing unit, and the second storage unit includes:
the configuration information is sent to a third storage unit, wherein the configuration information carries the to-be-configured table item, the to-be-configured data, the service type corresponding to the to-be-configured table item and the index address corresponding to the to-be-configured table item and the to-be-configured data; writing the to-be-configured table item into the content addressing unit from the third storage unit according to the index address, and writing the to-be-configured data into the second storage unit from the third storage unit; and writing the corresponding relation between the index address and the service type into the first storage unit by the third storage unit.
For specific explanation, reference is made to the foregoing, and no further description is given here.
Before searching the matching process, the first storage unit, the ternary content addressing unit and the second storage unit can be respectively preconfigured, so that when the ternary content addressing unit searches for the target service type later, other table items can be skipped by utilizing the two-dimensional table, and only the table items stored at the index address corresponding to the target service type are matched by combining the configuration process with the searching process, thereby improving the matching precision.
In order to facilitate understanding, the embodiment of the present application further provides an application scenario, where the application scenario is mainly used in a TCAM-based data searching process, and the above-mentioned stored data processing method may be applied. Thus, the first memory cell mentioned in the above embodiment may be specifically a 2-dimensional bitmap, the second memory cell may be an SRAM, and the third memory cell may be a CSR. The above mentioned entries may correspond to entries in a TCAM; the two-dimensional bit table may correspond to a table stored in a 2-dimensional bitmap, which may be directly represented by the 2-dimensional bitmap.
The key of this process flow is the data structure of the 2-dimensional bitmap, and reference is specifically made to fig. 4. Let 4 service types be service 0, service 1, service 2 and service 3, respectively, and the TCAM has a depth of 1024, which is divided into addr1023, addr1022, … …, addr0, i.e. 1024 index addresses in total. Correspondingly, in fig. 4, the 2-dimensional bitmap is divided into 4 columns, each column corresponding to a service type; the method is transversely divided into 1024 addresses, and each address corresponds to an index address of a storage table item in the TCAM one by one.
In fig. 4, the corresponding bit of service 1 in addr0 is 1, and the corresponding bit of other service types is 0, which indicates that the entry at the position in TCAM is exclusive to service 1, and when TCAM matching is performed for other service types, the address is skipped automatically, that is, the entry is skipped.
The corresponding bit of the service 0 and the service 2 in the addr1 is 1, the corresponding bit of other service types is 0, which means that the entry at the position in the TCAM is shared by the service 0 and the service 2, and the address can be automatically skipped when the TCAM matching is performed for other service types.
Corresponding bits of service 0, service 1 and service 3 in addr2 are 1, corresponding bits of service 2 are 0, which means that entry at the position in TCAM is shared by service 0, service 1 and service 3, and the address is skipped automatically when TCAM matching is performed for service 2.
all traffic corresponding bits in addr1023 are 1, which means that entry at that location in TCAM is shared by traffic 0, traffic 1, traffic 2 and traffic 3. It can be derived from this that the valid entry corresponding to each service type can be displayed in the 2-dimensional bitmap, and a high value (i.e., 1) indicates that the entry is valid for that service type.
In combination with the above description, as shown in fig. 5, the application of the data processing method in the application scenario is as follows:
step 502, the control plane configures the registers sequentially through the APB bus, and when configuring one table entry, the control plane notifies the hardware to write the content in the CSR into TCAM, SRAM and 2-dimensional bitmap respectively.
Based on the above description about the 2-dimensional bitmap, a specific configuration procedure of each entry will now be described.
Specifically, the user may issue the entry through the APB of the host computer, a process which may be referred to as control plane access. The APB has access to each register within the CSR by a register set within the CSR. When the entry is issued, the APB bus writes to a set of registers in the CSR. Wherein the structure of the set of registers may be as shown in fig. 6, the data stored in the set of registers may correspond to the configuration information in the previous content.
In fig. 6, tcam_data and tcam_mask together form an entry in TCAM, sram_data is data stored in SRAM, addr is index address common to TCAM and SRAM. The support service indicates which one or more of service types of service 0, service 1, service 2 and service 3 is currently supported by the entry, and the support service may correspond to the "support service field" in the previous contents, and reference may be made to the schematic diagram of the support service field as shown in fig. 7.
In fig. 7, the supported traffic field is 4bits, each bit corresponding to a traffic type. If bit0 is 1 and bit1, bit2 and bit3 are 0, it means that the entry only supports service 0, that is, the entry is only a valid entry of service 0. If bit0 and bit1 are 1, bit2 and bit3 are 0, this means that the entry supports service 0 and service 1, and so on.
Returning to FIG. 6, in FIG. 6, the number of bits occupied by both tcam_data and tcam_mask is 80bits, the number of bits occupied by sram_data is 64bits, the number of bits occupied by addr is 10bits, and the number of bits occupied by the supporting service is 4bits. The data channel bit width of an APB is typically 32bits when forwarding entries through the APB.
The 80bit wide fields of FIG. 6 may use 2 32bits registers and 1 16bits registers in the CSR, and other widths may be analogized. For the current table entry, after all the registers in the group are written, the APB may issue a valid signal again, which indicates that the registers in the group have been written, and the hardware may write the contents of the registers in TCAM, SRAM, and 2-dimensional bitmap, so as to complete the configuration process for the current table entry. The configuration process may specifically refer to fig. 8, that is, the configuration is performed on the 2-dimensional bitmap, TCAM, and SRAM through CSR.
Step 504, the above process is repeated until all entries are written into TCAM.
Specifically, the configuration process of each subsequent table entry may refer to the configuration process described above until all table entries are configured.
Step 506, the data plane Master sends a matching command.
And step 508, inquiring the 2-dimensional bitmap according to the target service type carried in the matching command, and obtaining the 1-dimensional bitmap indexed out of the 2-dimensional bitmap by the target service type.
The 1-dimensional bitmap corresponds to the "target column vector" in the previous content, and the search process can refer to the previous description.
Step 510, searching in the TCAM based on the target key and the 1-dimensional bitmap carried in the matching command.
The 1-dimensional bitmap may be equivalent to an entry mask corresponding to the target service type in the process of searching the TCAM for the target service type. From the foregoing, it can be seen that using 2-dimensional bitmap corresponds to demarcating a private area for each traffic type and a common area for all traffic types in the TCAM.
As will be explained again in connection with the foregoing, the private area can effectively avoid that service 0 matches the entry of service 1. The common area can unify common table items of multiple service types, namely, only one table item storage unit space is adopted for storage, so that the storage space can be saved. Meanwhile, the shared area can be flexibly configured, and can be shared by 2 service types, or 3 or 4 service types.
Step 512, determine if the lookup process hits.
Specifically, entries in the TCAM may be sequentially matched based on the target key. It should be noted that if an entry in the TCAM is not a valid entry of the target service type in the match command, the entry will be skipped in actual matching, that is, only the valid entry is matched.
For each entry, if the target key matches the current entry successfully, then it may be determined that the target key hits the current entry, at which point the process may jump to step 514. If not, the process may jump to step 516.
And step 514, based on the hit table entry, corresponding storage data is read in the SRAM, and the read data is returned to the data plane Mater.
Specifically, the TCAM may return an index of the hit entry (corresponding to the "target index address" in the previous content). And using the index to read the SRAM, and returning the read data to the data plane Mater.
Step 516, the information of the miss is used as the matching result of the matching command, and the information is returned to the data plane match.
The overall process of the above configuration and matching may refer to fig. 9, in fig. 9, the control plane APB bus may issue configuration information to the CSR, and based on the content stored in the CSR, may perform table entry configuration on TCAM, store number configuration on SRAM, and perform configuration on the correspondence between service type and index address (corresponding to valid table entry) on 2-dimensional bitmap.
After a matching command is acquired through a matching data stream inlet, a corresponding 1-dimensional bitmap can be searched in the 2-dimensional bitmaps according to the target service type carried in the matching command. And then, controlling the searching process in the TCAM based on the 1-dimensional bitmap, and searching according to the target key carried in the matching command. In the case of a search hit, the TCAM returns an index address corresponding to the hit entry, reads data from the SRAM according to the index address, and returns the read data through the matching data stream port.
In the above embodiment, the index address corresponding to each service type is represented by the data stored in advance in the 2-dimensional bitmap. Before searching in the TCAM, the corresponding target service type in the searching process can be determined according to the matching command, and searching is performed in the 2-dimensional bitmap according to the target service type so as to obtain the index address corresponding to the target service type. This is equivalent to screening the entries in the TCAM, so that when matching is performed in the subsequent search process, only the entry corresponding to the corresponding index address is matched with the target key, and other entries can be skipped directly.
In the above embodiment, by storing the correspondence between the service type and the index address in the first storage unit 102, when the control unit 108 searches the data, it may first search the first storage unit 102 according to the obtained target service type to obtain the first target index address of the ternary content addressing unit 104. This is equivalent to screening the entries stored in the ternary content addressing unit 104, and when the subsequent control unit 108 performs entry matching in the ternary content addressing unit 104 according to the obtained target key, only the target key may be matched with the entries stored at the first target index address, and other entries may be skipped directly.
Therefore, the situation that the matched table item is not the table item applicable to the target service type due to the fact that the table item is not differentiated among the service types in the prior art scheme is improved, and matching accuracy is improved. Furthermore, for a service type, corresponding first target index addresses of the service type in the first storage unit can be matched with the target keys according to corresponding table entries of each first target index address, so that a plurality of second target index addresses can be obtained as long as a plurality of matching exists, the possibility of failure in matching is reduced, and the matching success rate is improved.
Also, since software function intervention is not required for control, the subsequent search process is guided by the content searched in the first storage unit, so that the complexity of the overall process can be reduced. Finally, since the table entry and the information bit in the key are not occupied to represent the service type in the whole process, the situation that the effective coverage of the matching process is affected due to the occupation of the information bit in the key in the previous scheme can be improved, so that the information bit in the key can be released, and the matching precision can be relatively improved.
It should be noted that the application scenario is an exemplary application scenario, which is used to help understand the scheme of the present application, and is not used to limit the actual application scenario of the present application.
It should be understood that, although the steps in the flowcharts related to the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
In some embodiments, a chip is provided, the chip comprising the data processing apparatus of the first embodiment.
In some embodiments, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store entries. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data processing method.
It will be appreciated by those skilled in the art that the structure shown in FIG. 10 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In an embodiment, there is also provided a computer device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the steps of the method embodiments described above when the computer program is executed.
In one embodiment, a computer-readable storage medium is provided, storing a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
In an embodiment, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the steps of the method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the embodiments provided herein may include at least one of a relational database and a non-relational database. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processor referred to in the embodiments provided in the present application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, or the like, but is not limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The foregoing examples illustrate only a few embodiments of the application and are described in detail herein without thereby limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of the application should be assessed as that of the appended claims.

Claims (13)

1. A data processing apparatus, comprising: the device comprises a first storage unit, a three-state content addressing unit, a second storage unit and a control unit;
the first storage unit is used for storing the corresponding relation between the service type and the index address of the three-state content addressing unit;
the three-state content addressing unit is used for storing table entries according to index addresses thereof;
The second storage unit is used for storing data according to the index address;
the control unit is used for acquiring a target service type and a target key; searching the first storage unit according to the target service type to obtain a first target index address of the tri-state content addressing unit; according to the first target index address and the target key, matching the table items stored in the three-state content addressing unit to obtain a second target index address aiming at a second storage unit; and acquiring data stored in the second storage unit at the second target index address.
2. The apparatus of claim 1, wherein the first storage unit stores data in a two-dimensional table, rows in the two-dimensional table being used to characterize index addresses of the ternary content addressing units, and columns in the two-dimensional table being used to characterize traffic types; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
3. The apparatus of claim 2, wherein the two-dimensional table is a two-dimensional bit table, and the data stored in the two-dimensional bit table is divided into two values of 1 and 0;
Wherein, a value of 1 is used for representing that a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column, and a value of 0 is used for representing that no corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
4. The apparatus according to claim 3, wherein the control unit is specifically configured to obtain, for a corresponding target column of the target service type in the two-dimensional bit table, a target column vector corresponding to the target column; and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
5. The apparatus according to claim 1, wherein the control unit is specifically configured to traverse the ternary content addressing unit according to an index address, match an entry stored in the ternary content addressing unit at the first target index address with the target key if traversing to the first target index address, and use the first target index address as a second target index address for a second storage unit if matching passes.
6. The apparatus according to any one of claims 1 to 5, further comprising: a third storage unit;
the control unit is further configured to send configuration information to the third storage unit, where the configuration information carries an entry to be configured, data to be configured, a service type corresponding to the entry to be configured, and an index address corresponding to the entry to be configured and the data to be configured;
writing the to-be-configured table entry from the third storage unit to the ternary content addressing unit according to the index address, and writing the to-be-configured data from the third storage unit to the second storage unit;
and writing the corresponding relation between the index address and the service type into the first storage unit by the third storage unit.
7. A data processing method, applied to a data processing system, the data processing system comprising at least a first storage unit, a ternary content addressing unit, a second storage unit, and a control unit, the method comprising:
the control unit acquires a target service type and a target key;
searching the first storage unit according to the target service type to obtain a first target index address of the ternary content addressing unit, wherein the first storage unit is pre-stored with a corresponding relation between the service type and the index address of the ternary content addressing unit;
According to the first target index address and the target key, matching the table items stored in the three-state content addressing unit to obtain a second target index address aiming at a second storage unit;
and acquiring data stored in the second storage unit at the second target index address.
8. The method of claim 7, wherein the first storage unit stores data via a two-dimensional table, rows in the two-dimensional table being used to characterize index addresses of tri-state content addressing units, and columns in the two-dimensional table being used to characterize traffic types; the data stored in the two-dimensional table is at least used for representing whether a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
9. The apparatus of claim 8, wherein the two-dimensional table is a two-dimensional bit table, and the data stored in the two-dimensional bit table is divided into two values of 1 and 0;
wherein, a value of 1 is used for representing that a corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column, and a value of 0 is used for representing that no corresponding relation exists between the index address corresponding to the belonging row and the service type corresponding to the belonging column.
10. The method of claim 9, wherein the searching the first storage unit according to the target service type to obtain the corresponding first target index address includes:
aiming at a corresponding target column of the target service type in the two-dimensional bit table, obtaining a corresponding target column vector of the target column;
and aiming at the element with the value of 1 in the target column vector, taking the index address corresponding to the row to which the element belongs as a first target index address.
11. The method of claim 7, wherein said matching the entries stored in the content addressing unit according to the first target index address and the target key to obtain a second target index address for a second storage unit comprises:
traversing the content addressing unit according to the index address, and skipping the traversed index address under the condition of traversing to the first target index address;
and under the condition of traversing to the first target index address, matching the table entry stored in the content addressing unit at the first target index address with the target key, and under the condition of passing matching, taking the first target index address as a second target index address aiming at a second storage unit.
12. The method according to any one of claims 7 to 11, wherein the pre-configuration procedure of each of the first storage unit, the content addressing unit and the second storage unit comprises:
the configuration information is issued to a third storage unit, wherein the configuration information carries an item to be configured, data to be configured, a service type corresponding to the item to be configured and index addresses corresponding to the item to be configured and the data to be configured;
writing the to-be-configured table entry from the third storage unit to the content addressing unit according to the index address, and writing the to-be-configured data from the third storage unit to the second storage unit;
and writing the corresponding relation between the index address and the service type into the first storage unit by the third storage unit.
13. A chip comprising a data processing device according to any one of claims 1-6.
CN202310961328.9A 2023-07-31 2023-07-31 Data processing device, method and chip Pending CN116975061A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310961328.9A CN116975061A (en) 2023-07-31 2023-07-31 Data processing device, method and chip

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310961328.9A CN116975061A (en) 2023-07-31 2023-07-31 Data processing device, method and chip

Publications (1)

Publication Number Publication Date
CN116975061A true CN116975061A (en) 2023-10-31

Family

ID=88474576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310961328.9A Pending CN116975061A (en) 2023-07-31 2023-07-31 Data processing device, method and chip

Country Status (1)

Country Link
CN (1) CN116975061A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230379177A1 (en) * 2022-05-20 2023-11-23 Optum Services (Ireland) Limited Network-wide supervision in a hierarchically-segmented blockchain network

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230379177A1 (en) * 2022-05-20 2023-11-23 Optum Services (Ireland) Limited Network-wide supervision in a hierarchically-segmented blockchain network

Similar Documents

Publication Publication Date Title
US20240143169A1 (en) Method for Improving Message Storage Efficiency of Network Chip, Device, and Storage medium
US7281085B1 (en) Method and device for virtualization of multiple data sets on same associative memory
US9871727B2 (en) Routing lookup method and device and method for constructing B-tree structure
CN107528783B (en) IP route caching with two search phases for prefix length
CN111937360B (en) Longest prefix matching
CN116975061A (en) Data processing device, method and chip
US10095720B2 (en) Database table index
US20100228914A1 (en) Data caching system and method for implementing large capacity cache
CN108134739B (en) Route searching method and device based on index trie
US9049157B1 (en) Method and device for improving scalability of longest prefix match
CN110555001B (en) Data processing method, device, terminal and medium
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
CN111552520B (en) User-defined application identification method and system
US9436403B1 (en) Memory controller with on-chip linked list memory
CN117435912A (en) Data packet index and retrieval method based on network data packet attribute value length characteristics
JP2012155650A (en) Router and many-core system
JP2006246488A (en) Network router, address processing method, and computer program
US9703484B2 (en) Memory with compressed key
US11899985B1 (en) Virtual modules in TCAM
US10795580B2 (en) Content addressable memory system
US20180054386A1 (en) Table lookup method for determing set membership and table lookup apparatus using the same
WO2001067456A2 (en) Multiple entry matching in a content addressable memory
EP3203388B1 (en) Database table index
CN116225314A (en) Data writing method, device, computer equipment and storage medium
CN112035380B (en) Data processing method, device and equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination