Message data communication method and device and computer equipment

Through virtual network interface communication between user space and kernel space, two-way data processing between user state protocol stack and kernel state protocol stack is realized, solving the compatibility problem of single-state network cards, reducing development and maintenance costs, and improving the performance of user state protocol stack.

CN120499301APending Publication Date: 2025-08-15CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510571127.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

In the prior art, most network cards only support single-state operation, which limits the usage scenarios of user-state protocol stacks, leads to increased development and maintenance costs, and is unable to be compatible with kernel-state management tools.

Method used

By receiving the original message data in the user space, sending the management surface data to the kernel space using the target virtual network port, processing using the kernel-state protocol stack, and obtaining response data through the user-state protocol stack, realizing two-way communication between the user-state and the kernel-state protocol stack.

Benefits of technology

It simplifies the development difficulty and maintenance cost of the user-state protocol stack, reduces the performance requirements of the network card, and improves the compatibility and flexibility of the user-state protocol stack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120499301A_ABST
    Figure CN120499301A_ABST
Patent Text Reader

Abstract

The invention relates to a message data communication method and device and computer equipment. The method comprises the following steps: receiving original message data of a local end application program based on a user mode protocol stack in a user space; determining at least one piece of management plane data in the original message data, and sending the at least one piece of management plane data to the kernel space through the target virtual network port; in the kernel space, processing the at least one piece of management plane data according to a protocol processing mode corresponding to the respective data type of the at least one piece of management plane data based on a kernel mode protocol stack to obtain first response data; in the user space, the first response data is obtained through the target virtual network port based on the user mode protocol stack, and the first target message data obtained according to the first response data is sent to the opposite-end application, so that the development difficulty and the maintenance cost of the user mode protocol stack are reduced, and the implementation process of the user mode protocol stack is simplified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data communication technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for communicating message data. Background Art

[0002] As network speeds increase, the Linux network protocol stack has significant software overhead. Intel has introduced the Data Plane Development Kit (DPDK) for data plane network acceleration. On the device side, user-mode protocol stacks are widely used in software development.

[0003] Currently, most network cards don't support simultaneous operation in both kernel and user modes, limiting the use cases for user-mode protocol stacks. Once a single-mode network card is taken over by a user-mode driver, it becomes inaccessible and unmanageable from kernel mode, forcing it to operate exclusively in user mode. This increases the functionality and compatibility requirements of the user-mode protocol stack, making development and maintenance more difficult and costly. Summary of the Invention

[0004] Based on this, it is necessary to provide a communication method, device, computer equipment, computer-readable storage medium and computer program product that can simplify the message data of single-state and polymorphic network cards using user-mode protocol stacks to address the above technical problems.

[0005] In a first aspect, the present application provides a method for communicating message data, the method comprising:

[0006] In user space, the original message data of the local application is received based on the user-mode protocol stack;

[0007] Determine at least one management plane data in the original message data, and send the at least one management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user mode protocol stack and the kernel mode protocol stack in the kernel space;

[0008] In the kernel space, based on the kernel state protocol stack, the at least one management plane data is processed according to protocol processing modes corresponding to respective data types of the at least one management plane data to obtain first response data;

[0009] In the user space, the first response data is obtained through the target virtual network port based on the user-mode protocol stack, and the first target message data obtained according to the first response data is sent to the opposite application.

[0010] In one embodiment, sending the at least one management plane data to the kernel space through the target virtual network port includes:

[0011] Determine at least one candidate virtual network port; the candidate virtual network port is configured for the user space and the kernel space;

[0012] Determining, from the at least one candidate virtual network port according to the configuration information of the at least one candidate virtual network port, a target virtual network port that supports data communication between the user mode protocol stack and the kernel mode protocol stack in the kernel space;

[0013] The at least one management plane data is sent to the kernel space through the target virtual network port according to a preset forwarding method.

[0014] In one embodiment, determining at least one candidate virtual network port includes:

[0015] When at least one physical network port in the physical network card is taken over by the user-mode driver in the user space, at least one candidate virtual network port corresponding to the at least one physical network port is created in the kernel space; the candidate virtual network port is used to simulate the data sending and receiving behavior of the physical network port to support data communication between the user space and the kernel space;

[0016] A correspondence between the at least one candidate virtual network port and the at least one physical network port is established, and configuration information of the at least one candidate virtual network port is determined based on the correspondence and configuration information of the at least one physical network port.

[0017] In one embodiment, the management plane data includes at least two, and the forwarding mode includes a single-thread forwarding mode;

[0018] The step of sending the at least one management plane data to the kernel space according to a preset forwarding method through the target virtual network port includes:

[0019] Adding each of the management plane data to the buffer data queue in sequence according to the order of receiving the original message data to which each of the management plane data belongs from first to last;

[0020] Through the first thread corresponding to the buffered data queue, each management plane data is sent from the buffered data queue to the kernel space through the target virtual network port in sequence according to the order in which each management plane data in the buffered data queue is added from first to last.

[0021] In one embodiment, the management plane data includes at least two, and the forwarding mode includes a multi-threaded forwarding mode;

[0022] The step of sending the at least one management plane data to the kernel space according to a preset forwarding method through the target virtual network port includes:

[0023] Adding each of the management plane data to at least two parallel data queues respectively;

[0024] Through the second threads corresponding to the at least two parallel data queues, the cached management plane data are respectively obtained from the parallel data queues, and the management plane data are respectively sent to the kernel space in parallel through the target virtual network port.

[0025] In one embodiment, determining at least one management plane data in the original message data includes at least one of the following:

[0026] Determining at least one management plane data from the original message data based on the user mode protocol stack and in accordance with a data diversion method corresponding to the target virtual network port;

[0027] Based on the user-mode protocol stack, the original message data is sent to the data plane acceleration suite to instruct the data plane acceleration suite to determine at least one management plane data from the original message data according to the data diversion method corresponding to the target virtual network port, and return the at least one management plane data.

[0028] In one embodiment, the method further comprises:

[0029] When the protocol processing mode satisfies the response data return condition, caching the first response data into the network port data queue corresponding to the target virtual network port based on the kernel state protocol stack;

[0030] When the protocol processing mode does not satisfy the response data return condition, performing response data processing in the kernel space for the first response data based on the kernel state protocol stack;

[0031] The obtaining, in the user space, the first response data through the target virtual network port based on the user state protocol stack includes:

[0032] In the user space, the first response data is obtained from the network port data queue corresponding to the target virtual network port based on the user state protocol stack.

[0033] In one embodiment, the method further comprises:

[0034] Determining at least one data plane data in the original message data;

[0035] In the user space, based on the user state protocol stack, the at least one data plane data is processed respectively according to a data processing mode corresponding to each of the at least one data plane data in the user state protocol stack to obtain second response data;

[0036] Generate second target message data according to the second response data, and send the second target message data to the opposite-end application.

[0037] In a second aspect, the present application further provides a communication device for message data, the device comprising:

[0038] A data receiving module is used to receive original message data from a local application in user space based on a user-mode protocol stack;

[0039] a data screening module, configured to determine at least one management plane data in the original message data, and send the at least one management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user mode protocol stack and the kernel mode protocol stack in the kernel space;

[0040] a management plane data processing module, configured to process the at least one management plane data in the kernel space based on the kernel state protocol stack and in accordance with protocol processing modes corresponding to respective data types of the at least one management plane data to obtain first response data;

[0041] A data sending module is used to obtain the first response data through the target virtual network port based on the user state protocol stack in the user space, and send the first target message data obtained according to the first response data to the opposite application.

[0042] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0044] In a fifth aspect, the present application also provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.

[0045] The above-mentioned communication method, device, computer equipment, computer-readable storage medium and computer program product for message data receive original message data of a local application based on a user-mode protocol stack in user space; determine at least one management plane data in the original message data, and send the at least one management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user-mode protocol stack and the kernel-mode protocol stack in the kernel space; in the kernel space, based on the kernel-mode protocol stack, the at least one management plane data is processed in accordance with the protocol processing mode corresponding to the data type of the at least one management plane data to obtain first response data; in the user space, the first response is obtained through the target virtual network port based on the user-mode protocol stack. data, and sends the first target message data obtained according to the first response data to the opposite application; by receiving the original message data based on the user-mode protocol stack in the user space, and sending the management plane data in the original message data to the kernel space through the target virtual network port, the kernel-mode protocol stack in the kernel space can process the management plane data according to its internal original protocol processing method, and return the processed first response data to the user space through the target virtual network port, so that the user can customize the complex management plane data according to the demand and perform processing logic in the kernel-mode protocol stack. The user-mode protocol stack no longer needs to process the complex management plane data, which is conducive to reducing the development difficulty and maintenance cost of the user-mode protocol stack, and thus simplifying the implementation process of the user-mode protocol stack. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 A diagram illustrating an application environment of a method for communicating message data in one embodiment;

[0048] Figure 2 1 is a flow chart of a method for communicating message data in one embodiment;

[0049] Figure 3 A flowchart of a method for communicating message data in an application example;

[0050] Figure 4 Schematic diagram of a flow chart of steps for sending management plane data in one embodiment;

[0051] Figure 5 This is a flowchart of the steps for configuring a virtual network port in an application example;

[0052] Figure 6 This is a flowchart showing the process of sending management plane data in a single-thread forwarding mode in an application example.

[0053] Figure 7 A schematic diagram of the process of sending management plane data in a multi-threaded forwarding manner in an application example;

[0054] Figure 8 A flowchart of data offloading based on a data plane acceleration kit in an application example;

[0055] Figure 9 A structural block diagram of a communication device for message data in one embodiment;

[0056] Figure 10 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0058] Most network cards do not support running in both kernel and user modes simultaneously. In some application scenarios, users may abandon the user-mode protocol stack because the Linux kernel protocol stack is more comprehensive and stable. This greatly limits the application scenarios of the user-mode protocol stack. However, the user-mode protocol stack can provide higher throughput and lower latency than the Linux kernel protocol stack.

[0059] Related technologies only support single-mode network cards. If users need to use a user-mode protocol stack, they must first use a device driver binding tool (such as DPDK-dev.py, DPDK: Data Plane Development Kit) to bind the network card as a user-mode driver. This can be achieved through the igb_uio (UIO, Userspace I / O, for the igb network card driver) framework in DPDK or the VFIO (Virtual Function I / O) framework in the Linux kernel. Once the network card is taken over by the user-mode driver, it becomes inaccessible to the Linux kernel. Furthermore, network card management tools in the Linux kernel (such as iproute2 and ethtool) will no longer be able to operate and manage the network card. Furthermore, because DPDK operates at Layer 2 and lacks IP (Internet Protocol) layer management logic, managing a user-mode network card generally requires developers to provide a separate network card management framework and tools to complement the user-mode protocol stack.

[0060] In addition, the Linux kernel's protocol stack supports many socket (interface) options, which come in a wide variety. Applications often have various requirements, requiring the user-mode protocol stack to implement more functions. Furthermore, management-plane data also requires support for more complex protocols, such as cross-domain routing learning, bonding (network card binding), and DHCP (Dynamic Host Configuration Protocol). This further increases the development difficulty, error rate, and maintenance cost of the user-mode protocol stack.

[0061] Therefore, for a single-state network card, if it only runs in user mode, this will increase the functional and compatibility requirements of the user-mode protocol stack. In addition, additional configuration management tools will be needed to manage the network card running in user mode, which will make the user-mode protocol stack become huge, and the development and maintenance costs will also increase accordingly, while also causing the performance of the network card to degrade.

[0062] Based on the above, the present invention provides a method for communicating message data, which can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. In the user space, the server 104 receives the original message data of the local application based on the user-mode protocol stack; and determines at least one management plane data in the original message data, and sends the at least one management plane data to the kernel space through the target virtual network port; wherein the target virtual network port is configured for the user-mode protocol stack and the kernel-mode protocol stack in the kernel space; then, in the kernel space, the server 104 processes the at least one management plane data based on the kernel-mode protocol stack in accordance with the protocol processing method corresponding to the data type of each at least one management plane data, and obtains the first response data; finally, in the user space, the server 104 obtains the first response data through the target virtual network port based on the user-mode protocol stack, and sends the first target message data obtained according to the first response data to the opposite application.

[0063] Terminal 102 may include, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, smart car devices, and projectors. Portable wearable devices may include smart watches, smart bracelets, and head-mounted devices. Head-mounted devices may include virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, and the like. Server 104 may be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.

[0064] In an exemplary embodiment, Figure 2 As shown, a communication method for message data is provided, which is applied to Figure 1 The server 104 in FIG is used as an example to illustrate, and it is understood that the method can also be applied to Figure 1 The terminal 102 in the embodiment can also be applied to a system including the terminal 102 and the server 104, and implemented through the interaction between the terminal 102 and the server 104. The method of this embodiment includes the following steps 202 to 208. Among them:

[0065] Step 202: In user space, original message data of a local application is received based on a user-mode protocol stack.

[0066] User space refers to the environment in which user applications run. Due to access permissions, user space applications cannot directly access system hardware resources and must instead request kernel services through system calls to access resources. The user-mode protocol stack refers to the network protocol stack running in user space. This stack migrates network protocol stack functionality originally implemented in the operating system kernel, such as TCP / IP (Transmission Control Protocol / Internet Protocol) protocol processing, to user space, where it is directly managed by user-mode applications to process application-layer data packets. Local applications refer to software programs running on user devices. Local applications can exchange data with remote devices or services through the network interfaces provided by the operating system. Raw packet data refers to data packets sent directly from local applications without being processed by the protocol stack, or network data packets received from a physical network interface card. Raw packet data may include, but is not limited to, management plane data and data plane data.

[0067] Exemplarily, the server may receive original message data sent by a local application in a user space of the local application based on a user-mode protocol stack of the user space.

[0068] Step 204: Determine at least one piece of management plane data in the original message data, and send the at least one piece of management plane data to the kernel space through the target virtual network port.

[0069] Management plane data refers to data extracted from raw packet data and sent to kernel space for processing for managing, configuring, or monitoring network devices and protocol stacks. In specific implementations, management plane data may include, but is not limited to, protocol data such as the Address Resolution Protocol (ARP), routing control protocols (such as route learning), and link layer discovery protocols (such as bonding port negotiation). A target virtual network port refers to a virtual network interface used for communication between user space and kernel space. A target virtual network port can be a virtual network card implemented in software. In specific implementations, the target virtual network port is configured for the user-mode protocol stack and the kernel-mode protocol stack in kernel space. For example, the target virtual network port can be configured using a virtual network device driver or application programming interface (API) provided by the operating system. Virtual network devices may include KNI (Kernel NIC Interface) and TAP (Tunneling traffic access point). Through the target virtual network port, the user-mode protocol stack can send management plane data to kernel space and receive response data from kernel space.

[0070] Kernel space corresponds to user space. Kernel space refers to the environment in which the operating system kernel runs. The kernel (such as the Linux kernel) has direct access to system hardware resources and is responsible for managing various system resources and providing system services. The kernel-mode protocol stack refers to the network protocol stack running in kernel space. It is responsible for processing network packets sent by the user-mode protocol stack (i.e., management-plane data).

[0071] Exemplarily, the server may determine at least one piece of management plane data in the received original message data based on the data type of each piece of data in the original message data, and send the at least one piece of management plane data to the kernel space via the target virtual network port. For example, the server may establish a forwarding thread between the user space and the kernel space, and based on the forwarding thread, send the determined at least one piece of management plane data one by one or in parallel to the network port data queue of the target virtual network. The target virtual network port then sends the at least one piece of management plane data in the network port data queue to the kernel space.

[0072] Step 206: In the kernel space, based on the kernel protocol stack, the at least one management plane data is processed according to the protocol processing manner corresponding to each data type of the at least one management plane data to obtain first response data.

[0073] The protocol processing method refers to the method used to process management plane data (i.e., protocol data) based on its data type (i.e., network protocol type). Different protocol data has different processing methods. In implementation, the kernel-mode protocol stack selects the appropriate protocol processing method based on the data type of the management plane data. These processing methods include, but are not limited to, protocol header parsing, routing, data forwarding, and response. The specific method depends on the network protocol type and application scenario requirements. For example, when the management plane data is ARP data, the corresponding protocol processing methods may include, but are not limited to, header parsing, address learning, response generation, and cache management. For another example, when the management plane data is route learning data, the corresponding protocol processing methods may include, but are not limited to, routing table updates, policy-based routing, and load balancing. For another example, when the management plane data is bonding port negotiation data, the corresponding protocol processing methods may include, but are not limited to, mode negotiation, member link management, and traffic distribution.

[0074] The first response data refers to the response data generated by the kernel-mode protocol stack after processing the management plane data. The first response data may include, but is not limited to, processing results, status information, configuration confirmation, etc. The first response data may or may not be returned to the user space, depending on the protocol processing method. When the first response data needs to be returned to the user space, the kernel-mode protocol stack will send the first response data to the network port data queue of the target virtual network port. When the first response data does not need to be returned, the kernel-mode protocol stack will process the first data accordingly based on the protocol processing method.

[0075] Exemplarily, after the management plane data is sent to the kernel space, the server can determine the protocol processing method corresponding to the data type of at least one management plane data in the kernel space based on the kernel mode protocol stack corresponding to the user mode protocol stack, and process the at least one management plane data according to the determined protocol processing method to obtain the first response data.

[0076] In an application example, for example, when the management plane data is ARP data, first, the server can extract the ARP data's operation code, target IP, and sender MAC (Media Access Control) / IP field from the protocol header file of the ARP data based on the corresponding kernel-mode protocol stack in the kernel space. Then, the server can perform address learning on the ARP data to maintain the ARP cache table and record the mapping relationship between the IP address and the MAC address. Then, if it is a request in the ARP data and the target IP is the local machine, the server can construct the ARP response data.

[0077] Step 208: In the user space, first response data is obtained through the target virtual network port based on the user-mode protocol stack, and first target message data obtained according to the first response data is sent to the opposite-end application.

[0078] The first target message data refers to the network data packet generated by the user-mode protocol stack based on the first response data. The first target message data may include, but is not limited to, processed application layer data, transport layer headers, network layer headers, etc. In a specific implementation, the first target message data may be a network data packet directly encapsulating the first response data, or a network data packet obtained by filtering, fusing, or other processing on the first response data before encapsulating it. The first target message data is sent to the peer application via the user-mode protocol stack to complete network communication.

[0079] Illustratively, the server may, in user space, obtain first response data through the target virtual network port based on the user-mode protocol stack, and send the first target message data obtained based on the first response data to the peer application. Optionally, the server may periodically obtain first response data from the target virtual network port based on the user-mode protocol stack, and send the first target message data obtained based on the first response data to the peer application.

[0080] In an application example, Figure 3 As shown, when a local application and a peer application have communication needs, if the local application sends data to the peer application, the local application encapsulates the communication data into raw message data and sends it to the server. The server can obtain the raw message data sent by the local application in user space based on the user-mode protocol stack. The server can parse the raw message data to determine the management plane data in the raw message data, encapsulate the management plane data into a network data packet, and then, through a forwarding thread between user space and kernel space, send the network data packet to the kernel space via a target virtual network port configured in the kernel space. Then, in the kernel space, the server can determine a matching protocol processing method based on the data type of the management plane data, and process the management plane data according to the determined protocol processing method based on the kernel-mode protocol stack to obtain first response data. When the communication between the user-mode protocol stack and the kernel-mode protocol stack is bidirectional, the server can send the first response data to the target virtual network port in the kernel space. Subsequently, in the user space, the server can obtain the first response data through the target virtual network port based on the user-mode protocol stack and encapsulate the first response data to obtain first target message data. Finally, the server can send the first target message data to the physical network card through the data plane acceleration kit, and send the first target message data to the peer application through the physical network card to realize data communication from the local application to the peer application.

[0081] If a local application receives data sent by a peer application, the physical network card sends the received peer message data (similar to the original message data) sent by the peer application to the user space through the data plane acceleration kit. The server can parse the peer message data based on the user-mode protocol stack in the user space, determine the management plane data in the peer message data, and encapsulate the management plane data into a network data packet. Then, through the forwarding thread between the user space and the kernel space, the network data packet is sent to the kernel space through the target virtual network port configured in the kernel space for processing to obtain the first response data. Subsequently, the server can obtain the first response data through the target virtual network port in the user space based on the user-mode protocol stack, and encapsulate it according to the first response data to obtain the first target message data. Finally, the server can feed back the first target message data to the peer application to realize data communication from the peer application to the local application.

[0082] In the above-mentioned communication method for message data, the original message data of the local application is received in the user space based on the user mode protocol stack; at least one management plane data in the original message data is determined, and the at least one management plane data is sent to the kernel space through the target virtual network port; the target virtual network port is obtained according to the configuration of the user mode protocol stack and the kernel mode protocol stack in the kernel space; in the kernel space, based on the kernel mode protocol stack, the at least one management plane data is processed in accordance with the protocol processing mode corresponding to the data type of each at least one management plane data to obtain the first response data; in the user space, based on the user mode protocol stack, the first response data is obtained through the target virtual network port, and the first response data is sent to the kernel space through the target virtual network port. The obtained first target message data is sent to the opposite application; by receiving the original message data based on the user-mode protocol stack in the user space, and sending the management plane data in the original message data to the kernel space through the target virtual network port, the kernel-mode protocol stack in the kernel space can process the management plane data according to its internal original protocol processing method, and return the processed first response data to the user space through the target virtual network port, so that the user can customize the complex management plane data according to the needs and perform processing logic in the kernel-mode protocol stack. The user-mode protocol stack no longer needs to process complex management plane data, which is conducive to reducing the development difficulty and maintenance cost of the user-mode protocol stack, and thus simplifying the implementation process of the user-mode protocol stack.

[0083] In some embodiments, as Figure 4 As shown, sending at least one management plane data to the kernel space through the target virtual network port in step 204 includes steps 402 to 406.

[0084] Step 402: Determine at least one candidate virtual network port, where the candidate virtual network port is configured for the user space and the kernel space.

[0085] Among them, the candidate virtual network port refers to the virtual network interface configured for user space and kernel space for communication between user space and kernel space. Similarly, the candidate virtual network port can be a virtual network card implemented by software. The candidate virtual network port can be used to simulate the functions of a physical network port, but runs at the software level. In specific implementation, the candidate virtual network port can be configured through the virtual network device driver or API (Application Programming Interface) provided by the operating system. For example, the KNI / TAP device in the Linux system can be used as a virtual network device. In the Linux system, multiple candidate virtual network ports can be configured through the virtual network device. Each network port can be configured with different configuration information to communicate different types of management plane data. Through the candidate virtual network port, the user-mode protocol stack can send management plane data to the kernel space and receive response data from the kernel space.

[0086] Exemplarily, the server may determine at least one candidate virtual network port based on at least one candidate virtual network port obtained from the configurations of the user space and the kernel space, and based on the configuration of the virtual network port in the kernel space.

[0087] Step 404: Determine a target virtual network port that supports data communication between a user-mode protocol stack and a kernel-mode protocol stack in kernel space from the at least one candidate virtual network port based on the configuration information of the at least one candidate virtual network port.

[0088] Configuration information refers to the various parameters and attributes of a candidate virtual network port, describing the functionality and characteristics of the virtual network port to determine whether the candidate virtual network port meets the communication requirements between the user-mode protocol stack and the kernel-mode protocol stack. Configuration information may include, but is not limited to, network parameters (such as IP address, subnet mask, gateway), hardware parameters (such as MAC address, MTU (Maximum Transmission Unit), performance parameters (such as bandwidth limit, queue length), and security parameters (such as ACL (Access Control List), encryption method). The target virtual network port is determined from the candidate virtual network ports to support data communication between the user-mode protocol stack and the kernel-mode protocol stack. The configuration information of the target virtual network port must match the communication requirements of the user-mode protocol stack and the kernel-mode protocol stack to ensure smooth communication between the two.

[0089] Exemplarily, the server may determine the target virtual network port that supports data communication between the user-mode protocol stack and the kernel-mode protocol stack in the kernel space from at least one candidate virtual network port based on the network parameters, hardware parameters, performance parameters, and security parameters of the at least one candidate virtual network port.

[0090] Step 406: Send at least one management plane data to the kernel space through the target virtual network port according to a preset forwarding method.

[0091] The preset forwarding mode refers to a predefined method for sending data from user space to kernel space via the target virtual network port. For example, the preset forwarding mode can be a single-thread forwarding mode or a multi-thread forwarding mode. During implementation, the preset forwarding mode can be configured and adjusted based on actual needs to adapt to different application scenarios.

[0092] Exemplarily, the server may send at least one management plane data to the kernel space through the target virtual network port in at least one of a single-thread forwarding mode and a multi-thread forwarding mode.

[0093] In an optional embodiment, when sending management plane data, the server can encapsulate the management plane data in user space, add necessary header information, and then determine which target virtual network port the management plane data is sent through, and select an appropriate transmission protocol for data transmission.

[0094] In an application example, using a TAB device as an example, the server can use the TAP device to create two candidate virtual network ports, tab0 and tab1, in kernel space based on the user-mode protocol stack and configure tab0 and tab1 separately. The server then matches the configuration information of tab0 and tab1 with the information in the management plane data header file. Based on application requirements (such as one-way or two-way communication), the server selects tab0 from tab0 and tab1 that matches the communication requirements of the user-mode and kernel-mode protocol stacks as the target virtual network port. Finally, the server encapsulates the management plane data into network packets in user space using the user-mode protocol stack and sends them to kernel space via tab0.

[0095] In this embodiment, by configuring and screening candidate virtual network ports, the target virtual network port that supports data communication between the user-mode protocol stack and the kernel-mode protocol stack is determined, which can exclude incompatible interfaces and then send the management plane data to the kernel space through the matching target virtual network port in a targeted manner, thereby reducing invalid communication attempts and improving data forwarding efficiency.

[0096] In some embodiments, determining at least one candidate virtual network port includes:

[0097] When at least one physical network port in a physical network card is taken over by a user-mode driver in user space, at least one candidate virtual network port corresponding to the at least one physical network port is created in kernel space; the candidate virtual network port is used to simulate the data sending and receiving behavior of the physical network port to support data communication between user space and kernel space; a correspondence between the at least one candidate virtual network port and the at least one physical network port is established, and configuration information of the at least one candidate virtual network port is determined based on the correspondence and the configuration information of the at least one physical network port.

[0098] Among them, the physical network card is a hardware device that connects the computer to the network and is responsible for the physical transmission of data. The physical network port is the interface located on the physical network card, and a physical network card can have one or more physical network ports. The physical network port can serve as a physical connection point between the computer and the network to connect a network cable (such as an Ethernet cable) and convert digital signals into signals that can be transmitted on the network, thereby enabling data transmission and reception. User-mode drivers refer to drivers running in user space that are used to control hardware devices (such as physical network ports); user-mode drivers allow applications in user space to directly access and control hardware devices without going through kernel-mode drivers. When at least one physical network port is taken over by a user-mode driver in user space, the user-mode program can directly control the taken-over physical network port to send and receive data without the involvement of the kernel-mode driver.

[0099] The correspondence between the candidate virtual network port and the physical network port refers to the mapping relationship between the candidate virtual network port and the physical network port, which is used to ensure that the candidate virtual network port can correctly simulate the data transmission and reception behavior of the physical network port. After the virtual candidate network port is created, the name of the virtual candidate virtual network port can be modified to the name of the physical network port to be taken over, and the configuration information of the physical network port can be synchronized in the candidate virtual network port to achieve synchronization between the candidate virtual network port and the corresponding physical network port. The configuration information of the candidate virtual network port is determined based on the configuration information and the correspondence of the physical network port. The configuration information of the candidate virtual network port may also include but is not limited to network parameters (such as IP address, subnet mask, gateway, etc.), hardware parameters (such as MAC address, MTU, etc.), performance parameters (such as bandwidth limit, queue length, etc.), and security parameters (such as ACL, encryption method, etc.).

[0100] Exemplarily, when at least one physical network port in a single-state physical network card is taken over by a user-mode driver in user space, the server can create at least one candidate virtual network port in kernel space corresponding to the at least one physical network port through the user-mode protocol stack, and modify the name of the candidate virtual network port to the name of the taken-over physical network port, so that the candidate virtual network port can simulate the data transmission and reception behavior of the physical network port, thereby supporting data communication between user space and kernel space. The server can then establish a correspondence between the candidate virtual network port and the taken-over physical network port based on the candidate virtual network port and the taken-over physical network port. Based on the correspondence and the configuration information of the at least one physical network port, the server can determine the configuration information of the at least one candidate virtual network port, and synchronize the configuration information of the candidate virtual network port with the configuration information of the taken-over physical network port through ifdown / ifup (commands for shutting down and enabling network interfaces), ensuring that the candidate virtual network port can correctly simulate the data transmission and reception behavior of the physical network port.

[0101] In an optional embodiment, since management plane data is processed by the kernel-mode protocol stack, the user-mode protocol stack needs to synchronize necessary information from the kernel space for data processing, such as the physical network interface card's ARP table, routing table, IP address, and bonding network interface card configuration information. When a user or network administrator modifies the physical network port's configuration information, candidate virtual network ports need to synchronize configuration changes. Modifications may include, but are not limited to, configuring the IP address, setting a VLAN (Virtual Local Area Network), setting a MAC address, setting the MTU, configuring routing, and configuring ARP. In this case, the server can detect configuration changes on the candidate virtual network ports through netlink (inter-process communication) based on the user-mode protocol stack and call an information synchronization interface to synchronize configuration information between the user space and kernel space. Furthermore, if the user-mode protocol stack fails to send management plane data or fails to look up a route, the server can also call the information synchronization interface to proactively synchronize configuration information between the user space and kernel space.

[0102] In an application example, take TAB equipment as an example. Figure 5As shown, when the server detects that the physical network port on the physical network card has been taken over by the user-mode driver, the server can use the TAP device to create two candidate virtual network ports, tab0 and tab1, in the kernel space based on the user-mode protocol stack, and modify the names of tab0 and tab1 to the names of the physical network port being taken over. Then, according to the configuration instructions of the network administrator and the mapping relationship between the candidate virtual network port and the physical network port being taken over, tab0 and tab1 are configured respectively. When the configuration information of the physical network port being taken over changes, the configuration information of tab0 and tab1 needs to be updated synchronously. At this time, the configuration information of tab0 and tab1 changes. The kernel-mode protocol stack can perceive the configuration information changes on tab0 and tab1 through netlink based on the user-mode protocol stack, and call the information synchronization interface to synchronize the configuration information between the user space and the kernel space. In specific implementation, since tab0 and tab1 are created and destroyed by the user-state protocol stack, the life cycle of tab0 and tab1 is usually the same as the life cycle of the user-state protocol stack. However, in some other embodiments, the life cycle can also be configured separately for tab0 and tab1. In this case, the life cycle of tab0 and tab1 can be less than the life cycle of the user-state protocol stack.

[0103] In this embodiment, by creating the candidate virtual network port in the kernel space, users and network administrators can directly manage the candidate virtual network port through the management tools provided by the Linux kernel without the need to additionally configure network card management tools. It has high compatibility and can reduce the difficulty of developing the kernel-mode protocol stack.

[0104] In some embodiments, the management plane data includes at least two, and the forwarding mode includes a single-thread forwarding mode. The single-thread forwarding mode refers to using a single thread to process data transmission.

[0105] Furthermore, at least one management plane data is sent to the kernel space through the target virtual network port according to a preset forwarding method, including:

[0106] According to the order in which the original message data to which each management plane data belongs is received from first to last, each management plane data is added to the buffer data queue in sequence; through the first thread corresponding to the buffer data queue, according to the order in which each management plane data in the buffer data queue is added from first to last, each management plane data is sent to the kernel space in sequence from the buffer data queue through the target virtual network port.

[0107] Among them, the buffer data queue refers to a data structure used to store data, which is used to temporarily store management plane data to be sent to the kernel space. The buffer data queue uses the first-in-first-out principle, that is, the data added first is sent to the kernel space through the target virtual network port first, ensuring that the data is processed by the kernel-mode protocol stack in the order of receipt. The first thread refers to the thread responsible for obtaining data from the buffer data queue and sending it to the kernel space through the target virtual network port. The first thread sends the management plane data to the kernel space through the target virtual network port in the order in which the management plane data is added in the buffer data queue. In specific implementation, the first thread can be a loop-executed thread that continuously checks whether there is management plane data to be processed in the buffer data queue, and sends each management plane data to the kernel space in the order in which it is added.

[0108] Exemplarily, the server constructs a data buffer queue in user space. Then, each piece of management plane data is sequentially added to the data buffer queue in the order in which its original message data is received. Finally, the server, through the first thread corresponding to the data buffer queue, sends each piece of management plane data from the data buffer queue to the target virtual network port according to the first-in, first-out principle. The target virtual network port can receive the management plane data via a soft interrupt and sequentially send it to kernel space.

[0109] In an application example, Figure 6 As shown, there are multiple I / O threads (IN / OUT threads, i.e., input / output threads) in user space. These multiple I / O threads correspond to the same buffered data queue. The I / O threads can determine management plane data from raw message data based on the configured data diversion method. The server can receive raw message data from different applications through different I / O threads and extract the corresponding management plane data from each application's raw message data through different I / O threads. For example, the server receives raw message data from applications A1 through A3 through different I / O threads and determines management plane data M1 through M3 from each raw message data using the data diversion method using the corresponding I / O threads 1 through 3. Assuming that application A1's raw message data arrives in user space first, the corresponding management plane data M1 is added to the buffered data queue Q0 first. Subsequently, application A2's data arrives in user space, and management plane data M2 is added to the buffered data queue Q0, and so on. When the first thread obtains data in the buffered data queue Q0, it first takes out the management plane data M1 and sends it to the kernel space through the target virtual network port. Then it takes out the management plane data M2 and also sends it to the kernel space through the target virtual network port. And so on, to realize single-thread forwarding of management plane data.

[0110] In this embodiment, a single-thread forwarding method is used to send management plane data to the kernel space. By adding at least one management plane data to the buffer data queue in the order of receiving the original message data, and then using the first thread corresponding to the queue to send it to the kernel space in the order of adding through the target virtual network port, it can ensure the orderly processing and forwarding of management plane data, and improve the accuracy and reliability of data forwarding.

[0111] In some embodiments, the management plane data includes at least two forwarding modes, and the forwarding mode includes a multi-thread forwarding mode, wherein the multi-thread forwarding mode refers to using multiple threads to process the sending of the management plane data in parallel.

[0112] Furthermore, at least one management plane data is sent to the kernel space through the target virtual network port according to a preset forwarding method, including:

[0113] Each management plane data is added to at least two parallel data queues respectively; through the second threads corresponding to the at least two parallel data queues, each cached management plane data is obtained from each parallel data queue, and each management plane data is sent to the kernel space in parallel through the target virtual network port.

[0114] Among them, parallel data queues refer to multiple independent data queues for parallel storage and processing of management plane data to be sent; each parallel data queue can independently receive, store, and send management plane data, ensuring that multiple management plane data are processed in parallel to improve the efficiency of data transmission. The second thread refers to the thread responsible for obtaining management plane data from the parallel data queues and sending it to the kernel space through the target virtual network port. In user space, there are at least two second threads, each corresponding to a parallel data queue, responsible for obtaining management plane data from its corresponding parallel data queue and sending the management plane data to the kernel space through the target virtual network port. In specific implementation, similar to the first thread, the second thread can also be a looped execution thread that continuously checks whether there is management plane data to be processed in the corresponding parallel data queue and sends each piece of management plane data to the kernel space.

[0115] For example, the server can construct parallel data queues in user space that correspond one-to-one with each IO thread. The server can then add each piece of management plane data to the parallel data queue corresponding to each IO thread. Finally, the server uses the second thread corresponding to each parallel data queue to retrieve the cached management plane data from each parallel data queue and send each piece of management plane data in parallel to the target virtual network port. The target virtual network port receives the management plane data via a soft interrupt and sends it in parallel to kernel space.

[0116] In an application example, Figure 7As shown, there are also multiple IO threads in the user space, and each IO thread corresponds to a parallel data queue. The server can receive original message data from different applications through each IO thread. For example, the server receives original message data from applications A1 to A3 through different IO threads, and determines the management plane data M1 to M3 in each original message data through the corresponding IO threads 1 to 3 according to the data diversion method, and adds the management plane data M1 to M3 to the parallel data queues Q1 to Q3 respectively. The second thread T1 obtains the management plane data M1 from the parallel data queue Q1 and sends it to the kernel space through the target virtual network port. The second thread T2 obtains the management plane data M2 from the parallel data queue Q2 and also sends it to the kernel space through the target virtual network port, and so on, realizing multi-threaded forwarding of management plane data.

[0117] In some other embodiments, when the number of parallel data queues is limited, other management plane data (such as M4~Mn) can wait or be added to the existing parallel data queue according to a certain strategy (such as polling, priority, etc.) to forward data through the parallel data queue.

[0118] In this embodiment, a multi-threaded forwarding method is adopted to process the management plane data transmission, and each management plane data is distributed to at least two parallel data queues. The second thread corresponding to each queue is used to obtain the data in parallel and send the data to the kernel space through the target virtual network port. This can realize the parallelization of data transmission, which is beneficial to improving the forwarding efficiency and processing speed of the management plane data, so as to effectively cope with high concurrency and large data volume data forwarding scenarios, and enhance system performance and responsiveness.

[0119] In some optional embodiments, the server can forward management plane data by integrating single-thread forwarding and multi-thread forwarding. The integration of single-thread forwarding and multi-thread forwarding can be a simple integration, that is, single-thread forwarding and multi-thread forwarding exist simultaneously in the user space to independently execute the forwarding of management plane data. The integration of single-thread forwarding and multi-thread forwarding can also be the integration of single-thread forwarding in each second thread in the multi-thread forwarding method, that is, a parallel data queue can correspond to multiple IO threads, and multiple IO threads send management plane data to the parallel data queue according to the single-thread forwarding method. For the management plane data within a single parallel data queue, it is sent to the kernel space according to the first-in-first-out principle. For each parallel data queue, the management plane data of each parallel data queue can be sent to the kernel space in parallel. In addition, the server can also integrate multiple single-thread forwarding methods to form a multi-level forwarding, that is, the first layer is the IO thread, and each IO thread adds the management plane data to the buffer data queue of the second layer. The management plane data in the buffer data queue of the second layer is added to the buffer data queue of the third layer according to the first-in-first-out principle. The management plane data in the buffer data queue of the third layer is then sent to the kernel space according to the first-in-first-out principle or continues to be added to the buffer data queue of the next layer to cope with the processing of massive data and ensure the orderly forwarding of management plane data.

[0120] In some embodiments, determining at least one management plane data in the original message data includes at least one of the following:

[0121] Determine at least one management plane data from the original message data based on the user-mode protocol stack and in accordance with the data diversion method corresponding to the target virtual network port;

[0122] Based on the user-mode protocol stack, the original message data is sent to the data plane acceleration suite to instruct the data plane acceleration suite to determine at least one management plane data from the original message data according to the data diversion method corresponding to the target virtual network port, and return at least one management plane data.

[0123] Among them, the data diversion method refers to a method for extracting management plane data from the original message data; the data diversion method may include but is not limited to methods based on specific protocols, port numbers, data formats, etc. In specific implementation, the data diversion method can be directly implemented by the user-mode protocol stack, or it can be implemented through external tools such as a data plane acceleration suite. The data plane acceleration suite refers to a software or hardware tool used to accelerate data processing and forwarding to improve the efficiency of data processing. In specific implementation, the data plane acceleration suite can receive the original message data and extract the management plane data from the original message data according to a predetermined data diversion method. Such a setting can reduce the processing burden of the user-mode protocol stack and improve the efficiency and performance of data processing.

[0124] Exemplarily, for determining the management plane data based on the user-mode protocol stack, the server can determine the port range reserved for the user-mode protocol stack in the target virtual network port based on the user-mode protocol stack, and determine at least one management plane data from the original message data through the set network card RRS rule (Receive Side Scaling).

[0125] For the determination of management plane data based on the data plane acceleration suite, the server can send the original message data to the data plane acceleration suite based on the user-state protocol stack, so that the server acceleration suite can determine the port range reserved for the user-state protocol stack in the target virtual network port, and determine at least one management plane data from the original message data through the set network card RRS rules, and return at least one management plane data to the user space.

[0126] In an application example, Figure 8 As shown, when the management plane data is determined based on the data plane acceleration suite, the server can then send the original message data to the data plane acceleration suite based on the kernel-mode protocol stack, so that the data plane acceleration suite can determine the port range reserved for the user-mode protocol stack in the target virtual network port through the data diversion method set by the configuration module, and determine at least one management plane data from the original message data through the set network card RRS rules, and store it in the data forwarding queue in the user space, and send the management plane data to the kernel space through the target virtual network port through the forwarding thread (the first thread or the second thread).

[0127] In this embodiment, through direct offloading based on the user-mode protocol stack or offloading in collaboration with the data plane acceleration suite, different offloading methods can be configured according to different scenario requirements to flexibly and efficiently extract management plane data from the original message. Specifically, the direct offloading method based on the user-mode protocol stack can reduce the cross-layer data transmission overhead and improve the data processing flow and complexity; while the collaborative offloading method using the data plane acceleration suite can significantly reduce the CPU (Central Processing Unit) load and improve processing performance in complex scenarios (such as high throughput and high real-time requirements).

[0128] In some embodiments, the method for communicating message data further includes:

[0129] If the protocol processing method satisfies the response data return condition, the kernel-mode protocol stack caches the first response data in the network port data queue corresponding to the target virtual network port. If the protocol processing method does not satisfy the response data return condition, the kernel-mode protocol stack performs response data processing on the first response data in kernel space.

[0130] Among them, the response data return condition refers to the condition for judging whether the response data needs to be returned to the user space; the response data return condition can be determined based on the protocol specification, application requirements or system configuration. If the response data return condition is met, the first response data will be cached in the network port data queue corresponding to the target virtual network port; if it is not met, it will be further processed in the kernel space, such as broadcasting externally according to the first response data or updating the routing table, IP address and MAC address mapping table, etc. For example, in application scenarios such as network device initialization, route allocation, configuration distribution, authentication / authorization, etc., the kernel-mode protocol stack needs to return response data to the user space; for example, in application scenarios such as log update, device identification, and receiving responses from the other end, the kernel-mode protocol stack does not need to return response data to the user space.

[0131] The network port data queue is used to temporarily store the first response data that needs to be returned through the target virtual network port. The network port data queue can serve as a data buffer between the user-mode protocol stack and the kernel-mode protocol stack, allowing the kernel-mode protocol stack to periodically retrieve the first response data from the network port data queue. In specific implementations, the network port data queue can be retrieved by the user-mode protocol stack on a first-in, first-out basis.

[0132] Exemplarily, the server may receive management plane data sent by the user-mode protocol stack based on the kernel-mode protocol stack, and determine whether the protocol processing method for processing the management plane data requires returning response data to the user space based on the data type corresponding to the management plane data, so as to determine whether the protocol processing method satisfies the response data return condition. If the response data return condition is met, the server may cache the generated first response data in the network port data queue corresponding to the target virtual network port based on the kernel-mode protocol stack. If the response data return condition is not met, the server may perform response data processing in the kernel space for the first response data based on the kernel-mode protocol stack.

[0133] In an optional embodiment, the server processes the response data in the kernel space based on the kernel-mode protocol stack for the first response data. Depending on the different protocol processing methods, the processing process for the response data is different. For example, in an application scenario where log / monitoring push is performed, the first response data may be the verification result of the kernel-mode protocol stack verifying the legitimacy of the management plane data. Further processing of the first response data (i.e., the verification result) may be discarding illegal data or storing legal data in a data storage system for user reading. For another example, in a unicast notification, the first response data may be the verification result obtained by the kernel-mode protocol stack verifying the ARP opcode in the management plane data. Further processing of the first response data (i.e., the verification result) may be discarding the management plane data if the ARP opcode is a response and is not a request from the local end.

[0134] Furthermore, in the user space, first response data is obtained through the target virtual network port based on the user-mode protocol stack, including:

[0135] In the user space, first response data is obtained from the network port data queue corresponding to the target virtual network port based on the user state protocol stack.

[0136] Exemplarily, the server may periodically obtain the first response data from a network port data queue corresponding to the target virtual network port based on a user-mode protocol stack.

[0137] In this embodiment, by setting the response data return conditions, the kernel-mode protocol stack can dynamically select a processing path based on the response data return conditions. When the conditions are met, the data is cached to the network port data queue to avoid invalid user-mode interaction; when the conditions are not met, the kernel directly processes the data to reduce cross-layer overhead.

[0138] In some embodiments, the method for communicating message data further includes:

[0139] Determine at least one data plane data in the original message data; in user space, based on the user-state protocol stack, process the at least one data plane data separately according to the data processing methods corresponding to the at least one data plane data in the user-state protocol stack to obtain second response data; generate second target message data according to the second response data, and send the second target message data to the peer application.

[0140] Data plane data refers to the portion of the original message data that is directly related to user data, namely the actual business data being transmitted; data plane data may include, but is not limited to, various forms of user data such as text, images, video, and audio. Data processing refers to the processing method used by the user-mode protocol stack on the extracted data plane data; data processing methods may include, but are not limited to, at least one of data parsing, format conversion, content filtering, encryption, and decryption.

[0141] The second response data refers to the result data obtained after the user-mode protocol stack processes the extracted data plane data according to a predetermined data processing method. The second target message data refers to the message data generated according to the second response data, which is used to be sent to the peer application. The second target message data can be generated by directly encapsulating the second response data, adding necessary header information, etc., or by further filtering and fusing the second response data, adding necessary header information, etc. The peer application refers to the other party's application that communicates with the local application over the network. The peer application can run on the same computer as the local application, or it can run on a different computer. The peer application communicates with the local application by receiving the second target message data.

[0142] For example, the server can receive a video request message (raw data message) from a local application and extract the video stream data (data plane data) from the video request message. The server can then decode and format-convert the video stream data in user space using the user-mode protocol stack to obtain processed video data (second response data). The server can then generate a new video stream message (second target message data) based on the processed video data. Finally, the server can send the new video stream message to the peer application, implementing video stream transmission.

[0143] In this embodiment, by determining the data plane data in the original data message and directly processing the data plane data using the user-state protocol stack, and sending the management plane data to the kernel-state protocol stack through the configured virtual network port for processing, the user-state protocol stack can be focused on data plane processing. In the scenario where the network card runs in a single state, it can support the high-performance, low-latency storage services provided by the user-state protocol stack. At the same time, it supports the use of the kernel state to directly manage ARP, routing, and IP addresses without the need for additional configuration management tools. It is compatible with the use of user-state protocol stacks for single-state and multi-state network cards, effectively simplifying the development and operation and maintenance of the user-state protocol stack. It is suitable for scenarios requiring high performance and low latency, such as high-performance computing, AI (Artificial Intelligence) training, and cloud storage across AZs (Availability Zones).

[0144] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.

[0145] Based on the same inventive concept, embodiments of the present application further provide a message data communication device for implementing the message data communication method involved above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more message data communication device embodiments provided below can be found in the above-mentioned limitations of the message data communication method and will not be repeated here.

[0146] In an exemplary embodiment, Figure 9 As shown, a communication device for message data is provided, including: a data receiving module 902, a data screening module 904, a management plane data processing module 906 and a data sending module 908, wherein:

[0147] The data receiving module 902 is used to receive original message data of the local application based on the user mode protocol stack in the user space;

[0148] A data filtering module 904 is configured to determine at least one piece of management plane data in the original message data and send the at least one piece of management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user-mode protocol stack and the kernel-mode protocol stack in the kernel space;

[0149] A management plane data processing module 906 is configured to process the at least one management plane data in a kernel space based on a kernel-mode protocol stack and in accordance with protocol processing modes corresponding to respective data types of the at least one management plane data to obtain first response data;

[0150] The data sending module 908 is configured to obtain first response data through a target virtual network port based on a user-mode protocol stack in user space, and send first target message data obtained according to the first response data to a peer application.

[0151] In an optional embodiment, the data screening module 904 is also used to determine at least one candidate virtual network port; the candidate virtual network port is configured for the user space and the kernel space; based on the configuration information of the at least one candidate virtual network port, a target virtual network port that supports data communication between the user-mode protocol stack and the kernel-mode protocol stack in the kernel space is determined from the at least one candidate virtual network port; through the target virtual network port, at least one management plane data is sent to the kernel space according to a preset forwarding method.

[0152] In an optional embodiment, the data screening module 904 is also used to create at least one candidate virtual network port corresponding to the at least one physical network port in the kernel space when at least one physical network port in the physical network card is taken over by the user-mode driver in the user space; the candidate virtual network port is used to simulate the data sending and receiving behavior of the physical network port to support data communication between the user space and the kernel space; establish a correspondence between at least one candidate virtual network port and at least one physical network port, and determine the configuration information of the at least one candidate virtual network port based on the correspondence and the configuration information of the at least one physical network port.

[0153] In an optional embodiment, the management plane data includes at least two pieces, and the forwarding mode includes a single-thread forwarding mode. The data screening module 904 is further configured to sequentially add each piece of management plane data to the buffer data queue in the order in which the original message data to which each piece of management plane data belongs is received from the earliest to the latest; and sequentially send each piece of management plane data from the buffer data queue to the kernel space via the target virtual network port via the first thread corresponding to the buffer data queue in the order in which each piece of management plane data is added from the earliest to the latest.

[0154] In an optional embodiment, the management plane data includes at least two pieces, and the forwarding method includes a multi-threaded forwarding method. The data screening module 904 is further configured to add each piece of management plane data to at least two parallel data queues; obtain the cached management plane data from each parallel data queue through a second thread corresponding to each of the at least two parallel data queues; and send each piece of management plane data in parallel to the kernel space through the target virtual network port.

[0155] In an optional embodiment, the data screening module 904 is also used to determine at least one management plane data from the original message data based on the user-state protocol stack and in accordance with the data diversion method corresponding to the target virtual network port; or to send the original message data to the data plane acceleration suite based on the user-state protocol stack to instruct the data plane acceleration suite to determine at least one management plane data from the original message data according to the data diversion method corresponding to the target virtual network port, and return at least one management plane data.

[0156] In an optional embodiment, the communication device for message data also includes a response data return module, which is used to cache the first response data to the network port data queue corresponding to the target virtual network port based on the kernel-state protocol stack when the protocol processing method meets the response data return condition; and perform response data processing in the kernel space for the first response data based on the kernel-state protocol stack when the protocol processing method does not meet the response data return condition.

[0157] The data sending module 908 is further configured to obtain the first response data from the network port data queue corresponding to the target virtual network port based on the user mode protocol stack in the user space.

[0158] In an optional embodiment, the communication device for message data also includes a data plane data processing module, which is used to determine at least one data plane data in the original message data; in the user space, based on the user-state protocol stack, the at least one data plane data is processed separately according to the data processing method corresponding to the at least one data plane data in the user-state protocol stack to obtain second response data; second target message data is generated according to the second response data, and the second target message data is sent to the opposite application.

[0159] Each module in the above-mentioned message data communication device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.

[0160] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, memory and I / O interface are connected via a system bus, and the communication interface is connected to the system bus via the I / O interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as virtual network port configuration information, physical network port configuration information, protocol processing mode, preset forwarding mode, data diversion mode, and data processing mode. The I / O interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements a method for communicating message data.

[0161] Those skilled in the art will understand that Figure 10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0162] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the message data communication method in each of the above embodiments when executing the computer program.

[0163] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for communicating message data in the above embodiments is implemented.

[0164] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method for communicating message data in the above embodiments is implemented.

[0165] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0166] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.

[0167] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0168] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.

Claims

1. A method for communicating message data, characterized in that: The method comprises: In user space, the original message data of the local application is received based on the user-mode protocol stack; Determine at least one management plane data in the original message data, and send the at least one management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user mode protocol stack and the kernel mode protocol stack in the kernel space; In the kernel space, based on the kernel state protocol stack, the at least one management plane data is processed according to protocol processing modes corresponding to respective data types of the at least one management plane data to obtain first response data; In the user space, the first response data is obtained through the target virtual network port based on the user-mode protocol stack, and the first target message data obtained according to the first response data is sent to the opposite application.

2. The method according to claim 1, characterized in that The sending of the at least one management plane data to the kernel space through the target virtual network port includes: Determine at least one candidate virtual network port; the candidate virtual network port is configured for the user space and the kernel space; Determining, from the at least one candidate virtual network port according to the configuration information of the at least one candidate virtual network port, a target virtual network port that supports data communication between the user mode protocol stack and the kernel mode protocol stack in the kernel space; The at least one management plane data is sent to the kernel space through the target virtual network port according to a preset forwarding method.

3. The method according to claim 2, characterized in that The determining of at least one candidate virtual network port includes: When at least one physical network port in the physical network card is taken over by the user-mode driver in the user space, at least one candidate virtual network port corresponding to the at least one physical network port is created in the kernel space; the candidate virtual network port is used to simulate the data sending and receiving behavior of the physical network port to support data communication between the user space and the kernel space; A correspondence between the at least one candidate virtual network port and the at least one physical network port is established, and configuration information of the at least one candidate virtual network port is determined based on the correspondence and configuration information of the at least one physical network port.

4. The method according to claim 2, characterized in that The management plane data includes at least two, and the forwarding mode includes a single-thread forwarding mode; The step of sending the at least one management plane data to the kernel space according to a preset forwarding method through the target virtual network port includes: Adding each of the management plane data to the buffer data queue in sequence according to the order of receiving the original message data to which each of the management plane data belongs from first to last; Through the first thread corresponding to the buffered data queue, each management plane data is sent from the buffered data queue to the kernel space through the target virtual network port in sequence according to the order in which each management plane data in the buffered data queue is added from first to last.

5. The method according to claim 2, characterized in that The management plane data includes at least two, and the forwarding mode includes a multi-thread forwarding mode; The step of sending the at least one management plane data to the kernel space according to a preset forwarding method through the target virtual network port includes: Adding each of the management plane data to at least two parallel data queues respectively; Through the second threads corresponding to the at least two parallel data queues, the cached management plane data are respectively obtained from the parallel data queues, and the management plane data are respectively sent to the kernel space in parallel through the target virtual network port.

6. The method according to claim 1, characterized in that The determining of at least one management plane data in the original message data includes at least one of the following: Determining at least one management plane data from the original message data based on the user mode protocol stack and in accordance with a data diversion method corresponding to the target virtual network port; Based on the user-mode protocol stack, the original message data is sent to the data plane acceleration suite to instruct the data plane acceleration suite to determine at least one management plane data from the original message data according to the data diversion method corresponding to the target virtual network port, and return the at least one management plane data.

7. The method according to claim 1, characterized in that The method further comprises: When the protocol processing mode satisfies the response data return condition, caching the first response data into the network port data queue corresponding to the target virtual network port based on the kernel state protocol stack; When the protocol processing mode does not satisfy the response data return condition, performing response data processing in the kernel space for the first response data based on the kernel state protocol stack; The obtaining, in the user space, the first response data through the target virtual network port based on the user state protocol stack includes: In the user space, the first response data is obtained from the network port data queue corresponding to the target virtual network port based on the user state protocol stack.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: Determining at least one data plane data in the original message data; In the user space, based on the user state protocol stack, the at least one data plane data is processed respectively according to a data processing mode corresponding to each of the at least one data plane data in the user state protocol stack to obtain second response data; Generate second target message data according to the second response data, and send the second target message data to the opposite-end application.

9. A communication device for message data, characterized in that: The device comprises: A data receiving module is used to receive original message data from a local application in user space based on a user-mode protocol stack; a data screening module, configured to determine at least one management plane data in the original message data, and send the at least one management plane data to the kernel space through a target virtual network port; the target virtual network port is configured for the user mode protocol stack and the kernel mode protocol stack in the kernel space; a management plane data processing module, configured to process the at least one management plane data in the kernel space based on the kernel state protocol stack and in accordance with protocol processing modes corresponding to respective data types of the at least one management plane data to obtain first response data; A data sending module is used to obtain the first response data through the target virtual network port based on the user state protocol stack in the user space, and send the first target message data obtained according to the first response data to the opposite application.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.