WO2022142901A1 - Data transmission method and apparatus, readable storage medium, and terminal device - Google Patents

Data transmission method and apparatus, readable storage medium, and terminal device Download PDF

Info

Publication number
WO2022142901A1
WO2022142901A1 PCT/CN2021/133114 CN2021133114W WO2022142901A1 WO 2022142901 A1 WO2022142901 A1 WO 2022142901A1 CN 2021133114 W CN2021133114 W CN 2021133114W WO 2022142901 A1 WO2022142901 A1 WO 2022142901A1
Authority
WO
WIPO (PCT)
Prior art keywords
channel
data
sending
data processing
task
Prior art date
Application number
PCT/CN2021/133114
Other languages
French (fr)
Chinese (zh)
Inventor
顾鹏
Original Assignee
深圳云天励飞技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳云天励飞技术股份有限公司 filed Critical 深圳云天励飞技术股份有限公司
Publication of WO2022142901A1 publication Critical patent/WO2022142901A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Definitions

  • the present application belongs to the field of chip technology, and in particular, relates to a data transmission method, an apparatus, a computer-readable storage medium, and a terminal device.
  • AI coprocessor chip solutions have gradually become the main application scenarios of solutions in the field of artificial intelligence.
  • AI artificial intelligence
  • this method requires complicated coordination and management of the data transmission process, and is inefficient when faced with a large number of complex tasks.
  • the embodiments of the present application provide a data transmission method, an apparatus, a computer-readable storage medium, and a terminal device, so as to solve the problem of low efficiency of the existing data transmission method.
  • a first aspect of the embodiments of the present application provides a data transmission method, which may include:
  • the data transmission channel includes a sending task queue, a sending port and a receiving port;
  • the source thread is the data stream output party in the data processing thread of the host side and the data processing thread of the slave side;
  • the data packet is received through the receiving port, the data processing task is parsed from the data packet and sent to the destination thread; the destination thread is the data processing thread on the host side and the data processing on the slave side The data stream input side in the thread.
  • creating a data transmission channel between the host and the slave may include:
  • a sending task queue, a sending port and a receiving port corresponding to the logical channel of the USB endpoint are created on the host side and the slave side by the channel creation module.
  • the data transmission channel is a channel from the host side to the slave side; the channel creation module creates logic with the USB endpoint on the host side and the slave side
  • the sending task queue, sending port and receiving port corresponding to the channel can include:
  • a receive port is created on the slave side by the channel creation module using a preset remote procedure call module.
  • the data transmission channel is a channel from the slave side to the host side; the channel creation module creates logic with the USB endpoint on the host side and the slave side
  • the sending task queue, sending port and receiving port corresponding to the channel can include:
  • a receiving port is created on the host side by the channel creation module.
  • the channel creation module in the preset channel management component may further include:
  • the channel resource management module in the channel management component through the channel creation module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters;
  • the channel creation process is stopped.
  • sending the data processing task of the source thread to the sending task queue may include:
  • a new data processing task is formed according to the serialized data processing task, the task type and the pointer of the task queue of the destination thread;
  • the encapsulating the data processing task into a data packet and sending it to the receiving port may include:
  • a plurality of the data packets are encapsulated into aggregate packets and sent to the receiving port.
  • a second aspect of the embodiments of the present application provides a data transmission apparatus, which may include various functional modules for implementing any of the foregoing data transmission methods.
  • a third aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the steps of any of the foregoing data transmission methods.
  • a fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program Implement the steps of any of the above data transmission methods.
  • a fifth aspect of the embodiments of the present application provides a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to execute the steps of any of the above data transmission methods.
  • the embodiments of the present application have the following beneficial effects: the embodiments of the present application create a data transmission channel between the host end and the slave end, and the data transmission channel includes a sending task queue, a sending port, and a receiving port; Send the data processing task of the source thread to the sending task queue; read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port; receiving the data packet through the receiving port, parsing the data processing task from the data packet and sending it to the destination thread.
  • the existing USB interface is further encapsulated as a data transmission channel between the host and the slave, and a task queue processing mechanism is introduced therein to realize the coordination management between the threads of the host and the threads of the slave. , without requiring users to perform complicated control operations, which greatly improves the processing efficiency of a large number of complex tasks.
  • Fig. 1 is a schematic diagram of a task queue for inter-thread task communication
  • Fig. 2 is the schematic diagram of USB endpoint logic channel
  • Fig. 3 is the schematic diagram of the point-to-point channel from the host side to the slave side direction;
  • FIG. 4 is a schematic diagram of a channel management component for point-to-point channel management
  • FIG. 5 is a flowchart of an embodiment of a data transmission method in an embodiment of the present application.
  • FIG. 6 is a schematic diagram of cross-platform data transmission through a data transmission channel
  • Fig. 7 is the schematic diagram of group package format
  • Fig. 8 is the schematic diagram of polybag
  • FIG. 9 is a structural diagram of an embodiment of a data transmission apparatus in an embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a terminal device in an embodiment of the present application.
  • the task queue (denoted as TaskQueue) as shown in FIG. 1 may be used to perform communication between tasks (denoted as Task) between data processing threads (denoted as Node).
  • the TaskQueue internally uses a fixed-size First Input First Output (FIFO) queue to store the Task information between threads.
  • the Task information includes the Task type information and the Task pointer information.
  • the sending threads A and B dynamically apply for Task objects on the heap space, send tasks Task X and Y through the TaskQueue object, and the receiving thread C reads the Tasks from the TaskQueue object in turn and processes them.
  • the Task object is released on the heap space after processing. If the FIFO queue of the TaskQueue is full when the sending thread sends the task, the sending thread will block until the receiving thread removes the Task from the FIFO queue; if the FIFO queue of the TaskQueue is empty when the receiving thread receives the task, the receiving thread will block waiting for the sending thread to send the Task .
  • a USB endpoint (denoted as Endpoint) may be used to perform data communication between the host end (denoted as Host) and the slave end (denoted as Device).
  • Host is generally an X86 or ARM-based main processor
  • Device is generally a device used for a specific purpose, such as an AI coprocessor chip.
  • Figure 2 shows a schematic diagram of the USB endpoint logical channel.
  • the USB endpoint logical channel can be divided into point-to-point channels in two directions (denoted as P2P Channel), that is, the point-to-point channel from Host to Device (denoted as HostàDevice P2P Channel), and the point-to-point channel from Device to Host (denoted as DeviceàHost P2P Channel).
  • P2P Channel is an application communication channel carried on the logical channel connection of USB endpoints, and uses the transmission characteristics of USB to efficiently transmit user data to the opposite end.
  • the P2P Channel may include:
  • the TaskQueue of the P2P sending port of the Host is used to receive the Task sending requests of other threads of the Host.
  • the sent Task content includes: the TaskQueue information of the Device, the serialized code stream information of the Task, and the Task type information.
  • the type information is used to inform the Device how to deserialize the received stream information.
  • TxChannel The P2P sending port of the Host (referred to as TxChannel) is used to take out the Task from the TaskQueue and send it in packets;
  • the P2P receiving port of the Device (referred to as RxChannel) is used to receive data packets and unpack them. After unpacking, the receiving TaskQueue and Task type information of the Task are obtained and pushed to the TaskQueue corresponding to the Device.
  • the P2P Channel in the direction from the Device to the Host is similar, and it is only necessary to exchange the Device and the Host in the foregoing content, which is not repeated in this embodiment of the present application.
  • the P2P Channel can be managed on the Host side through a channel management component (referred to as P2P ChannelWrapper) as shown in FIG. 4 .
  • P2P ChannelWrapper can specifically include the following modules:
  • the channel creation module and channel deletion module of H2D are responsible for the creation and deletion of the P2P Channel from Host to Device;
  • the channel creation module and channel deletion module of D2H are used to create and delete the P2P Channel from Device to Host;
  • the channel resource management module is used to maintain the created P2P Channel resource information and support P2P Channel multiplexing
  • the USB endpoint resource management module is used to manage the use of USB endpoint resources, and supports dynamic application and release of USB endpoints in pairs.
  • an embodiment of a data transmission method in this embodiment of the present application may include:
  • Step S501 creating a data transmission channel between the host end and the slave end.
  • a P2P Channel may be used as a data transmission channel between the Host and the Device, and a specific creation process thereof may include the following steps:
  • the channel name and the channel parameters can be set by the user according to the actual situation, and the channel name can be a combination of numbers, letters and symbols.
  • the channel name can be set as: "H2D VideoStream #1"
  • the channel parameters may include specific parameters such as maximum transmission block, transmission direction, and transmission mode.
  • the maximum transmission block in the channel parameters may be set to 1MB, that is, the maximum data block that can be transmitted in the channel is 1MB.
  • the channel name and the channel parameters need to be passed to the H2D channel creation module; if the data transmission channel to be created is the direction from the Device to the Host direction channel, the channel name and the channel parameters need to be passed to the channel creation module of D2H.
  • the channel creation module invokes the channel resource management module in the channel management component to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters.
  • the channel parameter is the maximum transmission block of 1MB, and a channel with the same name exists, and the maximum transmission block of the channel is not less than 1MB, the The channel is determined as the target channel.
  • the channel resource management module is called to add 1 to the reference count of the target channel, and step (3) is performed; if the target channel does not exist, a new channel needs to be recreated, that is, step (4) is continued. .
  • the USB endpoint resource management module can call the general USB interface, and pass specific parameters such as the maximum transmission block, transmission direction and transmission mode in the channel parameters to the API function provided by the USB interface, thereby creating a new USB endpoint logic channel, and name it after the channel name.
  • the data transmission channel to be created is a channel from the Host to the Device
  • a sending port and a sending task queue corresponding to the sending port can be created on the Host side through the channel creation module, and the channel creation module can use the preset
  • the remote procedure call module (Remote Procedure Call, RPC) creates a receiving port on the Device side, thereby establishing a data transmission channel from the Host to the Device.
  • the channel creation module can use RPC to create a sending port and a sending task queue corresponding to the sending port on the Device side, and create a module through the channel. Create a receiving port on the Host side to establish a data transmission channel from Device to Host.
  • a cross-platform data transmission channel can be created between the host end and the slave end, thereby providing a basis for subsequent data transmission.
  • the channel resource management module can be called to increase the reference count of the newly created data transmission channel by 1, and return the pointer of the created sending task queue so that the sending task queue needs to be used later. call it directly.
  • Step S502 Send the data processing task of the source thread to the sending task queue.
  • the source thread is the data stream output party in the data processing thread of the host side and the data processing thread of the slave side; correspondingly, the destination thread is the data processing thread of the host side and the data processing thread of the slave side.
  • the data stream input side in the thread Taking Figure 6 as an example, the thread A of the Host sends the Task of type TaskX1 and TaskX2 to the thread B of the Device, and sends the Task of the type TaskY to the thread C of the Device, then the thread A is the source thread, and the threads B and C are the destination threads. .
  • the source thread Before data transmission, the source thread can obtain the following information through RPC:
  • TaskType 0 in the TaskQueue sent to thread B represents the serialized code stream of the TaskX1 type
  • TaskType 1 represents the TaskX2 type.
  • TaskType 0 in the TaskQueue agreed to be sent to thread C represents the serialization code stream of the TaskY type.
  • the source thread can send the Task data stream.
  • the task type serialize the data processing task that needs to be transmitted to obtain the serialized data processing task, or it is called the Task serialization code stream.
  • the Task serialization code stream serializes the data processing task that needs to be transmitted to obtain the serialized data processing task, or it is called the Task serialization code stream.
  • a new data processing task is formed according to the serialized data processing task, the task type and the TaskQueue pointer of the destination thread, and the new data processing task is sent to the sending task queue.
  • Step S503 Read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port.
  • the content read by the sending port includes the Task serialization code stream, the task type and the TaskQueue pointer of the destination thread. After reading these contents, it can be encapsulated into a data packet according to the preset packet format, and the USB can be called.
  • the endpoint driver sends the packet.
  • the specific packet format can be set according to the actual situation.
  • Figure 7 shows a schematic diagram of a packet format. The packet format adds a transmission header including the following content before the Task serialization code stream:
  • Task type the type identification (id) information of the task, the destination thread deserializes according to the type id of the task;
  • Destination thread Queue pointer the TaskQueue pointer of the destination thread
  • Number of aggregated packets the number of packets in the transmission block, P2P Channel supports the aggregation of multiple small data packets to send together, please refer to the following specific instructions for details;
  • Cyclic Redundancy Check (CRC) information optional. If CRC check is supported, CRC calculation is performed on the data area of the transmission header or the transmission header + Task serialized code stream to ensure the integrity of data transmission.
  • a buffer with continuous physical addresses can be allocated to the user, and the storage of the transmission header is reserved before the buffer. Space, through such special processing, data copying is not required during the packet transmission process.
  • the data packet can be directly sent to the receiving port without performing the packet aggregation process; if the data length of the data packet is less than or equal to the threshold, the Then, several of the data packets can be encapsulated into one data packet (denoted as a cluster packet) and sent to the receiving port, thereby improving the USB transmission efficiency.
  • the sending port can allocate a maximum transmission block buffer supported on the USB endpoint during the initialization phase for packet data transmission, and then periodically read Tasks from the TaskQueue continuously, and group packets into the buffer. If The buffer is full, then call USB send.
  • the threshold may be set according to actual conditions, which is not specifically limited in this embodiment of the present application.
  • Figure 8 shows the format in which two data packets are encapsulated into one aggregated packet.
  • the data length in the transmission header of the aggregated packet is the transmission header of the two data packets and the total length of the Task serialization code stream.
  • the Task type and The TaskQueue pointers of the destination thread are all -1, which means they are invalid.
  • Step S504 Receive the data packet through the receiving port, parse the data processing task from the data packet, and send it to the destination thread.
  • the receiving port can parse the data packet according to the agreed packet format, and use the magic word and CRC information to judge the validity of the data packet transmission, and discard the data packet if it is invalid. If the received packet is composed of multiple data packets, it will be unpacked according to the indication of the number of packets. For each valid data packet received, read the TaskQueue pointer and Task type in the transmission header, and send the Task to the TaskQueue of the corresponding destination thread. The destination thread reads the Task in its TaskQueue, and performs deserialization and subsequent processing according to the instruction of the Task type.
  • the channel name needs to be passed to the H2D channel deletion module; if the data transmission channel to be deleted is the channel from the Device to the Host direction, the The channel name is passed to the channel delete module of D2H.
  • the channel can be determined as the target channel.
  • step (3) If the target channel does not exist, return a message that the deletion failed, and the failure reason can be attached to the message to delete the non-existing P2P Channel; if the target channel exists, continue to execute step (3).
  • the channel resource management module is called by the channel deletion module, and the reference count of the target channel is decremented by 1. At this time, if the reference count is not 0, a message of successful deletion is returned; if the reference count is 0, Then proceed to step (4).
  • the existing USB interface is further encapsulated as a data transmission channel between the host and the slave, and a task queue processing mechanism is introduced therein to realize the thread of the host and the thread of the slave.
  • the coordination and management between users does not require users to perform complicated control operations, which greatly improves the processing efficiency of a large number of complex tasks.
  • FIG. 9 shows an embodiment structure diagram of a data transmission apparatus provided by an embodiment of the present application.
  • a data transmission device may include:
  • the channel creation module 901 is used to create a data transmission channel between the host end and the slave end, the data transmission channel including a sending task queue, a sending port and a receiving port;
  • a data sending module 902 configured to send the data processing task of the source thread to the sending task queue;
  • the source thread is the data stream output party in the data processing thread on the host side and the data processing thread on the slave side ;
  • a data encapsulation module 903 configured to read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port;
  • the data receiving module 904 is configured to receive the data packet through the receiving port, parse the data processing task from the data packet and send it to a destination thread; the destination thread is the data processing thread of the host and the The data stream input side in the data processing thread of the slave side.
  • the channel creation module may include:
  • a resource management unit configured to invoke the USB endpoint resource management module in the channel management component through the channel creation module to create a USB endpoint logical channel corresponding to the channel name and the channel parameter;
  • a channel creation unit configured to create a sending task queue, a sending port and a receiving port corresponding to the logical channel of the USB endpoint on the host side and the slave side through the channel creating module.
  • channel creation unit may include:
  • the first creation subunit is used to create a sending port and a sending task queue corresponding to the sending port on the host side through the channel creation module; the channel creation module uses a preset remote procedure call module in the Create a receive port on the slave side.
  • the second creation subunit is used to create a sending port and a sending task queue corresponding to the sending port on the slave side by using the preset remote procedure call module through the channel creating module;
  • the host side creates a receive port as described above.
  • channel creation module may also include:
  • a channel query unit configured to invoke the channel resource management module in the channel management component through the channel creation module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters;
  • the stop creation unit is configured to stop the channel creation process if the target channel exists.
  • the data sending module may include:
  • serialization unit used to serialize the data processing task to obtain the serialized data processing task
  • a package unit for forming a new data processing task according to the serialized data processing task, the task type and the pointer of the task queue of the destination thread;
  • a sending unit configured to send the new data processing task to the sending task queue.
  • the data encapsulation module may include:
  • a package unit configured to encapsulate the data processing task into a data package according to a preset package format
  • a first processing unit configured to send the data packet to the receiving port if the data length of the data packet is greater than a preset threshold
  • the second processing unit is configured to encapsulate a plurality of the data packets into aggregated packets and send them to the receiving port if the data length of the data packets is less than or equal to the threshold.
  • FIG. 10 shows a schematic block diagram of a terminal device provided by an embodiment of the present application. For convenience of description, only parts related to the embodiment of the present application are shown.
  • the terminal device 10 in this embodiment includes: a processor 100 , a memory 101 , and a computer program 102 stored in the memory 101 and executable on the processor 100 .
  • the processor 100 executes the computer program 102
  • the steps in each of the above data transmission method embodiments are implemented, for example, steps S505 to S504 shown in FIG. 5 .
  • the processor 100 executes the computer program 102
  • the functions of the modules/units in the foregoing device embodiments are implemented, for example, the functions of the modules 901 to 904 shown in FIG. 9 .
  • the computer program 102 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 101 and executed by the processor 100 to complete the this application.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 102 in the terminal device 10 .
  • the terminal device 10 may be a computing device such as a desktop computer, a notebook, a palmtop computer, a smart phone, and a smart TV.
  • FIG. 10 is only an example of the terminal device 10, and does not constitute a limitation on the terminal device 10. It may include more or less components than the one shown, or combine some components, or different components
  • the terminal device 10 may further include an input and output device, a network access device, a bus, and the like.
  • the processor 100 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 100 may be the nerve center and command center of the terminal device 10, and the processor 100 may generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
  • the memory 101 may be an internal storage unit of the terminal device 10 , such as a hard disk or a memory of the terminal device 10 .
  • the memory 101 may also be an external storage device of the terminal device 10, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the terminal device 10 card, flash memory card (Flash Card), etc.
  • the memory 101 may also include both an internal storage unit of the terminal device 10 and an external storage device.
  • the memory 101 is used to store the computer program and other programs and data required by the terminal device 10 .
  • the memory 101 may also be used to temporarily store data that has been output or will be output.
  • the terminal device 10 may further include a communication module, and the communication module may provide a wireless local area network (Wireless Local Area Network) which is applied on the network device.
  • Local Area Networks WLAN
  • WLAN Wireless Local Area Networks
  • WLAN Wireless Local Area Networks
  • GNSS Global Navigation Satellite System
  • FM Frequency Modulation
  • NFC Near Field Communication Technology
  • IR infrared technology
  • the communication module may be one or more devices integrating at least one communication processing module.
  • the communication module may include an antenna, and the antenna may have only one array element, or may be an antenna array including multiple array elements.
  • the communication module can receive the electromagnetic wave through the antenna, frequency modulate and filter the electromagnetic wave signal, and send the processed signal to the processor.
  • the communication module can also receive the signal to be sent from the processor, perform frequency modulation and amplification on it, and then convert it into electromagnetic waves for radiation through the antenna.
  • the terminal device 10 may further include a power management module, which may receive input from an external power source, a battery and/or a charger, and supply power to the processor, the memory, the communication module, and the like.
  • a power management module which may receive input from an external power source, a battery and/or a charger, and supply power to the processor, the memory, the communication module, and the like.
  • the terminal device 10 may further include a display module, which may be used to display information input by the user or information provided to the user.
  • the display module may include a display panel, optionally, a liquid crystal display (Liquid Crystal Display, LCD), organic light-emitting diode (Organic Light-Emitting Diode, OLED) and other forms to configure the display panel.
  • the touch panel can cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor to determine the type of the touch event, and then the processor determines the type of the touch event according to the type of the touch event. A corresponding visual output is provided on the display panel.
  • the disclosed apparatus/terminal device and method may be implemented in other manners.
  • the apparatus/terminal device embodiments described above are only illustrative.
  • the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the embodiments of the present application provide a computer program product, which enables the terminal device to implement the steps in the foregoing method embodiments when the computer program product runs on the terminal device.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program.
  • the computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented.
  • the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like.
  • the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only). Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer-readable Storage media exclude electrical carrier signals and telecommunications signals.

Abstract

A data transmission method and apparatus, a computer readable storage medium, and a terminal device, relating to the technical field of chips. The method comprises: creating a data transmission channel between a host end and a slave end (S501), the data transmission channel comprising a sending task queue, a sending port, and a receiving port; sending a data processing task of a source thread to the sending task queue (S502); reading the data processing task from the sending task queue by means of the sending port, and encapsulating the data processing task into a data packet and sending the data packet to the receiving port (S503); and receiving the data packet by means of the receiving port, and parsing the data processing task from the data packet and sending the data processing task to a destination thread (S504). According to the method, a task queue processing mechanism is introduced into the data transmission channel to implement coordination management between a thread of the host end and a thread of the slave end, such that the processing efficiency for a large number of complex tasks is greatly improved.

Description

一种数据传输方法、装置、可读存储介质及终端设备A data transmission method, apparatus, readable storage medium and terminal device 技术领域technical field
本申请属于芯片技术领域,尤其涉及一种数据传输方法、装置、计算机可读存储介质及终端设备。The present application belongs to the field of chip technology, and in particular, relates to a data transmission method, an apparatus, a computer-readable storage medium, and a terminal device.
本申请要求于2020年12月29日提交中国专利局,申请号为202011614094.3、发明名称为“一种数据传输方法、装置、可读存储介质及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。 This application claims the priority of the Chinese patent application filed on December 29, 2020 with the application number 202011614094.3 and the invention name is "a data transmission method, device, readable storage medium and terminal device", all of which are The contents are incorporated herein by reference. 
背景技术Background technique
随着各种人工智能(Artificial Intelligence,AI)芯片的普及,AI协处理器芯片方案也逐步成为人工智能领域解决方案的主要应用场景。现有技术在进行主处理器和AI协处理器芯片之间的跨平台的数据传输时,大多是直接调用通用的USB接口来实现。但这种方式需要对数据传输过程进行繁杂的协调管理,当面对大量复杂任务时,效率较低。With the popularization of various artificial intelligence (AI) chips, AI coprocessor chip solutions have gradually become the main application scenarios of solutions in the field of artificial intelligence. In the prior art, when the cross-platform data transmission between the main processor and the AI co-processor chip is performed, most of them directly call the general USB interface to realize it. However, this method requires complicated coordination and management of the data transmission process, and is inefficient when faced with a large number of complex tasks.
技术解决方案technical solutions
有鉴于此,本申请实施例提供了一种数据传输方法、装置、计算机可读存储介质及终端设备,以解决现有的数据传输方法效率较低的问题。In view of this, the embodiments of the present application provide a data transmission method, an apparatus, a computer-readable storage medium, and a terminal device, so as to solve the problem of low efficiency of the existing data transmission method.
本申请实施例的第一方面提供了一种数据传输方法,可以包括:A first aspect of the embodiments of the present application provides a data transmission method, which may include:
创建主机端与从机端之间的数据传输信道,所述数据传输信道包括发送任务队列、发送端口和接收端口;Create a data transmission channel between the host and the slave, and the data transmission channel includes a sending task queue, a sending port and a receiving port;
将源线程的数据处理任务发送至所述发送任务队列;所述源线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输出方;sending the data processing task of the source thread to the sending task queue; the source thread is the data stream output party in the data processing thread of the host side and the data processing thread of the slave side;
通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口;Read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port;
通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程;所述目的线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输入方。The data packet is received through the receiving port, the data processing task is parsed from the data packet and sent to the destination thread; the destination thread is the data processing thread on the host side and the data processing on the slave side The data stream input side in the thread.
进一步地,所述创建主机端与从机端之间的数据传输信道,可以包括:Further, creating a data transmission channel between the host and the slave may include:
将所述数据传输信道的信道名称和信道参数传递至预设的信道管理组件中的信道创建模块;passing the channel name and channel parameters of the data transmission channel to the channel creation module in the preset channel management component;
通过所述信道创建模块调用所述信道管理组件中的USB端点资源管理模块,创建与所述信道名称和所述信道参数对应的USB端点逻辑信道;Calling the USB endpoint resource management module in the channel management component by the channel creation module to create a USB endpoint logical channel corresponding to the channel name and the channel parameter;
通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口。A sending task queue, a sending port and a receiving port corresponding to the logical channel of the USB endpoint are created on the host side and the slave side by the channel creation module.
进一步地,所述数据传输信道为从所述主机端到所述从机端方向的信道;所述通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口,可以包括:Further, the data transmission channel is a channel from the host side to the slave side; the channel creation module creates logic with the USB endpoint on the host side and the slave side The sending task queue, sending port and receiving port corresponding to the channel can include:
通过所述信道创建模块在所述主机端创建发送端口以及与该发送端口对应的发送任务队列;Create a sending port and a sending task queue corresponding to the sending port on the host side by the channel creation module;
通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建接收端口。A receive port is created on the slave side by the channel creation module using a preset remote procedure call module.
进一步地,所述数据传输信道为从所述从机端到所述主机端方向的信道;所述通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口,可以包括:Further, the data transmission channel is a channel from the slave side to the host side; the channel creation module creates logic with the USB endpoint on the host side and the slave side The sending task queue, sending port and receiving port corresponding to the channel can include:
通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建发送端口以及与该发送端口对应的发送任务队列;Using the preset remote procedure call module to create a sending port and a sending task queue corresponding to the sending port on the slave end through the channel creation module;
通过所述信道创建模块在所述主机端创建接收端口。A receiving port is created on the host side by the channel creation module.
进一步地,在将所述数据传输信道的信道名称和信道参数传递至预设的信道管理组件中的信道创建模块之后,还可以包括:Further, after passing the channel name and channel parameters of the data transmission channel to the channel creation module in the preset channel management component, it may further include:
通过所述信道创建模块调用所述信道管理组件中的信道资源管理模块,查询是否存在目标信道,所述目标信道为与所述信道名称和信道参数对应的数据传输信道;Call the channel resource management module in the channel management component through the channel creation module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters;
若存在所述目标信道,则停止信道创建过程。If the target channel exists, the channel creation process is stopped.
进一步地,所述将源线程的数据处理任务发送至所述发送任务队列,可以包括:Further, the sending the data processing task of the source thread to the sending task queue may include:
对所述数据处理任务进行序列化,得到序列化的数据处理任务;serializing the data processing task to obtain a serialized data processing task;
根据所述序列化的数据处理任务、任务类型和所述目的线程的任务队列的指针组成新的数据处理任务;A new data processing task is formed according to the serialized data processing task, the task type and the pointer of the task queue of the destination thread;
将所述新的数据处理任务发送至所述发送任务队列。Send the new data processing task to the sending task queue.
进一步地,所述将所述数据处理任务封装为数据包并发送至所述接收端口,可以包括:Further, the encapsulating the data processing task into a data packet and sending it to the receiving port may include:
按照预设的组包格式将所述数据处理任务封装为数据包;Encapsulate the data processing task into a data package according to a preset package format;
若所述数据包的数据长度大于预设的阈值,则将所述数据包发送至所述接收端口;If the data length of the data packet is greater than a preset threshold, send the data packet to the receiving port;
若所述数据包的数据长度小于或等于所述阈值,则将若干个所述数据包封装为聚包并发送至所述接收端口。If the data length of the data packets is less than or equal to the threshold, a plurality of the data packets are encapsulated into aggregate packets and sent to the receiving port.
本申请实施例的第二方面提供了一种数据传输装置,可以包括实现上述任一种数据传输方法的各个功能模块。A second aspect of the embodiments of the present application provides a data transmission apparatus, which may include various functional modules for implementing any of the foregoing data transmission methods.
本申请实施例的第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述任一种数据传输方法的步骤。A third aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the steps of any of the foregoing data transmission methods.
本申请实施例的第四方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述任一种数据传输方法的步骤。A fourth aspect of the embodiments of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program Implement the steps of any of the above data transmission methods.
本申请实施例的第五方面提供了一种计算机程序产品,当计算机程序产品在终端设备上运行时,使得终端设备执行上述任一种数据传输方法的步骤。A fifth aspect of the embodiments of the present application provides a computer program product that, when the computer program product runs on a terminal device, causes the terminal device to execute the steps of any of the above data transmission methods.
本申请实施例与现有技术相比存在的有益效果是:本申请实施例创建主机端与从机端之间的数据传输信道,所述数据传输信道包括发送任务队列、发送端口和接收端口;将源线程的数据处理任务发送至所述发送任务队列;通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口;通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程。通过本申请实施例,将现有的USB接口进一步封装为主机端与从机端之间的数据传输信道,在其中引入任务队列处理机制来实现主机端的线程与从机端的线程之间的协调管理,而无需使用者进行繁杂的控制操作,极大提升了对于大量复杂任务的处理效率。Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application create a data transmission channel between the host end and the slave end, and the data transmission channel includes a sending task queue, a sending port, and a receiving port; Send the data processing task of the source thread to the sending task queue; read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port; receiving the data packet through the receiving port, parsing the data processing task from the data packet and sending it to the destination thread. Through the embodiment of the present application, the existing USB interface is further encapsulated as a data transmission channel between the host and the slave, and a task queue processing mechanism is introduced therein to realize the coordination management between the threads of the host and the threads of the slave. , without requiring users to perform complicated control operations, which greatly improves the processing efficiency of a large number of complex tasks.
附图说明Description of drawings
图1为进行线程间任务通信的任务队列的示意图;Fig. 1 is a schematic diagram of a task queue for inter-thread task communication;
图2为USB端点逻辑通道的示意图;Fig. 2 is the schematic diagram of USB endpoint logic channel;
图3为从主机端到从机端方向的点对点信道的示意图;Fig. 3 is the schematic diagram of the point-to-point channel from the host side to the slave side direction;
图4为进行点对点信道管理的信道管理组件的示意图;4 is a schematic diagram of a channel management component for point-to-point channel management;
图5为本申请实施例中一种数据传输方法的一个实施例流程图;FIG. 5 is a flowchart of an embodiment of a data transmission method in an embodiment of the present application;
图6为通过数据传输信道进行跨平台的数据传输的示意图;6 is a schematic diagram of cross-platform data transmission through a data transmission channel;
图7为组包格式的示意图;Fig. 7 is the schematic diagram of group package format;
图8为聚包的示意图;Fig. 8 is the schematic diagram of polybag;
图9为本申请实施例中一种数据传输装置的一个实施例结构图;FIG. 9 is a structural diagram of an embodiment of a data transmission apparatus in an embodiment of the present application;
图10为本申请实施例中一种终端设备的示意框图。FIG. 10 is a schematic block diagram of a terminal device in an embodiment of the present application.
本发明的实施方式Embodiments of the present invention
在本申请实施例中,可以使用如图1所示的任务队列(记为TaskQueue)来进行数据处理线程(记为Node)间任务(记为Task)的通信。TaskQueue内部使用固定大小的先进先出(First Input First Output,FIFO)队列保存线程间的Task信息,Task信息包括Task类型信息以及Task的指针信息。如图1所示的例子,发送线程A和B在堆空间上动态申请Task对象,通过TaskQueue对象发送任务Task X和Y,接收线程C依次从TaskQueue对象中读取Task并处理,Task类型采用数值表示,约定Task指针的类型信息,处理完毕后在堆空间上释放Task对象。如果发送线程发送任务时TaskQueue的FIFO队列满,那么发送线程会堵塞直到接收线程从FIFO队列中取出Task;如果接收线程接收任务时TaskQueue的FIFO队列为空,那么接收线程会堵塞等待发送线程发送Task。In this embodiment of the present application, the task queue (denoted as TaskQueue) as shown in FIG. 1 may be used to perform communication between tasks (denoted as Task) between data processing threads (denoted as Node). The TaskQueue internally uses a fixed-size First Input First Output (FIFO) queue to store the Task information between threads. The Task information includes the Task type information and the Task pointer information. In the example shown in Figure 1, the sending threads A and B dynamically apply for Task objects on the heap space, send tasks Task X and Y through the TaskQueue object, and the receiving thread C reads the Tasks from the TaskQueue object in turn and processes them. Indicates that the type information of the Task pointer is agreed, and the Task object is released on the heap space after processing. If the FIFO queue of the TaskQueue is full when the sending thread sends the task, the sending thread will block until the receiving thread removes the Task from the FIFO queue; if the FIFO queue of the TaskQueue is empty when the receiving thread receives the task, the receiving thread will block waiting for the sending thread to send the Task .
在本申请实施例中,可以使用USB端点(记为Endpoint)来进行主机端(记为Host)与从机端(记为Device)之间数据通信。一般USB最多支持16个端点,每个端点可以配置最大传输块、传输方向和传输模式。其中,Host一般为基于X86或ARM的主处理器,Device一般为用于特定目的的设备,例如AI协处理器芯片等。图2所示即为USB端点逻辑通道的示意图,USB端点逻辑通道可以分为两个方向的点对点信道(记为P2P Channel),即从Host到Device方向的点对点信道(记为HostàDevice P2P Channel),以及从Device到Host方向的点对点信道(记为DeviceàHost P2P Channel)。In this embodiment of the present application, a USB endpoint (denoted as Endpoint) may be used to perform data communication between the host end (denoted as Host) and the slave end (denoted as Device). Generally, USB supports up to 16 endpoints, and each endpoint can configure the maximum transfer block, transfer direction and transfer mode. Among them, Host is generally an X86 or ARM-based main processor, and Device is generally a device used for a specific purpose, such as an AI coprocessor chip. Figure 2 shows a schematic diagram of the USB endpoint logical channel. The USB endpoint logical channel can be divided into point-to-point channels in two directions (denoted as P2P Channel), that is, the point-to-point channel from Host to Device (denoted as HostàDevice P2P Channel), and the point-to-point channel from Device to Host (denoted as DeviceàHost P2P Channel).
P2P Channel是承载于USB端点逻辑信道连接之上的应用通信信道,利用USB的传输特点高效地把用户数据传递到对端。P2P Channel is an application communication channel carried on the logical channel connection of USB endpoints, and uses the transmission characteristics of USB to efficiently transmit user data to the opposite end.
以图3所示的从Host到Device方向的信道为例来说明,P2P Channel可以包括:Taking the channel from the Host to the Device direction shown in Figure 3 as an example, the P2P Channel may include:
(1)Host的P2P发送端口的TaskQueue,用于接收Host的其它线程的Task发送请求,发送的Task内容包括:Device的TaskQueue信息、Task的序列化码流信息以及Task类型信息,其中,Task的类型信息用于通知Device如何反序列化接收到的码流信息。(1) The TaskQueue of the P2P sending port of the Host is used to receive the Task sending requests of other threads of the Host. The sent Task content includes: the TaskQueue information of the Device, the serialized code stream information of the Task, and the Task type information. The type information is used to inform the Device how to deserialize the received stream information.
(2)Host的P2P发送端口(记为TxChannel),用于从TaskQueue取出Task并组包发送;(2) The P2P sending port of the Host (referred to as TxChannel) is used to take out the Task from the TaskQueue and send it in packets;
(3)Device的P2P接收端口(记为RxChannel),用于接收数据包并对其解包,解包后获得Task的接收TaskQueue以及Task类型信息,推送到Device对应的TaskQueue中。(3) The P2P receiving port of the Device (referred to as RxChannel) is used to receive data packets and unpack them. After unpacking, the receiving TaskQueue and Task type information of the Task are obtained and pushed to the TaskQueue corresponding to the Device.
从Device到Host方向的P2P Channel与之类似,仅需将上述内容中的Device和Host互换即可,本申请实施例对此不再赘述。The P2P Channel in the direction from the Device to the Host is similar, and it is only necessary to exchange the Device and the Host in the foregoing content, which is not repeated in this embodiment of the present application.
在本申请实施例中,可以在Host端通过如图4所示的信道管理组件(记为P2P ChannelWrapper)来进行P2P Channel的管理。P2P ChannelWrapper具体可以包括如下模块:In this embodiment of the present application, the P2P Channel can be managed on the Host side through a channel management component (referred to as P2P ChannelWrapper) as shown in FIG. 4 . The P2P ChannelWrapper can specifically include the following modules:
H2D(Host to Device)的信道创建模块和信道删除模块,用于负责Host到Device的P2P Channel的创建和删除;The channel creation module and channel deletion module of H2D (Host to Device) are responsible for the creation and deletion of the P2P Channel from Host to Device;
D2H(Device to Host)的信道创建模块和信道删除模块,用于负责Device到Host的P2P Channel的创建和删除;The channel creation module and channel deletion module of D2H (Device to Host) are used to create and delete the P2P Channel from Device to Host;
信道资源管理模块,用于维护已经创建的P2P Channel资源信息,支持P2P Channel复用;The channel resource management module is used to maintain the created P2P Channel resource information and support P2P Channel multiplexing;
USB端点资源管理模块,用于管理USB端点资源使用,支持USB端点成对动态申请和释放。The USB endpoint resource management module is used to manage the use of USB endpoint resources, and supports dynamic application and release of USB endpoints in pairs.
请参阅图5,本申请实施例中一种数据传输方法的一个实施例可以包括:Referring to FIG. 5, an embodiment of a data transmission method in this embodiment of the present application may include:
步骤S501、创建主机端与从机端之间的数据传输信道。Step S501 , creating a data transmission channel between the host end and the slave end.
在本申请实施例中,可以使用P2P Channel来作为Host和Device之间的数据传输信道,其具体的创建过程可以包括如下步骤:In this embodiment of the present application, a P2P Channel may be used as a data transmission channel between the Host and the Device, and a specific creation process thereof may include the following steps:
(1)将需创建的数据传输信道的信道名称和信道参数传递至信道管理组件中的信道创建模块。(1) Pass the channel name and channel parameters of the data transmission channel to be created to the channel creation module in the channel management component.
所述信道名称和所述信道参数可以由用户根据实际情况进行设置,所述信道名称可以为数字、字母以及符号的组合,例如,可以将所述信道名称设置为:“H2D VideoStream #1”,所述信道参数可以包括最大传输块、传输方向和传输模式等具体参数,例如,可以将所述信道参数中的最大传输块设置为1MB,即在该信道中可传输的最大数据块为1MB。The channel name and the channel parameters can be set by the user according to the actual situation, and the channel name can be a combination of numbers, letters and symbols. For example, the channel name can be set as: "H2D VideoStream #1", The channel parameters may include specific parameters such as maximum transmission block, transmission direction, and transmission mode. For example, the maximum transmission block in the channel parameters may be set to 1MB, that is, the maximum data block that can be transmitted in the channel is 1MB.
若需创建的数据传输信道为从Host到Device方向的信道,则需将所述信道名称和所述信道参数传递至H2D的信道创建模块;若需创建的数据传输信道为从Device到Host方向的信道,则需将所述信道名称和所述信道参数传递至D2H的信道创建模块。If the data transmission channel to be created is the channel from the Host to the Device direction, the channel name and the channel parameters need to be passed to the H2D channel creation module; if the data transmission channel to be created is the direction from the Device to the Host direction channel, the channel name and the channel parameters need to be passed to the channel creation module of D2H.
(2)通过所述信道创建模块调用所述信道管理组件中的信道资源管理模块,查询是否存在目标信道,所述目标信道为与所述信道名称和信道参数对应的数据传输信道。(2) The channel creation module invokes the channel resource management module in the channel management component to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters.
例如,若所述信道名称为:“H2D VideoStream #1”,所述信道参数为最大传输块1MB,而查询到有同名的信道存在,且该信道的最大传输块不小于1MB,则可将该信道确定为目标信道。For example, if the channel name is: "H2D VideoStream #1", the channel parameter is the maximum transmission block of 1MB, and a channel with the same name exists, and the maximum transmission block of the channel is not less than 1MB, the The channel is determined as the target channel.
若存在所述目标信道,则可以直接使用该信道,无需重新创建新的信道,通过对已存在的信道的复用来减少对信道资源的消耗。此时调用所述信道资源管理模块将所述目标信道的引用计数加1,并执行步骤(3);若不存在所述目标信道,则需重新创建新的信道,即继续执行步骤(4)。If the target channel exists, the channel can be used directly without re-creating a new channel, and the consumption of channel resources can be reduced by multiplexing the existing channel. At this time, the channel resource management module is called to add 1 to the reference count of the target channel, and step (3) is performed; if the target channel does not exist, a new channel needs to be recreated, that is, step (4) is continued. .
(3)停止信道创建过程,返回所述目标信道的发送任务队列的指针以便后续需要使用到该发送任务队列时直接对其调用。(3) Stop the channel creation process, and return the pointer of the sending task queue of the target channel so that it can be directly called when the sending task queue needs to be used later.
(4)通过所述信道创建模块调用所述信道管理组件中的USB端点资源管理模块,创建与所述信道名称和所述信道参数对应的USB端点逻辑信道。(4) Calling the USB endpoint resource management module in the channel management component through the channel creation module to create a USB endpoint logical channel corresponding to the channel name and the channel parameter.
USB端点资源管理模块可以调用通用的USB接口,将所述信道参数中的最大传输块、传输方向和传输模式等具体参数传递至USB接口提供的API函数中,从而创建起一个新的USB端点逻辑信道,并以所述信道名称来为其命名。The USB endpoint resource management module can call the general USB interface, and pass specific parameters such as the maximum transmission block, transmission direction and transmission mode in the channel parameters to the API function provided by the USB interface, thereby creating a new USB endpoint logic channel, and name it after the channel name.
若USB端点资源不足,则返回信道申请失败的消息,并可在消息中附带上失败原因为USB端点资源耗尽;若USB端点资源足够,则继续执行步骤(5)。If the resource of the USB endpoint is insufficient, a message of channel application failure is returned, and the failure reason can be attached to the message that the resource of the USB endpoint is exhausted; if the resource of the USB endpoint is sufficient, proceed to step (5).
(5)通过所述信道创建模块在Host端和Device端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口。(5) Create a sending task queue, sending port and receiving port corresponding to the USB endpoint logical channel on the Host side and the Device side through the channel creation module.
若需创建的数据传输信道为从Host到Device方向的信道,则可以通过所述信道创建模块在Host端创建发送端口以及与该发送端口对应的发送任务队列,并通过所述信道创建模块使用预设的远程过程调用模块(Remote Procedure Call,RPC)在Device端创建接收端口,从而建立起从Host到Device方向的数据传输信道。If the data transmission channel to be created is a channel from the Host to the Device, a sending port and a sending task queue corresponding to the sending port can be created on the Host side through the channel creation module, and the channel creation module can use the preset The remote procedure call module (Remote Procedure Call, RPC) creates a receiving port on the Device side, thereby establishing a data transmission channel from the Host to the Device.
若需创建的数据传输信道为从Device到Host方向的信道,则可以通过所述信道创建模块使用RPC在Device端创建发送端口以及与该发送端口对应的发送任务队列,并通过所述信道创建模块在Host端创建接收端口,从而建立起从Device到Host方向的数据传输信道。If the data transmission channel to be created is a channel from the Device to the Host direction, the channel creation module can use RPC to create a sending port and a sending task queue corresponding to the sending port on the Device side, and create a module through the channel. Create a receiving port on the Host side to establish a data transmission channel from Device to Host.
通过步骤S501的过程,可以在主机端与从机端之间创建起跨平台的数据传输信道,从而为后续的数据传输提供基础。Through the process of step S501, a cross-platform data transmission channel can be created between the host end and the slave end, thereby providing a basis for subsequent data transmission.
在完成以上的信道创建过程之后,则可以调用所述信道资源管理模块将新创建的数据传输信道的引用计数加1,并返回创建的发送任务队列的指针以便后续需要使用到该发送任务队列时直接对其调用。After the above channel creation process is completed, the channel resource management module can be called to increase the reference count of the newly created data transmission channel by 1, and return the pointer of the created sending task queue so that the sending task queue needs to be used later. call it directly.
步骤S502、将源线程的数据处理任务发送至所述发送任务队列。Step S502: Send the data processing task of the source thread to the sending task queue.
所述源线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输出方;相应地,目的线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输入方。以图6所示为例,Host的线程A发送TaskX1和TaskX2类型的Task给Device的线程B,发送TaskY类型的Task给Device的线程C,则线程A为源线程,线程B、C为目的线程。The source thread is the data stream output party in the data processing thread of the host side and the data processing thread of the slave side; correspondingly, the destination thread is the data processing thread of the host side and the data processing thread of the slave side. The data stream input side in the thread. Taking Figure 6 as an example, the thread A of the Host sends the Task of type TaskX1 and TaskX2 to the thread B of the Device, and sends the Task of the type TaskY to the thread C of the Device, then the thread A is the source thread, and the threads B and C are the destination threads. .
在数据传输之前,所述源线程可以通过RPC获取如下信息:Before data transmission, the source thread can obtain the following information through RPC:
(1)目的线程的TaskQueue指针;(1) The TaskQueue pointer of the destination thread;
(2)源线程与目的线程之间的任务类型约定,以图6所示为例,可以约定送给线程B的TaskQueue中的TaskType 0表示TaskX1类型的序列化码流,TaskType 1表示TaskX2类型的序列化码流;约定送给线程C的TaskQueue中的TaskType 0表示TaskY类型的序列化码流。(2) The task type agreement between the source thread and the destination thread. Taking Figure 6 as an example, it can be agreed that TaskType 0 in the TaskQueue sent to thread B represents the serialized code stream of the TaskX1 type, and TaskType 1 represents the TaskX2 type. Serialization code stream; TaskType 0 in the TaskQueue agreed to be sent to thread C represents the serialization code stream of the TaskY type.
在获得上述信息后,所述源线程则可以进行Task数据流的发送。首先,根据任务类型,对需要进行传输的数据处理任务进行序列化,得到序列化的数据处理任务,或称之为Task序列化码流。然后,根据所述序列化的数据处理任务、任务类型和所述目的线程的TaskQueue指针组成新的数据处理任务,并将所述新的数据处理任务发送至所述发送任务队列。After obtaining the above information, the source thread can send the Task data stream. First, according to the task type, serialize the data processing task that needs to be transmitted to obtain the serialized data processing task, or it is called the Task serialization code stream. Then, a new data processing task is formed according to the serialized data processing task, the task type and the TaskQueue pointer of the destination thread, and the new data processing task is sent to the sending task queue.
步骤S503、通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口。Step S503: Read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port.
所述发送端口读取的内容包括Task序列化码流、任务类型和目的线程的TaskQueue指针,在读取到这些内容之后,可以按照预设的组包格式将其封装为数据包,并调用USB端点驱动发送数据包。具体的组包格式可以根据实际情况进行设置,图7所示即为一种组包格式的示意图,该组包格式在Task序列化码流之前加入了包括如下内容的传输头:The content read by the sending port includes the Task serialization code stream, the task type and the TaskQueue pointer of the destination thread. After reading these contents, it can be encapsulated into a data packet according to the preset packet format, and the USB can be called. The endpoint driver sends the packet. The specific packet format can be set according to the actual situation. Figure 7 shows a schematic diagram of a packet format. The packet format adds a transmission header including the following content before the Task serialization code stream:
魔术字:用于数据传输头检测;Magic word: used for data transmission header detection;
数据区描述:包括Task序列化码流的长度信息等;Data area description: including the length information of the Task serialization code stream, etc.;
Task类型:Task的类型标识(id)信息,目的线程依据Task的类型id进行反序列化;Task type: the type identification (id) information of the task, the destination thread deserializes according to the type id of the task;
目的线程Queue指针:即目的线程的TaskQueue指针;Destination thread Queue pointer: the TaskQueue pointer of the destination thread;
聚包数目:传输块的包数目,P2P Channel支持聚集多个小数据包一起发送,详见后续具体说明;Number of aggregated packets: the number of packets in the transmission block, P2P Channel supports the aggregation of multiple small data packets to send together, please refer to the following specific instructions for details;
循环冗余校验(Cyclic Redundancy Check,CRC)信息:可选项,如果支持CRC校验,那么针对传输头或者传输头+Task序列化码流的数据区进行CRC计算,确保数据传输完整性。Cyclic Redundancy Check (CRC) information: optional. If CRC check is supported, CRC calculation is performed on the data area of the transmission header or the transmission header + Task serialized code stream to ensure the integrity of data transmission.
通过这样的组包格式,便于接收方对接收到的数据包进行检测,及时剔除掉其中可能出现的无效数据包,提高数据的准确性。Through such a packet format, it is convenient for the receiver to detect the received data packets, and promptly remove the invalid data packets that may appear therein, thereby improving the accuracy of the data.
优选地,为了减少数据拷贝,本申请实施例可以在用户申请Task序列化所需内存(memory)时,为其分配物理地址连续的缓存(buffer),且在buffer前预留下传输头的存储空间,通过这样的特殊处理,在传输的组包过程中即可无需进行数据拷贝。Preferably, in order to reduce data copying, in this embodiment of the present application, when the user applies for the memory required for task serialization, a buffer with continuous physical addresses can be allocated to the user, and the storage of the transmission header is reserved before the buffer. Space, through such special processing, data copying is not required during the packet transmission process.
在组包完成后,若数据包的数据长度大于预设的阈值,则可以直接将数据包发送至所述接收端口,无需进行聚包过程;若数据包的数据长度小于或等于所述阈值,则可以将若干个所述数据包封装为一个数据包(将该数据包记为聚包)并发送至所述接收端口,从而提高USB传输效率。具体地,发送端口在初始化阶段可以分配一个在USB端点上支持的最大传输块buffer,用于聚包数据发送,然后周期性地从TaskQueue中连续读取Task,并组包填入buffer中,如果buffer已满,那么则调用USB发送。所述阈值可以根据实际情况进行设置,本申请实施例对此不作具体限定。After the grouping is completed, if the data length of the data packet is greater than the preset threshold, the data packet can be directly sent to the receiving port without performing the packet aggregation process; if the data length of the data packet is less than or equal to the threshold, the Then, several of the data packets can be encapsulated into one data packet (denoted as a cluster packet) and sent to the receiving port, thereby improving the USB transmission efficiency. Specifically, the sending port can allocate a maximum transmission block buffer supported on the USB endpoint during the initialization phase for packet data transmission, and then periodically read Tasks from the TaskQueue continuously, and group packets into the buffer. If The buffer is full, then call USB send. The threshold may be set according to actual conditions, which is not specifically limited in this embodiment of the present application.
图8所示即为将两个数据包封装为一个聚包发送的格式,聚包的传输头中的数据长度为两个数据包的传输头以及Task序列化码流的总长度,Task类型和目的线程的TaskQueue指针均为-1,即表示无效。Figure 8 shows the format in which two data packets are encapsulated into one aggregated packet. The data length in the transmission header of the aggregated packet is the transmission header of the two data packets and the total length of the Task serialization code stream. The Task type and The TaskQueue pointers of the destination thread are all -1, which means they are invalid.
步骤S504、通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程。Step S504: Receive the data packet through the receiving port, parse the data processing task from the data packet, and send it to the destination thread.
所述接收端口可以按照约定的组包格式对数据包进行解析,并利用魔术字和CRC信息,判断数据包传输的有效性,如果无效,则丢弃该数据包。如果接收到的是由多个数据包组成的聚包,则根据聚包数目的指示进行解包。针对接收的每个有效数据包,读取传输头中的TaskQueue指针以及Task类型,将Task发送到相对应的目的线程的TaskQueue中。所述目的线程则读取其TaskQueue中的Task,根据Task类型的指示对其进行反序列化以及后续处理。The receiving port can parse the data packet according to the agreed packet format, and use the magic word and CRC information to judge the validity of the data packet transmission, and discard the data packet if it is invalid. If the received packet is composed of multiple data packets, it will be unpacked according to the indication of the number of packets. For each valid data packet received, read the TaskQueue pointer and Task type in the transmission header, and send the Task to the TaskQueue of the corresponding destination thread. The destination thread reads the Task in its TaskQueue, and performs deserialization and subsequent processing according to the instruction of the Task type.
在完成数据传输之后,则可以通过如下步骤删除P2P Channel:After completing the data transmission, you can delete the P2P Channel through the following steps:
(1)将需删除的数据传输信道的信道名称传递至信道管理组件中的信道删除模块。(1) Pass the channel name of the data transmission channel to be deleted to the channel deletion module in the channel management component.
若需删除的数据传输信道为从Host到Device方向的信道,则需将该信道名称传递至H2D的信道删除模块;若需删除的数据传输信道为从Device到Host方向的信道,则需将该信道名称传递至D2H的信道删除模块。If the data transmission channel to be deleted is the channel from the Host to the Device direction, the channel name needs to be passed to the H2D channel deletion module; if the data transmission channel to be deleted is the channel from the Device to the Host direction, the The channel name is passed to the channel delete module of D2H.
(2)通过所述信道删除模块调用所述信道管理组件中的信道资源管理模块,查询是否存在目标信道,所述目标信道为与该信道名称对应的数据传输信道。(2) Call the channel resource management module in the channel management component through the channel deletion module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name.
例如,若该信道名称为:“H2D VideoStream #1”,且查询到有同名的信道存在,则可将查询到的该信道确定为目标信道。For example, if the channel name is: "H2D VideoStream #1", and a channel with the same name is found in the query, the channel can be determined as the target channel.
若不存在目标信道,则返回删除失败的消息,并可在消息中附带上失败原因为删除不存在的P2P Channel;若存在目标信道,则继续执行步骤(3)。If the target channel does not exist, return a message that the deletion failed, and the failure reason can be attached to the message to delete the non-existing P2P Channel; if the target channel exists, continue to execute step (3).
(3)通过所述信道删除模块调用所述信道资源管理模块,将目标信道的引用计数减1,此时若该引用计数为非0,则返回删除成功的消息;若该引用计数为0,则继续执行步骤(4)。(3) The channel resource management module is called by the channel deletion module, and the reference count of the target channel is decremented by 1. At this time, if the reference count is not 0, a message of successful deletion is returned; if the reference count is 0, Then proceed to step (4).
(4)通过所述信道删除模块调用所述信道资源管理模块,清除目标信道的记录,并调用USB端点资源管理模块,释放目标信道占用的USB端点资源,返回信道删除成功的消息。(4) Call the channel resource management module through the channel deletion module, clear the record of the target channel, and call the USB endpoint resource management module to release the USB endpoint resources occupied by the target channel, and return a channel deletion success message.
综上所述,通过本申请实施例,将现有的USB接口进一步封装为主机端与从机端之间的数据传输信道,在其中引入任务队列处理机制来实现主机端的线程与从机端的线程之间的协调管理,而无需使用者进行繁杂的控制操作,极大提升了对于大量复杂任务的处理效率。To sum up, through the embodiments of the present application, the existing USB interface is further encapsulated as a data transmission channel between the host and the slave, and a task queue processing mechanism is introduced therein to realize the thread of the host and the thread of the slave. The coordination and management between users does not require users to perform complicated control operations, which greatly improves the processing efficiency of a large number of complex tasks.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
  
对应于上文实施例所述的一种数据传输方法,图9示出了本申请实施例提供的一种数据传输装置的一个实施例结构图。Corresponding to a data transmission method described in the above embodiment, FIG. 9 shows an embodiment structure diagram of a data transmission apparatus provided by an embodiment of the present application.
本实施例中,一种数据传输装置可以包括:In this embodiment, a data transmission device may include:
信道创建模块901,用于创建主机端与从机端之间的数据传输信道,所述数据传输信道包括发送任务队列、发送端口和接收端口;The channel creation module 901 is used to create a data transmission channel between the host end and the slave end, the data transmission channel including a sending task queue, a sending port and a receiving port;
数据发送模块902,用于将源线程的数据处理任务发送至所述发送任务队列;所述源线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输出方;A data sending module 902, configured to send the data processing task of the source thread to the sending task queue; the source thread is the data stream output party in the data processing thread on the host side and the data processing thread on the slave side ;
数据封装模块903,用于通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口;A data encapsulation module 903, configured to read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port;
数据接收模块904,用于通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程;所述目的线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输入方。The data receiving module 904 is configured to receive the data packet through the receiving port, parse the data processing task from the data packet and send it to a destination thread; the destination thread is the data processing thread of the host and the The data stream input side in the data processing thread of the slave side.
进一步地,所述信道创建模块可以包括:Further, the channel creation module may include:
创建信息传递单元,用于将所述数据传输信道的信道名称和信道参数传递至预设的信道管理组件中的信道创建模块;Create an information transfer unit for transferring the channel name and channel parameters of the data transmission channel to the channel creation module in the preset channel management component;
资源管理单元,用于通过所述信道创建模块调用所述信道管理组件中的USB端点资源管理模块,创建与所述信道名称和所述信道参数对应的USB端点逻辑信道;a resource management unit, configured to invoke the USB endpoint resource management module in the channel management component through the channel creation module to create a USB endpoint logical channel corresponding to the channel name and the channel parameter;
信道创建单元,用于通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口。A channel creation unit, configured to create a sending task queue, a sending port and a receiving port corresponding to the logical channel of the USB endpoint on the host side and the slave side through the channel creating module.
进一步地,所述信道创建单元可以包括:Further, the channel creation unit may include:
第一创建子单元,用于通过所述信道创建模块在所述主机端创建发送端口以及与该发送端口对应的发送任务队列;通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建接收端口。The first creation subunit is used to create a sending port and a sending task queue corresponding to the sending port on the host side through the channel creation module; the channel creation module uses a preset remote procedure call module in the Create a receive port on the slave side.
第二创建子单元,用于通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建发送端口以及与该发送端口对应的发送任务队列;通过所述信道创建模块在所述主机端创建接收端口。The second creation subunit is used to create a sending port and a sending task queue corresponding to the sending port on the slave side by using the preset remote procedure call module through the channel creating module; The host side creates a receive port as described above.
进一步地,所述信道创建模块还可以包括:Further, the channel creation module may also include:
信道查询单元,用于通过所述信道创建模块调用所述信道管理组件中的信道资源管理模块,查询是否存在目标信道,所述目标信道为与所述信道名称和信道参数对应的数据传输信道;a channel query unit, configured to invoke the channel resource management module in the channel management component through the channel creation module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters;
停止创建单元,用于若存在所述目标信道,则停止信道创建过程。The stop creation unit is configured to stop the channel creation process if the target channel exists.
进一步地,所述数据发送模块可以包括:Further, the data sending module may include:
序列化单元,用于对所述数据处理任务进行序列化,得到序列化的数据处理任务;a serialization unit, used to serialize the data processing task to obtain the serialized data processing task;
组包单元,用于根据所述序列化的数据处理任务、任务类型和所述目的线程的任务队列的指针组成新的数据处理任务;a package unit, for forming a new data processing task according to the serialized data processing task, the task type and the pointer of the task queue of the destination thread;
发送单元,用于将所述新的数据处理任务发送至所述发送任务队列。A sending unit, configured to send the new data processing task to the sending task queue.
进一步地,所述数据封装模块可以包括:Further, the data encapsulation module may include:
组包单元,用于按照预设的组包格式将所述数据处理任务封装为数据包;a package unit, configured to encapsulate the data processing task into a data package according to a preset package format;
第一处理单元,用于若所述数据包的数据长度大于预设的阈值,则将所述数据包发送至所述接收端口;a first processing unit, configured to send the data packet to the receiving port if the data length of the data packet is greater than a preset threshold;
第二处理单元,用于若所述数据包的数据长度小于或等于所述阈值,则将若干个所述数据包封装为聚包并发送至所述接收端口。The second processing unit is configured to encapsulate a plurality of the data packets into aggregated packets and send them to the receiving port if the data length of the data packets is less than or equal to the threshold.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的装置,模块和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices, modules and units can be referred to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
图10示出了本申请实施例提供的一种终端设备的示意框图,为了便于说明,仅示出了与本申请实施例相关的部分。FIG. 10 shows a schematic block diagram of a terminal device provided by an embodiment of the present application. For convenience of description, only parts related to the embodiment of the present application are shown.
如图10所示,该实施例的终端设备10包括:处理器100、存储器101以及存储在所述存储器101中并可在所述处理器100上运行的计算机程序102。所述处理器100执行所述计算机程序102时实现上述各个数据传输方法实施例中的步骤,例如图5所示的步骤S505至步骤S504。或者,所述处理器100执行所述计算机程序102时实现上述各装置实施例中各模块/单元的功能,例如图9所示模块901至模块904的功能。As shown in FIG. 10 , the terminal device 10 in this embodiment includes: a processor 100 , a memory 101 , and a computer program 102 stored in the memory 101 and executable on the processor 100 . When the processor 100 executes the computer program 102, the steps in each of the above data transmission method embodiments are implemented, for example, steps S505 to S504 shown in FIG. 5 . Alternatively, when the processor 100 executes the computer program 102, the functions of the modules/units in the foregoing device embodiments are implemented, for example, the functions of the modules 901 to 904 shown in FIG. 9 .
示例性的,所述计算机程序102可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器101中,并由所述处理器100执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序102在所述终端设备10中的执行过程。Exemplarily, the computer program 102 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 101 and executed by the processor 100 to complete the this application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 102 in the terminal device 10 .
所述终端设备10可以是桌上型计算机、笔记本、掌上电脑、智能手机及智能电视等计算设备。本领域技术人员可以理解,图10仅仅是终端设备10的示例,并不构成对终端设备10的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备10还可以包括输入输出设备、网络接入设备、总线等。The terminal device 10 may be a computing device such as a desktop computer, a notebook, a palmtop computer, a smart phone, and a smart TV. Those skilled in the art can understand that FIG. 10 is only an example of the terminal device 10, and does not constitute a limitation on the terminal device 10. It may include more or less components than the one shown, or combine some components, or different components For example, the terminal device 10 may further include an input and output device, a network access device, a bus, and the like.
所述处理器100可以是中央处理单元(Central Processing Unit,CPU),还可以是其它通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA) 或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。所述处理器100可以是所述终端设备10的神经中枢和指挥中心,所述处理器100可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor 100 may be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The processor 100 may be the nerve center and command center of the terminal device 10, and the processor 100 may generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
所述存储器101可以是所述终端设备10的内部存储单元,例如终端设备10的硬盘或内存。所述存储器101也可以是所述终端设备10的外部存储设备,例如所述终端设备10上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器101还可以既包括所述终端设备10的内部存储单元也包括外部存储设备。所述存储器101用于存储所述计算机程序以及所述终端设备10所需的其它程序和数据。所述存储器101还可以用于暂时地存储已经输出或者将要输出的数据。The memory 101 may be an internal storage unit of the terminal device 10 , such as a hard disk or a memory of the terminal device 10 . The memory 101 may also be an external storage device of the terminal device 10, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the terminal device 10 card, flash memory card (Flash Card), etc. Further, the memory 101 may also include both an internal storage unit of the terminal device 10 and an external storage device. The memory 101 is used to store the computer program and other programs and data required by the terminal device 10 . The memory 101 may also be used to temporarily store data that has been output or will be output.
所述终端设备10还可以包括通信模块,所述通信模块可以提供应用在网络设备上的包括无线局域网(Wireless Local Area Networks,WLAN)(如Wi-Fi网络),蓝牙,Zigbee,移动通信网络,全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等通信的解决方案。所述通信模块可以是集成至少一个通信处理模块的一个或多个器件。该通信模块可以包括天线,该天线可以只有一个阵元,也可以是包括多个阵元的天线阵列。所述通信模块可以通过天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器。所述通信模块还可以从处理器接收待发送的信号,对其进行调频、放大,经天线转为电磁波辐射出去。The terminal device 10 may further include a communication module, and the communication module may provide a wireless local area network (Wireless Local Area Network) which is applied on the network device. Local Area Networks, WLAN) (such as Wi-Fi networks), Bluetooth, Zigbee, mobile communication networks, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication Technology (Near) Field Communication, NFC), infrared technology (Infrared, IR) and other communication solutions. The communication module may be one or more devices integrating at least one communication processing module. The communication module may include an antenna, and the antenna may have only one array element, or may be an antenna array including multiple array elements. The communication module can receive the electromagnetic wave through the antenna, frequency modulate and filter the electromagnetic wave signal, and send the processed signal to the processor. The communication module can also receive the signal to be sent from the processor, perform frequency modulation and amplification on it, and then convert it into electromagnetic waves for radiation through the antenna.
所述终端设备10还可以包括电源管理模块,所述电源管理模块可以接收外接电源、电池和/或充电器的输入,为所述处理器、所述存储器和所述通信模块等供电。The terminal device 10 may further include a power management module, which may receive input from an external power source, a battery and/or a charger, and supply power to the processor, the memory, the communication module, and the like.
所述终端设备10还可以包括显示模块,所述显示模块可用于显示由用户输入的信息或提供给用户的信息。所述显示模块可包括显示面板,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode, OLED)等形式来配置显示面板。进一步的,触控面板可覆盖显示面板,当触控面板检测到在其上或附近的触摸操作后,传送给所述处理器以确定触摸事件的类型,随后所述处理器根据触摸事件的类型在所述显示面板上提供相应的视觉输出。The terminal device 10 may further include a display module, which may be used to display information input by the user or information provided to the user. The display module may include a display panel, optionally, a liquid crystal display (Liquid Crystal Display, LCD), organic light-emitting diode (Organic Light-Emitting Diode, OLED) and other forms to configure the display panel. Further, the touch panel can cover the display panel, and when the touch panel detects a touch operation on or near it, it is transmitted to the processor to determine the type of the touch event, and then the processor determines the type of the touch event according to the type of the touch event. A corresponding visual output is provided on the display panel.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
本申请实施例提供了一种计算机程序产品,当计算机程序产品在所述终端设备上运行时,使得所述终端设备可实现上述各个方法实施例中的步骤。The embodiments of the present application provide a computer program product, which enables the terminal device to implement the steps in the foregoing method embodiments when the computer program product runs on the terminal device.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the present application can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable storage medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only). Memory), random access memory (RAM, Random Access Memory), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content contained in the computer-readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer-readable Storage media exclude electrical carrier signals and telecommunications signals.

Claims (10)

  1. 一种数据传输方法,其特征在于,包括:A data transmission method, comprising:
    创建主机端与从机端之间的数据传输信道,所述数据传输信道包括发送任务队列、发送端口和接收端口;Create a data transmission channel between the host and the slave, and the data transmission channel includes a sending task queue, a sending port and a receiving port;
    将源线程的数据处理任务发送至所述发送任务队列;所述源线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输出方;sending the data processing task of the source thread to the sending task queue; the source thread is the data stream output party in the data processing thread of the host side and the data processing thread of the slave side;
    通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口;Read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port;
    通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程;所述目的线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输入方。The data packet is received through the receiving port, the data processing task is parsed from the data packet and sent to the destination thread; the destination thread is the data processing thread on the host side and the data processing on the slave side The data stream input side in the thread.
  2. 根据权利要求1所述的数据传输方法,其特征在于,所述创建主机端与从机端之间的数据传输信道,包括:The data transmission method according to claim 1, wherein the creating a data transmission channel between the host and the slave comprises:
    将所述数据传输信道的信道名称和信道参数传递至预设的信道管理组件中的信道创建模块;passing the channel name and channel parameters of the data transmission channel to the channel creation module in the preset channel management component;
    通过所述信道创建模块调用所述信道管理组件中的USB端点资源管理模块,创建与所述信道名称和所述信道参数对应的USB端点逻辑信道;Calling the USB endpoint resource management module in the channel management component by the channel creation module to create a USB endpoint logical channel corresponding to the channel name and the channel parameter;
    通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口。A sending task queue, a sending port and a receiving port corresponding to the logical channel of the USB endpoint are created on the host side and the slave side by the channel creation module.
  3. 根据权利要求2所述的数据传输方法,其特征在于,所述数据传输信道为从所述主机端到所述从机端方向的信道;The data transmission method according to claim 2, wherein the data transmission channel is a channel from the host end to the slave end direction;
    所述通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口,包括:The creating a sending task queue, sending port and receiving port corresponding to the USB endpoint logical channel on the host side and the slave side through the channel creation module, including:
    通过所述信道创建模块在所述主机端创建发送端口以及与该发送端口对应的发送任务队列;Create a sending port and a sending task queue corresponding to the sending port on the host side by the channel creation module;
    通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建接收端口。A receive port is created on the slave side by the channel creation module using a preset remote procedure call module.
  4. 根据权利要求2所述的数据传输方法,其特征在于,所述数据传输信道为从所述从机端到所述主机端方向的信道;The data transmission method according to claim 2, wherein the data transmission channel is a channel from the slave end to the host end;
    所述通过所述信道创建模块在所述主机端和所述从机端创建与所述USB端点逻辑信道对应的发送任务队列、发送端口和接收端口,包括:The creating a sending task queue, sending port and receiving port corresponding to the USB endpoint logical channel on the host side and the slave side through the channel creation module, including:
    通过所述信道创建模块使用预设的远程过程调用模块在所述从机端创建发送端口以及与该发送端口对应的发送任务队列;Using the preset remote procedure call module to create a sending port and a sending task queue corresponding to the sending port on the slave end through the channel creation module;
    通过所述信道创建模块在所述主机端创建接收端口。A receiving port is created on the host side by the channel creation module.
  5. 根据权利要求2所述的数据传输方法,其特征在于,在将所述数据传输信道的信道名称和信道参数传递至预设的信道管理组件中的信道创建模块之后,还包括:The data transmission method according to claim 2, wherein after passing the channel name and channel parameters of the data transmission channel to the channel creation module in the preset channel management component, the method further comprises:
    通过所述信道创建模块调用所述信道管理组件中的信道资源管理模块,查询是否存在目标信道,所述目标信道为与所述信道名称和信道参数对应的数据传输信道;Call the channel resource management module in the channel management component through the channel creation module to query whether there is a target channel, where the target channel is a data transmission channel corresponding to the channel name and channel parameters;
    若存在所述目标信道,则停止信道创建过程。If the target channel exists, the channel creation process is stopped.
  6. 根据权利要求1所述的数据传输方法,其特征在于,所述将源线程的数据处理任务发送至所述发送任务队列,包括:The data transmission method according to claim 1, wherein the sending the data processing task of the source thread to the sending task queue comprises:
    对所述数据处理任务进行序列化,得到序列化的数据处理任务;serializing the data processing task to obtain a serialized data processing task;
    根据所述序列化的数据处理任务、任务类型和所述目的线程的任务队列的指针组成新的数据处理任务;A new data processing task is formed according to the serialized data processing task, the task type and the pointer of the task queue of the destination thread;
    将所述新的数据处理任务发送至所述发送任务队列。Send the new data processing task to the sending task queue.
  7. 根据权利要求1至6中任一项所述的数据传输方法,其特征在于,所述将所述数据处理任务封装为数据包并发送至所述接收端口,包括:The data transmission method according to any one of claims 1 to 6, wherein the encapsulating the data processing task into a data packet and sending it to the receiving port comprises:
    按照预设的组包格式将所述数据处理任务封装为数据包;Encapsulate the data processing task into a data package according to a preset package format;
    若所述数据包的数据长度大于预设的阈值,则将所述数据包发送至所述接收端口;If the data length of the data packet is greater than a preset threshold, send the data packet to the receiving port;
    若所述数据包的数据长度小于或等于所述阈值,则将若干个所述数据包封装为聚包并发送至所述接收端口。If the data length of the data packets is less than or equal to the threshold, a plurality of the data packets are encapsulated into aggregate packets and sent to the receiving port.
  8. 一种数据传输装置,其特征在于,包括:A data transmission device, comprising:
    信道创建模块,用于创建主机端与从机端之间的数据传输信道,所述数据传输信道包括发送任务队列、发送端口和接收端口;a channel creation module for creating a data transmission channel between the host and the slave, the data transmission channel including a sending task queue, a sending port and a receiving port;
    数据发送模块,用于将源线程的数据处理任务发送至所述发送任务队列;所述源线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输出方;A data sending module, configured to send the data processing task of the source thread to the sending task queue; the source thread is the data stream exporter among the data processing thread of the host side and the data processing thread of the slave side;
    数据封装模块,用于通过所述发送端口从所述发送任务队列中读取所述数据处理任务,将所述数据处理任务封装为数据包并发送至所述接收端口;a data encapsulation module, configured to read the data processing task from the sending task queue through the sending port, encapsulate the data processing task into a data packet and send it to the receiving port;
    数据接收模块,用于通过所述接收端口接收所述数据包,从所述数据包中解析出所述数据处理任务并发送至目的线程;所述目的线程为所述主机端的数据处理线程和所述从机端的数据处理线程之中的数据流输入方。A data receiving module, configured to receive the data packet through the receiving port, parse out the data processing task from the data packet and send it to a destination thread; the destination thread is the data processing thread on the host side and the The input side of the data stream in the data processing thread of the slave side.
  9. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的数据传输方法的步骤。A computer-readable storage medium storing a computer program, characterized in that, when the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 7 is implemented A step of.
  10. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至7中任一项所述的数据传输方法的步骤。A terminal device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, when the processor executes the computer program, the process according to claim 1 to Steps of the data transmission method described in any one of 7.
PCT/CN2021/133114 2020-12-29 2021-11-25 Data transmission method and apparatus, readable storage medium, and terminal device WO2022142901A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011614094.3A CN114691581A (en) 2020-12-29 2020-12-29 Data transmission method and device, readable storage medium and terminal equipment
CN202011614094.3 2020-12-29

Publications (1)

Publication Number Publication Date
WO2022142901A1 true WO2022142901A1 (en) 2022-07-07

Family

ID=82131620

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/133114 WO2022142901A1 (en) 2020-12-29 2021-11-25 Data transmission method and apparatus, readable storage medium, and terminal device

Country Status (2)

Country Link
CN (1) CN114691581A (en)
WO (1) WO2022142901A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002031672A2 (en) * 2000-10-13 2002-04-18 Zucotto Wireless Inc. Method and apparatus for interprocessor communication and peripheral sharing
CN101371570A (en) * 2006-02-14 2009-02-18 国际商业机器公司 A method and apparatus for providing a picture in picture service
CN101556569A (en) * 2008-04-10 2009-10-14 联发科技股份有限公司 Method for transferring data from host device to slave device and the slave device
CN101587462A (en) * 2008-05-21 2009-11-25 上海摩波彼克半导体有限公司 USB data transmission device in high-speed data communication link and data transmission method thereof
CN103051978A (en) * 2012-12-16 2013-04-17 华南理工大学 H264-based real-time mobile video service control method
CN111131932A (en) * 2019-12-04 2020-05-08 广东东研网络科技股份有限公司 Master-slave communication method in OLT system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856440B (en) * 2012-11-29 2015-11-18 腾讯科技(深圳)有限公司 A kind of message treatment method based on distributed bus, server and system
CN110399329B (en) * 2019-07-12 2022-06-07 苏州浪潮智能科技有限公司 RDMA data processing method and related device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002031672A2 (en) * 2000-10-13 2002-04-18 Zucotto Wireless Inc. Method and apparatus for interprocessor communication and peripheral sharing
CN101371570A (en) * 2006-02-14 2009-02-18 国际商业机器公司 A method and apparatus for providing a picture in picture service
CN101556569A (en) * 2008-04-10 2009-10-14 联发科技股份有限公司 Method for transferring data from host device to slave device and the slave device
CN101587462A (en) * 2008-05-21 2009-11-25 上海摩波彼克半导体有限公司 USB data transmission device in high-speed data communication link and data transmission method thereof
CN103051978A (en) * 2012-12-16 2013-04-17 华南理工大学 H264-based real-time mobile video service control method
CN111131932A (en) * 2019-12-04 2020-05-08 广东东研网络科技股份有限公司 Master-slave communication method in OLT system

Also Published As

Publication number Publication date
CN114691581A (en) 2022-07-01

Similar Documents

Publication Publication Date Title
WO2023087938A1 (en) Data processing method, programmable network card device, physical server, and storage medium
US11868297B2 (en) Far-end data migration device and method based on FPGA cloud platform
CN112822193B (en) Application communication method, device, equipment and storage medium
US11948021B2 (en) Method for inter-core communication, processor, inter-core communication system and computer readable storage medium
WO2021135574A1 (en) Data storage method and apparatus, and terminal device
WO2024001515A1 (en) Information transmission method and apparatus, device, and storage medium
US8135851B2 (en) Object request broker for accelerating object-oriented communications and method
WO2003063461A1 (en) Apparatus for wireless connectivity using software modem
WO2022142902A1 (en) Data pipeline arrangement method, apparatus, readable storage medium, and terminal device
CN110071839B (en) CORBA communication device supporting digital signal processor
WO2022142901A1 (en) Data transmission method and apparatus, readable storage medium, and terminal device
WO2022179427A1 (en) Configuration method of data transmission bandwidth and related device
CN113778714B (en) Shared shear plate method and device compatible with Android for Linux
WO2020221033A1 (en) Method for managing remote storage device by means of management device
CN116136790A (en) Task processing method and device
US8176117B2 (en) Accelerator for object-oriented communications and method
WO2022142900A1 (en) Data pipelining arrangement method and apparatus, and storage medium and terminal device
CN110909359A (en) Communication method based on dual-system architecture and terminal equipment
WO2024060247A1 (en) Data exchange method and apparatus based on bluetooth communication, and device and storage medium
CN114189562B (en) Data processing method, device, terminal and storage medium
CN115982090B (en) Method and device for realizing remote memory access by cooperation of software and hardware
WO2023202241A1 (en) Communication method and related product
CN115037671B (en) Multi-path aggregation scheduling method and electronic equipment
WO2024082099A1 (en) Communication method, electronic device and storage medium
CN112187698B (en) Communication method, service system, electronic equipment and host MCU (micro control Unit) of electronic equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21913643

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21913643

Country of ref document: EP

Kind code of ref document: A1