Data Processing Method, Apparatus, Non-Volatile Storage Medium, and Computer Device

By setting the user state protocol stack in the user state of the operating system and including the time-sensitive network protocol, deterministic forwarding of the time-sensitive stream is solved, and the problem that the kernel state protocol stack of the end device cannot achieve deterministic forwarding is achieved, and fast and deterministic time-sensitive stream forwarding is achieved.

CN115665057BActive Publication Date: 2025-06-27PURPLE MOUNTAIN LAB
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211296819.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-06-27
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

When the terminal device uses the kernel-state protocol stack to process packet forwarding, it cannot quickly realize deterministic forwarding of time-sensitive streams, and cannot meet the requirements of deterministic network transmission.

Method used

Set the user state protocol stack in the user state of the operating system, and includes a time-sensitive network protocol that supports deterministic forwarding in the protocol stack, which directly forwards the time-sensitive stream in the service data stream to bypass the kernel protocol stack.

Benefits of technology

It realizes rapid deterministic forwarding for time-sensitive streams, solves the technical problem that the kernel-state protocol stack cannot meet the deterministic network transmission, and supports the deterministic forwarding of service data flows on the end devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665057B_ABST
    Figure CN115665057B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, apparatus, non-volatile storage medium, and computer device. Among them, the method includes: obtaining a service data stream, where the service data stream comes from at least one of the following: an application program of an end device, an external device of the end device; based on a user-space protocol stack, deterministically forwarding time-sensitive flows in the service data stream to a target end device, where the user-space protocol stack is located in the user space of the operating system of the end device, and the user-space protocol stack includes a time-sensitive network protocol that supports deterministic forwarding. The present invention solves the technical problem that the end device uses a kernel-space protocol stack to process packet forwarding, resulting in the inability to perform fast and deterministic forwarding of time-sensitive flows.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network communication, and in particular, to a data processing method, device, non-volatile storage medium, and computer device. Background Art

[0002] Time-Sensitive Networking (TSN) is a new generation of Ethernet communication technology actively promoted by the domestic and international industrial circles. Time-Sensitive Networking allows co-network transmission of periodic and aperiodic services, can ensure the upper limit of the transmission delay of critical service flow data, and greatly promotes the determinacy of the transmission time of traditional Ethernet. TSN technology ensures the end-to-end time determinacy of network transmission through clock synchronization and traffic scheduling.

[0003] The devices that make up a TSN network include devices at the end for sending and receiving TSN data streams, and also include TSN network devices for transmitting TSN data streams. There are a large number of end computing devices in the field of smart factories, such as edge servers, industrial control computers, PC computers, etc. Computing platforms in the field of intelligent driving, such as domain controllers (DCUs) and other computing units, may also need to process TSN data streams. These computing units are usually composed of network application programs, operating systems (Linux), and network protocol stacks; the computing units and TSN network devices are networked together to form the entire TSN network. The current network protocol stack is based on the kernel state and does not have time synchronization and scheduling functions, and thus cannot meet the requirements of deterministic network transmission.

[0004] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of the present invention provide a data processing method, device, non-volatile storage medium, and computer device, so as to at least solve the technical problem that end devices using a kernel-state protocol stack to process packet forwarding cannot perform fast and deterministic forwarding of time-sensitive flows.

[0006] According to one aspect of the embodiments of the present invention, a data processing method is provided, including: obtaining a service data stream, where the service data stream comes from at least one of the following: an application program of an end device, an external device of the end device; based on a user-state protocol stack, deterministically forwarding a time-sensitive flow in the service data stream to a target end device, where the user-state protocol stack is located in the user state of the operating system of the end device, and the user-state protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0007] According to another aspect of the embodiments of the present invention, there is also provided a data processing device, including: an acquisition module, configured to acquire service data streams, where the service data streams come from at least one of the following: application programs of end devices, external devices of end devices; a forwarding module, configured to deterministically forward time-sensitive streams in the service data streams to target end devices based on a user-space protocol stack, where the user-space protocol stack is located in the user space of the operating system of the end device, and the user-space protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0008] According to yet another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, it controls the device where the non-volatile storage medium is located to execute the data processing method described in any one of the above.

[0009] According to still another aspect of the embodiments of the present invention, there is also provided a computer device, where the computer device includes a memory and a processor, the memory is used to store a program, and the processor is used to run the program stored in the memory, and when the program runs, it executes the data processing method described in any one of the above.

[0010] In the embodiments of the present invention, by adopting the method of setting a user-space protocol stack in the user space of the operating system, and deterministically forwarding time-sensitive streams in the service data streams through the user-space protocol stack including a time-sensitive network protocol, the purpose of bypassing the kernel protocol stack and directly performing deterministic forwarding on time-sensitive streams is achieved, thereby realizing the technical effect of providing a technology that supports end devices to perform deterministic forwarding of service data streams, and further solving the technical problem that end devices cannot perform fast deterministic forwarding on time-sensitive streams when using the kernel-space protocol stack to process packet forwarding. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The drawings described herein are used to provide a further understanding of the present invention, form a part of this application, and the schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings:

[0012] Figure 1 A hardware structure block diagram of a computer terminal for implementing a data processing method is shown;

[0013] Figure 2 It is a schematic flowchart of a data processing method provided according to an embodiment of the present invention;

[0014] Figure 3 It is a schematic diagram of an end device operating system architecture provided according to an optional embodiment of the present invention;

[0015] Figure 4It is a schematic diagram of deterministic forwarding of end-to-end service data flow provided according to an optional embodiment of the present invention;

[0016] Figure 5 It is a structural block diagram of a data processing device provided according to an embodiment of the present invention. Detailed implementation manners

[0017] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order different from those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0019] First, some nouns or terms that appear in the process of describing the embodiments of the present application are applicable to the following explanations:

[0020] User space protocol stack, a network protocol stack created in the user space of the operating system.

[0021] Deterministic forwarding, the forwarding behavior of service data flow based on a deterministic network, and the upper and lower limits of the forwarding delay of data packets can be guaranteed.

[0022] Time-Sensitive Networking is a set of protocol standards formulated by the IEEE 802.1 working group. This protocol standard defines the time-sensitive mechanism for Ethernet data transmission, adding determinism and reliability to the forwarding of data packets.

[0023] Time-sensitive flow, the key service data flow in a time-sensitive network, and the data flow that needs to be deterministically forwarded.

[0024] According to an embodiment of the present invention, an embodiment of a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0025] The method embodiment provided by the first embodiment of the present application can be executed in a mobile terminal, a computer terminal, or a similar computing device. Figure 1 A hardware structure block diagram of a computer terminal for implementing a data processing method is shown. As Figure 1 shown, the computer terminal 10 may include one or more (shown as 102a, 102b,..., 102n in the figure) processors (the processor may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), and a memory 104 for storing data. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the BUS bus), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 1 the structure shown is only schematic and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 may further include more or fewer components than Figure 1 shown, or have a different configuration from Figure 1 shown.

[0026] It should be noted that the above one or more processors and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit can be embodied in software, hardware, firmware, or any combination thereof, in whole or in part. In addition, the data processing circuit can be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 10. As involved in the embodiments of the present application, the data processing circuit is a processor control (such as the selection of a variable resistor terminal path connected to an interface).

[0027] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data processing method in the embodiments of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implements the data processing method of the above application program. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely disposed relative to the processor, and these remote memories can be connected to the computer terminal 10 through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and combinations thereof.

[0028] The display can be, for example, a touch-screen liquid crystal display (LCD), and the liquid crystal display enables a user to interact with the user interface of the computer terminal 10.

[0029] In order to build a complete TSN network, as an important end device, the computing unit has problems that need to be solved urgently, such as the network transmission determinism of its network protocol stack and how to access the TSN network. The data processing method provided by the present invention realizes the deterministic transmission of the network protocol stack supported by the end device, and then, by being applied to the deterministic end device, a wide range of TSN networks can be built.

[0030] Figure 2 is a schematic flowchart of the data processing method provided by the embodiments of the present invention, as Figure 2 shown, the method includes the following steps:

[0031] Step S202, obtain service data streams, where the service data streams come from at least one of the following: application programs of the end device, external devices of the end device.

[0032] It should be noted that the present invention can be applied to the operating system of the end device. The end device can be an edge server, an industrial control computer, or a PC computer in the field of intelligent factories, or can also be a computing platform in the field of intelligent driving, such as a domain controller. The application program of the end device can be an application program running in the end device itself, and the external device of the end device can be a device that is connected to the end device and sends service data streams to the end device. The end device can obtain service data streams from the application program and / or the external device, and perform deterministic forwarding or forwarding according to the best-effort forwarding mechanism on the service data streams based on the nature of the service data streams.

[0033] Step S204: Based on the user-mode protocol stack, deterministically forward the time-sensitive flows in the service data stream to the target end device. Here, the user-mode protocol stack is located in the user mode of the operating system of the end device, and the user-mode protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0034] In this step, the time-sensitive flows in the service data stream are data packets that need to be forwarded according to the forwarding mechanism of the deterministic network, and the time-sensitive flows can also be referred to as critical data streams. The end device can distinguish the time-sensitive flows in the service data stream according to the source of the service data stream. For example, in the end device, it is predefined in advance which data stream from which external device is a time-sensitive flow, then when the data stream transmitted by this external device is received, it is marked as a time-sensitive flow, or the data stream incoming from a specific port of the end device can be marked as a time-sensitive flow. Generally speaking, for data streams from sources such as games, videos, and industrial precision machines, they require low data transmission latency and deterministic latency, so the data streams that meet the requirements of such applications or requests forwarded by external devices can be marked as time-sensitive flows.

[0035] It should be noted that in the related art, when the end device forwards data packets, it needs to give the data stream to the kernel mode, and the kernel mode calls the kernel-mode protocol stack to automatically forward the data packets. However, the kernel mode of the end device does not have time synchronization and scheduling functions and cannot meet the requirements of deterministic network transmission. Therefore, in the present invention, a user-mode protocol stack is preset in the user mode of the operating system of the end device, and a time-sensitive network protocol that supports deterministic network transmission is preset in the user-mode protocol stack. When it is detected that the time-sensitive flow in the service data stream requests the end device to perform deterministic forwarding, the time-sensitive network protocol in the user-mode protocol stack is directly called by the user mode of the operating system to process the data packets to achieve deterministic forwarding, bypassing the data packet forwarding logic of the kernel mode and helping the end device to achieve the function of supporting deterministic network transmission.

[0036] Through the above steps, by setting the user-mode protocol stack in the user mode of the operating system, and using the user-mode protocol stack including the time-sensitive network protocol to deterministically forward the time-sensitive flows in the service data stream, the purpose of directly performing deterministic forwarding on the time-sensitive flows by bypassing the kernel protocol stack is achieved, thereby realizing the technical effect of providing a technology that supports the end device to perform deterministic forwarding of the service data stream, and further solving the technical problem that the end device cannot perform fast deterministic forwarding on the time-sensitive flows when using the kernel-mode protocol stack to process packet forwarding.

[0037] As an alternative embodiment, a slave process in the user space of the end device operating system can determine the time-sensitive type of the service data stream, where the time-sensitive type includes at least one of a time-sensitive stream and a background stream; then, the background stream in the service data stream is sent to the kernel space of the operating system through a pre-created kernel protocol stack channel, where the kernel protocol stack channel is used to transfer data between the kernel space and the user space.

[0038] In this alternative embodiment, the end device can receive service data streams from different application programs and / or external devices simultaneously, and distinguish the types of service data streams from different sources. If part of the service data stream is a time-sensitive stream, the Figure 2 method shown in the figure is used for deterministic forwarding by the user space of the operating system. If part of the service data stream is a background stream, that is, a data stream with less stringent requirements for forwarding delay, the background stream can be given to the kernel space and forwarded using the default data stream forwarding protocol in the kernel space of the end device to avoid preempting the resources for deterministic network transmission in the user space.

[0039] As an alternative embodiment, the time-sensitive stream and the background stream of the service data stream can be distinguished in the following way: determine the User Datagram Protocol (UDP) frame in the service data stream; determine whether the source port number corresponding to the UDP frame is stored in the mapping table, where the mapping table is used to record the correspondence between the gated queue and the source port number; in the case where the source port number corresponding to the UDP frame is stored in the mapping table, determine that the UDP frame is a time-sensitive stream. Determine the non-UDP frames in the service data stream as the first part of the background stream; determine the UDP frames whose source port numbers are not stored in the mapping table as the second part of the background stream.

[0040] In this alternative embodiment, a method for distinguishing time-sensitive streams and background streams is proposed. For service data streams sent from source port numbers not pre-stored in the mapping table, they are defaulted to be background streams. Optionally, if a slave process in the user space wants to mark the service data stream incoming from a port as a time-sensitive stream, the slave process can register with the master process and register the information of the service data stream in the mapping table, and then it can be processed as a time-sensitive stream.

[0041] As an alternative embodiment, based on the user space protocol stack, the time-sensitive streams in the service data stream can be deterministically forwarded to the target end device in the following way: based on the Time-Sensitive Networking (TSN) protocol, mark the virtual local area network (VLAN) information of the time-sensitive stream to obtain the marked time-sensitive stream, and store the marked time-sensitive stream in the target queue in the gated queue, where the gated queue is a plurality of queues pre-opened based on the TSN protocol; according to the gated list corresponding to the gated queue, read the marked time-sensitive stream from the target queue and forward it to the target end device.

[0042] Among them, the virtual local area network information is the VLAN information of the time-sensitive flow. Marking it can also be called adding a VLAN tag. After marking, the data stream can be officially recognized as a time-sensitive flow that needs to be transmitted through a deterministic network. Subsequently, the operating system user mode performs deterministic network transmission on all marked time-sensitive flows.

[0043] As an alternative embodiment, when storing the marked time-sensitive flow into the target queue in the gating queue, the following method can be adopted: obtain the source port number of the service data stream corresponding to the marked time-sensitive flow; determine the target queue in the gating queue corresponding to the source port number according to the mapping table, where the mapping table is used to record the correspondence between the gating queue and the source port number; store the marked time-sensitive flow into the target queue.

[0044] Optionally, the priority of each marked time-sensitive flow can also be identified according to the VLAN tag added to each time-sensitive flow, and then different priorities of time-sensitive flows are controlled to enter different queues in the gating queue. Generally, the gating queue has 8 queues, and the user mode can complete scheduling according to the priorities of different gating queues, and uniformly determine a lowest priority for the data stream forwarded through the kernel mode.

[0045] As an alternative embodiment, according to the gating list corresponding to the gating queue, reading out the marked time-sensitive flow from the target queue and forwarding it to the target end device includes the following steps: obtain the gating list corresponding to the gating queue according to the IEEE802.1Qbv protocol in the time-sensitive network protocol; according to the gating list, map the marked time-sensitive flow in the target queue to the virtual memory area, where the time-sensitive network network card of the end device reads the marked time-sensitive flow in the virtual memory area to forward the marked time-sensitive flow to the target end device.

[0046] Through this alternative embodiment, the control of data forwarding by the kernel mode can be bypassed, and the user mode of the operating system directly accesses the time-sensitive network network card (abbreviation: TSN network card). Optionally, the user mode and the TSN network card can pre-agree on the memory area in the DMA for different gating queues based on the direct storage access DMA technology. Different gating queues directly transmit the data stream to the TSN network card through the DMA method according to the IEEE802.1Qbv protocol, reducing the latency and ensuring the latency determinacy of data packet forwarding.

[0047] It should be noted that in the above data processing method, the user mode can also achieve clock synchronization calibration from the process, the main process, and the network card clock based on the IEEE802.1AS protocol in the user mode protocol stack, and achieve clock synchronization calibration with the TSN switch through the TSN network card, and finally achieve end-to-end clock synchronization.

[0048] Figure 3 It is a schematic diagram of the operating system architecture of the end device provided according to an optional embodiment of the present invention. As Figure 3 shown, the ST stream is a time-sensitive stream, and the BE stream is a background stream. In order to help the end device implement the transmission of data packets in a deterministic network, a centralized architecture can be adopted. The main process in the user state is responsible for docking with the TSN network card, and the service processes in the user state, as slave processes, dock with the main process through gated queues. As an optional implementation method, the end device can adopt the following architecture to implement the function of supporting deterministic forwarding:

[0049] Each service process, as a slave process, applies for resources such as queues and ports. During this process, the service process can judge whether the data stream corresponding to the service process is a time-sensitive stream; at the same time, the slave process passes the information such as the priority, IP address, and port number of the service data stream to the user-state protocol stack of the main process through the custom socket interface.

[0050] The main process is responsible for managing the registration and task application of each slave process, and respectively manages the read packet, write packet, queue gating management, and ip-mac table management by creating task threads. The main process also provides custom socket programming interface management to realize the call of the UDP protocol by the service process.

[0051] The main process adds a TSNtag label to the time-sensitive stream in the service data stream according to different port numbers passed by the service process (adding a TSN tag label means modifying the VLAN information. The process of adding a TSN tag label is actually modifying the fields in the VLAN information), and converts the time-sensitive stream into a marked time-sensitive stream, so as to identify which gated queue the different time-sensitive streams should be stored in according to the label.

[0052] The main process can create 8 queues to store the received data packets. According to the VLAN information of the marked time-sensitive stream in the data packet, the priority of the service flow is identified, and the marked time-sensitive streams with different priorities are assigned to different priority queues, and a gating table is configured to schedule and manage the marked time-sensitive streams in the gated queue according to the gating time slot and priority.

[0053] The end device can also include a queue mapping module, which can map the marked time-sensitive streams in each queue to the memory area (DMA) according to different priority queues. The TSN network card can directly read the corresponding data stream from the DMA and forward it, realizing the binding of the data in the gated queue to the TSN network card queue, and ensuring that the priorities of the gated queue and the TSN network card correspond one by one.

[0054] In addition, the end device may further include a clock synchronization module. Based on the IEEE802.1AS protocol, this module realizes the clock synchronization and calibration of the service process, the main process, and the network card, and realizes the clock synchronization and calibration with the TSN switch through the TSN network card, finally achieving end-to-end clock synchronization.

[0055] In the above manner, the user-mode protocol stack can bypass the kernel-mode protocol stack to achieve deterministic forwarding of time-sensitive flows. It directly connects to the TSN network card through a custom user-mode protocol stack and binds to the TSN network card queue, finally realizing the time synchronization and scheduling of the data stream by the user-mode protocol stack.

[0056] Figure 4 It is a schematic diagram of end-to-end service data stream deterministic forwarding provided by an optional embodiment of the present invention. Figure 4 In it, the end-to-end device can be an end device based on general computer hardware devices and the Linux operating system, equipped with a TSN network card, networking with the TSN switch, and building a set of general end-to-end TSN network systems.

[0057] The user-mode protocol stack supporting the time-sensitive network is deployed in the end device computer, including the sending end device A and the receiving end device B. Among them, devices A and B are respectively equipped with TSN network cards and install and execute the corresponding drivers. Finally, devices A and B are networked through the TSN switch. In the actual deployment architecture, the terminal system executes the user-space process. The source and destination of the time-sensitive flow are based on the current process. The main application scenarios include: sensors for transmitting collected data streams, mainly used to send messages; actuators for transmitting command streams, mainly used to receive messages; CPS controllers responsible for driving physical processes, mainly used to receive messages, process tasks, and send messages.

[0058] In the above scenarios, if the real-time or deterministic nature of the end-to-end delay (jitter) is to be ensured, the software and hardware modules such as the application program, the operating system, the driver program, the network interface card, and the switch need to cooperate with each other. The following introduces the main functions of the service process and the main process in the end device of this optional embodiment.

[0059] As a slave process, the service process mainly has the following processing procedures: initialize resources; customize and implement the socket function; confirm whether the port number is occupied, and then bind the port number; set the IP, port number, VLAN parameter information, and encapsulate the UDP header; send data, and send the data stream to the target queue in the 0-7 gated queues according to the priority of the time-sensitive flow; receive data, and read the data from the corresponding port queue.

[0060] The main process is used to implement the docking between the deterministic user-space protocol stack and the service process, conduct data interaction with the kernel space, and interface with the TSN network card to complete the data transmission process. Its processing flow is as follows:

[0061] Initialize resources, create a kernel protocol stack channel to achieve data interaction with the kernel protocol stack; create working threads, including: read thread, write thread, and resource management thread. The resource management thread is mainly responsible for handling gating operations and maintaining tasks such as ip / mac mapping; identify the received process registration information, including: creation and elimination of queue resources, matching of queue resources and port numbers, and management of port and queue information through the int_map (i.e., queue resource and port mapping table); send data: read frames from the queue according to the gating table, look up the mac address of the corresponding ip from the ip / mac mapping table, fill in the mac address and send the packet (i.e., send it to the network card); receive data. If the received frame is not a UDP frame, it is directly sent to the kernel protocol stack for processing through the kernel protocol stack channel. If it is an arp or rarp packet, the ip address and mac address of the packet are stored in the ip / mac address mapping table; if it is a UDP packet, check whether the port number exists in the queue resource and port mapping table according to the port number. If it exists, it is sent to the corresponding queue. If it does not exist, it is sent to the kernel protocol stack for processing through the kernel protocol stack channel; through the above operations, flow classification is completed, and the user-space protocol stack only processes the key service flows related to the UDP protocol; according to the VLAN tags of the service flows, identify different priority flows, and enter 8 queues respectively. Scheduling is completed according to the gating priority. Other data flows sent through the kernel protocol stack channel are uniformly assigned a lowest priority; the marked time-sensitive flows in the queues in the above steps are mapped to the forwarding queues of the TSN network card according to the priority of the queues through DMA, realizing the binding of the in-memory data flow queue and the network card queue.

[0062] It should be noted that the user-space protocol stack can be used for the deterministic forwarding of key service flows (i.e., time-sensitive flows, abbreviated as ST flows), or for handling background flows (abbreviated as BE flows). For example, when the user space simultaneously receives an ST flow sent by application 1 and a BE flow sent by application 2, the user-space protocol stack can preferentially allocate a high-priority gating queue for the key service flow for deterministic forwarding, and store the background flow in the lowest-priority queue in the gating queue, that is, give priority to allocating communication resources to the key service flow to ensure the deterministic forwarding of the key service flow; in other scenarios, such as when the traffic of the key service flow is large, the user space can also directly send the background flow to the kernel space through the kernel protocol stack channel, and the kernel space performs ordinary forwarding on the background flow to ensure that all communication resources of the user space are allocated to the key service flow.

[0063] In this alternative embodiment, the main data structures implemented are as follows:

[0064] Transmission queue data structure:

[0065]

[0066] Received data data structure:

[0067]

[0068] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0069] Through the description of the above embodiments, those skilled in the art can clearly understand that the data processing method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that makes a contribution to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0070] According to an embodiment of the present invention, there is also provided a data processing device for implementing the above data processing method. Figure 5 It is a structural block diagram of the data processing device provided according to an embodiment of the present invention, as Figure 5 shown. The data processing device includes: an acquisition module 52 and a forwarding module 54. The following is an explanation of the data processing device.

[0071] The acquisition module 52 is used to acquire service data streams, where the service data streams come from at least one of the following: application programs of the terminal device, external devices of the terminal device;

[0072] The forwarding module 54 is used to deterministically forward the time-sensitive streams in the service data streams to the target terminal device based on the user-space protocol stack, where the user-space protocol stack is located in the user space of the operating system of the terminal device, and the user-space protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0073] It should be noted here that the above-mentioned acquisition module 52 and forwarding module 54 correspond to steps S202 to S204 in the embodiment. The instances and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the content disclosed in the above embodiment. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in the embodiment.

[0074] An embodiment of the present invention may provide a computer device. Optionally, in this embodiment, the above computer device may be located in at least one of multiple network devices in a computer network. The computer device includes a memory and a processor.

[0075] Among them, the memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the data processing method and device in the embodiment of the present invention. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implements the above-mentioned data processing method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory may further include a memory remotely set relative to the processor, and these remote memories can be connected to the computer terminal through a network. Examples of the above network include but are not limited to the Internet, enterprise intranet, local area network, mobile communication network, and their combinations.

[0076] The processor can call the information and application programs stored in the memory through a transmission device to execute the following steps: obtaining service data streams, where the service data streams come from at least one of the following: application programs of end devices, external devices of end devices; based on the user-space protocol stack, deterministically forwarding the time-sensitive streams in the service data streams to the target end device, where the user-space protocol stack is located in the user space of the operating system of the end device, and the user-space protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0077] Those of ordinary skill in the art can understand that all or part of the steps in the above-mentioned various methods can be completed by instructing the hardware related to the terminal device through a program. The program can be stored in a non-volatile storage medium, and the storage medium can include: flash drive, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disc, etc.

[0078] An embodiment of the present invention also provides a non-volatile storage medium. Optionally, in this embodiment, the above non-volatile storage medium can be used to save the program code executed by the data processing method provided in the above embodiment.

[0079] Optionally, in this embodiment, the non-volatile storage medium may be located in any one of the computer terminals in the computer terminal group in the computer network, or in any one of the mobile terminals in the mobile terminal group.

[0080] Optionally, in this embodiment, the non-volatile storage medium is configured to store program code for performing the following steps: obtaining service data streams, where the service data streams come from at least one of the following: application programs of the terminal device, external devices of the terminal device; based on the user-mode protocol stack, deterministically forwarding the time-sensitive streams in the service data streams to the target terminal device, where the user-mode protocol stack is located in the user mode of the operating system of the terminal device, and the user-mode protocol stack includes a time-sensitive network protocol that supports deterministic forwarding.

[0081] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0082] In the above embodiments of the present invention, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0083] In the several embodiments provided in the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of units can be a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of units or modules can be in electrical or other forms.

[0084] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0085] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0086] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, read-only memories (ROMs), random access memories (RAMs), mobile hard disks, magnetic disks, or optical discs that can store program codes.

[0087] The foregoing is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A data processing method, characterized in that, Including: Obtain a service data stream, where the service data stream comes from at least one of the following: an application program of an end device, an external device of the end device; Based on a user-mode protocol stack, deterministically forward the time-sensitive stream in the service data stream to a target end device, where the user-mode protocol stack is located in the user mode of the operating system of the end device, and the user-mode protocol stack includes a time-sensitive network protocol that supports deterministic forwarding; Wherein, the method further includes: determining the time-sensitive type of the service data stream, where the time-sensitive type includes at least one of the following: time-sensitive stream, background stream; sending the background stream in the service data stream to the kernel mode of the operating system through a pre-created kernel protocol stack channel, where the kernel protocol stack channel is used to transfer data between the kernel mode and the user mode.

2. The method according to claim 1, wherein The step of deterministically forwarding the time-sensitive stream in the service data stream to a target end device based on the user-mode protocol stack includes: Based on the time-sensitive network protocol, mark the virtual local area network information of the time-sensitive stream to obtain a marked time-sensitive stream, and store the marked time-sensitive stream in a target queue in a gated queue, where the gated queue is a plurality of queues pre-opened based on the time-sensitive network protocol; According to the gated list corresponding to the gated queue, read out the marked time-sensitive stream from the target queue and forward it to the target end device.

3. The method according to claim 2, characterized in that, The step of storing the marked time-sensitive stream in a target queue in the gated queue includes: Obtain the source port number of the service data stream corresponding to the marked time-sensitive stream; Determine the target queue in the gated queue corresponding to the source port number according to a mapping table, where the mapping table is used to record the correspondence between the gated queue and the source port number; Store the marked time-sensitive stream in the target queue.

4. The method according to claim 2, characterized in that, The step of reading out the marked time-sensitive stream from the target queue and forwarding it to the target end device according to the gated list corresponding to the gated queue includes: Obtain the gated list corresponding to the gated queue according to the IEEE802.1Qbv protocol in the time-sensitive network protocol; According to the gated list, map the marked time-sensitive stream in the target queue to a virtual memory area, where the time-sensitive network network card of the end device forwards the marked time-sensitive stream to the target end device by reading the marked time-sensitive stream in the virtual memory area.

5. The method according to claim 1, wherein Determining the time-sensitive stream of the service data stream includes: Determine the User Datagram Protocol (UDP) frame in the service data stream; Determine whether the source port number corresponding to the UDP frame is stored in a mapping table, where the mapping table is used to record the correspondence between the gated queue and the source port number; In the case where the source port number corresponding to the UDP frame is stored in the mapping table, determine that the UDP frame is the time-sensitive stream.

6. The method according to claim 5, wherein Determining the background stream of the service data stream includes: Determine that the non-UDP frame in the service data stream is the first part of the background stream; Determine that the UDP frame whose source port number is not stored in the mapping table is the second part of the background stream of the background stream.

7. A data processing device, characterized in that, Including: An acquisition module for acquiring service data streams, where the service data streams come from at least one of the following: application programs of end devices, external devices of end devices; A forwarding module for deterministically forwarding the time-sensitive streams in the service data streams to the target end device based on the user-space protocol stack, where the user-space protocol stack is located in the user space of the operating system of the end device, and the user-space protocol stack includes a time-sensitive network protocol that supports deterministic forwarding; Wherein, the device is further configured to determine the time-sensitive type of the service data stream, where the time-sensitive type includes at least one of the following: time-sensitive stream, background stream; send the background stream in the service data stream to the kernel space of the operating system through a pre-created kernel protocol stack channel, where the kernel protocol stack channel is used to transfer data between the kernel space and the user space.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, where when the program runs, it controls the device where the non-volatile storage medium is located to execute the data processing method described in any one of claims 1 to 6.

9. A computer device, characterized in that, The computer device includes a memory and a processor, the memory is used to store a program, and the processor is used to run the program stored in the memory, where when the program runs, it executes the data processing method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method and system for realizing safe and reliable data transmission based on user mode protocol stack

    CN114143061A