Data processor, data processor-based packet forwarding control method and device

CN122909197APending Publication Date: 2026-10-13BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610720996.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-22
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0003]然而,这种技术架构并非完美无缺,其自身存在的一些限制导致整体通信转发体系仍存在诸多短板

Benefits of technology

[0009]根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,所述计算机指令用于使计算机执行本公开上述提出的基于数据处理器的报文转发控制方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122909197A_ABST
    Figure CN122909197A_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processor, a packet forwarding control method and device based on the data processor, and relates to the field of network communication, in particular to the technical field of data processors, network data processing, software and hardware collaborative network forwarding, cloud computing and the like. The data processor comprises a hardware module and a software module. The hardware module comprises a query unit and a post-processing unit. The query unit is configured to obtain an original packet to be forwarded, and query a hardware flow table based on the original packet to obtain a query result. The software module is configured to determine a corresponding target operation processing based on the query result, and execute the target operation processing on the original packet. The post-processing unit is configured to perform forwarding control on a target packet, which is the original packet after processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of network communication, and in particular to the technical fields of data processors, network data processing, hardware and software collaborative network forwarding, cloud computing, etc., and especially to a data processor, a message forwarding control method and device based on the data processor. Background Technology

[0002] In related technologies, a technical architecture that separates hardware acceleration paths and software slow paths is adopted to realize DPU (Data Processing Unit) network data forwarding. The hardware acceleration path relies on the DPU's hardware offloading capabilities to perform fast forwarding of packets conforming to fixed flow table rules, offloading fixed and time-consuming tasks such as header parsing, checksum calculation, etc., from the main processor to the DPU hardware. The software slow path, on the other hand, handles flow table misses, unexpected packets, and packets requiring dynamic logic processing. These packets are parsed and processed packet by packet processing modules at the software level to maintain the flexibility and integrity of the forwarding logic.

[0003] However, this technical architecture is not without its flaws, and its inherent limitations result in numerous shortcomings in the overall communication forwarding system. Summary of the Invention

[0004] This disclosure provides a data processor, a message forwarding control method based on the data processor, and an apparatus.

[0005] According to one aspect of this disclosure, a data processor is provided, the data processor comprising a hardware module and a software module, the hardware module comprising a query unit and a post-processing unit, wherein:

[0006] The query unit is used to obtain the original packet to be forwarded and query the hardware flow table based on the original packet to obtain the query result; The software module is used to determine the corresponding target operation based on the query result, and to perform the target operation on the original message; The post-processing unit is used to control the forwarding of the target message; wherein the target message is the processed original message.

[0007] According to another aspect of this disclosure, a packet forwarding control method based on a data processor is provided. The data processor includes a hardware module and a software module. The hardware module includes a query unit and a post-processing unit. The method includes: obtaining an original packet to be forwarded through the query unit, and querying a hardware flow table based on the original packet to obtain a query result; determining a corresponding target operation based on the query result through the software module, and performing the target operation on the original packet; and performing forwarding control on the target packet through the post-processing unit; wherein the target packet is the processed original packet.

[0008] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the packet forwarding control method based on a data processor proposed above in this disclosure.

[0009] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to execute the data processor-based message forwarding control method proposed above in this disclosure.

[0010] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the data processor-based message forwarding control method proposed above in this disclosure.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure; Figure 2 This is a schematic diagram according to the second embodiment of the present disclosure; Figure 3 This is a schematic diagram according to the third embodiment of the present disclosure; Figure 4 This is a schematic diagram of the target data structure provided in this disclosure; Figure 5 This is a schematic diagram according to the fourth embodiment of the present disclosure; Figure 6This is a schematic diagram of the data processor architecture provided in this disclosure; Figure 7 This is a block diagram of an electronic device used to implement the data processor-based message forwarding control method of the embodiments of this disclosure. Detailed Implementation

[0013] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0014] The technical architecture that separates hardware acceleration paths from software slow paths is not without its flaws. Its inherent limitations result in several shortcomings in the overall communication forwarding system: First, there is an issue of unpredictable performance: due to the architecture's division of hardware acceleration paths and software slow paths, once a packet is transferred to the software slow path for processing, the forwarding latency increases, which can easily cause significant fluctuations in the overall network forwarding performance, making it difficult to guarantee the stability of business operations.

[0015] Second, the proportion of software forwarding services is too high: various unconventional traffic such as flow table miss packets and abnormal unexpected packets all need to be processed by software, which cannot fully realize the hardware offloading of all services and greatly increases the operating and processing pressure of the host software.

[0016] Third, the architecture has a high degree of hardware and software coupling: when faced with requirements such as adapting to new frame formats and adding new forwarding service features, it is necessary to rely on hardware modification and development to achieve this, which not only increases the cost of hardware R&D investment, but also greatly lengthens the product iteration cycle, making it impossible to achieve rapid online adaptation and launch of business functions.

[0017] Fourth, there are significant obstacles in the iteration of business functions: due to limitations in hardware architecture and resources, when various dynamic forwarding strategies such as access control and address translation are updated and adjusted, it is necessary to modify the underlying hardware configurations simultaneously, resulting in low overall iteration and upgrade efficiency.

[0018] Fifth, low forwarding efficiency: Software forwarding adopts a single packet sending and receiving processing mode, and the data interaction frequency between software and hardware is too high, resulting in a large amount of interaction delay overhead, making it difficult to improve the overall packet forwarding efficiency.

[0019] Sixth, low efficiency in distributing flow table entries: Under this architecture, the distribution of flow table entries relies on a dedicated control channel. In business scenarios where flow table entries are updated frequently, channel transmission bottlenecks are very likely to occur, which in turn directly drags down the overall network forwarding performance.

[0020] To address at least one of the aforementioned problems, this disclosure proposes a data processor, a message forwarding control method based on the data processor, and an apparatus.

[0021] Figure 1 This is a schematic diagram based on the first embodiment of the present disclosure. It should be noted that the data processor of the present disclosure embodiment can be configured in an electronic device so that the electronic device can perform message forwarding control functions.

[0022] Among them, electronic devices can be any device with computing capabilities, such as personal computers (PCs), mobile terminals, servers, etc. Mobile terminals can be, for example, in-vehicle devices, mobile phones, tablets, personal digital assistants, wearable devices, smart speakers, servers, server clusters, and other hardware devices with various operating systems, touch screens and / or displays.

[0023] In the following embodiments, an electronic device is used as an example for illustration.

[0024] like Figure 1 As shown, the data processor 100 may include a hardware module 110 and a software module 120, wherein the hardware module 110 includes a query unit 111 and a post-processing unit 112, wherein: The query unit 111 is used to obtain the original message to be forwarded and query the hardware flow table based on the original message to obtain the query result.

[0025] Software module 120 is used to determine the corresponding target operation processing based on the query results and to perform the target operation processing on the original message.

[0026] The post-processing unit 112 is used to control the forwarding of the target message; wherein the target message is the processed original message.

[0027] The hardware module 110 can be implemented by chip integration, including two types of hardware logic circuits: a query unit 111 and a post-processing unit 112. It should be noted that this disclosure does not limit the specific type of chip. For example, the chip can be an FPGA (Field Programmable Gate Array) chip, or other types of chips.

[0028] Among them, the software module 120 can be a business processing program running on the main control CPU (Central Processing Unit) or operating system, which is used to handle logic that cannot be implemented by hardware.

[0029] It should be noted that this disclosure does not limit the source of the original message. For example, the original message can be obtained from the host side or from the network side, and can be flexibly adapted according to the actual network scenario. Therefore, in one possible implementation of this disclosure, the query unit 111 can obtain the original message to be forwarded from the host side, or the query unit 111 can obtain the original message to be forwarded from the network side.

[0030] Among them, the host side can be used to indicate internal network host terminals such as terminal devices, business hosts, and local servers; the network side can also be called the external network side or the interconnection network side, for example, it can be used to indicate external network terminals such as switches, routers, and external network links.

[0031] The hardware flow table can be a flow table deployed in the hardware module 110, and the flow table can be a data table used to store multiple packet forwarding rules.

[0032] The query result can be used to indicate whether a packet forwarding rule (also known as a flow table entry or flow table rule) exists in the hardware flow table that matches the original packet to be forwarded. Optionally, when the query result indicates that a packet forwarding rule matching the original packet to be forwarded exists in the hardware flow table, the query result is the packet forwarding rule matching the original packet to be forwarded.

[0033] The packet forwarding rules may include, but are not limited to, the following: 5-tuple information, network flow identifier, VNI (Virtual Network Identifier), operation index (also known as action index or behavior index), etc. The 5-tuple information may include the source IP (Internet Protocol) address, destination IP address, source port number, destination port number, and transport layer protocol number; the network flow identifier (Flow ID) is used to uniquely identify network data flows, for example, it can be used to quickly distinguish various packet flows with different sources, destinations, and service types; the operation index can be used to indicate the corresponding operation processing, which may include, but is not limited to: verification operations (such as ACL (Access Control List) verification operations), translation operations (such as NAT (Network Address Translation)), service policy configuration, etc.

[0034] To obtain the query results, as an example, the query unit 111 can extract the five-tuple information of the original message, query the hardware flow table based on the five-tuple information, and if it is determined that there is a message forwarding rule in the hardware flow table that matches the five-tuple information, the message forwarding rule is determined as the message forwarding rule that matches the original message to be forwarded, and the query result is generated based on the message forwarding rule; if it is determined that there is no message forwarding rule in the hardware flow table that matches the five-tuple information, the query result is directly generated to indicate that there is no message forwarding rule in the hardware flow table that matches the original message to be forwarded.

[0035] In order to process the original packet based on the query result, as a possible implementation, when the query result indicates that there is a packet forwarding rule in the hardware flow table that matches the original packet to be forwarded, the software module 120 can determine the operation processing corresponding to the packet forwarding rule based on the operation index in the packet forwarding rule, and determine the target operation processing corresponding to the query result. Then, the software module 120 can perform the target operation processing on the original packet.

[0036] As another possible implementation, when the query result indicates that no packet forwarding rule matching the original packet to be forwarded exists in the hardware flow table, the software module 120 can use a preset operation process as the target operation process and can perform the preset operation process on the original packet. The preset operation process can be pre-defined to perform corresponding operation processes on packets that are not matched, i.e., original packets for which no packet forwarding rule matching the original packet to be forwarded exists in the hardware flow table.

[0037] In this embodiment of the disclosure, the post-processing unit 112 can perform forwarding control on the processed original message, i.e. the target message. For example, it can determine the forwarding exit and forwarding method of the target message based on the five-tuple information in the target message, and then send the target message to the corresponding forwarding exit according to the forwarding method to complete the message forwarding control.

[0038] As an example, the query unit 111 in hardware module 110 obtains the original packet to be forwarded and queries the hardware flow table based on the original packet to obtain the query result. If the query result indicates that there is a packet forwarding rule in the hardware flow table that matches the original packet to be forwarded, then the query unit 111 can send the packet forwarding rule and the original packet to the software module 120. Thus, the software module 120 can determine the corresponding target operation processing based on the packet forwarding rule and perform the target operation processing on the original packet. Then, the software module 120 can send the processed original packet to the post-processing unit 112 in hardware module 110, so that the post-processing unit 112 can perform forwarding control on the processed original packet, i.e., the target packet.

[0039] As another example, the query unit 111 in hardware module 110 obtains the original packet to be forwarded and queries the hardware flow table based on the original packet to obtain the query result. If the query result indicates that there is no packet forwarding rule matching the original packet to be forwarded in the hardware flow table, the query unit 111 can send the query result and the original packet to software module 120. Then, the software module 120 can determine the corresponding target operation processing based on the query result and perform target operation processing on the original packet. Then, the software module 120 can send the processed original packet to the post-processing unit 112 in hardware module 110, so that the post-processing unit 112 can perform forwarding control on the processed original packet, i.e., the target packet.

[0040] The data processor of this embodiment includes a hardware module and a software module. The hardware module includes a query unit and a post-processing unit. The query unit is used to obtain the original packet to be forwarded and query the hardware flow table based on the packet to be forwarded to obtain the query result. The software module is used to determine the corresponding target operation processing based on the query result and perform the target operation processing on the packet to be forwarded. The post-processing unit is used to perform forwarding control on the processed packet to be forwarded. Therefore, a unified software collaboration path is adopted, in which hardware and software modules work together. The query unit in the hardware module uniformly completes the original packet reception and hardware flow table query, and then the software module performs various flexible operations based on the query results. Finally, the post-processing unit in the hardware module uniformly completes packet forwarding control. This abandons the fast and slow path separation architecture in related technologies, so that all packets follow a unified standardized processing, eliminate the latency differences caused by path switching, effectively improve the problems of large fluctuations and unpredictable performance in forwarding, and improve packet forwarding efficiency. This unified processing mode can effectively reduce the forwarding workload borne by the software alone, effectively alleviate the software processing pressure, and balance the offloading of hardware. At the same time, by entrusting various dynamic and variable operation processing logic to the software module, the coupling degree between the relevant processing logic and the hardware architecture can be effectively reduced, which facilitates the rapid updating and adjustment of the hardware flow table.

[0041] like Figure 2 As shown, this disclosure also proposes a data processor. Figure 2 As shown in the schematic diagram of the second embodiment of this disclosure, the data processor 100 includes a hardware module 110 and a software module 120. The hardware module 110 includes a query unit 111, a generation unit 113, and a post-processing unit 112. The software module includes a message sending and receiving unit 121 and a message processing unit 122, wherein: The query unit 111 is used to obtain the original message to be forwarded and query the hardware flow table based on the original message to obtain the query result.

[0042] The generation unit 113 is used to generate a message descriptor for the original message based on the query results.

[0043] The message transceiver unit 121 is used to parse message descriptors and obtain query results.

[0044] The message processing unit 122 is used to determine the corresponding target operation processing based on the query results, and to perform the target operation processing on the original message.

[0045] The post-processing unit 112 is used to control the forwarding of the target message; wherein the target message is the processed original message.

[0046] It should be noted that the explanations of the query unit 111 and the post-processing unit 112 in the foregoing embodiments also apply to this embodiment, and will not be repeated here.

[0047] The message descriptor can be a lightweight data structure that carries information related to the original message. For example, it can carry a complete original message, an incomplete original message, or attribute information of the original message, etc. This disclosure does not impose any limitations on this. Attribute information can include, but is not limited to, message header length, 5-tuple information, VNI, etc.

[0048] In this embodiment of the disclosure, the generation unit 113 can generate a packet descriptor for the original packet based on the query result. As an example, assuming the query result indicates that a packet forwarding rule matching the original packet exists in the hardware flow table, the query unit 111 can also extract the second attribute information of the original packet and send the second attribute information, the packet forwarding rule, and the original packet to the generation unit 113. Thus, the generation unit 113 can assemble and generate the corresponding packet descriptor for the original packet based on the second attribute information, the network flow identifier included in the packet forwarding rule, and the original packet. The second attribute information may include, but is not limited to, packet header length, VNI, etc.

[0049] In this embodiment, the message transceiver unit 121 can parse the message descriptor according to a pre-defined data format, extract the query result, and send the query result to the message processing unit 122. Using the above example, after the generation unit 113 assembles and generates the corresponding message descriptor for the original message based on the second attribute information, the network flow identifier included in the message forwarding rules, and the original message, it can send the message descriptor to the message transceiver unit 121. The message transceiver unit 121 can then parse the message descriptor to obtain the second attribute information, the network flow identifier included in the message forwarding rules, and the original message. Furthermore, the message transceiver unit 121 can send the second attribute information, the network flow identifier included in the message forwarding rules, and the original message to the message processing unit 122.

[0050] It should be noted that the above examples of information for assembling message descriptors are merely illustrative. In practical applications, the information used for assembling message descriptors can be set as needed, and this disclosure does not impose any restrictions on this.

[0051] In this embodiment of the disclosure, after obtaining the query result, the message processing unit 122 can determine the corresponding target operation processing based on the query result, and can perform the target operation processing on the original message.

[0052] As an example, if the query result indicates that there is a packet forwarding rule in the hardware flow table that matches the original packet to be forwarded, the packet processing unit 122 can determine the corresponding target operation processing based on the operation index in the packet forwarding rule, and perform the target operation processing on the original packet.

[0053] As another example, if the query result indicates that no packet forwarding rule matching the original packet to be forwarded exists in the hardware flow table, the packet processing unit 122 may perform preset operation processing on the original packet. The preset operation processing may be pre-set for processing packets that have not been matched, i.e., original packets for which no packet forwarding rule matching the original packet to be forwarded exists in the hardware flow table.

[0054] The data processor of this embodiment includes a hardware module further comprising a generation unit and a software module comprising a message sending and receiving unit and a message processing unit. The generation unit is used to generate a message descriptor for the original message based on the query result. The message sending and receiving unit is used to parse the message descriptor to obtain the query result. The message processing unit is used to determine the corresponding target operation based on the query result and perform the target operation on the original message. Therefore, the generation unit in the hardware module generates corresponding message descriptors based on the query results of the hardware flow table. Then, the message sending and receiving unit in the software module parses the descriptors to obtain the query information. Finally, the message processing unit completes the corresponding data processing. By using message descriptors, standardized and orderly data interaction between hardware and software is achieved, making message flow and information transmission more regular and efficient. This not only preserves the normal data interaction process between hardware and software, but also simplifies redundant interaction processes by relying on standardized descriptor transmission methods, reducing latency losses caused by invalid data exchanges. At the same time, a unified data interaction format avoids performance fluctuations caused by path switching, stabilizing the overall forwarding operation status. Furthermore, by relying on layered modular division, the processing responsibilities of hardware and software are clearly defined, the processing load is reasonably distributed, and the binding degree between logical functions and hardware architecture is reduced.

[0055] like Figure 3 As shown, this disclosure also proposes a data processor. Figure 3 The data processor 100, as shown in the schematic diagram of the third embodiment of this disclosure, includes a hardware module 110 and a software module 120. The hardware module 110 includes a query unit 111, a generation unit 113, a preprocessing unit 114, and a post-processing unit 112. The software module includes a message sending and receiving unit 121 and a message processing unit 122. The query unit 111 is used to obtain the original message to be forwarded and query the hardware flow table based on the original message to obtain the query result.

[0056] The preprocessing unit 114 is used to extract the packet block to be processed from the original packet and store the packet block to be processed in the shared memory when the query result indicates that there is a packet forwarding rule matching the original packet in the hardware flow table, so as to obtain the first storage location information.

[0057] The generation unit 113 is used to generate a message descriptor for the original message based on the message forwarding rules and the first storage location information.

[0058] The message transceiver unit 121 is used to parse the message descriptor to obtain the message forwarding rules and the first storage location information.

[0059] The message processing unit 122 is used to read the message block to be processed from the shared memory based on the first storage location information, and query the software flow table based on the message forwarding rules to determine the target operation processing; and to perform the target operation processing on the message block to be processed to obtain the target message block.

[0060] The post-processing unit 112 is used to control the forwarding of the processed original message.

[0061] It should be noted that the explanations of the query unit 111 and the post-processing unit 112 in the foregoing embodiments also apply to this embodiment, and will not be repeated here.

[0062] Among them, the message block to be processed can be the message data segment to be processed in the original message (also known as message fragment or message data fragment).

[0063] Shared memory can be a memory area that can be accessed by both hardware module 110 and software module 120.

[0064] The first storage location information can be used to indicate the address offset, starting address, data length, and other location information of the message block to be processed stored in the shared memory, which can be used to quickly find the message block to be processed.

[0065] In this embodiment of the disclosure, when the query result indicates that there is a packet forwarding rule matching the original packet in the hardware flow table, the preprocessing unit 114 can identify the packet block to be processed in the original packet, extract the packet block to be processed from the original packet, and store the packet block to be processed in the shared memory to obtain the first storage location information.

[0066] As an example, the preprocessing unit 114 can identify the unprocessed message block in the original message, split and extract the unprocessed message block and the remaining message block from the original message, store the unprocessed message block in shared memory to obtain the first storage location information, and store the remaining message block in non-shared memory to obtain the second storage location information.

[0067] For example, if the query result indicates that a packet forwarding rule matching the original packet exists in the hardware flow table, the preprocessing unit 114 can identify the boundary of the original packet header and, based on this boundary, split the original packet into a packet header and a packet payload (referred to as the remaining packet block in this disclosure). The packet header can be written into shared memory, and the packet payload can be cached in the BM (Buffer Management) cache of the hardware module 110, thereby obtaining the storage location information of the packet header (referred to as the first storage location information in this disclosure) and the storage location information of the packet payload (referred to as the second storage location information in this disclosure). It should be noted that the above splitting of the original packet is only exemplary. In actual applications, it can be set as needed, and this disclosure does not impose any restrictions on it.

[0068] Therefore, only the message blocks to be processed are stored in shared memory, while the message blocks that do not need to be processed, i.e. the remaining message blocks, are stored in non-shared memory. This effectively saves the storage space of shared memory, avoids a large amount of irrelevant data occupying shared memory resources, and can reduce the access competition of message processing units to shared memory, thereby improving the overall efficiency of message processing.

[0069] In this embodiment of the disclosure, the generation unit 113 can assemble and generate a message descriptor for the original message based on the message forwarding rules and the first storage location information. Continuing with the above example, the query unit 111 can also extract the second attribute information of the original message and send the second attribute information and the query result to the generation unit 113. Thus, the generation unit 113 can assemble and generate a corresponding message descriptor for the original message based on the second attribute information, the network flow identifier in the message forwarding rules, the first storage location information, and the second storage location information.

[0070] In one possible implementation of this disclosure, the message processing unit 122 may further be used to: read the message block to be processed from the shared memory based on the first storage location information, and query the software flow table based on the message forwarding rules to determine the target operation processing; perform the target operation processing on the message block to be processed to obtain the target message block; and update the message block to be processed indicated by the first storage location information in the shared memory to the target message block.

[0071] The software flow table can be a flow table deployed in the software module 120, and the flow table can be a data table used to store target operation processing. For example, when the packet forwarding rule includes a network flow identifier, the software flow table is queried based on the network flow identifier to determine the operation processing corresponding to the network flow identifier, and the operation processing is used as the target operation processing.

[0072] As one possible implementation, a correspondence between target operation processing and network flow identifier can be established in advance and the correspondence can be saved in the software flow table. Thus, given the network flow identifier, the corresponding target operation processing can be determined.

[0073] It should be noted that the explanation of the operation process in any of the above embodiments also applies to this embodiment, and will not be repeated here.

[0074] For example, after obtaining the first storage location information and the packet forwarding rules, the packet processing unit 122 can access the shared memory based on the first storage location information, read the packet block to be processed indicated by the first storage location information from the shared memory, and query the software flow table based on the network flow identifier in the packet forwarding rules to determine the corresponding target operation processing. Then, the packet processing unit 122 can perform target operation processing on the packet block to be processed to obtain the processed packet block, i.e., the target packet block, and write the target packet block into the storage area indicated by the first storage location information in the shared memory to update the packet block to be processed stored in the shared memory to the target packet block.

[0075] Therefore, the message processing unit can directly read the message block to be processed from the shared memory based on the storage location information, retrieve the corresponding operation processing method from the software flow table in conjunction with the message forwarding rules, and write the processed message data back to the original storage location in the shared memory after completing the data processing. This achieves the processing of the original message without changing the storage location, facilitating subsequent data retrieval. The entire process only involves writing the message block to be processed into the shared memory, and data reading, writing, and updating are completed using the shared memory. There is no need to repeatedly transmit the complete message between the hardware and software, effectively reducing data copy overhead and further optimizing the efficiency of hardware and software interaction.

[0076] As one possible implementation, the post-processing unit 112 can also be used to: obtain the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message; read the target message block from the shared memory based on the first storage location information, and read the remaining message blocks based on the second storage location information; and reassemble the target message block and the remaining message blocks to obtain the processed original message, i.e., the target message.

[0077] It should be noted that the original message may also have corresponding remaining message blocks, which are the message blocks in the original message other than the message blocks to be processed.

[0078] In order to obtain the second storage location information of the remaining message blocks in the original message, as an example, the preprocessing unit 114 can also store the remaining message blocks in the original message in non-shared memory to obtain the second storage location information, and send the first storage location information and the second storage location information to the postprocessing unit 112. Thus, the postprocessing unit can obtain the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message.

[0079] As another example, the preprocessing unit 114 can also store the remaining packet blocks in the original packet into non-shared memory to obtain the second storage location information, and send the first storage location information and the second storage location information to the generation unit 113; then, the generation unit 113 can generate a packet descriptor of the original packet based on the packet forwarding rules, the first storage location information and the second storage location information, and send the packet descriptor to the packet transceiver unit 121; further, the packet transceiver unit 121 can parse the packet descriptor to obtain the packet forwarding rules and the first storage location information. The message processing unit 122 sends the message forwarding rules, the first storage location information, and the second storage location information to the message receiving unit 121 after performing the target operation on the text block to be processed. Finally, the message receiving unit 121 sends the message forwarding rules, the first storage location information, and the second storage location information to the post-processing unit 112, so that the post-processing unit 112 can obtain the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message.

[0080] Therefore, the post-processing unit in the hardware module retrieves two types of storage location information, reads the processed message blocks and the remaining message blocks from the shared memory respectively, and then reassembles the multiple message blocks into a complete message. This segmented processing and unified reassembly method is suitable for the needs of large message splitting and processing. Only the message blocks that need to be processed by the software module are written to the shared memory, and the entire data retrieval is completed by relying on the shared memory. This can save the transmission and copying operations of the complete message, further simplifying the hardware and software interaction overhead.

[0081] To enable the transmission of message forwarding rules and first storage location information from message transceiver unit 121 to message processing unit 122, as a possible implementation, message transceiver unit 121 can also assign values ​​to fields of a pre-allocated memory buffer structure based on message forwarding rules and first storage location information to obtain a target data structure pointing to the message block to be processed; message processing unit 122 can also obtain the target data structure based on the target interface and parse the target data structure to obtain message forwarding rules and first storage location information.

[0082] The memory buffer structure can be used to carry information about the unprocessed message blocks stored in shared memory, such as the storage location, length, corresponding network flow identifier, VNI, etc. of the unprocessed message blocks.

[0083] For example, the memory buffer structure can be an mbuf (memory buffer) structure. The mbuf structure can be a message management structure, for example, used to record information such as the storage location of the message block to be processed in shared memory, the length of the message block to be processed, the corresponding message forwarding rules, VNI, etc., which are not limited in this disclosure.

[0084] The target data structure can be a memory buffer structure after the fields are assigned values, and it can point to the unprocessed message block in shared memory.

[0085] The target interface can be used to obtain the target data structure from the message sending and receiving unit 121.

[0086] As an example, suppose the memory buffer structure is an mbuf structure, which includes cache lines cache_line0 and cache_line1. The fields to be assigned to each cache line may include pkt_len, buf_addr, vni, flow_id, idx, pid, etc. If the packet descriptor includes packet forwarding rules, first storage location information (IDX), second storage location information (PID), and the length of the packet block to be processed (Len, VNI), and the packet forwarding rules include network flow identifiers (Flow_ID), the packet to be processed can be found based on the first storage location information (IDX). The storage address of the packet block in shared memory is assigned to the `buf_addr` field of a pre-allocated `mbuf` structure. The first storage location information (IDX) is assigned to the `idx` field, the second storage location information (PID) to the `pid` field, the length of the packet block (Len) to the `pkt_len` field, and the network flow identifier (Flow_ID) to the `flow_id` field. After assigning the storage address to the `buf_addr` field, the `mbuf` structure points to the packet block in shared memory. This assigned `mbuf` structure is referred to as the target data structure in this disclosure. Figure 4 As shown, the data in the data area is used to point to the unprocessed message blocks in shared memory.

[0087] It should be noted that the above example of the target mbuf structure is merely exemplary. In practical applications, fields that need to be assigned values ​​can be set as needed, and this disclosure does not impose any restrictions on this.

[0088] Therefore, the message sending and receiving unit can combine message forwarding rules with the storage location information corresponding to shared memory to assign values ​​to various fields of the pre-configured memory buffer structure, generating a target data structure that can accurately point to the message block to be processed. The message processing unit can directly call this target data structure through a specified target interface, and after parsing it, it can quickly extract the message forwarding rules and the first storage location information. Information encapsulation and transmission can be completed using standardized structures, unifying the data interaction format between software and hardware, simplifying the information parsing process, improving the accuracy and efficiency of data transmission, and reducing redundant operations in the information transmission process by relying on fixed structures to standardize data interaction. This makes the flow of message-related parameters more concise and efficient, further optimizing the overall message processing flow and strengthening the standardization and stability of data interaction between software and hardware.

[0089] Optionally, in some embodiments of this disclosure, when the packet forwarding rule includes a network flow identifier and there are multiple original packets, the packet processing unit 122 can also be used to: perform a first clustering on the packet blocks to be processed corresponding to the multiple original packets based on the network flow identifier to obtain at least one cluster; and for any cluster, perform target operation processing corresponding to the cluster on the packet blocks to be processed in the cluster to obtain the corresponding target packet block.

[0090] It should be noted that each original packet has a matching packet forwarding rule, and the packet forwarding rule includes a network flow identifier. Therefore, each original packet or the packet block to be processed corresponding to the original packet has a corresponding network flow identifier.

[0091] It should also be noted that, since the network flow identifier is used to uniquely identify a network flow, the same network flow identifier indicates that the operation processing strategy to be performed on the corresponding message is exactly the same. In order to improve the message processing efficiency, in this embodiment of the disclosure, the message processing unit 122 can cluster the message blocks to be processed corresponding to multiple original messages based on the network flow identifier of each original message to obtain at least one cluster. For any cluster, the target operation processing corresponding to the cluster can be performed on the message blocks to be processed in the cluster. For example, the message processing unit 122 can query the software flow table based on the network flow identifier corresponding to the cluster to determine the corresponding target operation processing, thereby obtaining the target message blocks corresponding to each message block to be processed in the cluster.

[0092] Therefore, a clustering batch processing mechanism can be adopted to overcome the limitations of packet-by-packet processing in related technologies. It can centrally, uniformly, and batch process packets in the same flow, reduce repetitive software processing operations and the number of software and hardware interactions, effectively reduce the interaction latency and system overhead caused by single packet processing, and improve the overall processing throughput in multi-packet concurrent scenarios. At the same time, packets in the same cluster reuse the same processing logic, maintain the consistency of processing behavior of packets in the same flow, avoid forwarding jitter caused by differentiated processing, further improve the predictability and operational stability of packet forwarding performance, adapt to high-traffic, high-concurrency network forwarding scenarios, and optimize the overall data processing efficiency.

[0093] Optionally, in some embodiments of this disclosure, when the packet forwarding rule includes a network flow identifier and there are multiple original packets, the generation unit 113 can also be used to: perform a second clustering on the packet descriptors corresponding to the multiple original packets based on the network flow identifier to obtain at least one descriptor group; for any descriptor group, if the descriptor group meets the set aggregation conditions, perform information aggregation processing on the packet descriptors in the descriptor group to obtain an aggregated descriptor; and send the aggregated descriptor to the hardware message queue.

[0094] The aggregation conditions can be preset. For example, the aggregation conditions can include at least one of the following: the number of message descriptors in the descriptor group reaches a preset threshold, the aggregated descriptor group reaches a preset duration, etc., which can be set as needed.

[0095] The hardware message queue can be a message queue maintained by the hardware module 110. This disclosure does not restrict the type of hardware message queue. For example, the hardware message queue can be a ring message queue.

[0096] Therefore, in scenarios involving concurrent multi-message transmission, the generation unit in the hardware module clusters and groups multiple message descriptors based on network flow identifiers, aggregating message descriptors with the same flow attributes into a unified descriptor group. After meeting preset aggregation conditions, information is aggregated within the group to generate an aggregated descriptor, which is then pushed to the hardware message queue. This hardware-level descriptor clustering and aggregation mechanism can complete traffic regularization and information merging before messages enter the software processing flow, effectively integrating scattered message interaction tasks, reducing the frequency of software and hardware message interactions and queue scheduling, and avoiding queue congestion and performance loss caused by transmitting and scheduling massive amounts of single descriptors one by one. By aggregating and processing unified interaction entry points and scheduling logic for messages in the same flow, the parallel processing flow of multiple messages is further regularized, eliminating processing disorder and performance fluctuations caused by multi-flow concurrency.

[0097] Furthermore, in one possible implementation of this embodiment, the message transceiver unit 121 can also be used to: obtain an aggregation descriptor from a hardware message queue; parse the aggregation descriptor to obtain message forwarding rules and first storage location information corresponding to multiple original messages.

[0098] For example, the message transceiver unit 121 can call relevant interfaces (such as the rte_eth_rx_burst interface under the DPDK (Data Plane Development Kit) framework) to poll the hardware message queue and obtain the aggregation descriptor from the hardware message queue; then, the message transceiver unit 121 parses the aggregation descriptor and obtains the relevant parameters passed by the hardware module 110, such as message forwarding rules, the first storage location information of the message block to be processed, and the second storage location information of the remaining message blocks, etc.

[0099] Therefore, the message sending and receiving unit can directly read the aggregate descriptor from the hardware message queue. With a single parsing operation, it can obtain the message forwarding rules and memory location information corresponding to multiple original messages in batches, without needing to parse each individual message descriptor. This batch reading and unified parsing method effectively simplifies the information acquisition process on the software side, reduces the number of message reading and parsing operations, further reduces the message interaction overhead between software and hardware, achieves efficient flow of batch data information, and effectively improves data reading efficiency in scenarios with large volumes of messages.

[0100] Optionally, in any embodiment of this disclosure, the software module 120 maintains a software flow table, and the software module 120 may further include an allocation unit 123 and a flow table management unit 124, wherein: The allocation unit 123 is used to allocate a corresponding target network flow identifier to the processed original packet when the query result indicates that there is no packet forwarding rule matching the original packet in the hardware flow table.

[0101] The flow table management unit 124 is used to perform flow table update processing on hardware flow tables and software flow tables based on the target network flow identifier and the first attribute information of the original packet.

[0102] The first attribute information may include, but is not limited to: quintuple information, VNI, etc.

[0103] As an example, after the packet processing unit 122 completes ACL verification and session establishment for the original packet that failed to find a match, it can send the processed original packet to the allocation unit 123. The allocation unit 123 can then configure a 32-bit unique target network flow identifier for the packet and, based on the target network flow identifier and the first attribute information of the original packet, encapsulate an mbuf structure within that mbuf. A hitchhiking flag is set in the structure; then, the allocation unit 123 passes the flagged mbuf structure to the message transceiver unit 121; subsequently, the message transceiver unit 121 can parse the mbuf structure to obtain the target network flow identifier, the first attribute information of the original message, and simultaneously allocate the BOE bitmap index. After integrating the above information and encapsulating it into a flow table entry structure, it is sent to the flow table management unit 124. Finally, the flow table management unit 124 creates a flow table entry (referred to as a message forwarding rule in this disclosure) that matches the software flow table based on the flow table entry structure and caches it in the software flow table; then, the flow table management unit 124 can send a creation request to the hardware module 110. This request can carry the target network flow identifier and the first attribute information of the original message for the new flow table entry. Subsequently, the hardware module 110 can create a flow table entry that matches the hardware flow table based on the target network flow identifier and the first attribute information and cache it in the hardware flow table; after creation, the hardware module 110 communicates with the hardware module via CQ (Completion Queuing). The Queue (completion queue) feeds back the execution results. The flow table management unit 124 obtains the feedback information by polling the CQ, and then synchronously updates the status information of the corresponding flow table entry in the software flow table.

[0104] Among them, the hitchhiking marker can be used to indicate that the mbuf structure has carried flow table parameters such as the target network flow identifier and first attribute information after the upper layer has completed the session establishment. After the marker is identified, the above parameters can be directly extracted to complete the flow table entry without repeated parsing and matching, thus accelerating the construction of the flow table cache.

[0105] Therefore, for original packets that do not match the hardware flow table, the allocation unit can dynamically assign a corresponding target network flow identifier to them. The flow table management unit then combines the network flow identifier with the packet attribute information to synchronously update the software and hardware flow tables. This enables the completion of flow table entries for packets that do not match the hardware flow table, automatically learns and iteratively includes rules for new traffic, and effectively solves the problems of delayed flow table distribution and inefficient processing of new traffic under the software-hardware separation architecture in related technologies. It achieves dynamic synchronous updates of software and hardware flow tables, adapting to automatic flow table updates without manual intervention or hardware modification, improving flow table adaptation and iteration efficiency, reducing software forwarding pressure caused by frequent flow table misses, gradually increasing traffic hardware offloading coverage, and continuously optimizing packet forwarding stability and overall processing performance.

[0106] Optionally, in one possible implementation of this disclosure, the software module 120 maintains a software flow table, and the software module 120 may further include a detection unit 125 and a flow table management unit 124, wherein: The detection module 125 is used to detect the session to which the original packet belongs, obtain detection information, and determine whether the session meets the flow table failure condition based on the detection information.

[0107] The flow table management module 124 is used to perform expiration processing on software flow tables and hardware flow tables based on the flow table status when the session meets the flow table expiration conditions; wherein, the flow table status is used to indicate the status of software flow tables and hardware flow tables.

[0108] The detection information may include, but is not limited to, session idle time, session start time, etc.

[0109] The flow table failure conditions can be preset. For example, flow table failure conditions can be: the session idle time reaches a preset time threshold (such as 300s), or the two communicating parties corresponding to the session actively initiate a connection closure command, etc. This disclosure does not limit this.

[0110] For example, the flow table state may include: initial state 0xF, 0x1, 0x0, 0x2F, 0x21, 0x20, wherein 0xF can be used to instruct the flow table management module 124 to initiate a request to create a flow table entry (referred to as a packet forwarding rule in this disclosure), but no response is received from the hardware module 110; when the flow table state changes to: If 0xF→0x1, it indicates that the flow table management module 124 has received the CPL (Completion) instruction sent by the hardware module 110, and the corresponding flow table entry has been successfully created in both the software flow table and the hardware flow table. If 0xF→0x0, it indicates that the flow table management module 124 received an instruction from the hardware module 110CPL, and the corresponding flow table entry failed to be created in the hardware flow table. If 0xF→0x2F, it indicates that the flow table management module 124 has not received the CPL instruction sent by the hardware module 110, and the flow table management module 124 has received the expiration processing request sent by the detection module 125. If 0x1→0x21, it indicates that the flow table management module 124 has received the expiration processing request sent by the detection module 125 and deleted the flow table entry indicated by the expiration processing request in the software flow table and the hardware flow table. If 0x0→0x20, it indicates that the flow table management module 124 has received an expiration processing request sent by the detection module 125 and deleted the relevant mapping relationship of the flow table entry indicated by the expiration processing request in the software flow table. If 0x2F→0x21, it indicates that the flow table management module 124 has received the CPL instruction sent by the hardware module 110, and the corresponding flow table entry has been successfully created in both the software flow table and the hardware flow table, and the expiration process is executed. If 0x2F→0x20, it indicates that the flow table management module 124 has received the CPL instruction sent by the hardware module 110, and the corresponding flow table entries have all failed to be created in the hardware flow table, and expiration processing is performed.

[0111] It should be noted that the above-mentioned flow table states and the information indicated by state changes are merely exemplary. In practical applications, they can be set as needed, and this disclosure does not impose any restrictions on them.

[0112] This allows for the accurate identification of flow table entries corresponding to invalid, timed-out, and offline sessions, automatically releasing expired resources and cleaning up flow table entries. This avoids the long-term accumulation of redundant and invalid entries in both hardware and software flow tables, effectively saving hardware flow table resources, improving flow table retrieval and distribution efficiency, and preventing forwarding lag and performance degradation caused by flow table overflow and entry redundancy. Simultaneously, it achieves synchronization between hardware and software flow tables (e.g., synchronized aging, synchronized failure, synchronized updates), maintaining consistency between the two flow table states, avoiding issues such as incorrect hardware and software flow table rules and abnormal matching, further reducing forwarding fluctuations caused by unknown traffic and abnormal sessions, and continuously optimizing the overall stability and resource utilization of packet forwarding.

[0113] The data processor of this embodiment includes a preprocessing unit, configured to extract a packet block to be processed from the original packet and store it in shared memory when a query result indicates the existence of a packet forwarding rule matching the original packet in the hardware flow table, thereby obtaining first storage location information; a generation unit, configured to generate a packet descriptor for the original packet based on the packet forwarding rule and the first storage location information; a packet transceiver unit, configured to parse the packet descriptor to obtain the packet forwarding rule and the first storage location information; and a packet processing unit, configured to process the original packet based on the packet forwarding rule and the first storage location information. Thus, after a packet matches a packet forwarding rule, the preprocessing unit extracts the packet block to be processed and stores it in shared memory, simultaneously obtaining storage location information. The generation unit then combines the packet forwarding rule and storage location information to construct a packet descriptor. The software module can quickly obtain the corresponding packet forwarding rule and memory location by parsing the packet descriptor through the packet transceiver unit, and complete the reading and subsequent processing of the packet block to be processed using shared memory. This interaction mode can effectively simplify the data transfer process between software and hardware, eliminating the need to repeatedly copy the complete message content, effectively reducing data interaction time, standardizing the information exchange format between software and hardware, maintaining efficient and orderly message data transmission, and at the same time, relying on a unified information transmission format to stabilize the data processing process, avoiding performance fluctuations caused by path switching in a software and hardware separation architecture, rationally dividing the processing responsibilities of software and hardware, further reducing architectural coupling, facilitating flexible adjustment of forwarding rules, and improving the overall message processing speed and operational stability while maintaining normal communication interaction.

[0114] The above is an explanation of the data processor. This disclosure also proposes an application method of the data processor, namely, a message forwarding control method based on the data processor.

[0115] like Figure 5 As shown, this disclosure also proposes a message forwarding control method based on a data processor. Figure 5 This is a schematic diagram according to the fourth embodiment of the present disclosure. The packet forwarding control method based on a data processor includes a software module and a hardware module. The software module includes a query unit and a post-processing unit. The method may include the following steps: Step 501: Obtain the original message through the query unit, and query the hardware flow table based on the original message to obtain the query result.

[0116] Step 502: Based on the query results, the software module determines the corresponding target operation and performs the target operation on the original message.

[0117] Step 503: The target message is forwarded through the post-processing unit; wherein the target message is the processed original message.

[0118] As one possible implementation, if the hardware module also includes a generation unit and the software module includes a message sending and receiving unit and a message processing unit, the generation unit can generate a message descriptor for the original message based on the query result, and the message sending and receiving unit can parse the message descriptor to obtain the query result; the message processing unit can determine the corresponding target operation based on the query result and perform the target operation on the original message.

[0119] As one possible implementation, if the hardware module also includes a preprocessing unit, when the query result indicates that there is a packet forwarding rule matching the original packet in the hardware flow table, the preprocessing module extracts the packet block to be processed from the original packet and stores the packet block to be processed in shared memory to obtain the first storage location information; the generation unit generates the packet descriptor of the original packet based on the packet forwarding rule and the first storage location information.

[0120] As one possible implementation, the message descriptor is parsed by the message transceiver unit to obtain the message forwarding rules and the first storage location information; the message processing unit reads the message block to be processed from the shared memory based on the first storage location information, and queries the software flow table based on the message forwarding rules to determine the target operation processing; the message processing unit performs the target operation processing on the message block to be processed to obtain the target message block.

[0121] As one possible implementation, the message processing unit updates the message block to be processed indicated by the first storage location information in the shared memory to the target message block.

[0122] As one possible implementation, the post-processing unit obtains the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message; the post-processing unit reads the target message block from the shared memory based on the first storage location information and reads the remaining message blocks based on the second storage location information; the post-processing unit reassembles the target message block and the remaining message blocks to obtain the target message.

[0123] As one possible implementation, the message sending and receiving unit assigns values ​​to the fields of the pre-allocated memory buffer structure based on the message forwarding rules and the first storage location information to obtain the target data structure pointing to the message block to be processed; the message processing unit obtains the target data structure based on the target interface and parses the target data structure to obtain the message forwarding rules and the first storage location information.

[0124] As one possible implementation, when the packet forwarding rules include network flow identifiers and there are multiple original packets, the packet processing unit can perform a first clustering on the unprocessed packet blocks corresponding to the multiple original packets based on the network flow identifiers to obtain at least one cluster; for any cluster, the packet processing unit can perform target operation processing on the unprocessed packet blocks in the cluster corresponding to the cluster to obtain the corresponding target packet block.

[0125] As one possible implementation, when the packet forwarding rules include network flow identifiers and there are multiple original packets, the generation unit can perform a second clustering of the packet descriptors corresponding to the multiple original packets based on the network flow identifiers to obtain at least one descriptor group. For any descriptor group, if the descriptor group meets the set aggregation conditions, the generation unit can perform information aggregation processing on the packet descriptors in the descriptor group to obtain an aggregated descriptor. The generation unit can then send the aggregated descriptor to the hardware message queue.

[0126] As one possible implementation, the aggregation descriptor is obtained from the hardware message queue through the message transceiver unit; the aggregation descriptor is then parsed by the message transceiver unit to obtain the message forwarding rules and first storage location information corresponding to multiple original messages.

[0127] As one possible implementation, if the software module maintains a software flow table and the software module also includes an allocation unit and a flow table management unit, when the query result indicates that there is no packet forwarding rule matching the original packet in the hardware flow table, the allocation unit assigns the corresponding target network flow identifier to the processed original packet; and the flow table management unit performs flow table update processing on the hardware flow table and the software flow table based on the target network flow identifier and the first attribute information of the original packet.

[0128] As one possible implementation, if the software module maintains a software flow table and also includes a detection module and a flow table management unit, the detection module detects the session to which the original packet belongs, obtains detection information, and determines whether the session meets the flow table expiration conditions based on the detection information. If the session meets the flow table expiration conditions, the flow table management unit performs expiration processing on the software flow table and hardware flow table based on the flow table status. The flow table status is used to indicate the status of the software flow table and the hardware flow table.

[0129] It should be noted that the foregoing explanation of the data processor also applies to this embodiment, and will not be repeated here; moreover, this embodiment can achieve all the technical effects corresponding to the aforementioned data processor, and will not be repeated here.

[0130] This disclosure discloses a packet forwarding control method based on a data processor. The data processor includes a software module and a hardware module. The hardware module includes a query unit and a post-processing unit. The query unit obtains the original packet to be forwarded and queries the hardware flow table based on the original packet to obtain the query result. The software module determines the corresponding target operation based on the query result and executes the target operation on the original packet. The post-processing unit performs forwarding control on the target packet. The target packet is the processed original packet. Thus, relying on a software and hardware co-architecture, the hardware query unit uniformly receives packets and completes flow table queries, the software module flexibly completes various operation processing logics, and the post-processing unit in the hardware module uniformly executes forwarding control, realizing unified packet processing. This method abandons the fast and slow path separation mode in related technologies, eliminates the latency deviation caused by path switching, effectively avoids the problems of large forwarding performance fluctuations and uncontrollable operating status, improves packet forwarding efficiency, and can reasonably distribute the business processing load, reduce software processing pressure, give full play to the hardware offloading advantage, and at the same time, the flexible operation processing logic is implemented by the software module, reducing the coupling between the processing logic and the hardware architecture, and facilitating the rapid updating and adjustment of the hardware flow table.

[0131] To clearly illustrate the data processor and the message forwarding control method based on the data processor disclosed herein, a detailed explanation is provided below with examples.

[0132] As an example, Figure 6 This is a schematic diagram of the core architecture of a data processor, such as... Figure 6 As shown, the data processor includes: a hardware module 610 and a software module 620; wherein, the hardware module 610 may employ an FPGA chip, and the hardware module 610 includes a BOE flow table offloading module 611 (referred to as a query unit in this disclosure), a message preprocessing module 612 (referred to as a preprocessing unit in this disclosure), a message aggregation module 613 (referred to as a generation unit in this disclosure), and a message postprocessing unit 614 (referred to as a postprocessing unit in this disclosure); the software module 620 includes a driver 621 and a virtual switch 622 under the DPDK framework, the driver 621 includes a message sending and receiving unit 6211, and the virtual switch 622 includes a VPP (Vector Packet Processing) batch message processing module (referred to as a message processing unit in this disclosure) 6221, wherein: The message preprocessing module 612 is used to obtain the original message to be forwarded and send the original message to the BOE flow table offloading module 611; The BOE flow table offloading module 611 is used to extract the five-tuple information from the original packet and match it with the hardware flow table based on the five-tuple information. After a successful match, the forwarding rule information such as the network flow identifier (Flow ID) and VNI that match the original packet based on the hardware flow table is sent to the packet preprocessing module 612. The message preprocessing module 612 is further configured to receive forwarding rule information and parse the original message to identify the boundary position information of the message header (including the start and end positions); and based on the boundary position information, split the original message into a message header (referred to as the message block to be processed in this disclosure) and a message payload (referred to as the remaining message block in this disclosure); cache the message header in shared memory and cache the message payload in the BM of the FPGA chip to obtain the first storage location information of the message header (such as including the IDX (Index) offset index) and the second storage location information of the message payload (such as including the PID (Payload ID) index); and send the forwarding rule information, the first storage location information of the message header, the second storage location information of the message payload, and the message header length to the message aggregation module 613. The packet aggregation module 613 receives forwarding rule information, first storage location information of the packet header, second storage location information of the packet payload, and packet header length from the packet preprocessing module 612. Based on the forwarding rule information, first storage location information of the packet header, second storage location information of the packet payload, and packet header length corresponding to the original packet, it assembles and generates a packet descriptor corresponding to the original packet. When there are multiple original packets, it clusters the packet descriptors corresponding to the multiple original packets based on the network flow identifier (Flow ID) corresponding to each original packet to obtain a descriptor group corresponding to each network flow identifier. For any descriptor group, if the descriptor group meets the set aggregation conditions, it performs information aggregation processing on the packet descriptors in the descriptor group to obtain an aggregated descriptor. The aggregated descriptor is stored in the circular queues at both ends of the software and hardware, and the hardware-side PI (Produce Index) in the circular queues at both ends of the software and hardware is updated to mark the data storage location. The message transceiver unit 6211 is used to call the rte_eth_rx_burst interface under the DPDK framework to poll the aggregation descriptors in the circular queues at both ends of the software and hardware, and simultaneously update the hardware-side CI (ConsumeIndex) in the circular queues at both ends of the software and hardware; it parses the aggregation descriptors to obtain the forwarding rule information of the corresponding original message, the first storage location information of the message header, the second storage location information of the message payload, and the message header length; based on the above information, it assigns values ​​to the fields of the pre-allocated mbuf structure (referred to as the memory buffer structure in this disclosure) to obtain the target mbuf structure (referred to as the target data structure in this disclosure); and sends the target mbuf structure to the VPP batch message processing module 6221; wherein, VPP batch message processing module 6221 is used to receive target mbuf structures; parse the target structures to obtain corresponding forwarding rule information and first storage location information; wherein, the forwarding rule information includes network flow identifiers; when there are multiple target mbuf structures, based on the network flow identifiers, the multiple target mbuf structures are clustered to obtain the aggregation groups (referred to as clusters in this disclosure) corresponding to each network flow identifier, and the target mbuf structures in the aggregation groups corresponding to each network flow identifier are classified into the vector buffer corresponding to the network flow identifier; for any aggregation group, the target mbuf structure is extracted from the first target mbuf structure in the vector buffer corresponding to the aggregation group. The target field is used to obtain the network flow identifier and first storage location information corresponding to the aggregation group; based on the network flow identifier, the software flow table is queried to determine the target operation processing corresponding to the aggregation group, such as ACL verification, NAT translation and other business operation processing; based on the first storage location information corresponding to the aggregation group, the corresponding packet header is read from the shared memory, and the target operation processing corresponding to the aggregation group is performed in batches on the read packet header to obtain the processed packet header (referred to as the target packet block in this disclosure); the packet header at the first storage location in the shared memory is updated to the corresponding processed packet header; the processed target mbuf structure is sent in batches to the packet transceiver unit 6211 through the DPDK rte_eth_rx_burst interface; The message transceiver unit 6211 is also used to receive the processed target mbuf structure; and parse the target mbuf structure to obtain the relevant information carried by the target mbuf structure, such as network flow identifier, first storage location information, second storage location information, VNI, etc.; and send the relevant information carried by the target mbuf structure to the message post-processing unit 614. The message post-processing unit 614 is used to obtain first storage location information and second storage location information, and based on the first storage location information, obtain the corresponding processed message header from the shared memory, and based on the second storage location information, obtain the message payload from the BM; perform message reassembly based on the processed message header and message payload to obtain the processed original message, i.e., the target message; and perform forwarding control on the target message.

[0133] To achieve forwarding control of target packets, as an example, before forwarding the target packet, the packet post-processing unit 614 can calculate the packet integrity check value (such as CRC (Cyclic Redundancy Check) check value) of the target packet and write it into the reserved fields of the packet (such as the reserved storage area at the end of the frame, etc.); perform protocol compliance check on the target packet to determine whether the packet protocol field of the target packet conforms to the standard specification; when it is determined that the packet protocol field of the target packet conforms to the standard specification, forward the target packet, for example, by sending it to the external network side or the host side through the MAC (Media Access Control) interface or PCIe (Peripheral Component Interconnect Express) bus.

[0134] As another example, when it is determined that the message protocol field of the target message does not conform to the standard specification, the target message is discarded, and the number of discarded messages can be accumulated and recorded through registers.

[0135] Optionally, as a possible implementation, the BOE flow table offloading module 611 can also be used to implement hardware storage of packet forwarding rules (also known as flow table rule items, flow table entries, etc.). Specifically, the BOE flow table offloading module 611 can use a two-level hash table to complete the hardware storage of flow table rule items in the software-side flow table. The first-level hash table uses a hash algorithm based on the packet 5-tuple to achieve fast location of the flow table bucket, and the second-level hash table uses the CRC32 hash algorithm to resolve hash collisions. It should be noted that this storage architecture can support stable storage of 4M flow table rule items. Each flow table rule item has a fixed length, and can completely store core flow table information such as 5-tuples, Flow ID, VNI, and Action index, providing data support for high-speed matching.

[0136] Optionally, as a possible implementation, the BOE flow table unloading module 611 can also be used for flow table instruction response and updates. Specifically, the BOE flow table unloading module 611 can receive flow table creation, deletion, and other instructions issued by the software module 620 through the SQ (Send Queue), execute the above instructions and synchronously update the hardware flow table, and return the execution result to the software side through the CQ (Completion Queue) after the above operations are completed.

[0137] Optionally, the message preprocessing module 612 can identify the header boundaries of at least one type of message, such as, but not limited to, the headers of Ethernet, IPv4 (Internet Protocol version 4), IPv6 (Internet Protocol version 6), ICMP (Internet Control Message Protocol), UDP (User Datagram Protocol), TCP (Transmission Control Protocol), VXLAN (Virtual Extensible LAN), and other message types. It can also distinguish the start and end positions of Layer 2 to Layer 4 protocol headers and VXLAN tunnel message headers.

[0138] Optionally, the aggregation conditions may include: the number of message descriptors in the descriptor group reaches the aggregation quantity threshold (referred to as the set quantity threshold in this disclosure), the aggregation duration of the descriptor group reaches the message aggregation duration threshold (referred to as the preset duration in this disclosure), and so on.

[0139] Optionally, the driver 621 can send an initialization request to the hardware module 610 via PCIe to complete the shared memory region partitioning and address mapping configuration in sequence, and at the same time complete the configuration settings of related parameters such as the packet aggregation duration threshold and the aggregation quantity threshold.

[0140] To achieve complete isolation of link resources under the hardware-software co-engineering architecture, for example, eight dedicated channel queue pairs are added between the hardware module 610 and the software module 620 for each of the two types of links: uplink hardware to software transmission and downlink software to hardware transmission. The software module 620 independently configures the queue start / stop enable, queue depth, and head and tail pointer base address registers for each queue pair, and completes the initialization of the head and tail pointers to maintain real-time synchronization of the hardware and software data transmission pointers. The hardware and software uniformly set the queue pair depth to 4096, and configure 4096 individual 32-byte message descriptors for each queue pair. Relying on standardized parameter configuration, multiple links do not interfere with each other, achieving stable and efficient parallel data transmission between hardware and software.

[0141] Optionally, driver 621 may also include a flow table management module.

[0142] Optionally, the BOE flow table offloading module 611 is also used to mark the original message as a miss when a match is not found (e.g., the original message is the first packet of a data flow), and send the marked original message to the message transceiver unit 6211; the message transceiver unit 6211 can receive the marked original message and send it to the VPP batch message processing module 6221; the VPP batch message processing module 6221, upon receiving the marked original message, determines the corresponding target operation processing based on its mark, performs the target operation processing on the original message, and sends the processed original message to the message transceiver unit 6211; the message transceiver unit 6211 then sends the processed original message to the message post-processing unit 614, so that the message post-processing unit 614 can perform forwarding control on the processed original message.

[0143] Optionally, the virtual switch 622 can assign a unique target network flow identifier (Flow ID) to the processed original packet, and can encapsulate the corresponding mbuf structure of the original packet based on the Flow ID, and can set a hitchhiking flag inside the encapsulated mbuf structure; then, the virtual switch 622 can send the mbuf structure carrying the flag to the driver 621; then, the driver 621 can parse the mbuf structure to obtain the target network flow identifier, the first attribute information of the original packet (such as 5-tuple information, VNI, etc.), and simultaneously allocate a BOE bitmap index, integrate the above information, encapsulate it into a flow table entry structure, and send it to the flow table management module (referred to as the flow table management unit in this disclosure). Finally, the flow table management module creates a flow table entry that matches the software flow table based on the flow table entry structure. The flow table entry (referred to as packet forwarding rule in this disclosure) is configured and cached in the software flow table. Then, the flow table management module can send a creation request to the hardware module 110. The request can carry the target network flow identifier and the first attribute information of the original packet for the new flow table entry. Then, the hardware module 110 can create a flow table entry that matches the hardware flow table based on the target network flow identifier and the first attribute information, and cache it in the hardware flow table. After creation, the hardware module 110 feeds back the execution result via CQ. The flow table management module obtains the feedback information by polling CQ, and then synchronously updates the status information of the corresponding flow table entry in the software flow table.

[0144] Optionally, the driver 621 may also include a detection module.

[0145] Optionally, the detection module can be used to detect the session to which the original packet belongs, obtain detection information, and determine whether the session meets the flow table expiration conditions based on the detection information; the flow table management module can also be used to perform expiration processing on the software flow table and hardware flow table based on the flow table status when the session meets the flow table expiration conditions; wherein, the flow table status is used to indicate the status of the software flow table and hardware flow table.

[0146] It should be noted that the above examples of data processors are merely illustrative. In practical applications, the relevant configuration parameters can be configured as needed, and this disclosure does not impose any restrictions on this.

[0147] As an example, the data processor disclosed herein can be used in at least one of the following fields: 1. Cloud computing and data center field This enables data forwarding in a virtual private cloud network and accelerates network I / O (Input / Output) transmission on cloud servers within a DPU (Data Processing Unit) device.

[0148] 2. Deployed in high-performance computing scenarios It can meet the needs of high-speed data interaction and low-latency communication transmission across nodes in distributed clusters.

[0149] 3. Can be integrated into various enterprise-level network devices As the core hardware acceleration module of DPU in devices such as firewalls and load balancers, it fully adapts to the needs of various mainstream network service applications. In summary, the data processor disclosed herein ensures that all network packets flow uniformly through three standardized processing stages: hardware preprocessing, software business processing, and hardware post-processing. It abandons the design pattern of independent and fragmented operation of software and hardware data paths found in related technologies, achieving unified flow of all types of packets from the same source and along the same path. Relying on the hardware side to offload high-computing, high-load fixed processing tasks such as protocol parsing, verification calculations, and reassembly, coupled with the software side to flexibly carry dynamic and variable processing logic such as business strategy configuration, flow table management, and logical scheduling, this hardware-software collaborative operation mechanism effectively improves the overall architecture's business adaptability and functional scalability while fully guaranteeing high-speed packet forwarding throughput, achieving a balance between high-performance forwarding and flexible business expansion.

[0150] The data processor disclosed herein has at least the following advantages: 1. By leveraging batch packet aggregation and processing and a unified data transmission path, the overhead of data interaction between hardware and software is effectively reduced, latency loss caused by path switching is eliminated, and overall packet forwarding latency is significantly lowered. Simultaneously, the batch processing mechanism improves overall packet processing efficiency, and the efficient distribution mechanism of flow table entries simplifies control-level resource consumption, enhancing overall data throughput. Furthermore, all network packets follow a unified processing flow, avoiding performance instability issues caused by differentiated transmission paths, making the overall business operation more stable and controllable.

[0151] 2. By entrusting flexible and adaptable business logic to software implementation, it supports rapid feature iteration and remote hot upgrades, enabling quick adaptation to various new business application scenarios and effectively shortening product feature update cycles. The overall design minimizes the need for dedicated custom hardware development; adding new business functions requires no changes to the hardware architecture, effectively reducing hardware R&D and design investment and controlling overall development costs. The data processor disclosed herein possesses excellent business adaptability, is compatible with various mainstream network forwarding and security management business scenarios, and can be deployed on existing mature hardware architectures without requiring large-scale architecture modifications.

[0152] 3. In daily operation and maintenance management, relying on the software-based dynamic logic upgrade mode, business functions can be updated and upgraded online without equipment downtime, effectively simplifying the operation and maintenance process and reducing daily operation and maintenance investment. Stable and controllable operating performance can effectively reduce the adverse effects of network data transmission fluctuations, ensuring the continuous and stable operation of upper-layer services. The overall architecture has strong scalability, and flow table control rules and business processing logic can be flexibly expanded according to actual business needs, accurately matching customized business needs in different industry scenarios.

[0153] The collection, storage, use, processing, transmission, provision, and disclosure of users' personal information are all conducted with the consent of the users and comply with relevant laws and regulations, and do not violate public order and good morals.

[0154] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0155] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0156] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded into random access memory (RAM) 703 from storage unit 708. The RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0157] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0158] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a data processor-based message forwarding control method. For example, in some embodiments, the data processor-based message forwarding control method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the data processor-based message forwarding control method described above can be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform a data processor-based packet forwarding control method by any other suitable means (e.g., by means of firmware).

[0159] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0160] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0161] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0162] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0163] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0164] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0165] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0166] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A data processor, wherein, The data processor includes a hardware module and a software module. The hardware module includes a query unit and a post-processing unit, wherein: The query unit is used to obtain the original packet to be forwarded and query the hardware flow table based on the original packet to obtain the query result; The software module is used to determine the corresponding target operation processing based on the query results, and to perform the target operation processing on the original message; The post-processing unit is used to control the forwarding of the target message; wherein the target message is the processed original message.

2. The data processor according to claim 1, wherein, The hardware module further includes a generation unit, and the software module includes a message sending and receiving unit and a message processing unit, wherein: The generation unit is used to generate a message descriptor for the original message based on the query result. The message transceiver unit is used to parse the message descriptor to obtain the query result; The message processing unit is used to determine the corresponding target operation based on the query result, and to perform the target operation on the original message.

3. The data processor according to claim 2, wherein, The hardware module further includes a preprocessing unit, wherein: The preprocessing unit is configured to extract a packet block to be processed from the original packet and store the packet block to be processed in shared memory when the query result indicates that there is a packet forwarding rule matching the original packet in the hardware flow table, so as to obtain the first storage location information. The generation unit is further configured to generate a message descriptor for the original message based on the message forwarding rules and the first storage location information.

4. The data processor according to claim 3, wherein, The message transceiver unit is further configured to parse the message descriptor to obtain the message forwarding rule and the first storage location information; The message processing unit is further configured to read the message block to be processed from the shared memory based on the first storage location information, and query the software flow table based on the message forwarding rules to determine the target operation processing; The target operation is performed on the message block to be processed to obtain the target message block.

5. The data processor according to claim 4, wherein, The message processing unit is further configured to: The pending message block indicated by the first storage location information in the shared memory is updated to the target message block.

6. The data processor according to claim 5, wherein, The post-processing unit is further configured to: Obtain the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message; Based on the first storage location information, the target packet block is read from the shared memory, and based on the second storage location information, the remaining packet block is read. The target message block and the remaining message block are reassembled to obtain the target message.

7. The data processor according to claim 4, wherein, The message sending and receiving unit is further configured to assign field values ​​to the pre-allocated memory buffer structure based on the message forwarding rules and the first storage location information, so as to obtain a target data structure pointing to the message block to be processed; The message processing unit is further configured to obtain the target data structure based on the target interface, and parse the target data structure to obtain the message forwarding rules and the first storage location information.

8. The data processor according to claim 7, wherein, The message forwarding rules include network flow identifiers, and there are multiple original messages; The message processing unit is further configured to: Based on the network flow identifier, a first clustering is performed on the unprocessed packet blocks corresponding to multiple original packets to obtain at least one cluster. For any cluster, perform target operation processing corresponding to the cluster on the unprocessed message block in the cluster to obtain the corresponding target message block.

9. The data processor according to claim 3, wherein, The message forwarding rules include network flow identifiers, and there are multiple original messages; The generation unit is further configured to: Based on the network flow identifier, a second clustering is performed on the message descriptors corresponding to multiple original messages to obtain at least one descriptor group; For any of the aforementioned descriptor groups, if the descriptor group satisfies the set aggregation conditions, information aggregation processing is performed on the message descriptors in the descriptor group to obtain the aggregated descriptor; The aggregation descriptor is sent to the hardware message queue.

10. The data processor according to claim 9, wherein, The message transceiver unit is further configured to: Obtain the aggregation descriptor from the hardware message queue; The aggregation descriptor is parsed to obtain the packet forwarding rules and first storage location information corresponding to the multiple original packets.

11. The data processor according to any one of claims 1-10, wherein, The software module maintains a software flow table, and the software module also includes an allocation unit and a flow table management unit, wherein: The allocation unit is configured to allocate a corresponding target network flow identifier to the processed original packet when the query result indicates that there is no packet forwarding rule matching the original packet in the hardware flow table; The flow table management unit is used to perform flow table update processing on the hardware flow table and the software flow table based on the target network flow identifier and the first attribute information of the original packet.

12. The data processor according to any one of claims 1-10, wherein, The software module maintains a software flow table, and the software module also includes a detection module and a flow table management unit, wherein: The detection module is used to detect the session to which the original packet belongs, obtain detection information, and determine whether the session meets the flow table failure condition based on the detection information. The flow table management unit is used to perform expiration processing on the software flow table and the hardware flow table based on the flow table status when the session meets the flow table expiration conditions; wherein, the flow table status is used to indicate the status of the software flow table and the hardware flow table.

13. A message forwarding control method based on a data processor, wherein, The data processor includes a hardware module and a software module. The hardware module includes a query unit and a post-processing unit. The method includes: The query unit obtains the original packet to be forwarded and queries the hardware flow table based on the original packet to obtain the query result. Based on the query results, the software module determines the corresponding target operation and performs the target operation on the original message. The post-processing unit controls the forwarding of the target message; wherein the target message is the processed original message.

14. The method according to claim 13, wherein, The hardware module further includes a generation unit, and the software module includes a message sending and receiving unit and a message processing unit. After obtaining the original packet to be forwarded through the query unit and querying the hardware flow table based on the original packet to obtain the query result, the method further includes: The generation unit generates a message descriptor for the original message based on the query result. Correspondingly, the step of determining the corresponding target operation based on the query result by the software module and performing the target operation on the original message includes: The message descriptor is parsed by the message transceiver unit to obtain the query result; The message processing unit determines the corresponding target operation based on the query result and performs the target operation on the original message.

15. The method according to claim 14, wherein, The hardware module also includes a preprocessing unit; The step of generating a message descriptor for the original message based on the query result by the generation unit includes: If the query result indicates that there is a packet forwarding rule matching the original packet in the hardware flow table, the preprocessing module extracts the packet block to be processed from the original packet and stores the packet block to be processed in shared memory to obtain the first storage location information; The generation unit generates the message descriptor of the original message based on the message forwarding rules and the first storage location information.

16. The method according to claim 15, wherein, The step of parsing the message descriptor through the message transceiver unit to obtain the query result includes: The message descriptor is parsed by the message transceiver unit to obtain the message forwarding rules and the first storage location information; Correspondingly, the step of determining the corresponding target operation based on the query result by the message processing unit and performing the target operation on the original message includes: The message processing unit reads the message block to be processed from the shared memory based on the first storage location information, and queries the software flow table based on the message forwarding rules to determine the target operation processing. The target message block is obtained by performing the target operation on the message block to be processed by the message processing unit.

17. The method according to claim 16, wherein, The method further includes: The message processing unit updates the message block to be processed indicated by the first storage location information in the shared memory to the target message block.

18. The method according to claim 17, wherein, The process of obtaining the target message includes the following steps: The post-processing unit obtains the first storage location information of the message block to be processed and the second storage location information of the remaining message blocks in the original message. The post-processing unit reads the target packet block from the shared memory based on the first storage location information, and reads the remaining packet block based on the second storage location information; The target message is obtained by reassembling the target message block and the remaining message block using the post-processing unit.

19. The method of claim 16, wherein, After parsing the message descriptor through the message transceiver unit to obtain the message forwarding rule and the first storage location information, the method further includes: The message sending and receiving unit assigns values ​​to the fields of the pre-allocated memory buffer structure based on the message forwarding rules and the first storage location information to obtain a target data structure pointing to the message block to be processed. The message processing unit obtains the target data structure based on the target interface and parses the target data structure to obtain the message forwarding rules and the first storage location information.

20. The method according to claim 19, wherein, The message forwarding rules include network flow identifiers, and there are multiple original messages; The step of performing the target operation processing on the message block to be processed by the message processing unit to obtain the target message block includes: Based on the network flow identifier, the message processing unit performs a first clustering on the message blocks to be processed corresponding to multiple original messages to obtain at least one cluster. For any cluster, the message processing unit performs target operation processing on the message block to be processed in the cluster, corresponding to the cluster, to obtain the corresponding target message block.

21. The method according to claim 15, wherein, The message forwarding rules include network flow identifiers, and there are multiple original messages; After the generation unit generates the message descriptor of the original message based on the message forwarding rule and the first storage location information, the method further includes: The generation unit performs a second clustering on the message descriptors corresponding to multiple original messages based on the network flow identifier to obtain at least one descriptor group. For any of the descriptor groups, if the descriptor group meets the set aggregation conditions, the generation unit performs information aggregation processing on the message descriptors in the descriptor group to obtain the aggregated descriptor; The generation unit sends the aggregation descriptor to the hardware message queue.

22. The method according to claim 21, wherein, The step of parsing the message descriptor through the message transceiver unit to obtain the message forwarding rule and the first storage location information includes: The aggregation descriptor is obtained from the hardware message queue through the message transceiver unit; The packet transceiver unit parses the aggregation descriptor to obtain packet forwarding rules and first storage location information corresponding to multiple original packets.

23. The method according to any one of claims 13-22, wherein, The software module maintains a software flow table, and the software module also includes an allocation unit and a flow table management unit; the method further includes: If the query result indicates that there is no packet forwarding rule matching the original packet in the hardware flow table, the allocation unit allocates the corresponding target network flow identifier to the processed original packet. The flow table management unit performs flow table update processing on the hardware flow table and the software flow table based on the target network flow identifier and the first attribute information of the original packet.

24. The method according to any one of claims 13-22, wherein, The software module maintains a software flow table, and the software module also includes a detection module and a flow table management unit; the method further includes: The detection module detects the session to which the original packet belongs, obtains detection information, and determines whether the session meets the flow table failure condition based on the detection information. If the session meets the flow table expiration condition, the flow table management unit performs expiration processing on the software flow table and the hardware flow table based on the flow table status; wherein, the flow table status is used to indicate the status of the software flow table and the hardware flow table.

25. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 13 to 24.

26. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 13 to 24.

27. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 13 to 24.