Message query processing method and device, chip, equipment and readable storage medium
By using hash calculation and jump link pointer to query packet information in the storage configuration table and shared jump link list in network service processing, the problem of long message query delay is solved, and query efficiency and cache utilization are improved.
Patent Information
- Application Number
- CN202411640417.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-18
AI Technical Summary
In network service processing, the delay in querying packet content is long, especially in the case of limited hardware, which leads to query misses and external cache interactions, increasing query time.
The hash result is calculated as the query address by calculating the hash result by the query key value of the message to be queried, and the first stored row is queried in the storage configuration table, and when the link jump indication information of the first stored row indicates that the linked list pointer is valid, the target information is queried in the shared link jump list using the linked list pointer.
By storing entries in series in the storage configuration table and the shared jump list, the utilization and hit rate of on-chip cache is improved, and the dependence on external caches is reduced and query latency is reduced.
Smart Images

Figure CN119646030A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip technology, and in particular to a message query processing method, apparatus, chip, device and readable storage medium. Background Art
[0002] In network service processing, there's a need to query relevant information based on message content. This can be done in a variety of ways, such as using the message's Internet Protocol (IP) address (source and destination IP addresses) to find the address where the relevant information is stored. Due to the high volume of network service processing, message content queries typically require a relatively short completion time.
[0003] In related technologies, message content queries can be performed through hashing (HASH). The HASH table can convert the information of the message to be queried into a key value of a specific integer through a HASH function. The size of the key value is consistent with the depth of the stored data. Subsequently, the integer generated by the HASH function can be used as the subscript of the relevant information of the message to be queried, and the relevant information of the message to be queried can be stored in the space of the subscript. When querying the message content, the location of the relevant information of the message to be queried can be calculated according to the HASH function rules. Since multiple data can be stored in the same location, it is necessary to check whether the key value corresponding to the data stored in the location is consistent with the key value of the message to be queried. If the key value corresponding to the data stored in the location is consistent with the key value of the message to be queried, the relevant information of the message to be queried is obtained from the data stored in the location.
[0004] However, while multiple data items can be stored in the same location, the hardware is limited in the amount of data it can store in the same location, resulting in query misses. In the event of a query miss, the missed data can be stored in an external cache. During a query, the hardware interacts with the external cache to retrieve relevant information about the message being queried. However, the need to interact with the external cache results in longer query latency. Summary of the Invention
[0005] Based on this, it is necessary to provide a message query processing method, device, chip, equipment and readable storage medium that can reduce query delay to address the above technical problems.
[0006] In a first aspect, the present application provides a message query method, comprising:
[0007] Get the message to be queried;
[0008] Determining a query key value corresponding to the message to be queried based on the information in the message to be queried;
[0009] Performing a hash calculation on the query key value corresponding to the message to be queried as an input of a first hash function to obtain a first hash calculation result, and using the first hash calculation result as the query address of the message to be queried;
[0010] Querying a first storage row corresponding to the query address in a storage configuration table, and matching key values corresponding to a plurality of storage entries in the first storage row with the query key value respectively;
[0011] If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, then according to the linked list pointer of the first storage row, the target query information of the message to be queried is queried in the shared jump chain table.
[0012] In one embodiment, searching the shared jump list for target query information of the message to be queried according to the linked list pointer of the first storage row includes:
[0013] According to the linked list pointer of the first storage row, query the second storage row in the shared skip linked list at least once until the first target key value in any storage entry in the queried second storage row successfully matches the query key value;
[0014] The target query information of the message to be queried is extracted from the storage entry corresponding to the first target key value.
[0015] In one embodiment, querying the second storage row in the shared skip list at least once according to the linked list pointer of the first storage row includes:
[0016] Using the linked list pointer of the second storage row found in the Nth query in the shared jump linked list as the index for the N+1th query;
[0017] Determine a second storage row for the N+1th query according to the index of the N+1th query;
[0018] Matching key values corresponding to multiple storage entries in the second storage row queried for the N+1th time with the query key value respectively;
[0019] The index of the first query in the shared skip list is the list pointer of the first storage row, and N is an integer greater than or equal to 1.
[0020] In one embodiment, after matching the key values corresponding to the plurality of storage entries in the first storage row with the query key value respectively, the method further includes:
[0021] If a second target key value exists in the key values corresponding to the plurality of storage entries in the first storage row and successfully matches the query key value, the target query information of the message to be queried is extracted from the storage entry corresponding to the second target key value.
[0022] In one embodiment, the method further comprises:
[0023] Receive a message configuration request, wherein the message configuration request includes a key value of a message to be configured and query information;
[0024] Performing a hash calculation on the key value of the message to be configured as an input of a first hash function to obtain a second hash calculation result, and using the second hash calculation result as the configuration address of the message to be configured;
[0025] querying in the storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address;
[0026] If there is an idle storage entry in the first storage row corresponding to the configuration address, select a target storage entry from the idle storage entries according to a preset writing order, and write the key value and query information of the message to be configured into the target storage entry;
[0027] The target storage entry is modified from the idle state to a non-idle state.
[0028] In one embodiment, after querying the storage configuration table to see whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address, the method further includes:
[0029] If there is no idle storage entry in the first storage row corresponding to the configuration address, applying for a linked list pointer of the first storage row corresponding to the configuration address in the shared skip linked list;
[0030] Using the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index, determining the second storage row corresponding to the configuration address in the shared jump linked list;
[0031] Writing the key value and query information of the message to be configured into an idle storage entry in the second storage row corresponding to the configuration address;
[0032] The linked list pointer of the first storage row corresponding to the configuration address applied for in the shared skip list is written into the first storage row corresponding to the configuration address, and the skip chain indication information of the first storage row corresponding to the configuration address is set to indicate that the linked list pointer is valid.
[0033] In one embodiment, the method further comprises:
[0034] If there are no idle storage entries in the first storage row and the second storage row corresponding to the configuration address, a configuration instruction of the hash function is generated, wherein the configuration instruction includes a second hash function.
[0035] Using the second hash function to replace the first hash function, and updating the storage configuration table and the shared skip list according to the second hash function;
[0036] The configuration address corresponding to the second hash function has a storage entry in the idle state in the first storage row or the second storage row.
[0037] In a second aspect, the present application provides a message query device, comprising:
[0038] An acquisition module is used to obtain the message to be queried;
[0039] a determination module, configured to determine a query key value corresponding to the message to be queried based on information in the message to be queried; perform a hash calculation using the query key value corresponding to the message to be queried as an input to a hash function to obtain a first hash calculation result, and use the first hash calculation result as the query address of the message to be queried;
[0040] a matching module, configured to query a first storage row corresponding to the query address in a storage configuration table, and match key values corresponding to a plurality of storage entries in the first storage row with the query key value respectively;
[0041] A query module is configured to query the target query information of the message to be queried in the shared skip list according to the linked list pointer of the first storage row if the key values corresponding to all storage entries in the first storage row fail to match the query key value and the skip chain indication information of the first storage row indicates that the linked list pointer is valid.
[0042] In one embodiment, the query module is further used to query the second storage row in the shared jump linked list at least once according to the linked list pointer of the first storage row, until the first target key value in any storage entry in the queried second storage row successfully matches the query key value; and extract the target query information of the message to be queried from the storage entry corresponding to the first target key value.
[0043] In one embodiment, the query module is further used to use the linked list pointer of the second storage row queried for the Nth time in the shared jump linked list as the index of the N+1th query; determine the second storage row queried for the N+1th query based on the index of the N+1th query; and match the key values corresponding to multiple storage entries in the second storage row queried for the N+1th query with the query key value respectively; wherein the index of the first query in the shared jump linked list is the linked list pointer of the first storage row, and N is an integer greater than or equal to 1.
[0044] In one embodiment, the query module is also used to extract the target query information of the message to be queried from the storage entry corresponding to the second target key value if there is a second target key value in the key values corresponding to the multiple storage entries in the first storage row that successfully matches the query key value.
[0045] In one embodiment, the message query device further includes:
[0046] A configuration module is used to receive a message configuration request, wherein the message configuration request includes a key value and query information of a message to be configured; perform a hash calculation on the key value of the message to be configured as an input of a first hash function to obtain a second hash calculation result, and use the second hash calculation result as the configuration address of the message to be configured; query in the storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address; if there is a storage entry in an idle state in the first storage row corresponding to the configuration address, select a target storage entry from the idle state storage entries according to a preset writing order, and write the key value and query information of the message to be configured into the target storage entry; and modify the target storage entry from the idle state to a non-idle state.
[0047] In one embodiment, the configuration module is further used to apply for a linked list pointer of the first storage row corresponding to the configuration address in the shared jump linked list if there is no idle storage entry in the first storage row corresponding to the configuration address; use the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index to determine the second storage row corresponding to the configuration address in the shared jump linked list; write the key value and query information of the message to be configured into the idle storage entry in the second storage row corresponding to the configuration address; write the linked list pointer of the first storage row corresponding to the configuration address applied for in the shared jump linked list into the first storage row corresponding to the configuration address, and set the jump chain indication information of the first storage row corresponding to the configuration address to indicate that the linked list pointer is valid.
[0048] In one embodiment, the configuration module is further used to generate a configuration instruction for the hash function if there is no idle storage entry in the first storage row and the second storage row corresponding to the configuration address, the configuration instruction including a second hash function, use the second hash function to replace the first hash function, and update the storage configuration table and the shared skip list according to the second hash function; wherein, the configuration address corresponding to the second hash function has an idle storage entry in the first storage row or the second storage row.
[0049] In a third aspect, the present application further provides a chip comprising a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the message query method of the first aspect mentioned above is implemented.
[0050] In a fourth aspect, the present application further provides a network interface card, comprising the chip of the third aspect and a plurality of interfaces, wherein the chip communicates externally through the interfaces.
[0051] In a fifth aspect, the present application also provides a computer device comprising a central processing unit and the chip of the third aspect above, wherein the chip is used to dispatch messages to the central processing unit or the chip itself for processing, and the central processing unit is used to process messages dispatched by the chip.
[0052] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the message query method of the first aspect described above.
[0053] In a seventh aspect, the present application also provides a computer program product, including a computer program, which implements the message query method of the first aspect when executed by a processor.
[0054] The above-mentioned message query processing method, device, chip, equipment and readable storage medium first obtain the message to be queried, and determine the query key value corresponding to the message to be queried based on the information in the message to be queried. Secondly, the query key value corresponding to the message to be queried is used as the input of the first hash function to perform hash calculation to obtain a first hash calculation result, and the first hash calculation result is used as the query address of the message to be queried. Thirdly, the first storage row corresponding to the query address is queried in the storage configuration table, and the key values corresponding to the multiple storage entries in the first storage row are matched with the query key value respectively. Finally, if the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, then according to the linked list pointer of the first storage row, the target query information of the message to be queried is queried in the shared jump chain table. The message query processing method provided in this application uses the hash calculation result calculated from the query key value corresponding to the message to be queried as the query address. The method first searches the first storage row corresponding to the query address in the storage configuration table for the message to be queried. If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, the method searches the shared jump chain table for the message to be queried. Because multiple storage entries are placed in the same address in the storage configuration table and the shared jump chain table in series, the utilization and hit rate of the on-chip cache are improved, eliminating the need to store storage entries in the external cache and eliminating the need to interact with the external cache during queries, thereby reducing query latency. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0056] Figure 1 A flowchart of a message query method provided in an embodiment of the present application;
[0057] Figure 2 A schematic diagram illustrating the principle of a message query method provided in an embodiment of the present application;
[0058] Figure 3 A flowchart of another message query method provided in an embodiment of the present application;
[0059] Figure 4 A flowchart of another message query method provided in an embodiment of the present application;
[0060] Figure 5A structural block diagram of a message query device provided in an embodiment of the present application;
[0061] Figure 6 This is a diagram of the internal structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical solutions and advantages of this application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0063] First, the related technology will be described below.
[0064] In network service processing, there's a need to query relevant information based on message content. This query can be performed in a variety of ways, such as using the message's Internet Protocol (IP) address (source and destination IP addresses) to find the storage address for the relevant information. Due to the high volume of network service processing, message content queries are typically required to be completed quickly. For example, given a group of randomly input query messages, the storage address of the target query information corresponding to the group of query messages can be quickly found within one to four cycles.
[0065] In the related art, there are multiple ways of message query.
[0066] In the first approach, if the data width of the input message to be queried is short, a linear table approach can be used to perform message queries. For example, the input message to be queried can be used as an address index, and the value corresponding to the input message to be queried (X) can be directly used as the storage address (addr) of the target query information to complete the message query. In the linear table query approach, if the data width of the message to be queried (X) is 8 bits (BIT), only a linear table with a depth of 256 is required.
[0067] However, performing message queries using a linear table approach typically requires hardware support for a linear table. When the data width of the message to be queried is relatively long, the table entries in the linear table consume a large amount of resources, and may even be unavailable in hardware due to the excessive resource usage. Therefore, performing message queries using a linear table approach can typically only handle situations where the data width of the input message to be queried is relatively short, such as situations where the message to be queried is less than 32K bits, or where the bit width corresponding to the message to be queried is less than 15 bits.
[0068] In the second method, content-addressable memory (CAM) can be used for message queries. CAM matches the incoming query message with the CAM message header. Based on the CAM message header, it finds the target query information for the query message. The target query information for the query message is stored in the same location as the source IP and destination IP combination.
[0069] However, since CAM requires a customized memory structure, its frequency is limited and it is difficult to meet the bandwidth requirements of network processing. In addition, CAM has capacity limitations, and a CAM exceeding a certain capacity (for example, 4K depth multiplied by 64-bit width) is physically difficult to implement.
[0070] In the third method, the message query can be performed using the HASH method. The HASH table can convert the information of the message to be queried into a key value of a specific integer through the HASH function, and the size of the key value is consistent with the depth of the stored data. Subsequently, the integer converted by the HASH function can be used as the subscript of the array that stores the relevant information of the message to be queried. When querying the message content, the location of the relevant information of the message to be queried can be calculated according to the HASH function rules. Since multiple data can be stored in the same location, it is necessary to check whether the key value corresponding to the data stored in the location is consistent with the key value of the message to be queried. If the key value corresponding to the data stored in the location is consistent with the key value of the message to be queried, the relevant information of the message to be queried is obtained from the data stored in the location.
[0071] Among them, since the HASH function is a many-to-one mapping, when storing data, the message to be queried needs to be stored in the space. Generally, multiple messages to be queried and corresponding target query information can be stored under the same address. For example, 8, 12, 16, etc. can be stored.
[0072] However, while multiple data items can be stored in the same location, the hardware is limited in the amount of data it can store in the same location, resulting in query misses. In the event of a query miss, the missed data can be stored in an external cache. During a query, the hardware interacts with the external cache to retrieve relevant information about the message being queried. However, the need to interact with the external cache results in longer query latency.
[0073] For example, the address of the same location can be represented by a way. 8-way means that the same address can store eight pieces of data, and the key values of these eight pieces of data can be mapped to the same address. It should be understood that the hardware has a limited number of data that can be stored at a single address (limited ways), which can lead to lookup misses. For example, using an 8-way approach, the utilization rate of 128KB of storage entries is typically around 85%, and the first conflict occurs, on average, when the storage reaches 30% of its capacity.
[0074] To solve the above-mentioned technical problems, embodiments of the present application provide a message query processing method, apparatus, chip, device, and readable storage medium. Using a hash calculation result calculated using a query key value corresponding to a message to be queried as a query address, the first storage row corresponding to the query address in the storage configuration table is first queried for the message to be queried. When the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, the message to be queried is queried in the shared jump chain table. By placing multiple storage entries at the same address in the storage configuration table and the shared jump chain table in series, the utilization and hit rate of the on-chip cache are improved, eliminating the need to store storage entries in an external cache and eliminating the need to interact with the external cache during queries, thereby reducing query latency.
[0075] The message query processing method provided in the embodiments of the present application can be applied to network devices. It should be understood that the embodiments of the present application do not limit the type of network device. In some embodiments, the network device can be a data processing unit (DPU), a network interface card (NIC), a server (Sever), a network adapter (Network Adapter), a switch (Switch), or a router (Router).
[0076] In an exemplary embodiment, Figure 1 As shown, a message query method is provided, which is described by taking the application of the method to a network device as an example. The message query method includes S201-S205.
[0077] S201: Obtain the message to be queried.
[0078] In the present application, when information related to a query message is needed, the network device can obtain the message to be queried so as to subsequently determine the location of the corresponding target query information based on the message to be queried.
[0079] It should be understood that the embodiments of the present application do not limit how to obtain the message to be queried. For example, the message to be queried can be sent by an external device to the network device, or the message to be queried can be generated by a module in the network device.
[0080] For example, Figure 2 A schematic diagram of the principle of a message query method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the network device includes a software module and a hardware module. The software module can send a message to be queried to the hardware module, and the hardware module processes the message to be queried and queries the target query information of the message to be queried. The hardware module can be a chip on the network device.
[0081] It should be understood that the embodiment of the present application does not limit the message type of the message to be queried, and it can be any type of message.
[0082] S202: Determine a query key value corresponding to the message to be queried based on information in the message to be queried.
[0083] In this step, after the network device obtains the message to be queried, it can determine the query key value corresponding to the message to be queried based on the information in the message to be queried.
[0084] Among them, the information in the above-mentioned message to be queried may include one or more information such as the source IP and destination IP corresponding to the message to be queried, the identifier of the message to be queried, the message type of the message to be queried, etc., and the embodiment of the present application does not limit this.
[0085] In some embodiments, a mapping relationship can be pre-established between the information in the message to be queried and the query key corresponding to the message to be queried, and the mapping relationship can be recorded in a mapping relationship table. When the network device obtains the message to be queried, it can extract the information in the message to be queried from the message to be queried, match it with the mapping relationship table, and obtain the query key corresponding to the message to be queried based on the successfully matched mapping relationship.
[0086] S203: Perform a hash calculation on the query key value corresponding to the message to be queried as input of a first hash function to obtain a first hash calculation result, and use the first hash calculation result as the query address of the message to be queried.
[0087] In this step, after the network device determines the query key value corresponding to the message to be queried, it can use the query key value corresponding to the message to be queried as the input of the first hash function to perform a hash calculation to obtain a first hash calculation result, and use the first hash calculation result as the query address of the message to be queried.
[0088] The first hash function may be a hash function preconfigured in the hardware module, and the embodiment of the present application does not limit the function type of the first hash function. Exemplarily, the first hash function may be a cyclic redundancy check (CRC) 32 polynomial. Accordingly, the network device inputs the query key value corresponding to the message to be queried into the CRC32 polynomial for hash calculation to obtain a first hash calculation result. Subsequently, the network device may use the first hash calculation result obtained by the CRC32 polynomial as the query address of the message to be queried.
[0089] Exemplarily, formula (1) is the CRC32 polynomial provided in an embodiment of the present application. By taking the query key value (key is 64 bits) corresponding to the message to be queried as the input x of formula (1), the first hash calculation result F(x) of the CRC32 polynomial can be obtained. The first hash calculation result F(x) can be the value of the 14-bit query address.
[0090] F= x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7+ x^5 + x^4 + x^2 + x^1 + 1 (1)
[0091] S204: Query a first storage row corresponding to the query address in the storage configuration table, and match key values corresponding to multiple storage entries in the first storage row with the query key value respectively.
[0092] In this step, after calculating the first hash calculation result and using it as the query address of the message to be queried, the network device can query the first storage row corresponding to the query address in the storage configuration table, and match the key values corresponding to multiple storage entries in the first storage row with the query key values respectively.
[0093] The storage configuration table may use a single port random access memory (SP RAM) as a table entry storage unit. The table entry index depth of the storage configuration table may be set according to actual conditions, for example, may be set to 16K (ie, there are 16K storage rows).
[0094] For example, Table 1 illustrates a storage configuration table provided in an embodiment of the present application. As shown in Table 1, in the storage configuration table, a query address can be used to determine the corresponding first storage row in the corresponding storage configuration table. Each first storage row may include multiple storage entries (e.g., 8), with each storage entry having different storage fields and signal definitions within the fields. As shown in Table 1, the signal definitions within the fields of each storage entry may include a key value (Key), storage information (Info), and idle state information (Vld). The key value occupies 64 bits, the storage information occupies 62 bits, and the idle state information occupies 1 bit. Furthermore, each first storage row may also include skip chain indication information and a linked list pointer. The skip chain indication information indicates whether the linked list pointer is valid. A valid linked list pointer indicates the existence of a serial shared skip chain table, which includes a second storage row. The address corresponding to the storage entry recorded in the second storage row is the same as the address corresponding to the storage entry recorded in the first storage row. An invalid linked list pointer indicates the absence of a serial shared skip chain table.
[0095] Table 1
[0096]
[0097] It should be understood that the storage configuration table shown in Table 1 has a depth of 16K and a width of 127*8way+8bit=1024bit, so the resources occupied by the storage configuration table may be 16K*1024=16Mbit.
[0098] In some embodiments, if a second target key value successfully matches the query key value among the key values corresponding to multiple storage entries in the first storage row, target query information of the message to be queried is extracted from the storage entry corresponding to the second target key value.
[0099] In some embodiments, the network device can query the corresponding first storage row from the storage configuration table by searching for the query address, and then read the key values (Key) of multiple storage entries in the first storage row and compare them with the query key value corresponding to the message to be queried. If the key value of any storage entry is consistent with the query key value corresponding to the message to be queried, the query is a hit and the table lookup is successful. The storage information (Info) can then be read from the hit storage entry as the target query information for the message to be queried for feedback. If the key values of all storage entries are inconsistent with the query key value corresponding to the message to be queried, the query is a miss and the table lookup fails. Then, an attempt can be made to continue the message query from the shared skip list.
[0100] S205. If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, then according to the linked list pointer of the first storage row, query the target query information of the message to be queried in the shared jump chain table.
[0101] The format of the shared skip list can be the same as that of the storage configuration table. Accordingly, the format of the shared skip list can be the same as that of the storage configuration table shown in Table 1. The shared skip list and the storage configuration table have the same width, but may have different depths. The format of the content of the storage rows of the shared skip list is the same as that of the content of the storage rows of the storage configuration table.
[0102] It should be understood that the embodiments of the present application do not impose any restrictions on the size of the shared jump table, and the resources it occupies are generally much smaller than those of the storage configuration table. For example, the entry depth of the shared jump table can be set to 128 (i.e., there are 128 storage rows). Since the format of the shared jump table can be the same as that of the storage configuration table, the width of the shared jump table is the same as that of the storage configuration table, both being 1024 bits. Therefore, the resources occupied by the shared jump table can be 128*1024 = 128K bits. The ratio of the resources occupied by the shared jump table to the storage configuration table is 128K / 16M = 0.8%. Therefore, the shared jump table occupies a smaller proportion of resources.
[0103] The following describes how to search for target query information of a message to be queried in the shared jump chain table.
[0104] In some embodiments, if the key values corresponding to all storage entries in the first storage row fail to match the query key value and the skip chain indication information of the first storage row indicates that the linked list pointer is valid, the network device may query the second storage row at least once in the shared skip chain according to the linked list pointer of the first storage row until the first target key value in any storage entry in the queried second storage row successfully matches the query key value. Subsequently, the network device may extract the target query information of the message to be queried from the storage entry corresponding to the first target key value.
[0105] Exemplarily, the network device may first use the linked list pointer of the second storage row queried for the Nth time in the shared jump linked list as the index for the N+1th query, then determine the second storage row for the N+1th query based on the index for the N+1th query, and finally match the key values corresponding to multiple storage entries in the second storage row for the N+1th query with the query key values respectively, thereby realizing multiple queries in the shared jump linked list.
[0106] The index of the first query in the shared skip list is the list pointer of the first storage row, and N is an integer greater than or equal to 1.
[0107] Exemplarily, a value of 1 for the chain skipping indication information may indicate that the linked list pointer is valid, and a value of 0 for the chain skipping indication information may indicate that the linked list pointer is invalid.
[0108] For example, if the key values corresponding to all storage entries in the first storage row fail to match the query key value, it indicates that no storage entry matching the query key value corresponding to the message to be queried has been found in the storage configuration table. In this case, it can be determined whether the linked list pointer indicated by the skip chain indication information of the first storage row is valid. If the skip chain indication information of the first storage row indicates that the linked list pointer is invalid, the message query has failed. If the skip chain indication information of the first storage row indicates that the linked list pointer is valid, it indicates that at least one second storage row with the same address is stored in the shared skip chain table. Subsequently, the linked list pointer of the first storage row can be used as the index for the first query in the shared skip chain table to continue searching the corresponding second storage row in the shared skip chain table. Similarly, the network device can match the key values corresponding to multiple storage entries in the queried second storage row with the query key value. If a match is successful, the query is terminated. If a match is unsuccessful, the linked list pointer of the second storage row found in the current query can be used as the index for the next query to continue the query, and so on until the first target key value in any storage entry in the queried second storage row successfully matches the query key value.
[0109] It should be understood that the embodiment of the present application does not limit the maximum number of chain-hopping queries through the linked list pointer. Exemplarily, a maximum of 4 chain-hopping queries through the linked list pointer can be supported.
[0110] The message query method provided in the embodiment of the present application can place multiple storage entries at the same address in the storage configuration table and the shared skip list in series, thereby improving the utilization and hit rate of the on-chip cache. This eliminates the need to store storage entries in an external cache and eliminates the need to interact with the external cache during queries, thereby reducing query latency. Exemplarily, this message query method can achieve a miss probability of less than 0.001% for a 100,000 (10W) queue-level query. For line-rate input messages to be queried, a query can be provided every four cycles. If the main frequency of the chip in the hardware module of the network device is 1GHz, it can support messages at a network line rate of 250Mpps.
[0111] The following describes how to configure the storage configuration table and the shared skip list.
[0112] In some embodiments, the network device can receive a message configuration request, which includes a key value and query information of the message to be configured. Secondly, the network device can use the key value of the message to be configured as the input of the first hash function to perform a hash calculation to obtain a second hash calculation result, and use the second hash calculation result as the configuration address of the message to be configured. Thirdly, the network device can query in the storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address. If there is a storage entry in an idle state in the first storage row corresponding to the configuration address, the network device selects a target storage entry from the idle storage entries according to a preset write order, and writes the key value and query information of the message to be configured into the target storage entry. Finally, the network device can modify the target storage entry from an idle state to a non-idle state.
[0113] It should be understood that the aforementioned hash calculation using the key value of the message to be configured as the input of the first hash function to obtain the second hash calculation result can be performed in a manner similar to that used for querying. For example, a CRC32 polynomial can also be used to calculate the second hash calculation result based on the input key value of the message to be configured as the configuration address of the message to be configured.
[0114] For example, the network device may query the first storage row indexed by the configuration address, and then determine whether there is an idle storage entry by querying the status information of each storage entry in the first storage row. If an idle storage entry exists, the network device may select a target storage entry according to a preset write order, and write the key value of the to-be-configured message and the query information into the target idle storage entry.
[0115] The preset writing order may be specifically set according to actual conditions. For example, the target storage entries to be written may be selected in order from low to high according to the numbers of the storage entries in the idle state.
[0116] For example, the embodiments of the present application do not limit how to write to the target storage entry. In some embodiments, the key value of the message to be configured can be written to the Key location in the target storage entry, and the query information of the message to be configured can be written to the Info location in the target storage entry. At the same time, the value of Vld in the target storage entry is set to 1 to modify it to a non-idle state.
[0117] In other embodiments, if there is no idle storage entry in the first storage row corresponding to the configuration address, the network device first applies for a linked list pointer of the first storage row corresponding to the configuration address in the shared jump linked list. Secondly, the network device uses the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index to determine the second storage row corresponding to the configuration address in the shared jump linked list. Thirdly, the network device writes the key value and query information of the message to be configured into an idle storage entry in the second storage row corresponding to the configuration address. Finally, the network device writes the linked list pointer of the first storage row corresponding to the configuration address applied for in the shared jump linked list into the first storage row corresponding to the configuration address, and sets the jump chain indication information of the first storage row corresponding to the configuration address to indicate that the linked list pointer is valid.
[0118] It should be understood that the embodiments of the present application do not restrict how to request a linked list pointer for the first storage row corresponding to the configuration address in the shared skip list. In some embodiments, an address of a preset size can be allocated in the shared skip list as the linked list pointer for the first storage row corresponding to the configuration address. The preset size can be, for example, 7 bits, 10 bits, 12 bits, etc., and the embodiments of the present application do not restrict this.
[0119] For example, after the linked list pointer is applied for, the key value and query information of the message to be configured can be stored in the second storage row of the shared skip list indicated by the applied linked list pointer. Subsequently, the target storage entry can be selected for writing by querying the idle storage entries in the second storage row. After the key value and query information of the message to be configured are stored in the second storage row, the linked list pointer can be recorded in the first storage row, and the skip list indication information of the first storage row can be set to 1 to indicate that the linked list pointer is valid.
[0120] For example, if all storage entries in the second storage row corresponding to the configuration address are in a non-idle state, then the linked list pointer can continue to be applied for the shared jump linked list. The linked list pointer of the shared jump linked list is used to indicate the next shared jump linked list to jump from the shared jump linked list. Subsequently, the storage entries in the second storage row of the next shared jump linked list are continued to be queried for the storage entries in the idle state to write the key value and query information of the above-mentioned message to be configured.
[0121] It should be understood that the process of continuously indicating the storage row corresponding to the configuration address through the linked list pointer is a chaining process. To ensure query speed, the maximum length of the chaining can be configured. For example, the maximum length of the chaining can be configured to 4, that is, when writing and querying, an address is chained at most 4 times, thereby ensuring the speed of message query.
[0122] In the present application, since multiple chaining can be performed during writing and querying, one address can correspond to multiple storage entries. For example, 8 storage entries can be written in a storage row, and the maximum chaining length can be 4 times, so 32 storage entries can correspond to one address. This greatly reduces the possibility of query MISS, thereby greatly reducing the probability of the first conflict (reduced to below 0.001%), thereby improving resource utilization (increased to more than 99%).
[0123] In some embodiments, if there are no idle storage entries in the first storage row and the second storage row corresponding to the configuration address, the network device may generate a configuration instruction for a hash function, wherein the configuration instruction includes a second hash function. Subsequently, the network device replaces the first hash function with the second hash function and updates the storage configuration table and the shared skip list according to the second hash function.
[0124] The configuration address corresponding to the second hash function has a storage entry in an idle state in the first storage row or the second storage row.
[0125] For example, continue to refer to Figure 2 , there are two ways to generate hash calculation results in the hardware module of the network device. In the first way, the first hash function pre-configured by the hardware module can be used to perform hash calculation to obtain the first hash calculation result. However, if there are no idle storage entries in the first storage row and the second storage row corresponding to the first hash calculation result, the key value and query information of the corresponding message to be configured cannot be written into the storage configuration table and the shared jump chain table. At this time, the second way can be used, which does not use the first hash function pre-configured by the hardware module to perform hash calculation, but reconfigures the second hash function to replace the first hash function, and the configuration address corresponding to the second hash function has an idle storage entry in the first storage row or the second storage row.
[0126] It should be understood that the embodiments of the present application do not limit how the second hash function is reconfigured. In some embodiments, a software module can try different hash functions to find a second hash function that does not miss any storage entries in the storage configuration table or shared skip list. Subsequently, an open source instruction set (RISC-V) can be used to generate hash function configuration instructions corresponding to the second hash function, thereby indicating that the second hash function should be used instead of the first hash function.
[0127] It should be understood that the embodiments of the present application do not limit how the second hash function is used in place of the first hash function. The second hash function can be used to refresh the storage configuration table and the shared skip list, and the addresses corresponding to each storage row in the storage configuration table and the shared skip list can be refreshed using the second hash function. Accordingly, during subsequent query and configuration processes, the second hash function is used to generate query addresses and configuration addresses.
[0128] In this application, when a hash calculation of a first hash function row preconfigured by a hardware module yields a first hash calculation result and no idle storage entries exist in either the first storage row or the second storage row, a configuration instruction for generating a hash function can be used to flexibly select a second hash function, thereby replacing the first hash function with the second hash function, and updating the storage configuration table and shared skip list based on the second hash function. The flexible configuration of the hash function can reduce the probability of misses during message configuration and lookup, thereby improving message query processing performance.
[0129] The message query processing method provided in the embodiment of the present application can be applied to large-scale table item queries for network forwarding. By using the source IP address, target IP address, source port, target port and protocol type as information in the message to be queried, the query key value corresponding to the message to be queried is determined, so that the message query processing method provided in the embodiment of the present application can be used to perform message queries, which improves the on-chip conversion utilization and hit rate when querying large-scale table items for network forwarding, thereby improving the network forwarding processing performance.
[0130] The message query processing method provided in the embodiment of the present application can also be applied to context table item queries performed through remote direct memory access (RDMA). By using a message queue (QueuePair, QP) as information in the message to be queried, the query key value corresponding to the message to be queried is determined, so that the message query processing method provided in the embodiment of the present application can be used to perform message queries. This improves the on-chip switching utilization and hit rate when performing context table item queries through RDMA, thereby improving RDMA performance.
[0131] The message query processing method provided in the embodiment of the present application uses the hash calculation result calculated from the query key value corresponding to the message to be queried as the query address. The method first searches the first storage row corresponding to the query address in the storage configuration table for the message to be queried. If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, the method searches the shared jump chain table for the message to be queried. Because multiple storage entries are placed in the same address in the storage configuration table and the shared jump chain table in series, the utilization and hit rate of the on-chip cache are improved, eliminating the need to store storage entries in the external cache and eliminating the need to interact with the external cache during queries, thereby reducing query latency.
[0132] Figure 3 A flow chart of another message query method provided in an embodiment of the present application is shown as follows: Figure 3 As shown, the message query method includes S301-S309:
[0133] S301: Receive a message configuration request, where the message configuration request includes a key value of a message to be configured and query information.
[0134] S302: Perform a hash calculation on the key value of the message to be configured as input of a first hash function to obtain a second hash calculation result, and use the second hash calculation result as the configuration address of the message to be configured.
[0135] S303: Query the storage configuration table to see whether there is an idle storage entry in the first storage row corresponding to the configuration address.
[0136] If yes, execute S304; if no, execute S306.
[0137] S304 : Select a target storage entry from the storage entries in the idle state according to a preset writing order, and write the key value and query information of the message to be configured into the target storage entry.
[0138] S305: Change the target storage entry from an idle state to a non-idle state.
[0139] S306: Apply for a linked list pointer of the first storage row corresponding to the configuration address in the shared jump linked list.
[0140] S307: Use the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index, and determine the second storage row corresponding to the configuration address in the shared jump linked list.
[0141] S308: Write the key value and query information of the message to be configured into an idle storage entry in the second storage row corresponding to the configuration address.
[0142] S309: Write the linked list pointer of the first storage row corresponding to the configuration address applied for in the shared skip linked list into the first storage row corresponding to the configuration address, and set the skip link indication information of the first storage row corresponding to the configuration address to indicate that the linked list pointer is valid.
[0143] The following describes how to search for target query information of a message to be queried in the shared jump chain table. Figure 4 A flow chart of another message query method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, the message query method includes S401-S413:
[0144] S401: Obtain the message to be queried.
[0145] S402: Determine a query key value corresponding to the message to be queried based on information in the message to be queried.
[0146] S403: Perform a hash calculation on the query key value corresponding to the message to be queried as an input of a first hash function to obtain a first hash calculation result, and use the first hash calculation result as the query address of the message to be queried.
[0147] S404: Query a first storage row corresponding to the query address in the storage configuration table, and match key values corresponding to multiple storage entries in the first storage row with the query key value respectively.
[0148] S405: Determine whether the key values corresponding to all storage entries in the first storage row fail to match the query key value.
[0149] If yes, execute S407; if no, execute S406.
[0150] S406: Extract target query information of the message to be queried from the storage entry corresponding to the second target key value.
[0151] S407: Determine whether the chain jump indication information of the first storage row indicates a valid linked list pointer.
[0152] If yes, execute S409; if no, execute S408.
[0153] S408: Determine whether the message to be queried is not found.
[0154] S409 : Use the linked list pointer of the second storage row found in the Nth query in the shared skip linked list as the index for the N+1th query.
[0155] The index of the first query in the shared skip list is the list pointer of the first storage row, and N is an integer greater than or equal to 1.
[0156] S410 : Determine a second storage row for the N+1th query according to the index of the N+1th query.
[0157] S411 : Match key values corresponding to multiple storage entries in the second storage row queried for the (N+1)th time with the query key value respectively.
[0158] S412: Determine whether the first target key value in any storage entry in the queried second storage row successfully matches the query key value.
[0159] If yes, execute S413; if no, execute S409 to S412.
[0160] S413: Extract target query information of the message to be queried from the storage entry corresponding to the first target key value.
[0161] The message query processing method provided in the embodiment of the present application uses the hash calculation result calculated from the query key value corresponding to the message to be queried as the query address. The method first searches the first storage row corresponding to the query address in the storage configuration table for the message to be queried. If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, the method searches the shared jump chain table for the message to be queried. Because multiple storage entries are placed in the same address in the storage configuration table and the shared jump chain table in series, the utilization and hit rate of the on-chip cache are improved, eliminating the need to store storage entries in the external cache and eliminating the need to interact with the external cache during queries, thereby reducing query latency.
[0162] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0163] Based on the same inventive concept, embodiments of the present application further provide a message query device for implementing the message query method described above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more message query device embodiments provided below can be found in the above-mentioned limitations of the message query method and will not be repeated here.
[0164] In an exemplary embodiment, Figure 5 As shown, a message query device 600 is provided, comprising: an acquisition module 601, a determination module 602, a matching module 603 and a query module 604, wherein:
[0165] The acquisition module 601 is used to acquire the message to be queried.
[0166] The determination module 602 is used to determine the query key value corresponding to the message to be queried based on the information in the message to be queried; use the query key value corresponding to the message to be queried as the input of the hash function to perform hash calculation to obtain a first hash calculation result, and use the first hash calculation result as the query address of the message to be queried.
[0167] The matching module 603 is configured to query the first storage row corresponding to the query address in the storage configuration table, and match key values corresponding to multiple storage entries in the first storage row with the query key value respectively.
[0168] The query module 604 is used to query the target query information of the message to be queried in the shared jump list according to the link list pointer of the first storage row if the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the link list pointer is valid.
[0169] In one embodiment, the query module 604 is also used to query the second storage row in the shared jump linked list at least once according to the linked list pointer of the first storage row, until the first target key value in any storage entry in the queried second storage row successfully matches the query key value; and extract the target query information of the message to be queried from the storage entry corresponding to the first target key value.
[0170] In one embodiment, the query module 604 is further used to use the linked list pointer of the second storage row queried for the Nth time in the shared jump linked list as the index for the N+1th query; determine the second storage row queried for the N+1th query based on the index for the N+1th query; and match the key values corresponding to multiple storage entries in the second storage row queried for the N+1th query with the query key value respectively; wherein the index of the first query in the shared jump linked list is the linked list pointer of the first storage row, and N is an integer greater than or equal to 1.
[0171] In one embodiment, the query module 604 is also used to extract the target query information of the message to be queried from the storage entry corresponding to the second target key value if there is a second target key value in the key values corresponding to multiple storage entries in the first storage row that successfully matches the query key value.
[0172] In one embodiment, the message query device 600 further includes:
[0173] A configuration module is used to receive a message configuration request, which includes a key value and query information of a message to be configured; use the key value of the message to be configured as the input of a first hash function to perform a hash calculation to obtain a second hash calculation result, and use the second hash calculation result as the configuration address of the message to be configured; query in a storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address; if there is a storage entry in an idle state in the first storage row corresponding to the configuration address, select a target storage entry from the idle state storage entries according to a preset writing order, and write the key value and query information of the message to be configured into the target storage entry; and modify the target storage entry from an idle state to a non-idle state.
[0174] In one of the embodiments, the configuration module is further used to apply for a linked list pointer of the first storage row corresponding to the configuration address in the shared jump linked list if there is no idle storage entry in the first storage row corresponding to the configuration address; use the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index to determine the second storage row corresponding to the configuration address in the shared jump linked list; write the key value and query information of the message to be configured into the idle storage entry in the second storage row corresponding to the configuration address; write the linked list pointer of the first storage row corresponding to the configuration address applied for in the shared jump linked list into the first storage row corresponding to the configuration address, and set the jump chain indication information of the first storage row corresponding to the configuration address to indicate that the linked list pointer is valid.
[0175] In one embodiment, the configuration module is further used to generate a configuration instruction of a hash function if there is no idle storage entry in the first storage row and the second storage row corresponding to the configuration address, the configuration instruction includes a second hash function, the second hash function is used to replace the first hash function, and the storage configuration table and the shared jump chain table are updated according to the second hash function; wherein, the configuration address corresponding to the second hash function has an idle storage entry in the first storage row or the second storage row.
[0176] Each module in the above-mentioned message query device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0177] In one embodiment, a computer device is provided, which may be a server, and the server is equipped with a network interface card, which includes a chip, and the computer device can implement the above-mentioned message query method. The internal structure diagram of the server can be as follows: Figure 6 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used 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, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a message query method is implemented.
[0178] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0179] In one exemplary embodiment, a chip is provided. The chip includes a memory and a processor. The memory stores a computer program, and the processor implements the above-described message query method when executing the computer program. The chip can be a data processing unit (DPU) chip used in a data center, or other data processing chip.
[0180] In an exemplary embodiment, a network interface card (NIC) is provided, which includes the chip described in the above embodiment and multiple interfaces (such as PCI / PCIE interfaces, USB interfaces, etc.), through which the chip communicates externally.
[0181] In an exemplary embodiment, a computer device is provided. The computer device includes a central processing unit (CPU) and the chip or the network interface card described in the preceding embodiments, wherein the chip is configured to dispatch messages to the CPU or to process the chip itself, and the CPU is configured to process the messages dispatched by the chip.
[0182] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned message query method is implemented.
[0183] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned message query method when executed by a processor.
[0184] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0185] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0186] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A message query method, characterized in that: The method comprises: Get the message to be queried; Determine the query key value corresponding to the message to be queried according to the information in the message to be queried; Using the query key value corresponding to the message to be queried as an input of a first hash function to perform a hash calculation to obtain a first hash calculation result, and using the first hash calculation result as the query address of the message to be queried; Querying a first storage row corresponding to the query address in a storage configuration table, and matching key values corresponding to a plurality of storage entries in the first storage row with the query key value respectively; If the key values corresponding to all storage entries in the first storage row fail to match the query key value and the jump chain indication information of the first storage row indicates that the linked list pointer is valid, then according to the linked list pointer of the first storage row, the target query information of the message to be queried is queried in the shared jump chain table.
2. The method according to claim 1, characterized in that The querying the target query information of the message to be queried in the shared jump linked list according to the linked list pointer of the first storage row includes: According to the linked list pointer of the first storage row, query the second storage row in the shared skip linked list at least once until the first target key value in any storage entry in the queried second storage row successfully matches the query key value; The target query information of the message to be queried is extracted from the storage entry corresponding to the first target key value.
3. The method according to claim 2, characterized in that The querying of the second storage row in the shared skip linked list at least once according to the linked list pointer of the first storage row comprises: Using the linked list pointer of the second storage row queried for the Nth time in the shared skip linked list as the index for the N+1th query; Determine a second storage row for the N+1th query according to the index of the N+1th query; Matching the key values corresponding to the plurality of storage entries in the second storage row queried for the N+1th time with the query key value respectively; The index of the first query in the shared skip linked list is the linked list pointer of the first storage row, and N is an integer greater than or equal to 1.
4. The method according to claim 1, characterized in that After matching the key values corresponding to the plurality of storage entries in the first storage row with the query key value respectively, the method further includes: If a second target key value exists in the key values corresponding to the plurality of storage entries in the first storage row and successfully matches the query key value, the target query information of the message to be queried is extracted from the storage entry corresponding to the second target key value.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Receive a message configuration request, wherein the message configuration request includes a key value of a message to be configured and query information; Performing a hash calculation using the key value of the message to be configured as an input of the first hash function to obtain a second hash calculation result, and using the second hash calculation result as the configuration address of the message to be configured; Querying in the storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address; If there is an idle storage entry in the first storage row corresponding to the configuration address, select a target storage entry from the idle storage entries according to a preset writing order, and write the key value and query information of the message to be configured into the target storage entry; The target storage entry is modified from the idle state to a non-idle state.
6. The method according to claim 5, characterized in that After querying in the storage configuration table whether there is a storage entry in an idle state in the first storage row corresponding to the configuration address, the method further includes: If there is no idle storage entry in the first storage row corresponding to the configuration address, applying for a linked list pointer of the first storage row corresponding to the configuration address in the shared skip linked list; Using the linked list pointer of the first storage row corresponding to the configuration address of the message to be configured as an index, determining the second storage row corresponding to the configuration address in the shared jump linked list; Writing the key value and query information of the message to be configured into a storage entry in an idle state in the second storage row corresponding to the configuration address; The linked list pointer of the first storage row corresponding to the configuration address applied for in the shared skip linked list is written into the first storage row corresponding to the configuration address, and the skip chain indication information of the first storage row corresponding to the configuration address is set to indicate that the linked list pointer is valid.
7. The method according to claim 6, characterized in that The method further comprises: If there are no idle storage entries in the first storage row and the second storage row corresponding to the configuration address, generating a configuration instruction of a hash function, wherein the configuration instruction includes a second hash function; Using the second hash function to replace the first hash function, and updating the storage configuration table and the shared skip chain table according to the second hash function; The configuration address corresponding to the second hash function has a storage entry in the idle state in the first storage row or the second storage row.
8. A message query device, characterized in that: The device comprises: An acquisition module, used to acquire the message to be queried; A determination module, configured to determine a query key value corresponding to the message to be queried according to information in the message to be queried; perform a hash calculation using the query key value corresponding to the message to be queried as an input of a hash function to obtain a first hash calculation result, and use the first hash calculation result as a query address of the message to be queried; a matching module, configured to query a first storage row corresponding to the query address in a storage configuration table, and match key values corresponding to a plurality of storage entries in the first storage row with the query key value respectively; A query module is used to query the target query information of the message to be queried in the shared skip linked list according to the linked list pointer of the first storage row if the key values corresponding to all storage entries in the first storage row fail to match the query key value and the skip link indication information of the first storage row indicates that the linked list pointer is valid.
9. A chip, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A network interface card, characterized in that: The method comprises the chip as claimed in claim 9 and a plurality of interfaces, wherein the chip communicates externally through the interfaces.
11. A computer device, comprising a central processing unit and a chip as claimed in claim 9, wherein the chip is used to dispatch messages to the central processing unit or the chip itself for processing, and the central processing unit is used to process the messages dispatched by the chip.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.