Data transmission method, device, medium, vehicle and electronic equipment

By establishing a communication connection between the sender and the channel in the non-transparent bridge in the library in the sender memory, the data is directly sent to the receiver, solving the problems of data transmission delay and low throughput in the prior art, and achieving more efficient data transmission.

CN118363917BActive Publication Date: 2025-03-25XIAOMI EV TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410371321.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-28
Publication Date
2025-03-25
Estimated Expiration
2044-03-28

AI Technical Summary

Technical Problem

In the prior art, NTB is used in the Linux kernel to realize data transmission between two independent processor domains, which will pass through the network's protocol stack TCP/IP, resulting in high packet delay and low data transmission throughput.

Method used

By establishing a communication connection between the sender and the channel in the non-transparent bridge in the library in the sender memory, the data is directly sent to the receiver, avoiding transmission through the network protocol stack TCP/IP.

Benefits of technology

It effectively reduces the data transmission delay caused by TCP/IP, enhances the stability of data transmission, and thus improves the efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118363917B_ABST
    Figure CN118363917B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of data transmission, and to a data transmission method, device, medium, vehicle and electronic device, comprising: calling the data of an application to a sending end kernel; establishing a communication connection between the sending end and a channel in a non-transparent bridge through a library in the sending end kernel, and a receiving end applying for a user-state memory for receiving the data according to the channel; sending the data in the library in the sending end kernel to the receiving end through the channel, and the receiving end mapping the data to the user-state memory, thereby reducing the delay in data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data transmission, and in particular to a data transmission method, device, medium, vehicle and electronic equipment. Background Art

[0002] Currently, the Linux kernel uses NTB (Non-Transparent Bridging) to implement data transmission between two independent processor domains. By default, it will pass through the ntb_netdev network driver, that is, it will pass through the network protocol stack TCP / IP (Transmission Control Protocol / Internet Protocol). The network protocol stack runs in the CPU (Central Processing Unit), so the data packet delay is high and the data transmission throughput is low. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a data transmission method, device, medium, vehicle and electronic device.

[0004] According to a first aspect of an embodiment of the present disclosure, a data transmission method is provided, which is applied to a sending end and includes:

[0005] Call the application's data to the sending kernel;

[0006] Establishing a communication connection between the sending end and a channel in a non-transparent bridge through a library in the sending end kernel, so that the receiving end applies for a user state memory for receiving the data according to the channel;

[0007] The data in the library in the kernel of the sending end is sent to the receiving end through the channel, so that the receiving end maps the data into the user state memory.

[0008] Optionally, establishing a communication connection between the sending end and a channel in a non-transparent bridge through a library in a kernel of the sending end includes:

[0009] Calling a first interface in a sending end driver through a library in the sending end kernel;

[0010] A communication connection is established between the sending end and the channel in the non-transparent bridge through the first interface.

[0011] Optionally, establishing a communication connection between the sending end and a channel in the non-transparent bridge through the first interface includes:

[0012] Applying for a channel matching the data from the non-transparent bridge through the first interface;

[0013] In the case where the channel application is successful, calling a second interface through a library in the kernel of the sending end to determine whether the receiving end is online;

[0014] When the receiving end is online, a communication connection is established between the sending end and the channel in the non-transparent bridge.

[0015] Optionally, sending the data in the library in the kernel of the sending end to the receiving end through the channel includes:

[0016] Calling a third interface in the sending end driver through a library in the sending end kernel;

[0017] calling the data in the library in the sending end kernel to the sending end driver through the third interface;

[0018] Transmitting the data to the channel through the sending end driver;

[0019] The data in the channel is sent to the receiving end.

[0020] Optionally, sending the data in the channel to the receiving end includes:

[0021] Calling a fourth interface in the sending end driver through a library in the sending end kernel;

[0022] According to the fourth interface, a DMA controller is called to send the data in the channel to the receiving end.

[0023] Optionally, the method further comprises:

[0024] When the data transmission is completed, calling the fifth interface in the transmitting end driver through the library in the transmitting end kernel;

[0025] disconnecting the communication connection between the transmitting end and the channel in the non-transparent bridge through the fifth interface;

[0026] The channel is released by calling the sixth interface in the sending end driver through the library in the sending end kernel.

[0027] According to a second aspect of an embodiment of the present disclosure, a data transmission method is also provided, which is applied to a receiving end, and the method includes:

[0028] Applying for a user-state memory for receiving data according to a channel in a non-transparent bridge that establishes a communication connection with a sending end, wherein the channel in the non-transparent bridge and the sending end are established when the sending end calls data of an application program to a kernel of the sending end;

[0029] Receiving the data sent by the sending end through the channel;

[0030] The data is mapped into the user state memory.

[0031] Optionally, applying for a user-state memory for receiving data according to a channel for establishing a communication connection with the sending end in the non-transparent bridge includes:

[0032] According to the channel in the non-transparent bridge that establishes a communication connection with the sending end, calling the first interface in the receiving end driver through the library in the receiving end kernel;

[0033] Through the first interface, apply for a user state memory for receiving data.

[0034] According to a third aspect of an embodiment of the present disclosure, there is provided a data transmission device, applied to a transmitting end, comprising:

[0035] A calling module is configured to call the data of the application to the sending end kernel;

[0036] An establishing module is configured to establish a communication connection between the sending end and a channel in a non-transparent bridge through a library in the sending end kernel, so that the receiving end applies for a user state memory for receiving the data according to the channel;

[0037] The sending module is configured to send the data in the library in the sending end kernel to the receiving end through the channel, so that the receiving end maps the data into the user state memory.

[0038] According to a fourth aspect of an embodiment of the present disclosure, there is provided a data transmission device, applied to a receiving end, comprising:

[0039] an application module configured to apply for a user-state memory for receiving data according to a channel in a non-transparent bridge that establishes a communication connection with a sending end, wherein the channel in the non-transparent bridge and the sending end are established when the sending end calls data of an application program to a kernel of the sending end;

[0040] A receiving module, configured to receive the data sent by the sending end through the channel;

[0041] A mapping module is configured to map the data into the user state memory.

[0042] According to a fifth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data transmission method provided in the first aspect of the present disclosure are implemented.

[0043] According to a sixth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0044] a memory having a computer program stored thereon;

[0045] The processor is used to execute the computer program in the memory to implement the steps of the data transmission method provided in the first aspect of the present disclosure.

[0046] According to a seventh aspect of an embodiment of the present disclosure, a vehicle is provided, comprising:

[0047] processor;

[0048] a memory for storing processor-executable instructions;

[0049] Among them, the processor is configured to implement the steps of the data transmission method provided in the first aspect of the present disclosure when executing the executable instructions.

[0050] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0051] A communication connection is established between the sender and the channel in the non-transparent bridge through the library in the sender's memory, and data transmission between the sender and the receiver is realized through the channel, so that data transmission no longer needs to pass through the network protocol stack TCP / IP, and there is no need to establish communication between the application layer and TCP / IP through Socket, which effectively reduces the data transmission delay caused by TCP / IP, enhances the stability of data transmission, and thus effectively improves the efficiency of data transmission.

[0052] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0054] Figure 1 The present invention is a flowchart of a data transmission method based on a TCP / IP network protocol stack according to an exemplary embodiment.

[0055] Figure 2 The figure is a flow chart showing a data transmission method according to an exemplary embodiment.

[0056] Figure 3 The invention is a flow chart of a data transmission method at a sending end according to an exemplary embodiment.

[0057] Figure 4 It is a schematic diagram showing a transport layer driver according to an exemplary embodiment.

[0058] Figure 5 The invention is a schematic diagram of an interface of a sending end driver according to an exemplary embodiment.

[0059] Figure 6 The figure is a delay curve diagram of transmitting data according to an exemplary embodiment.

[0060] Figure 7 The figure is a flow chart showing a data transmission method according to an exemplary embodiment.

[0061] Figure 8 The figure is a block diagram of a data transmission device according to an exemplary embodiment.

[0062] Fig. 9 The figure is a block diagram of a data transmission device according to an exemplary embodiment.

[0063] Fig.10 The invention is a block diagram showing a device for data transmission according to an exemplary embodiment.

[0064] Fig.11 The invention is a block diagram showing a device for data transmission according to an exemplary embodiment.

[0065] Fig.12 is a block diagram of a vehicle according to an exemplary embodiment. DETAILED DESCRIPTION

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0067] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0068] Before introducing the data transmission method, device, medium, vehicle and electronic device provided by the present disclosure, the application scenarios of the present disclosure are first introduced.

[0069] In Linux, non-transparent bridges usually use the TCP / IP protocol stack for data transmission, see Figure 1 As shown, first, the application layer sends the data to the transport layer through the abstract layer, for example, the data is sent from the APP (Application) to TCP through the Socket, and the Socket is the intermediate abstract layer for the communication between the application layer and the protocol stack TCP / IP. The application layer can establish communication with TCP / IP based on the interface function of the Socket, thereby sending the data to the transport layer. The transport layer includes TCP (Transmission Control Protocol) and UDP (User Data Protocol), and then the data is passed to the network layer, and then the communication connection between the sender and the receiver is established through the IP address of the network layer and the protocol and port of the transport layer. After that, the data is sent to the transport layer driver (ntb_transport_driver) through the network driver (ntb_netdev_driver), and then sent to the PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) switch (PCIE switch) based on the transport layer hardware device (ntb_hw driver) and the DMA (Direct Memory Access) driver controller (dma controller driver). However, the current network protocol stack only supports a maximum of 64kMTU (Maximum Transmission Unit), so when sending large data packets, the process of unpacking and assembling packets will also be performed. When there are too many data packets, each packet has to go through the protocol stack, which greatly increases the delay of data packets. The large delay indirectly reduces the throughput of data transmission.

[0070] In view of this, in order to reduce the delay in data transmission, the present disclosure provides a data transmission method. Figure 2 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 2 As shown, the data transmission method is used in the sending end and includes the following steps.

[0071] In step S11, the data of the application is called to the sending end kernel.

[0072] In one implementation, data is first requested or constructed in the application program, and then the data is copied to the kernel through a system call.

[0073] It is worth mentioning that the Linux kernel is used to pass application-level requests to the hardware and acts as a low-level driver to address various devices and components in the system.

[0074] In step S12, a communication connection between the sending end and a channel in a non-transparent bridge is established through a library in the sending end kernel.

[0075] Wherein, establishing a communication connection between the sending end and the channel in the non-transparent bridge can enable the receiving end to apply for a user-state memory for receiving the data according to the channel.

[0076] In one embodiment, see Figure 3 As shown, a custom library, namely, C2C library, can be used to establish a communication connection between the sender and the non-transparent bridge, thereby eliminating the need to use Socket, thereby reducing the delay caused by the TCP / IP protocol stack.

[0077] It is worth noting that the library (C2C library) includes multiple pre-set call instructions (operations), each of which corresponds to a different interface, and each interface can be used to manage the memory, files, device drivers and networks in data transmission. Among them, the C2C interface corresponding to the C2C library (chip to chip library) can connect various chips that can share memory and resources.

[0078] In one embodiment, participating Figure 3 As shown, the sending end is the app, which first sends a control instruction to the sending end driver (C2C driver) through the library (C2C library), directly exposes the interface of NTB to the app, and then establishes a communication connection between the app and NTB, where NTB includes a transport layer driver (ntb_transport_driver) and a transport layer hardware device (ntb_hw driver).

[0079] In one embodiment, see Figure 4 As shown, the transport layer driver (ntb_transport_driver) in the non-transparent bridge includes multiple qp (queue pair), that is, channels, such as qp0, qp1, qp2, ..., qpn, wherein each qp includes data information of sending data and receiving data, and the data information includes data address, data length and data type.

[0080] Continuing to use the above embodiment for explanation, when the sending end establishes a communication connection with a channel in a non-transparent bridge, the receiving end can apply for a user-state memory for receiving the data according to the data information corresponding to the channel.

[0081] In step S13, the data in the library in the kernel of the sending end is sent to the receiving end through the channel.

[0082] Among them, sending the data in the library in the kernel of the sending end to the receiving end can enable the receiving end to map the data into the user state memory.

[0083] In one embodiment, participating Figure 3 As shown, the sending end is the app. First, the data to be transmitted in the app is copied to the C2C library through the system call, and the communication connection between the app and the qp in the ntb_transport_driver is established through the C2C library. Then, the data can be passed from the C2C library to the C2C driver, and then from the C2C driver to the ntb_transport_driver. Finally, based on the PCIE switch HW, the data is transmitted to the receiving end through the qp corresponding to the data in the ntb_transport_driver, the ntb_hw driver in NTB, and the DMA (Direct Memory Access) controller (dma_controller driver).

[0084] It is worth noting that the sending end and the receiving end can be a host, a system, and a chip.

[0085] Through the above method, the following technical effects can be achieved:

[0086] A communication connection is established between the sender and the channel in the non-transparent bridge through the library in the sender's memory, and data transmission between the sender and the receiver is realized through the channel, so that data transmission no longer needs to pass through the network protocol stack TCP / IP, and there is no need to establish communication between the application layer and TCP / IP through Socket, which effectively reduces the data transmission delay caused by TCP / IP, enhances the stability of data transmission, and thus effectively improves the efficiency of data transmission.

[0087] Optionally, establishing a communication connection between the sending end and a channel in a non-transparent bridge through a library in a kernel of the sending end includes:

[0088] The first interface in the sending end driver is called through the library in the sending end kernel.

[0089] In one embodiment, see Figure 5 As shown, there are multiple pre-configured call instructions in the library in the sending end kernel, each call instruction corresponds to an interface of the sending end driver, for example, the first call instruction is operation10, and the first interface corresponding to the first call instruction is alloc_qp, wherein the alloc_qp interface is used to apply for qp.

[0090] A communication connection is established between the sending end and the channel in the non-transparent bridge through the first interface.

[0091] In one implementation, the C2C driver may apply to the non-transparent bridge for the qp corresponding to the data to be sent through the first interface alloc_qp, thereby establishing a communication connection between the sender and the qp corresponding to the data, so that data transmission no longer needs to pass through the network protocol stack TCP / IP, and there is no need to establish communication between the application layer and TCP / IP through Socket, which effectively reduces the delay caused by TCP / IP.

[0092] Optionally, establishing a communication connection between the sending end and a channel in the non-transparent bridge through the first interface includes:

[0093] First, through the first interface, apply to the non-transparent bridge for a channel matching the data.

[0094] In one embodiment, the sending end is an app, and the C2C driver can apply to the non-transparent bridge for a qp corresponding to the data to be sent through the first interface alloc_qp. For example, if the qp corresponding to the data to be sent is qp0, a communication connection is established between the app and qp0.

[0095] Then, in the case that the channel application is successful, the library in the kernel of the sending end calls the second interface to determine whether the receiving end is online.

[0096] Continuing to use the above embodiment for explanation, when the channel qp0 corresponding to the data is successfully applied, it is also necessary to determine whether the opposite end device, that is, the receiving end is online, and then the second call instruction can be sent to the sending end driver through the library in the sending end kernel, see Figure 5 As shown, the second calling instruction in the C2C library is operation 11, and the second calling instruction corresponds to the second interface in the C2C driver. The second interface is connect_to_qp, and the second interface is used to determine whether the other end is online and exchange status information with the receiving end.

[0097] In one embodiment, each PCIE has its own transmission logic TX (Transport) and receiving logic RX (Receive), and then can identify whether the opposite device exists or works normally by determining the state of the opposite receiving logic Rx through a part of the transmission logic TX. For example, based on the receiver detection principle (ReceiverDetect), by detecting the DC (Direct Current) common mode input impedance of the opposite device receiving logic Rx, it can be determined whether the receiving end is online.

[0098] Finally, when the receiving end is online, a communication connection is established between the sending end and the channel in the non-transparent bridge.

[0099] In one implementation, when the receiving end is online, a communication connection is established between the sending end and the qp corresponding to the data in the NTB, and when the receiving end is offline, information transmission is stopped.

[0100] Through the above method, the efficiency of data transmission is effectively improved and the delay of data transmission is reduced.

[0101] Optionally, sending the data in the library in the kernel of the sending end to the receiving end through the channel includes:

[0102] The first step is to call the third interface in the sending end driver through the library in the sending end kernel.

[0103] In one implementation, the C2C library sends a third call instruction operation12 to the C2C driver, and the third call instruction calls the third interface in the sending end driver. Figure 4 As shown, the third interface is sengMsg, and the third interface is used to send data.

[0104] The second step is to call the data in the library in the sending end kernel to the sending end driver through the third interface.

[0105] In one embodiment, see Figure 3 As shown, through the third interface sengMsg, the data in the C2C library is called to the C2C driver.

[0106] The third step is to transmit the data to the channel through the sending end driver.

[0107] Continuing to use the above embodiment for explanation, after the data is called to the C2C driver, the data is transferred to the channel corresponding to the non-transparent bridge through the C2C driver, that is, the qp corresponding to the data in the ntb_transport_driver.

[0108] The data in the channel is sent to the receiving end.

[0109] In one embodiment, Figure 6 is a delay curve diagram of a transmission data according to an exemplary embodiment. Figure 6 As shown in the TCP / TP curve, the latency of each 64k data packet passing through the TCP / IP network protocol stack at different timestamps is 142us (microsecond), 354us, 692us, 1030us, ..., 5031us. It can be seen that the average latency of each 64k data packet is 150us, and the jitter is large. On the other hand, the TX callback latency curve using the C2C library has an average latency of 50us, and the latency is controllable and is not affected by the TCP / IP network protocol stack. Among them, the MTU of PCIETX latency disassembly is 64k, 270MB / s.

[0110] Optionally, sending the data in the channel to the receiving end includes:

[0111] The fourth interface in the sending end driver is called through the library in the sending end kernel.

[0112] In one embodiment, see Figure 5 As shown, a fourth calling instruction operation 13 is sent to the C2C driver through the C2C library. The corresponding interface of operation 13 in the C2C driver is the fourth interface register_dma_buffer_to_qp. The fourth interface is used to call the DMA controller.

[0113] According to the fourth interface, a DMA controller is called to send the data in the channel to the receiving end.

[0114] It is worth mentioning that data can be written directly to the memory through the DMA controller, and there is no need to read the data into the cache, which effectively reduces the time cost of the CPU when processing large amounts of data transmission and increases data transmission efficiency.

[0115] Optionally, the method further comprises:

[0116] When the data transmission is completed, the fifth interface in the transmitting end driver is called through the library in the transmitting end kernel.

[0117] In one embodiment, see Figure 5 As shown, the fifth call instruction operation 14 is sent to the C2C driver through the C2C library. The corresponding interface of operation 14 in the C2C driver is the fifth interface disconnect_to_qp.

[0118] The communication connection between the sending end and the channel in the non-transparent bridge is disconnected through the fifth interface.

[0119] In one embodiment, the communication connection between the sending end and the channel in the non-transparent bridge can be disconnected through the fifth interface disconnect_to_qp, that is, the communication connection between the application and qp can be disconnected.

[0120] The sixth calling instruction sent by the library in the sending end kernel calls the sixth interface in the sending end driver to release the channel.

[0121] In one embodiment, see Figure 5 As shown, a sixth call instruction operation 15 is sent to the C2C driver through the C2C library. The corresponding interface of operation 15 in the C2C driver is the sixth interface release_to_qp. The channel can be released through the sixth interface release_to_qp. For example, data is transmitted through qp0. After the communication connection between qp0 and the app is disconnected, qp is released through the sixth interface.

[0122] In another implementation, the memory may also be released through the sixth interface. For example, the receiving end may release the memory used for mapping the received data through the sixth interface.

[0123] Figure 7 is a flow chart of a data transmission method according to an exemplary embodiment. Figure 7 As shown, the data transmission method is used in a receiving end and includes the following steps.

[0124] In step S21, a user state memory for receiving data is applied for according to a channel in a non-transparent bridge that establishes a communication connection with a sending end.

[0125] The channel in the non-transparent bridge and the sending end are established when the sending end calls the data of the application program to the sending end kernel.

[0126] In one embodiment, when the sending end establishes a communication connection with the non-transparent bridge through the first interface, the receiving end can apply for user-mode memory for receiving the data based on the data information in the qp communicated with the sending end, such as the data address and data length.

[0127] In step S22, the data sent by the sending end through the channel is received.

[0128] In one implementation, after applying for a user-mode memory for receiving data, the receiving end receives the data sent by the sending end, wherein the data is transmitted based on the qp corresponding to the data and the PCIE switch.

[0129] In step S23, the data is mapped into the user state memory.

[0130] In one implementation, the received data is mapped to user-mode memory via mmap (memory map), that is, virtual memory space is mapped to a page cache of data, so that the application layer can read and write data by reading and writing the mapped area memory.

[0131] Optionally, applying for a user-state memory for receiving data according to a channel for establishing a communication connection with the sending end in the non-transparent bridge includes:

[0132] According to the channel in the non-transparent bridge that establishes a communication connection with the sending end, the first interface in the receiving end driver is called through the library in the receiving end kernel.

[0133] Through the first interface, apply for a user state memory for receiving data.

[0134] In one embodiment, a first interface alloc qp in a receiving end driver is called through a library call instruction in a receiving end kernel, and a user state memory for receiving data is applied for through the first interface alloc qp and data information in the qp corresponding to the transmission data.

[0135] Figure 8 1 is a block diagram of a data transmission device 100 according to an exemplary embodiment. Figure 8 The data transmission device 100 is applied to the sending end, and includes a calling module 101, an establishing module 102 and a sending module 103.

[0136] The calling module 101 is configured to call the data of the application program to the sending end kernel;

[0137] The establishing module 102 is configured to establish a communication connection between the sending end and a channel in the non-transparent bridge through a library in the sending end kernel, so that the receiving end applies for a user state memory for receiving the data according to the channel;

[0138] The sending module 103 is configured to send the data in the library in the sending end kernel to the receiving end through the channel, so that the receiving end maps the data into the user state memory.

[0139] Optionally, the establishing module 102 is configured to:

[0140] The first interface in the sending end driver is called through the library in the sending end kernel.

[0141] A communication connection is established between the sending end and the channel in the non-transparent bridge through the first interface.

[0142] Optionally, the establishing module 102 is configured to:

[0143] Through the first interface, apply to the non-transparent bridge for a channel matching the data.

[0144] In the case where the channel application is successful, the library in the kernel of the sending end calls the second interface to determine whether the receiving end is online.

[0145] When the receiving end is online, a communication connection is established between the sending end and the channel in the non-transparent bridge.

[0146] Optionally, the sending module 103 is configured to:

[0147] The third interface in the sending end driver is called through the library in the sending end kernel.

[0148] The data in the library in the sending end kernel is called to the sending end driver through the third interface.

[0149] The data is transmitted to the channel through the sending end driver.

[0150] The data in the channel is sent to the receiving end.

[0151] Optionally, the sending module 103 is configured to:

[0152] The fourth interface in the sending end driver is called through the library in the sending end kernel.

[0153] According to the fourth interface, a DMA controller is called to send the data in the channel to the receiving end.

[0154] Optionally, the sending module 103 is configured to:

[0155] When the data transmission is completed, the fifth interface in the transmitting end driver is called through the library in the transmitting end kernel.

[0156] The communication connection between the sending end and the channel in the non-transparent bridge is disconnected through the fifth interface.

[0157] The channel is released by calling the sixth interface in the sending end driver through the library in the sending end kernel.

[0158] Fig. 9 2 is a block diagram of a data transmission device 200 according to an exemplary embodiment. Fig. 9 The data transmission device 200 is applied to a receiving end, and includes an application module 201, a receiving module 202 and a mapping module 203.

[0159] The application module is configured to apply for user-mode memory for receiving data according to a channel in a non-transparent bridge that establishes a communication connection with a sending end, wherein the channel in the non-transparent bridge and the sending end are established when the sending end calls the data of the application to the sending end kernel.

[0160] The receiving module is configured to receive the data sent by the sending end through the channel.

[0161] A mapping module is configured to map the data into the user state memory.

[0162] Optionally, the application module 201 is configured to:

[0163] According to the channel in the non-transparent bridge that establishes a communication connection with the sending end, the first interface in the receiving end driver is called through the library in the receiving end kernel.

[0164] Through the first interface, apply for a user state memory for receiving data.

[0165] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0166] The present disclosure also provides an electronic device, comprising:

[0167] a memory having a computer program stored thereon;

[0168] A processor is used to execute the computer program in the memory to implement the steps of the data transmission method provided by the present disclosure.

[0169] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the data transmission method provided by the present disclosure are implemented.

[0170] Fig.10 8 is a block diagram of an apparatus 800 for data transmission according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0171] Reference Fig.10 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .

[0172] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned data transmission method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0173] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0174] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.

[0175] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0176] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0177] The input / output interface 812 provides an interface between the processing component 802 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0178] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0179] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0180] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned data transmission method.

[0181] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the above data transmission method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0182] In another exemplary embodiment, a computer program product is also provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned data transmission method when executed by the programmable device.

[0183] Fig.11 1 is a block diagram of a device 1900 for data transmission according to an exemplary embodiment. For example, the device 1900 may be provided as a server. Fig.11 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the steps of the above-mentioned data transmission method.

[0184] The device 1900 may also include a power supply component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input / output interface 1958. The device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or similar.

[0185] Fig.12 6 is a block diagram of a vehicle 600 according to an exemplary embodiment. For example, the vehicle 600 may be a hybrid vehicle, a non-hybrid vehicle, an electric vehicle, a fuel cell vehicle, or other types of vehicles. The vehicle 600 may be an autonomous vehicle, a semi-autonomous vehicle, or a non-autonomous vehicle.

[0186] Reference Fig.12 , the vehicle 600 may include various subsystems, for example, an infotainment system 610, a perception system 620, a decision control system 630, a drive system 640, and a computing platform 650. The vehicle 600 may also include more or fewer subsystems, and each subsystem may include multiple components. In addition, each subsystem and each component of the vehicle 600 may be interconnected by wire or wireless means.

[0187] In some embodiments, the infotainment system 610 may include a communication system, an entertainment system, and a navigation system, among others.

[0188] The perception system 620 may include several sensors for sensing information about the environment around the vehicle 600. For example, the perception system 620 may include a global positioning system (the global positioning system may be a GPS system, or a Beidou system or other positioning systems), an inertial measurement unit (IMU), a laser radar, a millimeter wave radar, an ultrasonic radar, and a camera.

[0189] The decision control system 630 may include a computing system, a vehicle controller, a steering system, a throttle, and a braking system.

[0190] The drive system 640 may include components that provide powered motion for the vehicle 600. In one embodiment, the drive system 640 may include an engine, an energy source, a transmission system, and wheels. The engine may be one or a combination of an internal combustion engine, an electric motor, and an air compression engine. The engine is capable of converting energy provided by the energy source into mechanical energy.

[0191] Some or all functions of the vehicle 600 are controlled by a computing platform 650. The computing platform 650 may include at least one processor 651 and a memory 652, and the processor 651 may execute instructions 653 stored in the memory 652.

[0192] The processor 651 may be any conventional processor, such as a commercially available CPU. The processor may also include a graphics processor (Graphic Process Unit, GPU), a field programmable gate array (Field Programmable Gate Array, FPGA), a system on chip (System on Chip, SOC), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or a combination thereof.

[0193] The memory 652 may be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0194] In addition to the instructions 653 , the memory 652 may also store data, such as road maps, route information, and data such as the location, direction, and speed of the vehicle. The data stored in the memory 652 may be used by the computing platform 650 .

[0195] In the embodiment of the present disclosure, the processor 651 can execute instruction 653 to complete all or part of the steps of the above-mentioned vehicle control method.

[0196] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0197] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A data transmission method, characterized in that: Applied to the sending end, the method includes: Call the application's data to the sending kernel; A communication connection is established between the sending end and a channel in a non-transparent bridge through a library in the sending end kernel, so that the receiving end applies for a user-mode memory for receiving the data according to the channel. The non-transparent bridge includes a transport layer driver and a transport layer hardware device. The library includes a plurality of pre-set call instructions, each of which corresponds to a different interface. The interface is used to manage at least one of a memory, a file, a device driver, and a network in data transmission. The communication connection is established between the sending end and the channel in the non-transparent bridge through the library in the sending end kernel by sending a control instruction to the sending end driver through the library to directly expose the interface of the non-transparent bridge to the application. The channel is a plurality of queue matching qp included in the transport layer driver in the non-transparent bridge. The library is a chip-to-chip library, and the sending end driver is a chip-to-chip driver. The data in the library in the kernel of the sending end is sent to the receiving end through the channel, so that the receiving end maps the data into the user state memory.

2. The method according to claim 1, characterized in that The step of establishing a communication connection between the sending end and a channel in a non-transparent bridge through a library in the sending end kernel includes: Calling a first interface in the sending end driver through a library in the sending end kernel; A communication connection is established between the sending end and the channel in the non-transparent bridge through the first interface.

3. The method according to claim 2, characterized in that The establishing of a communication connection between the transmitting end and the channel in the non-transparent bridge through the first interface includes: Applying for a channel matching the data from the non-transparent bridge through the first interface; In the case where the channel application is successful, calling a second interface through a library in the kernel of the sending end to determine whether the receiving end is online; When the receiving end is online, a communication connection is established between the sending end and the channel in the non-transparent bridge.

4. The method according to claim 1, characterized in that: The step of sending the data in the library in the kernel of the sending end to the receiving end through the channel includes: Calling a third interface in the sending end driver through a library in the sending end kernel; calling the data in the library in the sending end kernel to the sending end driver through the third interface; Transmitting the data to the channel through the sending end driver; The data in the channel is sent to the receiving end.

5. The method according to claim 4, characterized in that The sending the data in the channel to the receiving end includes: Calling a fourth interface in the sending end driver through a library in the sending end kernel; According to the fourth interface, a DMA controller is called to send the data in the channel to the receiving end.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: When the data transmission is completed, calling the fifth interface in the transmitting end driver through the library in the transmitting end kernel; Disconnecting the communication connection between the transmitting end and the channel in the non-transparent bridge through the fifth interface; The channel is released by calling the sixth interface in the sending end driver through the library in the sending end kernel.

7. A data transmission method, characterized in that: Applied to the receiving end, the method includes: According to the channel in the non-transparent bridge that establishes a communication connection with the sending end, apply for user-mode memory for receiving data, the non-transparent bridge includes a transport layer driver and a transport layer hardware device, wherein the channel in the non-transparent bridge that is connected to the sending end for communication is established by sending a control instruction to the sending end driver through a library in the sending end kernel when the sending end calls the data of the application to the sending end kernel, so as to directly expose the interface of the non-transparent bridge to the application, the channel is a plurality of queue matching qp included in the transport layer driver in the non-transparent bridge, the library includes a plurality of pre-set calling instructions, each of the calling instructions corresponds to a different interface, the interface is used to manage at least one of the memory, file, device driver and network in data transmission, the library is a chip-to-chip library, and the sending end driver is a chip-to-chip driver; Receiving the data sent by the sending end through the channel; The data is mapped into the user state memory.

8. The method according to claim 7, characterized in that The step of applying for a user-state memory for receiving data according to a channel in the non-transparent bridge that establishes a communication connection with the sending end includes: According to the channel in the non-transparent bridge that establishes a communication connection with the sending end, calling the first interface in the receiving end driver through the library in the receiving end kernel; Through the first interface, apply for a user state memory for receiving data.

9. A data transmission device, characterized in that: Applied to the sending end, including: A calling module is configured to call the data of the application to the sending end kernel; An establishment module is configured to establish a communication connection between the sender and a channel in a non-transparent bridge through a library in the sender kernel, so that the receiving end applies for a user-mode memory for receiving the data according to the channel. The non-transparent bridge includes a transport layer driver and a transport layer hardware device. The library includes a plurality of pre-set call instructions, each of which corresponds to a different interface. The interface is used to manage at least one of a memory, a file, a device driver, and a network in data transmission. The communication connection between the sender and the channel in the non-transparent bridge is established through the library in the sender kernel by sending a control instruction to the sender driver through the library to directly expose the interface of the non-transparent bridge to the application. The channel is a plurality of queue matching qp included in the transport layer driver in the non-transparent bridge. The library is a chip-to-chip library, and the sender driver is a chip-to-chip driver. The sending module is configured to send the data in the library in the sending end kernel to the receiving end through the channel, so that the receiving end maps the data into the user state memory.

10. A data transmission device, characterized in that: Applied to the receiving end, including: An application module is configured to apply for user-mode memory for receiving data according to a channel in a non-transparent bridge that establishes a communication connection with a sending end, wherein the non-transparent bridge includes a transport layer driver and a transport layer hardware device, wherein the channel in the non-transparent bridge that is connected to the sending end for communication is established by sending a control instruction to the sending end driver through a library in the sending end kernel when the sending end calls the data of the application to the sending end kernel, so as to directly expose the interface of the non-transparent bridge to the application, the channel is a plurality of queue matching qp included in the transport layer driver in the non-transparent bridge, the library includes a plurality of pre-set calling instructions, each of the calling instructions corresponds to a different interface, the interface is used to manage at least one of the memory, file, device driver and network in data transmission, the library is a chip-to-chip library, and the sending end driver is a chip-to-chip driver; A receiving module, configured to receive the data sent by the sending end through the channel; A mapping module is configured to map the data into the user state memory.

11. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented.

12. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 8.

13. A vehicle, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the steps of the method described in any one of claims 1-8 when executing the executable instructions.

Citation Information

Patent Citations

  • High-speed capturing method of bottom-layer data packet based on Linux

    CN101841470A

  • Direct writing window mode-based non-transparent bridge reading / writing method and apparatus

    CN106951378A