USB network accelerator and data transmission method and device
By separating the hardware and software processing units, the problem of low data transmission efficiency in USB networks is solved, achieving efficient data packet transmission and resource conservation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING X RING TECHNOLOGY CO LTD
- Filing Date
- 2025-12-19
- Publication Date
- 2026-04-17
AI Technical Summary
The current USB network data transmission efficiency is low, mainly because the central processing unit module needs to handle packet parsing and protocol header addition, resulting in high resource consumption and low efficiency.
By separating the hardware processing unit and the software processing unit, the hardware processing unit is responsible for the packet assembly or depacketization operation, the software processing unit is responsible for the transmission control task, and the USB controller is responsible for the transmission of data packets between devices, thereby realizing the acceleration of data transmission through the combination of hardware and software.
By separating hardware and software processing, the efficiency of packet assembly and decompression is improved, resource consumption is reduced, and the efficiency of USB network data transmission is significantly improved.
Smart Images

Figure CN121887645A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of computer and data transmission technology, and in particular to a USB network accelerator, data transmission method, and apparatus. Background Technology
[0002] Currently, Universal Serial Bus (USB) network data transmission is controlled by software. During network data transmission, the Central Processing Unit (CPU) needs to instruct the USB controller to receive data packets from the terminal device, parse the data packets, and send the parsed data packets to the network protocol stack. Simultaneously, it needs to add protocol headers to the data packets in the network protocol stack and then instruct the USB controller to send the encapsulated data packets to the terminal device, resulting in low efficiency in network data transmission. Summary of the Invention
[0003] This disclosure provides a USB network accelerator, data transmission method, apparatus, electronic device, computer-readable storage medium, and computer program product to at least solve the problem of low efficiency in network data transmission in related technologies. The technical solution of this disclosure is as follows: According to a first aspect of the present disclosure, a USB network accelerator is provided, comprising: a hardware processing unit, a software processing unit, and a USB controller; the hardware processing unit is configured to perform packet assembly or depacketization operations on data packets to be transmitted via USB between the network protocol stacks of a first device and a second device; the software processing unit is configured to perform a data packet transmission control task to send a data transmission command to the USB controller; the USB controller is configured to transmit the data packets processed by the hardware processing unit between the first device and the second device based on the data transmission command.
[0004] According to a second aspect of the present disclosure, a data transmission method is provided, comprising: a first processing subunit in a software processing unit of a USB network accelerator independently executing a data packet transmission task to send a data transmission command to a USB controller in the USB network accelerator; the USB controller, based on the data transmission command, controlling a hardware processing unit to perform packet assembly or depacketization operations on data packets that need to be transmitted via USB between the network protocol stacks of a first device and a second device, and transmitting the data packets processed by the hardware processing unit between the first device and the second device.
[0005] According to a third aspect of the present disclosure, a data transmission apparatus is provided, comprising: a sending module, configured to have a first processing subunit in a software processing unit of a USB network accelerator independently execute a data packet transmission task to send a data transmission command to a USB controller in the USB network accelerator; and a control transmission module, configured to have the USB controller, based on the data transmission command, control a hardware processing unit to perform packet assembly or depacketization operations on data packets to be transmitted via USB between the network protocol stacks of a first device and a second device, and to transmit the data packets processed by the hardware processing unit between the first device and the second device.
[0006] According to a fourth aspect of the present disclosure, an electronic device is provided, including a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the steps of the method described in the first aspect of the present disclosure.
[0007] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided that stores computer program instructions thereon, which, when executed by a processor, implement the steps of the method described in the first aspect of the present disclosure.
[0008] According to a sixth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor of an electronic device, implements the steps of the method as described in the first aspect of the present disclosure.
[0009] The technical solutions provided by the embodiments of this disclosure offer at least the following beneficial effects: The USB network accelerator includes a hardware processing unit, a software processing unit, and a USB controller. The hardware processing unit is configured to perform packet assembly or depacketization operations on data packets to be transmitted between the network protocol stacks of a first device and a second device via USB. The software processing unit is configured to execute data packet transmission control tasks to send data transmission commands to the USB controller. The USB controller is configured to transmit data packets processed by the hardware processing unit between the first device and the second device based on the data transmission commands. Therefore, by having the hardware processing unit perform packet assembly or depacketization operations independently, packet assembly and depacketization efficiency can be improved. By combining hardware and software, packet assembly and depacketization operations are separated from data packet transmission tasks, achieving functional decoupling of the USB network accelerator, improving its flexibility, and thus accelerating the data processing process. The USB network accelerator, through a combination of hardware and software, accelerates USB network data processing, significantly improving USB data transmission efficiency while reducing resource consumption.
[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure, and are not intended to unduly limit this disclosure.
[0012] Figure 1 This is a schematic diagram of the structure of a USB network accelerator according to an exemplary embodiment; Figure 2 This is a schematic diagram of the structure of a USB network accelerator according to another exemplary embodiment; Figure 3 This is a block diagram illustrating a USB network accelerator according to an exemplary embodiment; Figure 4 This is a flowchart illustrating a data transmission method according to another exemplary embodiment; Figure 5 This is a flowchart illustrating a data transmission method based on a USB network accelerator according to an exemplary embodiment; Figure 6 This is a block diagram illustrating a data transmission apparatus according to an exemplary embodiment; Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions of this disclosure, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0014] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0015] The acquisition, storage, use, and processing of data in this disclosed technical solution all comply with the relevant laws and regulations.
[0016] The USB network accelerator, data transmission method, and apparatus according to embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0017] Figure 1This is a schematic diagram illustrating the structure of a USB network accelerator according to an exemplary embodiment, such as... Figure 1 As shown, the Universal Serial Bus (USB) network accelerator 100 includes: a hardware processing unit 101, a software processing unit 102, and a USB controller 103.
[0018] The hardware processing unit 101 is configured to perform packet assembly or depacketization operations on data packets that need to be transferred via USB between the network protocol stacks of the first device and the second device.
[0019] The software processing unit 102 is configured to perform data packet transmission control tasks to send data transmission commands to the USB controller 103.
[0020] USB controller 103 is configured to transmit data packets processed by hardware processing unit 101 between a first device and a second device based on data transmission commands.
[0021] It should be noted that when transferring network data between the first and second devices via USB, the network protocol stack is used to handle network communication between the first and second devices. The network protocol stack defines how data is encapsulated, parsed, and transmitted between the network layer, transport layer, and application layer.
[0022] For example, when the first device sends data, the network protocol stack generates the data through the application layer, encapsulates the protocol header at the transport layer, performs address verification at the network layer, and then encapsulates the data into a USB-transferable format at the USB adapter layer, enabling the USB network accelerator to send the data to the second device. In some embodiments, the first device and the second device refer to devices that need to perform USB transmission. Both the first device and the second device can be terminal devices. Optionally, terminal devices include, but are not limited to, smartphones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, etc. No further limitations are imposed on the first device and the second device.
[0023] In some embodiments, the second device is a device that provides storage and input / output functions, and the first device is a device that manages device enumeration and data transmission.
[0024] For example, the first device is a computer and the second device is a smartphone.
[0025] For example, the first device is a smartphone and the second device is a computer.
[0026] It should be noted that the USB network accelerator 100 transmits data via the USB protocol. The USB protocol employs a master-slave architecture, meaning data transmission occurs between the host and the device. The host controls USB bus resource allocation, initiates all communication requests, and manages device enumeration and data transmission. The device passively responds to host requests, providing storage, networking, and input / output functions. In this embodiment, the first device can be designated as the host, and the USB network accelerator 100 can be configured as the second device.
[0027] In some embodiments, by configuring the packet assembly or unpacking operation to be executed by the hardware processing module 101 and the data transmission control task to be executed by the software control unit 102, the packet assembly or unpacking operation and the transmission control task can be separated in the USB network accelerator 100, thereby improving the efficiency and speed of data transmission in the USB network accelerator 100.
[0028] In some embodiments, unpacking and repacking operations are operations used in data communication to handle data format conversion between different protocol layers.
[0029] Packet assembly refers to encapsulating data packets from the upper-layer protocol into new data packets according to the specifications of the lower-layer protocol, adding necessary control fields, such as protocol headers, to make them conform to transmission requirements.
[0030] Unpacking refers to stripping control fields, such as protocol headers, from received lower-layer protocol data packets, restoring them to data packets recognizable by the upper-layer protocol, and verifying the integrity of the data.
[0031] In some embodiments, the hardware processing unit 101 can obtain data packets transmitted from the first device from the network protocol stack and perform unpacking operations on the data packets. The hardware processing unit 101 can also obtain data packets transmitted to the first device from the network protocol stack and perform packet assembly operations on the data packets.
[0032] In some embodiments, the software processing unit 102 performs a data packet transmission control task, which may be to perform an enumeration task between the first device and the second device. Through the enumeration task, the second device can determine the transmission parameters of the first device, and then transmit the data packet based on the transmission parameters.
[0033] In other words, after the software processing unit 102 completes the enumeration task, it can send a data transmission command to the USB controller 103 based on the acquired transmission parameters, so that the USB controller 103 can transmit data packets based on the transmission parameters carried in the data transmission command.
[0034] In some embodiments, the USB controller 103 may establish a transmission channel with the first device to transmit data packets processed by the hardware processing unit 101 between the first device and the second device through the transmission channel.
[0035] The USB network accelerator provided in this disclosure includes a hardware processing unit, a software processing unit, and a USB controller. The hardware processing unit is configured to perform packet assembly or depacketization operations on data packets to be transmitted between the network protocol stacks of a first device and a second device via USB. The software processing unit is configured to execute data packet transmission control tasks to send data transmission commands to the USB controller. The USB controller is configured to transmit the data packets processed by the hardware processing unit between the first device and the second device based on the data transmission commands. Therefore, by having the hardware processing unit perform packet assembly or depacketization operations independently, packet assembly and depacketization efficiency can be improved. By combining hardware and software, packet assembly and depacketization operations are separated from data packet transmission tasks, achieving functional decoupling of the USB network accelerator, improving its flexibility, and thus accelerating the data processing process. The USB network accelerator, through a combination of hardware and software, accelerates USB network data processing, significantly improving USB data transmission efficiency while reducing resource consumption.
[0036] Figure 2 This is a schematic diagram illustrating the structure of a USB network accelerator according to an exemplary embodiment, such as... Figure 2 As shown, the USB network accelerator 200 includes: a hardware processing unit 201, a software processing unit 202, and a USB controller 203.
[0037] In some embodiments, the software processing unit 202 includes at least a first processing subunit 221 and a second processing subunit 222.
[0038] The first processing subunit 221 is configured to perform transmission control tasks.
[0039] The second processing subunit 222 is configured to execute an enumeration task for the first device and the second device, wherein the enumeration task is used to complete the communication negotiation process between the first device and the second device.
[0040] In some embodiments, the second processing subunit 222 can complete the communication negotiation process between the first device and the second device by performing an enumeration task between the first device and the second device, and after completing the communication negotiation process, the first processing subunit performs a transmission control task to send a data transmission command to the USB controller 203.
[0041] In some embodiments, the communication negotiation process may involve determining the transmission parameters of data packets between the first device and the second device. The second processing subunit 222 can determine the transmission parameters of data packets between the first device and the second device by performing an enumeration task. The transmission parameters may include parameters such as the transmission size and transmission type of the data packets.
[0042] In some embodiments, the second processing subunit 222 may configure the transmission parameters of the USB controller 203 to be the same as the transmission parameters obtained from the enumeration task, so that the USB controller 203 can transmit data packets according to the transmission parameters.
[0043] In some embodiments, the first processing subunit 221 and the second processing subunit 222 may be a central processing unit (CPU). That is, the software processing unit 202 performs the transfer control task and the enumeration task through the CPU.
[0044] In this embodiment, the first processing subunit 221 and the second processing subunit 222 can separate the enumeration task and the transmission control task, so that the transmission control task is not disturbed by the enumeration task, thereby improving the efficiency of data transmission.
[0045] In some embodiments, the second processing subunit 222 may trigger the execution of enumeration tasks for the first device and the second device based on an enumeration start command, thereby completing the communication negotiation process between the first device and the second device.
[0046] It should be noted that the second processing subunit 222 is a subunit in the software processing unit 202, and the software processing unit 202 is a module in the USB network accelerator 200, and the USB network accelerator 200 is located in the second device.
[0047] Since the connection between the second device and the first device is through the USB controller 203, the second processing subunit 222 can send an enumeration start command to the USB controller 203 so that the USB controller 203 can perform a communication negotiation process with the first device, thereby completing the communication negotiation process between the first device and the second device.
[0048] In other words, the second processing subunit 222 is also configured to send an enumeration start command to the USB controller 203 to trigger the communication negotiation process between the first device and the USB controller 203.
[0049] The USB controller 203 is also configured to, based on an enumeration start command, open a control channel with the first device, receive an enumeration establishment data packet sent by the first device through the control channel, and, based on the enumeration establishment data packet, complete the communication negotiation process between the first device and the second device through the control channel. The enumeration establishment data packet includes the data packet's transmission parameters.
[0050] In some embodiments, the USB controller 203 can enumerate startup commands and establish a control channel between the USB controller 203 and the first device based on their respective control endpoints.
[0051] In some embodiments, the USB controller 203 is further configured to control the first control endpoint of the first device and the second control endpoint of the USB controller 203 to enter an on state according to an enumerated start command, so as to establish a control channel between the first control endpoint and the second control endpoint.
[0052] In other words, the USB controller 203 enumerates startup commands to control the first control endpoint of the first device and the second control endpoint of the USB controller 203 to enter the on state. After the first control endpoint and the second control endpoint are in the on state, a control channel can be established between the first control endpoint and the second control endpoint as a control channel between the USB controller 203 and the first device.
[0053] In some embodiments, the second processing subunit 222 may also send an enumeration task completion notification after the enumeration task is completed, so as to notify other units in the USB network accelerator 200 that the enumeration task has been completed.
[0054] Optionally, the second processing subunit 222 is further configured to send an enumeration task completion notification to the hardware processing unit 201, the network protocol stack, and the first processing subunit 221 after the enumeration task is completed, so as to inform the hardware processing unit 201, the network protocol stack, and the first processing subunit 221 that the communication negotiation process has been completed.
[0055] In some embodiments, the hardware processing unit 201 is further configured to perform at least one of the following operations: Perform unpacking operation on the first data packet transmitted by the first device to the network protocol stack; Perform packet assembly operations on the second data packet transmitted from the network protocol stack to the first device.
[0056] In some embodiments, the hardware processing unit 201 may perform unpacking operations on the first data packet transmitted from the first device to the network protocol stack, or perform packet assembly operations on the second data packet transmitted from the network protocol stack to the first device, through different sub-units.
[0057] In other words, the hardware processing unit 201 includes a depacketizing subunit 211 and a packet reassembly subunit 212. The depacketizing subunit 211 is configured to depacket a first data packet transmitted from the first device to the network protocol stack. The packet reassembly subunit 212 is configured to reassemble a second data packet transmitted from the network protocol stack to the first device.
[0058] In some embodiments, the unpacking subunit 211 is configured to receive a first data packet sent by the USB controller 203, unpack the first data packet to obtain a third data packet, and send the third data packet to the network protocol stack.
[0059] In some embodiments, the unpacking subunit 211 obtains a first data packet sent by the USB controller 203 from the network protocol stack, wherein the first data packet is a data packet sent by the first device. After obtaining the first data packet, the unpacking subunit 211 can obtain a first protocol header from the first data packet, determine a third data packet based on the first protocol header, and send the third data packet to the network protocol stack.
[0060] In some embodiments, the unpacking subunit 211 can locate the memory storage location of the data content of the first data packet according to the first protocol header, thereby obtaining the data content of the first data packet from that location and sending it as a third data packet to the network protocol stack.
[0061] In some embodiments, the memory storage location of the data content of the first data packet can be accessed via Direct Memory Access (DMA) to obtain the data content.
[0062] In other words, the unpacking subunit 211 is also configured to parse the first data packet, obtain the first protocol header of the first data packet, determine the memory storage location of the data content of the first data packet based on the first protocol header, and access the memory storage location through the direct memory access (DMA) controller to obtain the data content as the third data packet.
[0063] In some embodiments, the packet assembly subunit 212 is configured to receive a second data packet, perform a packet assembly operation on the second data packet to obtain a fourth data packet, and send the fourth data packet to the device.
[0064] In some embodiments, the packet assembly subunit 212 may determine the second protocol header of the second data packet and complete the packet assembly operation by writing the second protocol header into the second data packet to obtain the fourth data packet.
[0065] It is understandable that the second protocol header can indicate the memory storage location of the data content in the second data packet. That is, the packet grouping subunit 212 is configured to determine the memory storage location corresponding to the second protocol header of the second data packet, and access the memory storage location through the DMA controller to write the second protocol header into the second data packet to obtain the fourth data packet.
[0066] In some embodiments, the first processing subunit 221 in the software processing unit 202 can control the USB controller 203 to receive the first data packet sent by the first device and send the fourth data packet to the first device by sending a data transmission command to the USB controller 203.
[0067] It is understood that data transmission commands include data receive commands and data send commands. The USB controller 203 can receive a first data packet sent by the first device based on the data receive command, and send a fourth data packet to the first device according to the data send command.
[0068] In other words, the first processing subunit 221 is also configured to send a data receiving command to the USB controller 203. After receiving the data receiving command, the USB controller 203 can receive the first data packet based on the uplink transmission channel, and after receiving the first data packet, transmit it to the hardware processing unit 201 for unpacking.
[0069] In some embodiments, the USB controller 203 is further configured to receive a first data packet sent by the first device through an uplink transmission channel with the first device according to a data receiving command, and send it to the hardware processing unit 201 for unpacking operation through the first processing subunit 221.
[0070] In some embodiments, the uplink transmission channel refers to the transmission channel through which the first device sends data. Since the USB controller 203 can establish a transmission channel with the first device, data transmission between the second device and the first device can be realized.
[0071] In some embodiments, an uplink transmission channel can be established by controlling the endpoints of the first device and the USB controller 203 to enter an enabled state. Since the uplink transmission channel refers to the transmission channel through which the first device sends data, the endpoint of the first device is an output endpoint, and the endpoint of the second device is an input endpoint.
[0072] In other words, the USB controller 203 is also configured to control the first output endpoint of the first device and the second input endpoint of the USB controller 203 to enter an enabled state according to a data receiving command, so as to establish an uplink transmission channel between the first output endpoint and the second input endpoint.
[0073] In some embodiments, the USB controller 203 can also be used to monitor whether a first data packet has arrived. Optionally, the USB controller 203 is further configured to send a first interrupt command to the first processing subunit 221 when the arrival of the first data packet is detected. The first interrupt command is used to instruct the USB controller 203 to receive the first data packet sent by the first device.
[0074] In some embodiments, after receiving the first data packet, the USB controller 203 can transmit the first data packet to the hardware processing unit 201 for unpacking to obtain the third data packet. Optionally, the unpacking subunit 211 in the hardware processing unit 201 can perform the unpacking operation on the first data packet.
[0075] In some embodiments, the USB controller 203 and the hardware processing unit 201 interact through the first processing subunit 221. That is, the USB controller 203 sends a first interrupt command to the first processing subunit 221, and the first processing subunit 221 can notify the hardware processing unit 201 to perform an unpacking operation based on the first interrupt command.
[0076] Optionally, the first processing subunit 221 is also configured to send a first notification message that data has arrived to the hardware processing unit 201 according to the first interrupt command.
[0077] Optionally, the hardware processing unit 201 is further configured to receive a first data packet according to a first notification message, unpack the received first data packet to obtain a third data packet, and send the third data packet to the network protocol stack.
[0078] In some embodiments, when the hardware processing unit 201 acquires the fourth data packet, the first processing subunit 221 sends a data transmission command to the USB controller 203, causing the USB controller 203 to send the fourth data packet to the first device according to the data transmission command. In some embodiments, the hardware processing unit 201 can receive the third data packet sent by the network protocol stack, and the packet assembly subunit 212 in the hardware processing unit 201 can perform packet assembly operations on the third data packet to obtain the fourth data packet, and at the same time generate a second interrupt command to indicate that the fourth data packet has been acquired and can be transmitted.
[0079] Optionally, the hardware processing unit 201 is also configured to receive a second data packet sent by the network protocol stack, perform packet assembly operations on the second data packet to obtain a fourth data packet, and send a second interrupt command to the first processing subunit 221.
[0080] Optionally, the first processing subunit 221 is also configured to send a data transmission command to the USB controller 203 according to the second interrupt command.
[0081] In some embodiments, the USB controller 203 may transmit a fourth data packet via a downlink transmission channel.
[0082] Optionally, the USB controller 203 is also configured to send a fourth data packet to the first device via a downlink transmission channel with the first device, based on a data transmission command.
[0083] In some embodiments, the downlink transmission channel refers to the transmission channel through which the second device sends data, which is also the transmission channel through which the first device receives data. Since the USB controller 203 is located in the second device, it can establish a transmission channel with the first device to enable data transmission between the second and first devices.
[0084] In some embodiments, a downlink transmission channel can be established by controlling the endpoints of the first device and the USB controller 203 to enter an enabled state. Since the downlink transmission channel refers to the transmission channel through which the first device receives data, the endpoint of the first device is the input endpoint, and the endpoint of the second device is the output endpoint.
[0085] In other words, the USB controller 203 is also configured to send commands based on data to control the first input endpoint of the first device and the second output endpoint of the second device to enter an enabled state, so as to establish a downlink transmission channel between the first input endpoint and the second output endpoint.
[0086] The USB network accelerator provided in this disclosure separates the enumeration task and data transmission control task of the software processing unit through a first processing subunit and a second data subunit. This ensures that the enumeration task does not interfere with the transmission control task, improving data transmission efficiency. By using the unpacking and repackaging subunits in the hardware processing unit to perform data packet unpacking and repackaging operations, the speed of data packet assembly or unpacking can be improved, further increasing data transmission speed. Therefore, the USB network accelerator accelerates USB network data processing through a combination of hardware and software, significantly improving USB data transmission efficiency while reducing resource consumption.
[0087] Figure 3 The diagram shown is a block diagram of a USB network accelerator. Figure 3 The USB network accelerator includes a hardware processing unit, a software processing unit, and a USB controller.
[0088] The hardware processing unit includes a USB network unpacking module and a USB network repackaging module; the USB network unpacking module corresponds to... Figure 2 The packet unpacking subunit in the USB network packet repackaging module corresponds to... Figure 2 The group of sub-units in the middle.
[0089] The software processing unit includes CPU1 and CPU0, with CPU1 corresponding to... Figure 2 The first processing subunit in the process, CPU0 corresponds to Figure 2 The second processing subunit in the process.
[0090] The USB network unpacking module is used to unpack the first data packet sent by the first device, and access the memory storage location of the data content of the first data packet corresponding to the unpacked first protocol header through the DMA controller, thereby obtaining the data content as a third data packet and sending it to the network protocol stack.
[0091] The USB network packet assembly module receives the second data packet sent by the network protocol stack and adds a second protocol header to it, thus performing packet assembly operations. The second protocol header can be written into the second data packet by accessing the memory storage location through the DMA controller.
[0092] CPU0 is used to send enumeration start commands to the USB controller and to notify the hardware processing unit and network protocol stack after the enumeration task is completed.
[0093] CPU1 is used to send data transfer commands to the USB controller and handle interrupt commands after the USB controller completes the transfer. CPU1 and CPU0 operate independently.
[0094] The USB controller is used to receive data transmission commands sent by the software processing unit and to execute USB data packet transmission according to different data transmission commands.
[0095] Based on any of the above embodiments, the embodiments of this disclosure can also be based on... Figures 1-3 The USB network accelerator is used for data transfer.
[0096] Figure 4 This is a flowchart illustrating a data transmission method according to an exemplary embodiment, such as... Figure 4 As shown, the data transmission method of this disclosure includes the following steps: S401, the first processing subunit in the software processing unit of the USB network accelerator independently performs the data packet transmission task to send a data transmission command to the USB controller in the USB network accelerator.
[0097] It should be noted that the data transmission method of this embodiment is executed by a USB network accelerator. The data transmission method of this embodiment can be executed via a USB network accelerator.
[0098] In some embodiments, the USB network accelerator includes a hardware processing unit, a software processing unit, and a USB controller. The hardware processing unit includes an unpacking subunit and a packing subunit; the software processing unit includes a first processing subunit and a second processing subunit.
[0099] In some embodiments, the unpacking subunit and the packing subunit are independently operating subunits, and the first processing subunit and the second processing subunit are independently operating processing units. Optionally, the first processing subunit and the second processing subunit may be a central processing unit (CPU).
[0100] In some embodiments, the data packet transmission task can be performed by the first processing subunit in the software processing unit of the USB network accelerator, and a data transmission command can be sent to the USB controller in the USB network accelerator so that the USB controller can transmit the data packet between the first device and the second device based on the data transmission command.
[0101] In some embodiments, the USB network accelerator is disposed in the second device. The USB network accelerator can receive and transmit a first data packet sent by the first device, and the USB network accelerator can also send a second data packet to the first device.
[0102] In some embodiments, both the first device and the second device can be terminal devices. Optionally, terminal devices include, but are not limited to, smartphones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, etc. No further limitations are imposed on the first device and the second device.
[0103] For example, the first device is a computer and the second device is a smartphone.
[0104] For example, the first device is a smartphone and the second device is a computer.
[0105] It should be noted that the software processing unit also includes a second processing subunit, which can perform an enumeration task between the first device and the second device, complete the communication negotiation process between the first device and the second device, and after completing the communication negotiation process, execute a transmission control task through the first processing subunit to send a data transmission command to the USB controller.
[0106] S402, the USB controller, based on data transmission commands, controls the hardware processing unit to perform packet assembly or depacketization operations on data packets that need to be transmitted between the network protocol stacks of the first device and the second device via USB, and transmits the data packets processed by the hardware processing unit between the first device and the second device.
[0107] In some embodiments, after receiving a data transmission command, the USB controller can control the hardware processing unit to perform packet assembly or unpacking operations on the data packets that need to be transmitted via USB, according to the data transmission command.
[0108] It is understandable that data transmission commands include data receive commands and data send commands. If the data transmission command is a data receive command, then the first data packet sent by the first device can be received according to the data receive command, and the hardware processing unit can be controlled to perform unpacking operations on the first data packet.
[0109] If the data transmission command is a data sending command, then after the hardware processing unit performs a packet assembly operation on the second data packet to obtain the fourth data packet, the fourth data packet can be sent to the first device according to the data sending command.
[0110] In some embodiments, the hardware processing unit includes a depacketizing subunit and a packet reassembly subunit. The depacketizing subunit can perform depacketizing operations on data packets, and the packet reassembly subunit can perform packet reassembly operations on data packets.
[0111] In other words, the unpacking subunit in the hardware processing unit can be controlled to unpack the first data packet transmitted from the first device to the network protocol stack, and the packet assembly subunit in the hardware processing unit can be controlled to assemble the second data packet transmitted from the network protocol stack to the first device.
[0112] In some embodiments, if the data transmission command is a data receiving command, the first processing subunit can send the data receiving command to the USB controller, thereby enabling the USB controller to receive the first data packet sent by the first device through the uplink transmission channel between the first device and the first device, and send it to the hardware processing unit for unpacking operation through the first processing subunit.
[0113] In some embodiments, the uplink transmission channel refers to the transmission channel through which the first device sends data. Since the USB controller can establish a transmission channel with the first device, data transmission between the second device and the first device can be realized.
[0114] In some embodiments, an uplink transmission channel can be established by controlling the endpoints of the first device and the USB controller to enter an enabled state. Since the uplink transmission channel refers to the transmission channel through which the first device sends data, the endpoint of the first device is an output endpoint, and the endpoint of the second device is an input endpoint.
[0115] In other words, the USB controller can control the first output endpoint of the first device and the second input endpoint of the USB controller to enter the enabled state according to the data receiving command, so as to establish an uplink transmission channel between the first output endpoint and the second input endpoint.
[0116] In some embodiments, the USB controller may also monitor whether the first data packet has arrived. Optionally, when the arrival of the first data packet is detected, the USB controller may send a first interrupt command to the first processing subunit. The first interrupt command is used to instruct the USB controller to receive the first data packet sent by the first device.
[0117] In some embodiments, after receiving the first data packet, the USB controller can transmit the first data packet to the hardware processing unit for unpacking to obtain the third data packet.
[0118] In some embodiments, the USB controller and the hardware processing unit interact through a first processing subunit. That is, the USB controller sends a first interrupt command to the first processing subunit, and the first processing subunit can notify the hardware processing unit to perform an unpacking operation based on the first interrupt command.
[0119] In some embodiments, the hardware processing unit may receive a first data packet according to a first notification message, unpack the received first data packet to obtain a third data packet, and send the third data packet to the network protocol stack.
[0120] In some embodiments, when the hardware processing unit obtains the fourth data packet, the first processing subunit sends a data transmission command to the USB controller, so that the USB controller sends the fourth data packet to the first device according to the data transmission command. In some embodiments, the hardware processing unit can receive the third data packet sent by the network protocol stack, and the packet assembly subunit in the hardware processing unit performs packet assembly operation on the third data packet to obtain the fourth data packet, and at the same time generates a second interrupt command to indicate that the fourth data packet has been obtained and can be transmitted.
[0121] In some embodiments, if the data transmission command is a data sending command, the hardware processing unit receives the second data packet sent by the network protocol stack, performs packet assembly operation on the second data packet to obtain the fourth data packet, and sends a second interrupt command to the first processing subunit.
[0122] Furthermore, the first processing subunit sends a data transmission command to the USB controller according to the second interrupt command, so that the USB controller sends a fourth data packet to the first device through the downlink transmission channel between the USB controller and the first device according to the data transmission command.
[0123] In some embodiments, the downlink transmission channel refers to the transmission channel through which the second device sends data, which is also the transmission channel through which the first device receives data. Since the USB controller is located in the second device, it can establish a transmission channel with the first device to enable data transmission between the second and first devices.
[0124] In some embodiments, a downlink transmission channel can be established by controlling the endpoints of the first device and the USB controller to enter an enabled state. Since the downlink transmission channel refers to the transmission channel through which the first device receives data, the endpoint of the first device is the input endpoint, and the endpoint of the second device is the output endpoint.
[0125] In other words, the USB controller can send commands based on the data to control the first input endpoint of the first device and the second output endpoint of the second device to enter the enabled state, so as to establish a downlink transmission channel between the first input endpoint and the second output endpoint.
[0126] The data transmission method provided in the embodiments of this disclosure involves a first processing subunit in the software processing unit of a USB network accelerator independently executing a data packet transmission task. This subunit sends a data transmission command to the USB controller in the USB network accelerator. Based on the data transmission command, the USB controller controls the hardware processing unit to perform packet assembly or depacketization operations on data packets to be transmitted between the network protocol stacks of the first and second devices via USB. The processed data packets are then transmitted between the first and second devices. Therefore, by having the hardware processing unit independently perform packet assembly or depacketization operations, packet assembly and depacketization efficiency can be improved. By combining software and hardware, packet assembly and depacketization operations are separated from data packet transmission tasks, achieving functional decoupling of the USB network accelerator, increasing its flexibility, and thus accelerating the data processing process. Using a hardware-software combined USB network accelerator for data transmission accelerates the USB network data transmission process, significantly improving USB data transmission efficiency while reducing resource consumption.
[0127] Based on any of the above embodiments, this disclosure also proposes a data transmission method based on a USB network accelerator, such as... Figure 5 As shown, Figure 5 The USB network accelerator includes a hardware processing unit, a software processing unit, and a USB controller.
[0128] The hardware processing unit includes a USB network unpacking module and a USB network repackaging module; the USB network unpacking module corresponds to... Figure 2 The packet unpacking subunit in the USB network packet repackaging module corresponds to... Figure 2 The group of sub-units in the middle.
[0129] The software processing unit includes CPU1 and CPU0, with CPU1 corresponding to... Figure 2 The first processing subunit in the process, CPU0 corresponds to Figure 2 The second processing subunit in the process.
[0130] Figure 5The system also includes a first device, which comprises multiple endpoints: a first output endpoint, a first input endpoint, and a first control endpoint. The USB controller also comprises multiple endpoints: a second input endpoint, a second transmission endpoint, and a second control endpoint.
[0131] The specific steps of the data transmission method based on USB network accelerator are as follows: 1: CPU0 sends an enumeration start command to the USB controller.
[0132] 2: The USB controller controls the second control endpoint to prepare to receive the enumeration setup data packet from the first device.
[0133] 3: The first device sends an enumeration establishment data packet to the USB controller through the control channel between the first control endpoint and the second control endpoint, and completes the communication negotiation process between the first device and the second device through the control channel based on the enumeration establishment data packet.
[0134] 4. After the enumeration task is completed, CPU0 sends an enumeration task completion notification to the hardware processing unit to inform the hardware processing unit that it can perform unpacking or repacking operations.
[0135] 5: After the enumeration task is completed, CPU0 sends an enumeration task completion notification to the network protocol stack to inform the network protocol stack that it can receive the first data packet sent by the first device.
[0136] 6: CPU1 sends a data receiving command to the USB controller, so that the USB controller controls the first output endpoint of the first device and the second input endpoint of the USB controller to enter the enabled state, so as to establish an uplink transmission channel between the first output endpoint and the second input endpoint.
[0137] 7: The first device sends the first data packet to the USB controller through the uplink transmission channel.
[0138] 8: The USB controller monitors whether the first data packet has arrived based on the second input endpoint.
[0139] 9: When the USB controller detects the arrival of the first data packet, it sends the first interrupt command to CPU1.
[0140] 10: After receiving the first interrupt command, CPU1 sends a first notification message that the data has arrived to the USB network unpacking module in the hardware processing unit.
[0141] 11: The USB network unpacking module receives the first data packet according to the first notification message, performs unpacking operation on the received first data packet to obtain the third data packet, and sends the third data packet to the network protocol stack.
[0142] 12: The second data packet sent by the network protocol stack to the USB network packet assembly module in the hardware processing unit.
[0143] 13: The USB network packet assembly module performs packet assembly operations on the second data packet to obtain the fourth data packet, and sends a second interrupt command to CPU1.
[0144] 14: CPU1 sends a data transmission command to the USB controller based on the second interrupt command; 15: The USB controller sends a command based on the data to control the first input endpoint of the first device and the second output endpoint of the second device to enter the open state, so as to establish a downlink transmission channel between the first input endpoint and the second output endpoint, so as to send the fourth data packet to the first device through the downlink transmission channel with the first device.
[0145] 16: Send the fourth data packet to the network protocol stack corresponding to the first device.
[0146] Figure 6 This is a block diagram illustrating a data transmission apparatus according to an exemplary embodiment. (Refer to...) Figure 6 The data transmission apparatus 600 of this disclosure includes: The sending module 601 is used by the first processing subunit in the software processing unit of the USB network accelerator to perform the data packet transmission task alone, so as to send a data transmission command to the USB controller in the USB network accelerator. The control transmission module 602 is used by the USB controller to control the hardware processing unit to perform packet assembly or depacketization operations on data packets that need to be transmitted between the network protocol stacks of the first device and the second device based on the data transmission command, and to transmit the data packets processed by the hardware processing unit between the first device and the second device.
[0147] In one embodiment of this disclosure, the control transmission module 602 is further configured to: control the unpacking subunit in the hardware processing unit to unpack the first data packet transmitted from the first device to the network protocol stack; and control the packet assembly subunit in the hardware processing unit to assemble the second data packet transmitted from the network protocol stack to the first device.
[0148] In one embodiment of this disclosure, the data transmission command includes a data receiving command, and the control transmission module 602 is further configured to: send the data receiving command to the USB controller; the USB controller, according to the data receiving command, receives the first data packet sent by the first device through the uplink transmission channel between the first device and the first device, and sends it to the hardware processing unit for unpacking operation through the first processing subunit.
[0149] In one embodiment of this disclosure, the data transmission command includes a data transmission command. The control transmission module 602 is further configured to: the hardware processing unit receive a second data packet sent by the network protocol stack, perform packet assembly operations on the second data packet to obtain the fourth data packet, and send a second interrupt command to the first processing subunit; the first processing subunit sends the data transmission command to the USB controller according to the second interrupt command; and the USB controller sends the fourth data packet to the first device through the downlink transmission channel with the first device according to the data transmission command.
[0150] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0151] The data transmission apparatus provided in the embodiments of this disclosure includes a USB network accelerator comprising a hardware processing unit, a software processing unit, and a USB controller. The hardware processing unit is configured to perform packet assembly or depacketization operations on data packets to be transmitted via USB between the network protocol stacks of a first device and a second device. The software processing unit is configured to execute data packet transmission control tasks to send data transmission commands to the USB controller. The USB controller is configured to transmit the data packets processed by the hardware processing unit between the first device and the second device based on the data transmission commands. Thus, by having the hardware processing unit perform packet assembly or depacketization operations independently, packet assembly and depacketization efficiency can be improved. By combining hardware and software, packet assembly and depacketization operations are separated from data packet transmission tasks, achieving functional decoupling of the USB network accelerator, improving its flexibility, and thereby accelerating the data processing process. The USB network accelerator, through a combination of hardware and software, accelerates USB network data processing, significantly improving USB data transmission efficiency while reducing resource consumption.
[0152] Figure 7 This is a block diagram illustrating an electronic device according to an exemplary embodiment.
[0153] like Figure 7 As shown, the above-mentioned electronic device 700 includes: The system includes a memory 701 and a processor 702, and a bus 703 connecting different components (including the memory 701 and the processor 702). The memory 701 stores a computer program, and when the processor 702 executes the program, it implements the data transmission method described in the embodiments of this disclosure.
[0154] Bus 703 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0155] Electronic device 700 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 700, including volatile and non-volatile media, removable and non-removable media.
[0156] Memory 701 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 704 and / or cache memory 705. Electronic device 700 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 706 can be used to read and write non-removable, non-volatile magnetic media (… Figure 7 Not shown; usually referred to as a "hard drive"). Although Figure 7 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 703 via one or more data media interfaces. Memory 701 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.
[0157] A program / utility 708 having a set (at least one) of program modules 707 may be stored, for example, in memory 701. Such program modules 707 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 707 typically perform the functions and / or methods described in the embodiments of this disclosure.
[0158] Electronic device 700 can also communicate with one or more external devices 709 (e.g., keyboard, pointing device, display 791, etc.), and with one or more devices that enable a user to interact with the electronic device 700, and / or with any device that enables the electronic device 700 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 792. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 793. Figure 7 As shown, network adapter 793 communicates with other modules of electronic device 700 via bus 703. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0159] The processor 702 executes various functional applications and data processing by running programs stored in the memory 701.
[0160] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the data transmission method of the present disclosure embodiment, and will not be repeated here.
[0161] To implement the above embodiments, this disclosure also proposes a computer-readable storage medium storing computer program instructions thereon, which, when executed by a processor, implement the steps of the data transmission method provided in this disclosure.
[0162] Alternatively, the computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0163] To implement the above embodiments, this disclosure also provides a computer program product, including a computer program that, when executed by a processor of an electronic device, implements the data transmission method as described above.
[0164] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0165] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A Universal Serial Bus (USB) network accelerator, comprising: The USB network accelerator is located in the second device and includes a hardware processing unit, a software processing unit, and a USB controller. The hardware processing unit is configured to perform packet assembly or depacketization operations on data packets transmitted via USB between the network protocol stacks of the first device and the second device. The software processing unit is configured to perform a data packet transmission control task to send a data transmission command to the USB controller. The USB controller is configured to transmit data packets processed by the hardware processing unit between the first device and the second device based on the data transmission command.
2. The network accelerator of claim 1, wherein, The software processing unit includes at least a first processing subunit and a second processing subunit. The first processing subunit is configured to perform the transmission control task; The second processing subunit is configured to execute enumeration tasks for the first device and the second device, wherein the enumeration tasks are used to complete the communication negotiation process between the first device and the second device.
3. The network accelerator of claim 1, wherein, The hardware processing unit is also configured to perform at least one of the following operations: The first data packet transmitted by the first device to the network protocol stack is unpacked. The second data packet transmitted from the network protocol stack to the first device is reassembled.
4. The network accelerator of claim 3, wherein, The hardware processing unit includes: a depacketizing subunit. The unpacking subunit is configured to receive the first data packet sent by the USB controller, unpack the first data packet to obtain a third data packet, and send the third data packet to the network protocol stack.
5. The network accelerator of claim 4, wherein, The unpacking subunit is further configured to parse the first data packet to obtain the first protocol header of the first data packet, determine the memory storage location of the data content of the first data packet based on the first protocol header, and access the memory storage location through a direct memory access (DMA) controller to obtain the data content as the third data packet.
6. The network accelerator of claim 3, wherein, The hardware processing unit includes: a packet assembly subunit. The packet assembly subunit is configured to receive the second data packet, perform packet assembly operations on the second data packet to obtain a fourth data packet, and send the fourth data packet to the device.
7. The network accelerator according to claim 6, characterized in that, The packet group subunit is configured to determine the second protocol header of the second data packet and the memory storage location corresponding to the second protocol header, and access the memory storage location through the DMA controller to write the second protocol header into the second data packet.
8. The network accelerator according to claim 2, characterized in that, The second processing subunit is also configured to send an enumeration start command to the USB controller to trigger a communication negotiation process between the first device and the USB controller; The USB controller is further configured to open a control channel with the first device according to the enumeration start command, receive the enumeration establishment data packet sent by the first device through the control channel, and complete the communication negotiation process between the first device and the second device through the control channel based on the enumeration establishment data packet.
9. The network accelerator of claim 2, wherein, The second processing subunit is further configured to send an enumeration task completion notification to the hardware processing unit, the network protocol stack, and the first processing subunit after the enumeration task is completed.
10. The network accelerator of claim 8, wherein, The USB controller is further configured to control the first control endpoint of the first device and the second control endpoint of the USB controller to enter an on state according to the enumerated start command, so as to establish the control channel between the first control endpoint and the second control endpoint.
11. The network accelerator according to any one of claims 1-7, wherein, The data transmission command includes a data receiving command. The first processing subunit is also configured to send the data receiving command to the USB controller; The USB controller is further configured to receive a first data packet sent by the first device through an uplink transmission channel with the first device according to the data receiving command, and send it to the hardware processing unit for unpacking operation through the first processing subunit.
12. The network accelerator of claim 11, wherein, The USB controller is further configured to control the first output endpoint of the first device and the second input endpoint of the USB controller to enter an enabled state according to the data receiving command, so as to establish the uplink transmission channel between the first output endpoint and the second input endpoint.
13. The network accelerator of claim 11, wherein, The USB controller is also configured to send a first interrupt command to the first processing subunit when the arrival of the first data packet is detected. The first processing subunit is also configured to send a first notification message that data has arrived to the hardware processing unit according to the first interrupt command; The hardware processing unit is further configured to receive the first data packet according to the first notification message, unpack the received first data packet to obtain a third data packet, and send the third data packet to the network protocol stack.
14. The network accelerator according to any one of claims 1-7, wherein, The data transmission command includes a data sending command. The hardware processing unit is also configured to receive the second data packet sent by the network protocol stack, perform packet assembly operation on the second data packet to obtain the fourth data packet, and send a second interrupt command to the first processing subunit. The first processing subunit is further configured to send the data transmission command to the USB controller according to the second interrupt command; The USB controller is also configured to send a command based on the data to send the fourth data packet to the first device via a downlink transmission channel with the first device.
15. The network accelerator of claim 14, wherein, The USB controller is also configured to send commands based on the data to control the first input endpoint of the first device and the second output endpoint of the second device to enter an enabled state, so as to establish the downlink transmission channel between the first input endpoint and the second output endpoint.
16. A data transmission method, characterized by, The method, applicable to any one of claims 1-15, comprises: The first processing subunit in the software processing unit of the USB network accelerator performs the data packet transmission task independently to send a data transmission command to the USB controller in the USB network accelerator. Based on the data transmission command, the USB controller controls the hardware processing unit to perform packet assembly or depacketization operations on data packets that need to be transmitted between the network protocol stacks of the first device and the second device, and transmits the data packets processed by the hardware processing unit between the first device and the second device.
17. The method of claim 16, wherein, The control hardware processing unit performs packet assembly or depacketization operations on data packets that need to be transmitted via USB between the network protocol stacks of the first and second devices, including: The unpacking subunit in the hardware processing unit is controlled to unpack the first data packet transmitted by the first device to the network protocol stack. The packet assembly subunit in the hardware processing unit is controlled to perform packet assembly operations on the second data packets transmitted by the network protocol stack to the first device.
18. The method of claim 17, wherein, The data transmission command includes a data receiving command, and the method further includes: The first processing subunit sends the data receiving command to the USB controller; The USB controller receives the first data packet sent by the first device through the uplink transmission channel with the first device according to the data receiving command, and sends it to the hardware processing unit for unpacking operation through the first processing subunit.
19. The method of claim 18, wherein, The data transmission command includes a data sending command, and the method further includes: The hardware processing unit receives the second data packet sent by the network protocol stack, performs packet assembly operation on the second data packet to obtain the fourth data packet, and sends a second interrupt command to the first processing subunit. The first processing subunit sends the data transmission command to the USB controller according to the second interrupt command; The USB controller sends a command based on the data, and sends the fourth data packet to the first device through the downlink transmission channel between the controller and the first device.
20. A data transmission apparatus, characterized by comprising: The device, suitable for a USB network accelerator as described in any one of claims 1-15, comprises: The sending module is used by the first processing subunit in the software processing unit of the USB network accelerator to perform the data packet transmission task alone, so as to send the data transmission command to the USB controller in the USB network accelerator. The control transmission module is used by the USB controller to control the hardware processing unit to perform packet assembly or depacketization operations on data packets that need to be transmitted between the network protocol stacks of the first device and the second device based on the data transmission command, and to transmit the data packets processed by the hardware processing unit between the first device and the second device.
21. The apparatus of claim 20, wherein, The control transmission module is also used for: The unpacking subunit in the hardware processing unit is controlled to unpack the first data packet transmitted by the first device to the network protocol stack. The packet assembly subunit in the hardware processing unit is controlled to perform packet assembly operations on the second data packets transmitted by the network protocol stack to the first device.
22. An electronic device, comprising: include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The steps of implementing the method according to any one of claims 16-19.
23. A computer-readable storage medium having stored thereon computer program instructions, wherein, The program instructions, when executed by the processor, implement the steps of the method of any one of claims 16-19.