Data packet transmission method and apparatus, and terminal device
By introducing hardware accelerators into smartphones to process network data packets, the impact of USB interruptions on the main controller is reduced, the problems of performance degradation and battery life shortening in large-bandwidth network communications are solved, and the communication performance and user experience of terminal devices are improved.
Patent Information
- Application Number
- CN202410740899.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-07
AI Technical Summary
A large number of USB interrupts have a negative impact on the performance and power consumption of the smartphone's main controller, especially in large-bandwidth network communications, resulting in a decrease in communication rate and shortened battery life.
By introducing a hardware accelerator into the terminal device to process network data packets, the triggering frequency of USB receiving and sending interrupts is reduced, and the main controller context switch is avoided. The hardware accelerator is used to parse and encapsulate the network data packets, and is processed through the wireless communication module. transmission.
It eliminates the impact of a large number of USB reception interruptions on the performance and power consumption of the main controller, improves the user experience of using terminal devices, and improves communication performance and battery life.
Smart Images

Figure CN118574109A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data packet transmission method and device, and terminal equipment. Background Art
[0002] Currently, smartphones have the function of providing Internet access to PCs (Personal Computers) through USB lines. The connection and communication methods between devices are as follows: Figure 1 As shown. Smartphones connect to operator base stations through wireless communication technologies (such as 5G, 4G, etc.) to access the Internet. At the same time, smartphones can share the ability to access the Internet with PCs and other devices that do not have the ability to access the Internet through USB lines, thereby enabling PCs and other devices to access the Internet. Among them, smartphones serve as a bridge to build the interaction between PCs and operator base stations. Smartphones obtain network data packets from operator base stations through wireless communication technology, and then pass them to PCs through USB lines. Similarly, smartphones obtain network data packets from PCs through USB lines, and then pass them to operator base stations through wireless communication technology. The process of uplink and downlink of network data packets involves data format conversion and changes in physical communication methods.
[0003] like Figure 2 As shown, the network data packet communication link is usually composed of a wireless communication module, a main controller (such as a CPU) and a USB controller inside the chip 10. Among them, the main controller serves as an intermediate bridge between the wireless communication module and the USB controller, and is responsible for the parsing, repackaging and circulation of network data packets. When the smart phone enables the USB function, it will register the USB receive interrupt in the kernel and wait for the USB receive interrupt to be triggered, as well as register the USB send interrupt and wait for data to be sent (send idle). The smart phone will generate USB receive interrupts and USB send interrupts during the interaction with the PC. Specifically, the USB receive interrupt is generated when the PC sends data to the Internet, and the USB send interrupt is generated when the PC receives Internet data. Each interrupt will cause the kernel to trigger a context switch, stop the task originally being executed and switch to the USB receive interrupt or USB send interrupt to execute the task, resulting in CPU resource consumption. In the process of network communication with a small bandwidth, the interrupt triggering frequency is not high, the number of interrupts is small, and its impact on CPU performance is small. However, with the rapid growth of communication bandwidth, large-bandwidth network communications lead to frequent USB interruptions. A large number of USB interruptions will seriously affect CPU performance, thereby affecting communication performance, making its communication rate far below the peak value. At the same time, it will cause CPU power consumption to increase, causing smartphones to heat up severely and reduce battery life, affecting user experience. Summary of the invention
[0004] The technical problem to be solved by the present invention is to overcome the defect in the prior art that a large number of USB interrupts affect the performance and power consumption of the main controller, and to provide a data packet transmission method and device, and a terminal device.
[0005] The present invention solves the above technical problems through the following technical solutions:
[0006] A first aspect of the present invention provides a data packet transmission method, which is applied to a main controller in a terminal device, wherein the terminal device further includes a hardware accelerator, a USB controller and a wireless communication module, and the data packet transmission method includes the following steps:
[0007] In response to connecting to an external device through a USB interface, a first startup instruction is sent to the hardware accelerator; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the USB controller, and transmit the encapsulated network data packets through the wireless communication module.
[0008] Optionally, the hardware accelerator includes a register module, a storage module and a state machine, and before sending the first startup instruction to the hardware accelerator, the following steps are further included:
[0009] Configuring the register module according to the USB controller;
[0010] An instruction set set according to the USB controller is loaded into the storage module; wherein the state machine is used to execute instructions in the instruction set.
[0011] Optionally, the data packet transmission method includes the following steps: in response to connecting to an external device via a USB interface, sending a second startup instruction to the USB controller; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device.
[0012] Optionally, before the USB controller sends the second startup instruction, the following steps are also included:
[0013] Initializing the USB controller;
[0014] A port in the USB controller for communicating with the hardware accelerator is configured.
[0015] Optionally, the data packet transmission method further includes the following steps: in response to the disconnection between the external device and the hardware accelerator, sending a first stop instruction to the hardware accelerator; wherein the first stop instruction is used to instruct the hardware accelerator to stop running.
[0016] Optionally, the data packet transmission method further includes the following steps: in response to the disconnection of the connection with the external device, sending a first cleanup instruction to the hardware accelerator; wherein the first cleanup instruction is used to instruct to clean up the data in the register module and the memory.
[0017] Optionally, the data packet transmission method further comprises the following steps: in response to the disconnection between the external device and the USB controller, sending a second stop instruction to the USB controller; wherein the second stop instruction is used to instruct the USB controller to stop running.
[0018] Optionally, the data packet transmission method further includes the following steps: in response to the disconnection between the external device and the USB controller, sending a second cleanup instruction to the USB controller; wherein the second cleanup instruction is used to instruct the cleanup of resources in the USB controller.
[0019] A second aspect of the present invention provides a data packet transmission method, which is applied to a hardware accelerator in a terminal device, wherein the terminal device further includes a main controller, a USB controller, and a wireless communication module, and the data packet transmission method includes the following steps:
[0020] In response to a first start instruction sent by the main controller, detecting whether the USB controller receives a network data packet;
[0021] In response to detecting that the USB controller receives a network data packet, reading the network data packet from the USB controller;
[0022] Parsing and encapsulating the network data packet;
[0023] The encapsulated network data packets are transmitted through the wireless communication module.
[0024] Optionally, the detecting whether the USB controller receives a network data packet specifically includes:
[0025] If the data read from the target register of the USB controller is consistent with the locally pre-stored data, it is detected that the USB controller has received the network data packet; otherwise, it is detected that the USB controller has not received the network data packet.
[0026] A third aspect of the present invention provides a data packet transmission method, which is applied to a terminal device, wherein the terminal device includes a hardware accelerator, a main controller, a USB controller, and a wireless communication module; the data packet transmission method includes the following steps:
[0027] The main controller sends a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface;
[0028] The hardware accelerator responds to the first startup instruction to detect whether the USB controller has received a network data packet, and when detecting that the USB controller has received a network data packet, reads the network data packet from the USB controller, parses and encapsulates the network data packet, and transmits the encapsulated network data packet through the wireless communication module.
[0029] A fourth aspect of the present invention provides a data packet transmission device, which is applied to a main controller in a terminal device, wherein the terminal device further includes a hardware accelerator, a USB controller and a wireless communication module, and the data packet transmission device includes:
[0030] A first startup module is used to send a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the USB controller, and to transmit the encapsulated network data packets through the wireless communication module.
[0031] Optionally, the hardware accelerator includes a register module, a storage module and a state machine, and the data packet transmission device also includes a first configuration module, which is used to configure the register module according to the USB controller before sending a first startup instruction to the hardware accelerator, and load the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute instructions in the instruction set.
[0032] Optionally, the data packet transmission device also includes a second startup module, which is used to send a second startup instruction to the USB controller in response to being connected to an external device through a USB interface; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device.
[0033] Optionally, the data packet transmission device further includes a second configuration module, which is used to initialize the USB controller and configure a port in the USB controller for communicating with the hardware accelerator before the USB controller sends a second startup instruction.
[0034] Optionally, the data packet transmission apparatus further comprises a first stop module, configured to send a first stop instruction to the hardware accelerator in response to disconnection with the external device; wherein the first stop instruction is used to instruct the hardware accelerator to stop running.
[0035] Optionally, the data packet transmission device also includes a first cleaning module, which is used to send a first cleaning instruction to the hardware accelerator in response to the disconnection between the external device; wherein the first cleaning instruction is used to instruct the cleaning of the data in the register module and the memory.
[0036] Optionally, the data packet transmission device further comprises a second stop module, which is used to send a second stop instruction to the USB controller in response to the disconnection between the external device and the USB controller; wherein the second stop instruction is used to instruct the USB controller to stop running.
[0037] Optionally, the data packet transmission device also includes a second cleaning module, which sends a second cleaning instruction to the USB controller in response to the disconnection between the external device; wherein the second cleaning instruction is used to instruct the cleaning of resources in the USB controller.
[0038] A fifth aspect of the present invention provides a data packet transmission device, which is applied to a hardware accelerator in a terminal device, wherein the terminal device further includes a main controller, a USB controller and a wireless communication module, and the data packet transmission device includes:
[0039] a detection module, configured to detect whether the USB controller receives a network data packet in response to a first startup instruction sent by the main controller;
[0040] a reading module, configured to read the network data packet from the USB controller in response to detecting that the USB controller receives the network data packet;
[0041] A processing module, used for parsing and encapsulating the network data packets;
[0042] The transmission module is used to transmit the encapsulated network data packets through the wireless communication module.
[0043] Optionally, the detection module is specifically used to detect that the USB controller has received a network data packet when data read from a target register of the USB controller is consistent with locally pre-stored data; otherwise, detect that the USB controller has not received a network data packet.
[0044] A sixth aspect of the present invention provides a data packet transmission device, including a hardware accelerator, a main controller, a USB controller and a wireless communication module:
[0045] The main controller is used for sending a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface;
[0046] The hardware accelerator is used to respond to the first startup instruction, detect whether the USB controller has received a network data packet, and when detecting that the USB controller has received a network data packet, read the network data packet from the USB controller, parse and encapsulate the network data packet, and transmit the encapsulated network data packet through the wireless communication module.
[0047] Optionally, the hardware accelerator includes a register module, a storage module and a state machine, and the main controller is further used to configure the register module according to the USB controller before sending a first startup instruction to the hardware accelerator, and load the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute instructions in the instruction set.
[0048] Optionally, the main controller is further configured to send a second startup instruction to the USB controller in response to being connected to an external device via a USB interface; wherein the second startup instruction is configured to instruct the USB controller to allow itself to be recognized by the external device.
[0049] Optionally, the main controller is further used to initialize the USB controller and configure a port in the USB controller for communicating with the hardware accelerator before the USB controller sends the second startup instruction.
[0050] Optionally, the main controller is further configured to send a first stop instruction to the hardware accelerator in response to disconnection with the external device; wherein the first stop instruction is used to instruct the hardware accelerator to stop running.
[0051] Optionally, the main controller is further configured to send a first cleanup instruction to the hardware accelerator in response to a disconnection with the external device; wherein the first cleanup instruction is configured to instruct cleaning of data in the register module and the memory.
[0052] Optionally, the main controller is further configured to send a second stop instruction to the USB controller in response to disconnection with the external device; wherein the second stop instruction is used to instruct the USB controller to stop running.
[0053] Optionally, the main controller is further configured to send a second cleanup instruction to the USB controller in response to a disconnection with the external device; wherein the second cleanup instruction is configured to instruct cleanup of resources in the USB controller.
[0054] Optionally, the hardware accelerator is specifically used to detect that the USB controller has received a network data packet when data read from a target register of the USB controller is consistent with locally pre-stored data; otherwise, detect that the USB controller has not received a network data packet.
[0055] The seventh aspect of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data packet transmission method as described in the first aspect or the second aspect is implemented.
[0056] An eighth aspect of the present invention provides a chip, applied to a terminal device, and the chip is used to execute the data packet transmission method as described in the first aspect or the second aspect.
[0057] A ninth aspect of the present invention provides a chip module, applied to a terminal device, comprising a chip, wherein the chip is used to execute the data packet transmission method as described in the first aspect or the second aspect.
[0058] A tenth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the data packet transmission method described in the first aspect or the second aspect.
[0059] An eleventh aspect of the present invention provides a computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the data packet transmission method according to the first aspect or the second aspect.
[0060] Based on the common sense in the art, the above optional conditions can be combined arbitrarily to obtain the preferred embodiments of the present invention.
[0061] The positive and progressive effect of the present invention is that: the network data packets sent by the external device are received by the USB controller, and the network data packets are processed by the hardware accelerator. The communication link will no longer trigger the USB receive interrupt, so it will not cause the main controller to perform context switching, and the impact of a large number of USB receive interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 The figure is a schematic diagram of the connection and communication method between a smart phone and a PC in the prior art.
[0063] Figure 2 It is a schematic diagram of the connection between a chip and an external device in the prior art.
[0064] Figure 3A schematic diagram of a connection between a terminal device and an external device provided in an embodiment of the present invention.
[0065] Figure 4 A schematic diagram of the structure of a hardware accelerator provided in Example 1 of the present invention.
[0066] Figure 5 A flow chart of a method after a terminal device provided in Embodiment 1 of the present invention is connected to an external device.
[0067] Figure 6 A flow chart of a method after a terminal device provided in Embodiment 1 of the present invention is disconnected from an external device.
[0068] Figure 7 A flowchart of a data packet transmission method provided in Example 2 of the present invention.
[0069] Figure 8 A flowchart of a data packet transmission method provided in Example 3 of the present invention.
[0070] Fig. 9 A schematic diagram of the structure of a terminal device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0071] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0072] The terminal device in the embodiment of the present invention may refer to various forms of user equipment (UE), access terminal, user unit, user station, mobile station, mobile station (MS), mobile terminal (MT), remote station, remote terminal, mobile device, user terminal, wireless communication equipment, user agent or user device. The terminal device may also be a cellular phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), a handheld device with wireless communication function, a computer with wireless transceiver function, a Virtual Reality (VR) terminal device, an Augmented Reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a computing device or other processing device connected to a wireless modem, a vehicle-mounted device, a wearable device, a terminal device in a 5G network, or a terminal device in a future evolved Public Land Mobile Network (PLMN), etc. The embodiment of the present invention does not limit this.
[0073] The data packet transmission method provided by the embodiment of the present invention can realize the USB function, which can also be called USB shared connection, allowing the user to share the network of the terminal device with external devices through the USB data cable. The external device can be a PC, a laptop, etc. It should be noted that when the USB function is realized by the data packet transmission method provided by the embodiment of the present invention, it is not necessary to register the USB receive interrupt and the USB send interrupt in the kernel.
[0074] The data packet transmission method provided in an embodiment of the present invention can be executed by a data packet transmission device, which can be implemented by software and / or hardware. The data packet transmission device may include part or all of a terminal device, which may specifically be a separate chip, chip module or terminal device, or a chip or chip module integrated in the terminal device.
[0075] Regarding the various modules / units included in the data packet transmission device described in the embodiments of the present invention, they may be software modules / units, or hardware modules / units, or they may be partially software modules / units and partially hardware modules / units. For example, for various devices and products applied to or integrated in a chip, the various modules / units included therein may all be implemented in the form of hardware such as circuits, or at least some of the modules / units may be implemented in the form of software programs, which run on a processor integrated inside the chip, and the remaining modules / units may be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in a chip module, the various modules / units included therein may all be implemented in the form of hardware such as circuits, and different modules / units may be located in the same component of the chip module (such as a chip, circuit module, etc.) or in different components, or at least some of the modules / units may be implemented in the form of hardware such as circuits. It can be implemented in the form of a software program, which runs on a processor integrated inside the chip module, and the remaining modules / units can be implemented in the form of hardware such as circuits; for various devices and products applied to or integrated in terminal equipment, the various modules / units contained therein can be implemented in the form of hardware such as circuits, and different modules / units can be located in the same component (for example, chip, circuit module, etc.) or different components in the terminal equipment, or, at least some modules / units can be implemented in the form of a software program, which runs on a processor integrated inside the terminal equipment, and the remaining modules / units can be implemented in the form of hardware such as circuits.
[0076] Example 1
[0077] The data packet transmission method provided in this embodiment can be executed by a data packet transmission device, which can be implemented by software and / or hardware, and can include part or all of the main controller in the terminal device. Figure 3 As shown, the terminal device 20 includes a main controller, a hardware accelerator, a USB controller and a wireless communication module, wherein the main controller is respectively connected to the hardware accelerator, the USB controller and the wireless communication module for communication, and the hardware accelerator is respectively connected to the USB controller and the wireless communication module for communication.
[0078] The following describes the data packet transmission method provided by this embodiment with the main controller in the terminal device as the execution subject. The data packet transmission method provided by this embodiment may include the following steps S11:
[0079] Step S11, in response to connecting to an external device through a USB interface, sending a first startup instruction to the hardware accelerator; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the USB controller, and transmit the encapsulated network data packets through the wireless communication module.
[0080] Specifically, the USB controller in the terminal device can establish a connection with an external device through a USB interface. In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the base station through the wireless communication module. The above-mentioned parsing operation can be specifically RNDIS (Remote Network Driver Interface Specification) protocol parsing, removing the part about the RNDIS protocol in the network data packet, and the above-mentioned encapsulation operation can be specifically encapsulating the parsed network data packet according to the wireless communication protocol (i.e., the protocol corresponding to the wireless communication module).
[0081] In this embodiment, the network data packets sent by the external device are received by the USB controller, and the uplink network data packets are processed by the hardware accelerator. The communication link will no longer trigger the USB receive interrupt, and thus will not cause the main controller to perform context switching. The impact of a large number of USB receive interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0082] In an optional implementation, the first startup instruction is further used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the wireless communication module, and to transmit the encapsulated network data packets through the USB controller.
[0083] In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the external device through the USB controller. The above-mentioned parsing operation can specifically be wireless communication protocol (i.e., the protocol corresponding to the wireless communication module) parsing, removing the part of the network data packet related to the wireless communication protocol, and the above-mentioned encapsulation operation can specifically be encapsulating the parsed network data packet according to the RNDIS protocol.
[0084] In this implementation, the network data packets sent by the base station are received by the wireless communication module, and the hardware accelerator processes the downlink network data packets. The communication link will no longer trigger the USB send interrupt, and therefore will not cause the main controller to perform context switching. The impact of a large number of USB send interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0085] In an optional embodiment, Figure 4 As shown, the hardware accelerator includes a register module, a storage module and a state machine. In this embodiment, before sending the first startup instruction to the hardware accelerator in step S11, the following steps S101 to S102 are also included:
[0086] Step S101: configuring the register module according to the USB controller.
[0087] In the specific implementation of step S101, the address of the register in the USB controller requiring the hardware accelerator operation may be written into the register module, and the address of the data requiring the hardware accelerator operation may also be written into the register module.
[0088] Step S102: Loading the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute the instructions in the instruction set.
[0089] Among them, the register module includes multiple registers, each register is used to store data information, specifically, it can store initialization configuration data information such as the address of the register in the USB controller, and can also store temporary data information obtained by the state machine according to instructions such as the return value of the register in the USB controller.
[0090] The storage module is a memory area that supports both reading and writing, and may specifically be a RAM (random access memory), a Cache (cache memory), a Flash memory, and the like.
[0091] In a specific implementation, different instruction sets are set according to different USB controllers, wherein the number of instructions in the instruction set, the execution order of instructions, the execution content of instructions, the length of instructions, etc. can be flexibly set. The execution content of instructions generally includes operations such as reading, writing, data saving, and data comparison. In a specific example, the length of each register is 64 bits, and the length of each instruction is fixed to 8 bytes.
[0092] Taking the USB controller as a DWC3 controller (a USB 3.x controller) as an example, an instruction set including the following instructions is set:
[0093] Write the value of Reg1 to DEPCMDPAR0(1);
[0094] Write the value of Reg2 to DEPCMDPAR1(1);
[0095] Write Reg3 to DEPCMDPAR2(1);
[0096] Write the value of Reg4 to DEPCMD(1);
[0097] Read the value of DEPCMD(1) and write it to Reg0;
[0098] Determine whether the data in Reg0 is equal to the data pre-stored in Reg5. If not, continue to read the value of DEPCMD(1); if so, read the value of GEVNTCOUNT(1) and put it into Reg0.
[0099] Among them, Reg0, Reg1, Reg 2, Reg 3, Reg4, and Reg5 are all registers in the register module of the hardware accelerator, and DEPCMDPAR0, DEPCMDPAR1, DEPCMDPAR2, DEPCMD, and GEVNTCOUNT are all registers in the DWC3 controller. In this example, the state machine reads the instructions in the instruction set in sequence to perform the corresponding tasks. After reading the last instruction, if the returned result is yes, it means that the DWC3 controller has received a network data packet. The subsequent state machine can parse, encapsulate, and transmit the value of GEVNTCOUNT(1), that is, the network data packet.
[0100] In an optional implementation, the data packet transmission method further includes step S12: in response to being connected to an external device via a USB interface, sending a second startup instruction to the USB controller; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device. In this implementation, the USB controller allows being recognized by the external device means allowing the external device to enumerate the terminal device where the USB controller is located, that is, starting the USB controller, at which time the external device can send a network data packet to the USB controller, the external device is equivalent to a USB host, and the terminal device where the USB controller is located is equivalent to a USB slave.
[0101] It should be noted that the execution order of the above steps S12 and S11 is not limited. The above steps S12 and S11 can be executed simultaneously, or the above step S11 can be executed first and then the above step S12, or the above step S12 can be executed first and then the above step S11.
[0102] In an optional implementation manner, before the USB controller sends the second startup instruction in the above step S12, the following steps S201-S202 are also included:
[0103] Step S201: Initialize the USB controller. Specifically, data requiring memory resources such as global registers, ports and events in the USB controller may be initialized.
[0104] Step S202: configuring a port in the USB controller for communicating with the hardware accelerator. After the port is configured, the hardware accelerator communicates data with the USB controller through the port.
[0105] In an optional implementation, in order to reduce the power consumption of the hardware accelerator, the data packet transmission method further includes step S13: in response to the disconnection of the connection with the external device, sending a first stop instruction to the hardware accelerator; wherein the first stop instruction is used to instruct the hardware accelerator to stop running. In this implementation, the operation of the hardware accelerator is stopped after the USB connection between the terminal device and the external device is disconnected, specifically, the operation of the state machine is stopped, and the state machine is restored to an initial state.
[0106] In an optional implementation, the data packet transmission method further includes step S14: in response to the disconnection of the connection with the external device, sending a first cleanup instruction to the hardware accelerator; wherein the first cleanup instruction is used to instruct to clean up the data in the register module and the memory. In this implementation, after the USB connection between the terminal device and the external device is disconnected, the data in the hardware accelerator is cleaned up, including the data stored in the register module and the memory.
[0107] In an optional implementation, in order to reduce the power consumption of the USB controller, the above-mentioned data packet transmission method further includes step S15: in response to the disconnection between the terminal device and the external device, a second stop instruction is sent to the USB controller; wherein the second stop instruction is used to instruct the USB controller to stop running. In a specific implementation, it is also necessary to clear the resources that affect the stopping of the USB controller in advance. Taking the DWC3 controller as an example, the value of GEVNTCOUNT(1) is set to 0, and all ports are prohibited from data transmission. In this implementation, the operation of the USB controller is stopped after the USB connection between the terminal device and the external device is disconnected.
[0108] In an optional implementation, the data packet transmission method further includes step S16: in response to the disconnection of the connection with the external device, sending a second cleanup instruction to the USB controller; wherein the second cleanup instruction is used to instruct to clean up the resources in the USB controller. In this implementation, cleaning up the resources in the USB controller after the USB connection between the terminal device and the external device is disconnected may specifically include releasing resources occupying memory such as events, cleaning up data in registers, etc.
[0109] It should be noted that, after the USB connection between the terminal device and the external device is disconnected, if the data in the hardware accelerator is not cleaned up, the above steps S101 and S102 only need to be performed once, and there is no need to repeat the execution. After the USB connection between the terminal device and the external device is disconnected, if the resources in the USB controller are not cleaned up, the above steps S201 and S202 only need to be performed once, and there is no need to repeat the execution.
[0110] Figure 5 A flow chart showing a method after a terminal device is connected to an external device. Figure 5 As shown, in response to the terminal device being connected to the external device via the USB interface, the register module in the hardware accelerator is configured and the set instruction set is loaded into the storage module in the hardware accelerator, and the hardware accelerator is started by sending a first startup instruction. In response to the terminal device being connected to the external device via the USB interface, the USB controller is initialized and the port is configured, and the USB controller is started by sending a second startup instruction.
[0111] Figure 6 A flow chart showing a method after a terminal device is disconnected from an external device. Figure 6 As shown, in response to the terminal device being disconnected from the external device, a first stop instruction and a first cleanup instruction are sent to the hardware accelerator to stop the operation of the hardware accelerator and clean up the data in the hardware accelerator. In response to the terminal device being disconnected from the external device, a second stop instruction and a second cleanup instruction are sent to the USB controller to stop the operation of the USB controller and clean up the resources in the USB controller.
[0112] This embodiment also provides a data packet transmission device, which is applied to a main controller in a terminal device, and the terminal device also includes a hardware accelerator, a USB controller and a wireless communication module. The data packet transmission device includes a first startup module, which is used to send a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packet received by the USB controller, and to transmit the encapsulated network data packet through the wireless communication module.
[0113] In an optional implementation, the hardware accelerator includes a register module, a storage module and a state machine, and the data packet transmission device also includes a first configuration module, which is used to configure the register module according to the USB controller before sending a first startup instruction to the hardware accelerator, and load the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute instructions in the instruction set.
[0114] In an optional embodiment, the data packet transmission device also includes a second startup module, which is used to send a second startup instruction to the USB controller in response to being connected to an external device through a USB interface; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device.
[0115] In an optional implementation, the data packet transmission device further includes a second configuration module, configured to initialize the USB controller and configure a port in the USB controller for communicating with the hardware accelerator before the USB controller sends a second startup instruction.
[0116] In an optional embodiment, the data packet transmission device also includes a first stop module, which is used to send a first stop instruction to the hardware accelerator in response to the disconnection between the external device; wherein the first stop instruction is used to instruct the hardware accelerator to stop running.
[0117] In an optional embodiment, the data packet transmission device also includes a first cleaning module, which is used to send a first cleaning instruction to the hardware accelerator in response to the disconnection of the connection between the external device; wherein the first cleaning instruction is used to instruct the cleaning of the data in the register module and the memory.
[0118] In an optional embodiment, the data packet transmission device also includes a second stop module, which is used to send a second stop instruction to the USB controller in response to the disconnection between the external device; wherein the second stop instruction is used to instruct the USB controller to stop running.
[0119] In an optional embodiment, the data packet transmission device also includes a second cleaning module, which sends a second cleaning instruction to the USB controller in response to the disconnection between the external device; wherein the second cleaning instruction is used to instruct the cleaning of resources in the USB controller.
[0120] Example 2
[0121] Figure 7 The flowchart of the data packet transmission method provided in this embodiment. The data packet transmission method provided in this embodiment can be executed by a data packet transmission device, which can be implemented in software and / or hardware, and can include part or all of the hardware accelerator in the terminal device. Figure 3 As shown, the terminal device 20 includes a main controller, a hardware accelerator, a USB controller and a wireless communication module, wherein the main controller is respectively connected to the hardware accelerator, the USB controller and the wireless communication module, and the hardware accelerator is respectively connected to the USB controller and the wireless communication module. It should be noted that the main controller is used to execute the data packet transmission method in Example 1.
[0122] The following describes the data packet transmission method provided by this embodiment using the hardware accelerator in the terminal device as the execution subject. Figure 7As shown, the data packet transmission method provided in this embodiment may include the following steps S21 to S24:
[0123] Step S21, in response to a first start-up instruction sent by the main controller, detecting whether the USB controller has received a network data packet. The main controller sends the first start-up instruction to the hardware accelerator in response to being connected to an external device through a USB interface.
[0124] Step S22: In response to detecting that the USB controller receives a network data packet, read the network data packet from the USB controller.
[0125] Step S23, parsing and encapsulating the network data packet. The parsing operation may specifically be RNDIS protocol parsing, removing the RNDIS protocol portion of the network data packet. The encapsulation operation may specifically be encapsulating the parsed network data packet according to the wireless communication protocol (i.e., the protocol corresponding to the wireless communication module).
[0126] Step S24: Transmit the encapsulated network data packet through the wireless communication module. In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the base station through the wireless communication module.
[0127] In this embodiment, the network data packets sent by the external device are received through the USB controller. After the main controller starts the hardware accelerator, the hardware accelerator processes the network data packets. The communication link will no longer trigger the USB receive interrupt, and thus will not cause the main controller to perform context switching. The impact of a large number of USB receive interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0128] In an optional embodiment, in response to the first startup instruction sent by the main controller, the hardware accelerator parses and encapsulates the network data packet received by the wireless communication module, and transmits the encapsulated network data packet through the USB controller. In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the external device through the USB controller. The above-mentioned parsing operation can specifically be wireless communication protocol (i.e., the protocol corresponding to the wireless communication module) parsing, removing the part of the network data packet related to the wireless communication protocol, and the above-mentioned encapsulation operation can specifically be encapsulating the parsed network data packet according to the RNDIS protocol.
[0129] In this embodiment, the network data packet sent by the base station is received through the wireless communication module. After the main controller starts the hardware accelerator, the hardware accelerator processes the downlink network data packet. The communication link will no longer trigger the USB send interrupt, and therefore will not cause the main controller to perform context switching. The impact of a large number of USB send interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0130] In an optional implementation, the above step S21 specifically includes: if the data read from the target register of the USB controller is consistent with the locally pre-stored data, detecting that the USB controller has received the network data packet; otherwise, detecting that the USB controller has not received the network data packet.
[0131] In a specific implementation, the hardware accelerator may include a register module, a storage module and a state machine. Before the main controller sends the first startup instruction to the hardware accelerator, it may configure the register module according to the USB controller and load the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute the instructions in the instruction set.
[0132] The main controller can write the address of the register in the USB controller that needs the hardware accelerator to operate into the register module, and can also write the data address that needs the hardware accelerator to operate into the register module. The register module includes a plurality of registers, each of which is used to store data information, and can specifically store data information for initialization configuration, such as the address of the register in the USB controller, and can also store temporary data information obtained by the state machine according to the instruction, such as the return value of the register in the USB controller. The storage module is a memory area that supports read and write, and can specifically be a RAM (random access memory), a Cache (high-speed cache memory), a Flash memory, etc.
[0133] In a specific implementation, different instruction sets can be set according to different USB controllers, wherein the number of instructions in the instruction set, the execution order of instructions, the execution content of instructions, the length of instructions, etc. can be flexibly set. The execution content of instructions generally includes operations such as reading, writing, data saving, and data comparison. In a specific example, the length of each register is 64 bits, and the length of each instruction is fixed to 8 bytes.
[0134] Taking the USB controller as a DWC3 controller (a USB 3.x controller) as an example, an instruction set including the following instructions is set:
[0135] Write the value of Reg1 to DEPCMDPAR0(1);
[0136] Write the value of Reg2 to DEPCMDPAR1(1);
[0137] Write Reg3 to DEPCMDPAR2(1);
[0138] Write the value of Reg4 to DEPCMD(1);
[0139] Read the value of DEPCMD(1) and write it to Reg0;
[0140] Determine whether the data in Reg0 is equal to the data pre-stored in Reg5. If not, continue to read the value of DEPCMD(1); if so, read the value of GEVNTCOUNT(1) and put it into Reg0.
[0141] Among them, Reg0, Reg1, Reg 2, Reg 3, Reg4, and Reg5 are all registers in the register module of the hardware accelerator, and DEPCMDPAR0, DEPCMDPAR1, DEPCMDPAR2, DEPCMD, and GEVNTCOUNT are all registers in the DWC3 controller. In this example, the state machine reads the instructions in the instruction set in sequence to perform the corresponding tasks. After reading the last instruction, if the returned result is yes, it means that the DWC3 controller has received a network data packet. The subsequent state machine can parse, encapsulate, and transmit the value of GEVNTCOUNT(1), that is, the network data packet.
[0142] This embodiment also provides a data packet transmission device, which is applied to a hardware accelerator in a terminal device, and the data packet transmission device includes a detection module, a reading module, a processing module and a transmission module. The detection module is used to detect whether the USB controller receives a network data packet in response to a first startup instruction sent by the main controller. The reading module is used to read the network data packet from the USB controller in response to detecting that the USB controller receives a network data packet. The processing module is used to parse and encapsulate the network data packet. The transmission module is used to transmit the encapsulated network data packet through the wireless communication module.
[0143] In an optional implementation, the detection module is specifically used to detect that the USB controller has received a network data packet when data read from a target register of the USB controller is consistent with locally pre-stored data; otherwise, detect that the USB controller has not received a network data packet.
[0144] Example 3
[0145] The data packet transmission method provided in this embodiment is applied to a terminal device, such as Figure 3As shown, the terminal device 20 includes a main controller, a hardware accelerator, a USB controller and a wireless communication module, wherein the main controller is respectively connected to the hardware accelerator, the USB controller and the wireless communication module for communication, and the hardware accelerator is respectively connected to the USB controller and the wireless communication module for communication.
[0146] like Figure 8 As shown, the data packet transmission method provided in this embodiment may include the following steps S31-S32:
[0147] Step S31: In response to the main controller being connected to an external device via a USB interface, the main controller sends a first startup instruction to the hardware accelerator. Specifically, the USB controller in the terminal device can establish a connection with the external device via the USB interface.
[0148] Step S32, the hardware accelerator responds to the first startup instruction, detects whether the USB controller receives the network data packet, and when detecting that the USB controller receives the network data packet, reads the network data packet from the USB controller, parses and encapsulates the network data packet, and transmits the encapsulated network data packet through the wireless communication module.
[0149] In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the base station through the wireless communication module. The above-mentioned parsing operation can be specifically RNDIS protocol parsing, removing the part related to the RNDIS protocol in the network data packet, and the above-mentioned encapsulation operation can be specifically encapsulating the parsed network data packet according to the wireless communication protocol (i.e., the protocol corresponding to the wireless communication module).
[0150] In this embodiment, the network data packet sent by the external device is received through the USB controller. After the main controller starts the hardware accelerator, the hardware accelerator processes the uplink network data packet. The communication link will no longer trigger the USB receive interrupt, and thus will not cause the main controller to perform context switching. The impact of a large number of USB receive interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0151] In an optional embodiment, in response to the first startup instruction sent by the main controller, the hardware accelerator parses and encapsulates the network data packet received by the wireless communication module, and transmits the encapsulated network data packet through the USB controller. In a specific implementation, the hardware accelerator can transmit the encapsulated network data packet to the external device through the USB controller. The above-mentioned parsing operation can specifically be wireless communication protocol (i.e., the protocol corresponding to the wireless communication module) parsing, removing the part of the network data packet related to the wireless communication protocol, and the above-mentioned encapsulation operation can specifically be encapsulating the parsed network data packet according to the RNDIS protocol.
[0152] In this embodiment, the network data packet sent by the base station is received through the wireless communication module. After the main controller starts the hardware accelerator, the hardware accelerator processes the downlink network data packet. The communication link will no longer trigger the USB send interrupt, and therefore will not cause the main controller to perform context switching. The impact of a large number of USB send interrupts on the performance and power consumption of the main controller can be eliminated, thereby improving the user experience of using the terminal device.
[0153] It should be noted that the steps executed by the main controller and the hardware accelerator in this embodiment and the corresponding effects can all refer to the above-mentioned embodiments 1 and 2.
[0154] This embodiment also provides a data packet transmission device, including a hardware accelerator, a main controller, a USB controller and a wireless communication module. The main controller is used to send a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface. The hardware accelerator is used to detect whether the USB controller has received a network data packet in response to the first startup instruction, and when detecting that the USB controller has received a network data packet, read the network data packet from the USB controller, parse and encapsulate the network data packet, and transmit the encapsulated network data packet through the wireless communication module.
[0155] In an optional implementation, the hardware accelerator includes a register module, a storage module and a state machine, and the main controller is further used to configure the register module according to the USB controller before sending a first startup instruction to the hardware accelerator, and load the instruction set set according to the USB controller into the storage module; wherein the state machine is used to execute instructions in the instruction set.
[0156] In an optional embodiment, the main controller is further used to send a second startup instruction to the USB controller in response to being connected to an external device via a USB interface; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device.
[0157] In an optional implementation manner, the main controller is further used to initialize the USB controller and configure a port in the USB controller for communicating with the hardware accelerator before the USB controller sends the second startup instruction.
[0158] In an optional implementation, the main controller is further configured to send a first stop instruction to the hardware accelerator in response to disconnection of the connection with the external device; wherein the first stop instruction is configured to instruct the hardware accelerator to stop running.
[0159] In an optional embodiment, the main controller is further used to send a first cleanup instruction to the hardware accelerator in response to the disconnection between the external device; wherein the first cleanup instruction is used to instruct to clean up the data in the register module and the memory.
[0160] In an optional implementation, the main controller is further configured to send a second stop instruction to the USB controller in response to a disconnection with the external device; wherein the second stop instruction is configured to instruct the USB controller to stop running.
[0161] In an optional embodiment, the main controller is further used to send a second cleanup instruction to the USB controller in response to the disconnection between the main controller and the external device; wherein the second cleanup instruction is used to instruct the cleanup of resources in the USB controller.
[0162] In an optional implementation, the hardware accelerator is specifically used to detect that the USB controller has received a network data packet when data read from a target register of the USB controller is consistent with locally pre-stored data; otherwise, detect that the USB controller has not received a network data packet.
[0163] Example 4
[0164] Fig. 9A schematic diagram of the structure of a terminal device provided for this embodiment. The terminal device includes at least one processor and a memory connected to the at least one processor. The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data packet transmission method in embodiment 1 or 2. In one example, the processor is the above-mentioned main controller, which can execute the data packet transmission method in embodiment 1. In another example, the processor is the above-mentioned hardware accelerator, which can execute the data packet transmission method in embodiment 2, Fig. 9 The terminal device 3 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0165] The components of the terminal device 3 may include, but are not limited to: the at least one processor 4 mentioned above, the at least one memory 5 mentioned above, and a bus 6 connecting different system components (including the memory 5 and the processor 4).
[0166] The bus 6 includes a data bus, an address bus and a control bus.
[0167] The memory 5 may include a volatile memory, such as a random access memory (RAM) 51 and / or a cache memory 52 , and may further include a read-only memory (ROM) 53 .
[0168] The memory 5 may also include a program / utility 55 having a set (at least one) of program modules 54, such program modules 54 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0169] The processor 4 executes various functional applications and data processing, such as the above-mentioned data packet transmission method, by running the computer program stored in the memory 5 .
[0170] The terminal device 3 may also communicate with one or more external devices 7 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 8. Furthermore, the terminal device 3 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 9. Fig. 9 As shown, the network adapter 9 communicates with other modules of the terminal device 3 via the bus 6. It should be understood that although Fig. 9Not shown, other hardware and / or software modules may be used in conjunction with the terminal device 3, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.
[0171] It should be noted that although several units / modules or sub-units / modules of the terminal device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0172] Example 5
[0173] This embodiment provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the data packet transmission method in Embodiment 1 or 2 are implemented.
[0174] The computer-readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0175] In a possible implementation manner, the present invention may also be implemented in the form of a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the data packet transmission method in embodiment 1 or 2 are implemented.
[0176] Among them, the computer program for executing the present disclosure can be written in any combination of one or more programming languages, and the computer program can be executed completely on the terminal device, partially on the terminal device, as an independent software package, partially on the terminal device and partially on a remote device, or completely on the remote device.
[0177] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A data packet transmission method, characterized in that: A main controller applied to a terminal device, wherein the terminal device further comprises a hardware accelerator, a USB controller and a wireless communication module, and the data packet transmission method comprises the following steps: In response to connecting to an external device through a USB interface, a first startup instruction is sent to the hardware accelerator; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the USB controller, and transmit the encapsulated network data packets through the wireless communication module.
2. The data packet transmission method according to claim 1, characterized in that: The hardware accelerator includes a register module, a storage module and a state machine. Before sending a first startup instruction to the hardware accelerator, the following steps are also included: Configuring the register module according to the USB controller; An instruction set set according to the USB controller is loaded into the storage module; wherein the state machine is used to execute instructions in the instruction set.
3. The data packet transmission method according to claim 1, characterized in that: The data packet transmission method comprises the following steps: In response to connecting with an external device through a USB interface, a second startup instruction is sent to the USB controller; wherein the second startup instruction is used to instruct the USB controller to allow being recognized by the external device.
4. The data packet transmission method according to claim 3, characterized in that: Before the USB controller sends the second startup instruction, the method further includes the following steps: Initializing the USB controller; A port in the USB controller for communicating with the hardware accelerator is configured.
5. The data packet transmission method according to claim 1, characterized in that: The data packet transmission method further comprises the following steps: In response to the disconnection between the external device and the hardware accelerator, a first stop instruction is sent to the hardware accelerator; wherein the first stop instruction is used to instruct the hardware accelerator to stop running.
6. The data packet transmission method according to claim 2, characterized in that: The data packet transmission method further comprises the following steps: In response to the disconnection between the external device and the hardware accelerator, a first cleanup instruction is sent to the hardware accelerator; wherein the first cleanup instruction is used to instruct to clean up the data in the register module and the storage module.
7. The data packet transmission method according to claim 3, characterized in that: The data packet transmission method further comprises the following steps: In response to the disconnection between the external device and the USB controller, a second stop instruction is sent to the USB controller; wherein the second stop instruction is used to instruct the USB controller to stop running.
8. The data packet transmission method according to claim 4, characterized in that: The data packet transmission method further comprises the following steps: In response to the disconnection between the external device and the USB controller, a second cleanup instruction is sent to the USB controller; wherein the second cleanup instruction is used to instruct to clean up the resources in the USB controller.
9. A data packet transmission method, characterized in that: A hardware accelerator applied to a terminal device, wherein the terminal device further comprises a main controller, a USB controller and a wireless communication module, and the data packet transmission method comprises the following steps: In response to a first start instruction sent by the main controller, detecting whether the USB controller receives a network data packet; In response to detecting that the USB controller receives a network data packet, reading the network data packet from the USB controller; Parsing and encapsulating the network data packet; The encapsulated network data packets are transmitted through the wireless communication module.
10. The data packet transmission method according to claim 9, characterized in that: The detecting whether the USB controller receives the network data packet specifically includes: If the data read from the target register of the USB controller is consistent with the locally pre-stored data, it is detected that the USB controller has received the network data packet; otherwise, it is detected that the USB controller has not received the network data packet.
11. A data packet transmission method, characterized in that: Applied to a terminal device, the terminal device includes a hardware accelerator, a main controller, a USB controller and a wireless communication module; the data packet transmission method includes the following steps: The main controller sends a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface; The hardware accelerator responds to the first startup instruction to detect whether the USB controller has received a network data packet, and when detecting that the USB controller has received a network data packet, reads the network data packet from the USB controller, parses and encapsulates the network data packet, and transmits the encapsulated network data packet through the wireless communication module.
12. A data packet transmission device, characterized in that: A main controller applied to a terminal device, wherein the terminal device further comprises a hardware accelerator, a USB controller and a wireless communication module, and the data packet transmission device comprises: A first startup module is used to send a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface; wherein the first startup instruction is used to instruct the hardware accelerator to parse and encapsulate the network data packets received by the USB controller, and to transmit the encapsulated network data packets through the wireless communication module.
13. A data packet transmission device, characterized in that: A hardware accelerator applied to a terminal device, wherein the terminal device further comprises a main controller, a USB controller and a wireless communication module, and the data packet transmission device comprises: a detection module, configured to detect whether the USB controller receives a network data packet in response to a first startup instruction sent by the main controller; a reading module, configured to read the network data packet from the USB controller in response to detecting that the USB controller receives the network data packet; A processing module, used for parsing and encapsulating the network data packets; The transmission module is used to transmit the encapsulated network data packets through the wireless communication module.
14. A data packet transmission device, characterized in that: Including hardware accelerator, main controller, USB controller and wireless communication module: The main controller is used for sending a first startup instruction to the hardware accelerator in response to being connected to an external device through a USB interface; The hardware accelerator is used to respond to the first startup instruction, detect whether the USB controller has received a network data packet, and when detecting that the USB controller has received a network data packet, read the network data packet from the USB controller, parse and encapsulate the network data packet, and transmit the encapsulated network data packet through the wireless communication module.
15. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the data packet transmission method according to any one of claims 1 to 10 is implemented.
16. A chip, applied to a terminal device, characterized in that: The chip is used to execute the data packet transmission method according to any one of claims 1 to 10.
17. A chip module, applied to a terminal device, characterized in that: The invention comprises a chip, wherein the chip is used to execute the data packet transmission method according to any one of claims 1 to 10.
18. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the data packet transmission method according to any one of claims 1 to 10 are implemented.
19. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the data packet transmission method according to any one of claims 1 to 10.
Citation Information
Patent Citations
A data transmission method and system
CN101170382A
Method for controlling USB device through coprocessor for mobile phone
CN101645002A
Sampler for data of network of distributed control system
CN101718981A
Data packet transmission device and system
CN110765044A
Multifunctional USB control method and system based on BMC chip, terminal and storage medium
CN111090601A
Cited By
Data packet transmission method and apparatus, and terminal device
GB2644924A
Data packet transmission method and apparatus, and terminal device
WO2025251568A1
