Communication method, device, computer equipment and readable storage medium based on PCIE

By establishing a mapping relationship between hardware queues and virtual channels on the host side, data communication between PCIE endpoint devices and upper-layer function drivers is directly realized, which solves the problem that traditional driving methods are difficult to meet the high-speed requirements of 5G communication products, and achieves high speed and large bandwidth. and low-latency data transmission effects.

CN114416630BActive Publication Date: 2024-09-06FIBOCOM WIRELESS SOFTWARE INC
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202111603304.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2024-09-06
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

Existing technologies are difficult to meet the high-speed, large-bandwidth and low-latency requirements of 5G communication products on computer equipment. Traditional driving methods are difficult to achieve high-performance data transmission in the new generation of 5G communications.

Method used

Establish the mapping relationship between the hardware queue and the virtual channel on the host side through the PCIE driver, mount the upper-layer function driver and allocate the virtual channel, so that the upper-layer function driver can directly communicate with the PCIE endpoint device and avoid emulating the PCIE device as a USB device. Enable efficient data transfer.

Benefits of technology

It achieves high-speed, large-bandwidth and low-latency data transmission of 5G products on computer equipment, meets the high-performance requirements of 5G products, and reduces the workload of driver certification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416630B
    Figure CN114416630B
Patent Text Reader

Abstract

The present application relates to a communication method, device, computer equipment and readable storage medium based on PCIE. The method includes: if the host side identifies the PCIE endpoint device, the PCIE driver establishes a first mapping relationship between the queue number of the hardware queue and the channel number of the virtual channel; the hardware queue is the hardware access channel of the PCIE endpoint device; the PCIE driver mounts each upper-layer function driver and allocates a corresponding virtual channel to each upper-layer function driver, so that the upper-layer function driver sends the first service data through the corresponding virtual channel; when the PCIE driver receives the first service data, it determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first service data to the hardware queue corresponding to the first target queue number; the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first service data. The use of this method can enable 5G products to achieve high-speed effects on computer equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a communication method, apparatus, computer equipment and readable storage medium based on PCIE. Background Art

[0002] At present, in WWAN (Wireless Wide Area Network) products, multiple function drivers are configured on the host side. In order to realize the communication between each function driver and PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard) endpoint device, the existing technology will configure the UDE (USB Device Emulation) driver on the host side to simulate the PCIE device into a USB (Universal Serial Bus) device, and then provide ports to mount Microsoft's MBIM (Mobile Broadband Interface Model), ACM and other drivers, as well as mount the written GNSS (Global Navigation Satellite System) driver, thereby supporting various services required by WWAN products.

[0003] However, under the requirements of the new generation of 5G communications, traditional driving methods have been unable to meet the high-speed requirements of high-performance products. Summary of the invention

[0004] Based on this, it is necessary to provide a PCIE-based communication method, device, computer equipment and readable storage medium to address the above technical problems, which can complete data communication between the host side and the PCIE endpoint device through PCIE, so that 5G products can achieve high speed, large bandwidth and low latency on computer equipment.

[0005] In a first aspect, the present application provides a communication method based on PCIE. The method is applied to a host side, the host side is configured with an upper layer function driver and a kernel driver, and the kernel driver includes a PCIE driver. The method includes:

[0006] If the host side identifies a PCIE endpoint device, the PCIE driver establishes a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel; wherein the hardware queue is a hardware access channel of the PCIE endpoint device;

[0007] The PCIE driver mounts each of the upper-layer function drivers and allocates a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel;

[0008] When receiving the first business data, the PCIE driver determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0009] In one embodiment, the kernel driver also includes a network adapter driver. The method also includes:

[0010] The PCIE driver mounts the network adapter driver and allocates a corresponding virtual channel to the network adapter driver, so that the network adapter driver sends the second service data through the corresponding virtual channel;

[0011] When receiving the second business data, the PCIE driver determines the second target queue number corresponding to the second target channel number from the first mapping relationship, and sends the second business data to the hardware queue corresponding to the second target queue number; wherein the second target channel number is the channel number of the virtual channel corresponding to the network adapter driver.

[0012] In one embodiment, the method further includes: the network adapter driver calls a preset function interface to send the second service data to the PCIE driver;

[0013] The preset function interface is a function interface generated according to the universal unique identification code of the PCIE driver and the universal unique identification code of the network adapter driver.

[0014] In one embodiment, the second service data includes sending IP data and sending MBIM protocol data. The step of the network adapter driver calling the preset function interface to send the second service data to the PCIE driver includes:

[0015] The network adapter driver calls the preset function interface to send the sent IP data to the PCIE driver;

[0016] The network adapter driver generates a data write request according to the second target channel number and the sent MBIM protocol data, and sends the data write request to the PCIE driver to send the sent MBIM protocol data to the PCIE driver.

[0017] In one of the embodiments, the method also includes: when the PCIE driver obtains the first return data sent by the PCIE endpoint device, calling a preset function interface to send the first return data to the network adapter driver; wherein the preset function interface is a function interface generated according to the universal unique identification code of the PCIE driver and the universal unique identification code of the network adapter driver.

[0018] In one embodiment, the first return data is return IP data or return MBIM protocol data. The step of the PCIE driver calling a preset function interface to send the second service data to the network adapter driver includes:

[0019] If the first return data is the return IP data, the PCIE driver calls the preset function interface to send the return IP data to the network adapter driver;

[0020] If the first returned data is the returned MBIM data, the PCIE driver writes the returned MBIM data into a corresponding memory queue;

[0021] When receiving the data read request sent by the network adapter driver, the PCIE driver sends the returned MBIM data to the network adapter driver.

[0022] In one embodiment, the step of mounting each of the upper-layer function drivers by the PCIE driver and allocating a corresponding virtual channel to each of the upper-layer function drivers comprises:

[0023] The PCIE driver generates child nodes; the number of the child nodes is determined according to the number of upper-layer function drivers;

[0024] The PCIE driver mounts each of the upper-layer function drivers through the sub-nodes; wherein different upper-layer function drivers correspond to different sub-nodes;

[0025] The PCIE driver allocates a corresponding virtual channel to each of the upper-layer function drivers, and establishes a second mapping relationship between the subnode and the channel number of the virtual channel;

[0026] Before the step of determining the first target queue number corresponding to the first target channel number from the first mapping relationship, the method further includes:

[0027] The PCIE driver determines the first target channel number from the second mapping relationship according to the subnode corresponding to the upper layer function driver that sends the first service data.

[0028] In one of the embodiments, the method further includes: the PCIE driver obtains the working mode of the host side, and derives the corresponding child node according to the working mode.

[0029] In one of the embodiments, the step of sending the first business data into the hardware queue corresponding to the first target queue number includes: the PCIE driver generates a data packet according to the first target channel number and the first business data, and sends the data packet into the hardware queue corresponding to the first target queue number.

[0030] In one embodiment, the method further comprises:

[0031] The PCIE driver determines a target upper layer function driver corresponding to the second return data when acquiring the second return data sent by the PCIE endpoint device;

[0032] The PCIE driver writes the second return data into a memory queue corresponding to the target upper-layer function driver, and sends the second return data to the target upper-layer function driver upon receiving a data read request sent by the target upper-layer function driver.

[0033] In a second aspect, the present application also provides a PCIE-based communication device. The device includes a kernel driver configured on a host side, the kernel driver includes a PCIE driver, and the host side is also configured with an upper layer function driver. The PCIE driver includes:

[0034] A first mapping relationship establishing module, configured to establish a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel when the host side identifies a PCIE endpoint device; wherein the hardware queue is a hardware access channel of the PCIE endpoint device;

[0035] an allocation module, used for mounting each of the upper-layer function drivers and allocating a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel;

[0036] A business data writing module is used to determine the first target queue number corresponding to the first target channel number from the first mapping relationship when the first business data is received, and send the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0037] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0038] If the host side identifies a PCIE endpoint device, the PCIE driver establishes a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel; wherein the hardware queue is a hardware access channel of the PCIE endpoint device;

[0039] The PCIE driver mounts each of the upper-layer function drivers and allocates a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel;

[0040] When receiving the first business data, the PCIE driver determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0041] In one of the embodiments, the computer device further includes a PCIE endpoint device, and the PCIE endpoint device is connected to the processor via a PCIE bus.

[0042] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0043] If the host side identifies a PCIE endpoint device, the PCIE driver establishes a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel; wherein the hardware queue is a hardware access channel of the PCIE endpoint device;

[0044] The PCIE driver mounts each of the upper-layer function drivers and allocates a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel;

[0045] When receiving the first business data, the PCIE driver determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0046] In the above-mentioned communication method, device, computer equipment and readable storage medium based on PCIE, when the host side is connected to the PCIE endpoint device, the PCIE driver on the host side maps multiple hardware queues of the PCIE endpoint device to multiple virtual channels, and establishes a first mapping relationship between the queue number of the hardware queue and the channel number of the virtual channel. The PCIE driver can directly mount each upper-layer function driver, and allocate a corresponding virtual channel to the mounted upper-layer function driver for use by the upper-layer function driver, and the upper-layer function driver can send the first business data to the PCIE driver through the corresponding virtual channel. When the first business data is received, the PCIE driver determines the hardware queue number corresponding to the upper-layer driver that sends the first business data from the first mapping relationship, that is, the first target queue number, and sends the first business data to the hardware queue corresponding to the first target queue number. In the present application, each upper-layer function driver can directly realize data communication with the PCIE endpoint device through the PCIE driver, without simulating the PCIE device as a USB device. In this way, data communication between the host side and the PCIE endpoint device can be completed through the PCIE method, thereby improving the transmission rate, so that 5G products can achieve high speed, large bandwidth, and low latency on computer devices, meeting the rate requirements of 5G products. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 FIG. 1 is an application environment diagram of a communication method based on PCIE in an embodiment;

[0048] Figure 2 One of the flowcharts of a communication method based on PCIE in one embodiment;

[0049] Figure 3 FIG2 is a second flow chart of a communication method based on PCIE in an embodiment;

[0050] Figure 4 It is a flowchart of a step of a network adapter driver sending second service data in one embodiment;

[0051] Figure 5 A schematic diagram of a flow chart of a step in which a PCIE driver sends first return data in an embodiment;

[0052] Figure 6 It is a flowchart of the steps of a PCIE driver mounting an upper-layer function driver in one embodiment;

[0053] Figure 7 A diagram of the software architecture of the host side of the present application in one embodiment;

[0054] Figure 8 is a structural block diagram of a communication device based on PCIE in one embodiment;

[0055] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0057] In the Windows driver of existing WWAN products, although it is a PCIE device, the host side will simulate the PCIE device as a USB device through the UDE driver, and perform data communication through the virtual USB device. Use the mature technology of USB to complete the MBIM communication, data transmission and power management of WWAN products. However, under the requirements of the new generation of 5G communications, USB-based communications have been unable to meet the high-speed, low-latency and large-bandwidth requirements of high-performance products. Therefore, other methods are needed to achieve this.

[0058] At the same time, in the Windows drivers of existing products (such as the Windows drivers of 4GWWAN products), the MBIM driver built into the Microsoft system is mostly used to implement the transmission of MBIM data, without the need for independent development. However, in Windows' latest 5G architecture, Microsoft designed the NetAdapterCx architecture, which only provides interface methods and interface adaptation, but does not provide a mature MBIM driver that can be used directly. For IHV (Independent Hardware Vendor), it must develop corresponding drivers in accordance with Microsoft's driver architecture requirements.

[0059] To solve the above problems, the present application provides a communication method, device, computer equipment and readable storage medium based on PCIE. Among them, the PCIE driver mounts each upper-layer function driver respectively, and maps multiple hardware channels of the PCIE endpoint device to multiple virtual channels for use by each upper-layer function driver. Each upper-layer function driver can directly realize data communication with the PCIE endpoint device through the PCIE driver without simulating the PCIE device as a USB device. In this way, data communication between the host side and the PCIE endpoint device can be completed through the PCIE method, thereby improving the transmission rate, so that 5G products can achieve high speed, large bandwidth, and low latency on computer equipment, meeting the rate requirements of 5G products.

[0060] In some embodiments, the present application is also adapted to the NetAdapterCx framework of Microsoft 5G, and the network adapter driver (i.e., NetAdapter driver) is set separately from the PCIE driver, so that the hardware processing logic and the business logic are layered. The main hardware logic is implemented through the PCIE driver, thereby reducing the workload of driving Microsoft certification.

[0061] The PCIE-based communication method provided in this application can be applied to Figure 1 The computer device shown in the figure can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0062] The computer device can be divided into a host side 102 and a PCIE endpoint device 104. The host side 102 is a part for configuring and running upper-layer function drivers and kernel drivers. In the architecture of the computer system, it can be divided into a user layer, a kernel layer, and a hardware layer. The upper-layer function driver refers to a function driver located in the user layer, and the kernel driver refers to a function driver located in the kernel layer, and the kernel driver may include a PCIE driver.

[0063] The host side 102 can be connected to the PCIE endpoint device 104 through a PCIE interface and / or a PCIE bus. It can be understood that the device type of the PCIE endpoint device 104 can be determined according to actual conditions, and this application does not impose specific restrictions on this. It only needs to be connected to the host side 102 through a PCIE interface and / or a PCIE bus. In some of the following embodiments, this application takes the PCIE endpoint device 104 as a 5G communication module as an example for explanation.

[0064] In one embodiment, Figure 2 As shown, a communication method based on PCIE is provided, and the method is applied to Figure 2 The host side in the example is used for explanation. It includes the following steps:

[0065] S202, if the host side identifies the PCIE endpoint device, the PCIE driver establishes a first mapping relationship between the queue number of the hardware queue and the channel number of the virtual channel; wherein the hardware queue is a hardware access channel of the PCIE endpoint device.

[0066] Among them, the PCIE endpoint device will set a certain number of hardware access channels, which are the "hardware queues" involved in each embodiment. It can be understood that the specific device type of the hardware queue can be determined based on the specific hardware structure of the PCIE endpoint device, and this application does not impose specific restrictions on this. In one example, the hardware queue can be a storage device. For each hardware queue, it has a unique queue number for identification, so that each hardware queue can be distinguished by the queue number.

[0067] Specifically, when the host side is connected to the PCIE endpoint device, the host side can recognize the access of the PCIE endpoint device. The PCIE driver maps each hardware queue to a different virtual channel, and establishes a first mapping relationship between the queue number of the hardware queue and the channel number of the virtual channel. Further, the specific setting number of the virtual channel can be determined according to the number of business data, and the present application does not impose specific restrictions on this. In one embodiment, the queue number of the same hardware queue may correspond to the channel number of a virtual channel, that is, the hardware queue and the virtual channel are in a one-to-one correspondence. In another embodiment, the queue number of the same hardware queue may correspond to the channel number of multiple different virtual channels, that is, the hardware queue and the virtual channel are in a one-to-many correspondence. In this way, when the number of business data exceeds the number of queues of the hardware queue, multiple types of business data can be sent to the same hardware queue to further achieve high efficiency, large bandwidth and low latency.

[0068] In one embodiment, the PCIE driver can map the hardware queue to two types of virtual channels to construct a data path and a control path. The data path is a path for transmitting communication data, and the control path is a path for transmitting control messages. The data path and the control path each include their own sending and receiving hardware queues to realize the sending and receiving of communication data and control messages.

[0069] S204, the PCIE driver mounts each upper-layer function driver and allocates a corresponding virtual channel to each upper-layer function driver, so that the upper-layer function driver sends the first service data through the corresponding virtual channel.

[0070] The upper-layer function driver includes but is not limited to GNSS driver, burning driver, COM port driver (which can realize AT command, FLASH, log capture and Coredump export functions), etc. The first service data refers to the service data sent by the upper-layer function driver, which can be but is not limited to IP (Internet Protocol) data and control messages.

[0071] Specifically, the PCIE driver can mount each upper-layer function driver separately and allocate a corresponding virtual channel to each upper-layer function driver, so that the upper-layer function driver can be mapped to the underlying virtual channel and realize data transmission through the allocated virtual channel. If a certain upper-layer function driver needs to send corresponding service data to the PCIE endpoint device, the upper-layer function driver can send the first service data to the PCIE driver through its corresponding virtual channel, and the PCIE driver will send the first service data to the PCIE endpoint device after subsequent processing.

[0072] In one embodiment, each upper layer function driver may correspond to a different virtual channel. In another embodiment, each upper layer function driver may correspond to multiple virtual channels. For example, the same upper layer function driver may correspond to two virtual channels, one of which is used to transmit communication data and the other virtual channel is used to transmit control messages.

[0073] S206, when receiving the first business data, the PCIE driver determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0074] Specifically, if the PCIE driver receives the first service data sent by a certain upper-layer function driver, the PCIE driver can determine the first target queue number corresponding to the channel number from the first mapping relationship according to the channel number of the virtual channel corresponding to the upper-layer function driver, and send the first service data to the hardware queue corresponding to the first target queue number. In this way, the first service data sent by the upper-layer function driver can be sent to the designated hardware queue to realize data transmission between the host side and the PCIE endpoint device. In one embodiment, the upper-layer function driver can send a data read request or a data write request to the PCIE driver to send the first service data to the designated hardware queue.

[0075] In the above-mentioned communication method based on PCIE, when the host side is connected to the PCIE endpoint device, the PCIE driver on the host side maps multiple hardware queues of the PCIE endpoint device to multiple virtual channels, and establishes a first mapping relationship between the queue number of the hardware queue and the channel number of the virtual channel. The PCIE driver can mount each upper-layer function driver, and allocate a corresponding virtual channel to the mounted upper-layer function driver for use by the upper-layer function driver, and the upper-layer function driver can send the first business data to the PCIE driver through the corresponding virtual channel. When the first business data is received, the PCIE driver determines the hardware queue number corresponding to the upper-layer driver that sends the first business data from the first mapping relationship, that is, the first target queue number, and sends the first business data to the hardware queue corresponding to the first target queue number. In the present application, each upper-layer function driver can directly realize data communication with the PCIE endpoint device through the PCIE driver, without simulating the PCIE device as a USB device. In this way, data communication between the host side and the PCIE endpoint device can be completed through the PCIE method, thereby improving the transmission rate, so that 5G products can achieve high speed, large bandwidth, and low latency on computer devices, meeting the rate requirements of 5G products.

[0076] In one embodiment, the kernel driver also includes a network adapter driver, namely, a NetAdapter driver.

[0077] like Figure 3 As shown, the communication method based on PCIE also includes:

[0078] S208, the PCIE driver mounts the network adapter driver and allocates a corresponding virtual channel to the network adapter driver, so that the network adapter driver sends the second service data through the corresponding virtual channel;

[0079] S210, when receiving the second business data, the PCIE driver determines the second target queue number corresponding to the second target channel number from the first mapping relationship, and sends the second business data to the hardware queue corresponding to the second target queue number; wherein the second target channel number is the channel number of the virtual channel corresponding to the network adapter driver.

[0080] The second service data refers to the service data sent by the network adapter driver, which may be, but is not limited to, sending IP data and sending control messages.

[0081] As a bus driver, the PCIE driver is used to implement the logic processing of the hardware link. As a type of function driver, the network adapter driver is used to implement the business logic, just like the upper-layer function driver. This application separates the function driver from the PCIE driver, so that the business logic and the hardware processing logic are layered, which makes the business processing clearer and easier for developers to understand, locate and solve problems.

[0082] Specifically, the PCIE driver can mount the network adapter driver and can allocate a corresponding virtual channel to the network adapter driver. Further, the PCIE driver can allocate virtual channels to each upper-layer function driver and the network adapter in the same manner, which can be specifically described in any of the above embodiments and will not be repeated here. After the PCIE driver allocates a virtual channel to the network adapter driver, the network adapter driver can be mapped to the underlying virtual channel and realize data transmission through the allocated virtual channel. If the PCIE driver receives the second service data sent by the network adapter driver through the corresponding virtual channel, the corresponding second target queue number can be determined from the first mapping relationship according to the channel number of the virtual channel corresponding to the network adapter, and the second service data can be sent to the hardware queue corresponding to the second target queue number. In this way, the second service data sent by the network adapter driver can be sent to the specified hardware queue to realize data transmission between the host side and the PCIE endpoint device.

[0083] In one embodiment, the network adapter driver is a driver implemented based on the NetAdapterCx architecture and adapted to the Windows framework interface.

[0084] In this application, there is a parent-child relationship between the PCIE driver and each function driver (including the network adapter driver and each upper-layer function driver), and each function driver acts as a child driver and only provides a business processing interface. After the child driver is stable, only the PCIE driver needs to be modified to achieve the adaptation between the host side and the PCIE endpoint device. However, Microsoft's driver HLK (Test Automation Tool Group) certification has fewer certification items for PCIE drivers and more certification items for function drivers. This application can greatly reduce the workload of the driver in Microsoft HLK certification by placing the main hardware logic in the PCIE driver.

[0085] In this embodiment, by separating the function driver from the PCIE driver, the business logic and the hardware processing logic are layered, which makes the business processing clearer and easier for developers to understand, locate and solve problems. At the same time, by placing the main hardware logic in the PCIE driver, the workload of the driver in Microsoft HLK certification can be greatly reduced.

[0086] In one embodiment, the PCIE-based communication method further includes: the network adapter driver calls a preset function interface to send the second service data to the PCIE driver, wherein the preset function interface is a function interface generated according to the UUID (Universally Unique Identifier) ​​of the PCIE driver and the UUID of the network adapter.

[0087] Specifically, since both the PCIE driver and the network adapter driver are located in the kernel layer, a preset function interface can be generated according to the UUID of the PCIE driver and the UUID of the network adapter through the technology provided by the Microsoft WDF (Windows Driver Framework) framework. The network adapter driver calls the preset function interface to transfer data to the PCIE driver to complete the data transmission without any request encapsulation and conversion, thereby speeding up the transmission rate.

[0088] In one embodiment, the present application can generate a preset function interface through UUID in the PCIE driver, and define an API (Application Programming Interface) for data transmission in the interface. In this way, the network adapter driver only needs to export the preset function interface, and can use the API defined by the interface to send the second service data to the PCIE driver.

[0089] In this embodiment, the network adapter driver calls a preset function interface to send the second service data to the PCIE driver without any request encapsulation and conversion, thereby speeding up the transmission rate.

[0090] In one embodiment, the second service data includes sending IP data and sending MBIM protocol data. Figure 4 As shown, the network adapter driver calls a preset function interface to send the second service data to the PCIE driver, including:

[0091] S302, the network adapter driver calls a preset function interface to send the sent IP data to the PCIE driver;

[0092] S304: The network adapter driver generates a data write request according to the second target channel number and the sent MBIM protocol data, and sends the data write request to the PCIE driver to send the sent MBIM protocol data to the PCIE driver.

[0093] Specifically, in the data transmission driven by the network adapter, it includes sending MBIM protocol data transmission and sending IP data transmission, in which the sent MBIM protocol data is a control message. Considering that the amount of sent IP data is relatively large, and the transmission rate of sent IP data affects the communication rate, in order to improve the data transmission efficiency, so that 5G products can achieve high speed, large bandwidth, and low latency on computer devices, and meet the rate requirements of 5G products, the sent IP data driven by the network adapter can be directly sent to the PCIE driver through the preset function interface to reduce data packaging and conversion, thereby improving the transmission rate.

[0094] Since the rate requirement for sending MBIM protocol data is not high, the network adapter driver can complete the sending of MBIM protocol data by sending a data write request. Since the data write request is a standard method, it can be completed by directly calling the interface provided by the system without having to define a preset function interface separately, thereby simplifying the program implementation. Specifically, in the process of sending the sent MBIM protocol data, the network adapter driver can generate a data write request based on the channel number of the virtual channel corresponding to the network adapter driver and the sent MBIM protocol data, and send the data write request to the PCIE driver, so that the PCIE driver can receive the sent MBIM protocol data and send the sent MBIM protocol data to the corresponding hardware queue to realize the transmission of the sent MBIM protocol data.

[0095] In this embodiment, the network adapter driver sends IP data to the PCIE driver by calling a preset function interface, and sends MBIM protocol data to the PCIE driver through a data write request, which can improve the transmission rate and simplify the program implementation.

[0096] In one embodiment, the PCIE-based communication method further includes: when the PCIE driver obtains the first return data sent by the PCIE endpoint device, calling a preset function interface to send the first return data to the network adapter driver. The preset function interface is a function interface generated according to the UUID of the PCIE driver and the UUID of the network adapter driver.

[0097] The preset function interface may be as described in the above embodiment, and the present application will not repeat it here. The first return data refers to the return data that needs to be sent to the network adapter driver. In one embodiment, the first return data may be return IP data or return MBIM protocol data.

[0098] Specifically, in the process of the PCIE endpoint device transmitting data back to the network adapter driver, since the relationship between the PCIE driver and the network adapter driver is a parent-child relationship, the PCIE endpoint device needs to send the first transmission data to the network adapter driver through the PCIE driver. When the PCIE driver obtains the first transmission data, it can call a preset function interface to send the first transmission data to the network adapter driver through the preset function interface. In this way, there is no need to do any request encapsulation and conversion, thereby speeding up the transmission rate.

[0099] In one embodiment, the first backhaul data is backhaul IP data or backhaul MBIM protocol data. Figure 5 As shown, when the PCIE driver obtains the first return data sent by the PCIE endpoint device, the step of calling the preset function interface to send the first return data to the network adapter driver includes:

[0100] S402, if the first return data is return IP data, the PCIE driver calls a preset function interface to send the return IP data to the network adapter driver;

[0101] S404: If the first returned data is returned MBIM data, the PCIE driver writes the returned MBIM data into a corresponding memory queue;

[0102] S406: When the PCIE driver receives the data read request sent by the network adapter driver, the PCIE driver sends the returned MBIM data to the network adapter driver.

[0103] In this embodiment, the corresponding memory queue refers to a memory queue corresponding to a network adapter driver, and the memory queue refers to a memory mapped in the system and is used to store data of a PCIE endpoint device.

[0104] Specifically, the PCIE driver can transmit backhaul IP data and backhaul MBIM data in different ways. Considering that the amount of backhaul IP data may be relatively large and the transmission rate of backhaul IP data affects the communication rate, in order to improve data transmission efficiency and enable 5G products to achieve high speed, large bandwidth and low latency on computer devices, the PCIE driver can directly send backhaul IP data to the network adapter driver by calling the preset function interface to reduce data encapsulation and conversion, thereby improving the transmission rate.

[0105] Since the rate requirement for the returned MBIM protocol data is not high, the network adapter driver can complete the sending of the returned MBIM protocol data by sending a data read request. Since the data read request is a standard method, it can be completed by directly calling the interface provided by the system without having to define a preset function interface separately, thereby simplifying the program implementation. Specifically, the PCIE driver can write the returned MBIM data to the memory queue corresponding to the network adapter driver. The network adapter driver can read the data in the corresponding memory queue by sending a data read request to the PCIE driver to read the returned MBIM data.

[0106] In this embodiment, the PCIE driver returns IP data to the network adapter driver by calling a preset function interface, and returns MBIM protocol data to the network adapter driver through a data read request, which can improve the transmission rate and simplify the program implementation.

[0107] In one embodiment, the PCIE-based communication method further includes:

[0108] When the PCIE driver obtains the second return data sent by the PCIE endpoint device, the PCIE driver determines the target upper layer function driver corresponding to the second return data;

[0109] The PCIE driver writes the second return data into a memory queue corresponding to the target upper-layer function, and sends the second return data to the target upper-layer function driver upon receiving a data read request sent by the target upper-layer function driver.

[0110] The second return data refers to the return data sent by the PCIE endpoint device to the upper-layer function driver.

[0111] Specifically, according to Microsoft's driver architecture, the upper-layer function driver can transmit data with the underlying driver (i.e., PCIE driver) by sending a data read request. Specifically, when the PCIE driver obtains the second return data, it determines the upper-layer function driver that needs to receive the second return data, and the upper-layer function driver is the target upper-layer function driver. The PCIE driver writes the second return data to the memory queue corresponding to the target upper-layer function driver. The target upper-layer function driver can read the data in the corresponding memory queue by sending a data read request to the PCIE driver to read the second return data.

[0112] In one of the embodiments, the present application can obtain the first return data and the second return data in the following manner: the PCIE endpoint device can write the return data into the DMA (Direct Memory Access) memory, and notify the host side by means of an interrupt, so that the host side is informed that there is return data for processing. After receiving the interrupt, the host side obtains the return data from the DMA memory and parses the return data. The function driver that needs to receive the return data is determined based on the parsed return data. If the return data is return data sent to the network adapter driver, the parsed return data is used as the first return data; if the return data is return data sent to the upper-level function driver, the parsed return data is used as the second return data.

[0113] As a standard method, the data read request can directly call the interface provided by the system to realize data reading. This embodiment completes the reading of the second return data by calling the interface provided by the system, realizes the data return between the PCIE endpoint device and the upper layer function driver, thereby simplifying the program implementation.

[0114] In one embodiment, Figure 6 As shown, the steps of mounting each upper-layer function driver by the PCIE driver and allocating a corresponding virtual channel to each upper-layer function driver include:

[0115] S502, the PCIE driver generates child nodes, wherein the number of the child nodes is determined according to the number of upper-layer function drivers;

[0116] S504, the PCIE driver mounts each upper-layer function driver through the sub-node; wherein different upper-layer function drivers correspond to different sub-nodes;

[0117] S506: The PCIE driver allocates a corresponding virtual channel to each upper-layer function driver, and establishes a second mapping relationship between the sub-node and the channel number of the virtual channel.

[0118] Before the step of determining the first target queue number corresponding to the first target channel number from the first mapping relationship, the step also includes: the PCIE driver drives the corresponding subnode according to the upper layer function driving the first service data, and determines the first target channel number from the second mapping relationship.

[0119] The subnode may be a unique identifier for distinguishing the mounted function drivers.

[0120] Specifically, the PCIE driver can generate different subnodes, and mount each upper-layer function driver through each subnode. Among them, one subnode mounts one upper-layer function driver, and one upper-layer function driver is mounted through one subnode. When mounting each upper-layer function driver, the PCIE driver can allocate a corresponding virtual channel to each upper-layer function driver. The method of allocating virtual channels can be as described in the above embodiment, and this application will not repeat it. After the virtual channel is allocated, the PCIE driver can establish a second mapping relationship to reflect the mapping relationship between the subnode of each upper-layer function driver and the channel number of the virtual channel corresponding to it through the second mapping relationship.

[0121] In one embodiment, the network adapter driver and each upper layer function driver are both function drivers, and the PCIE driver can also mount the network adapter driver through a subnode, and different function drivers are mounted on different subnodes. The second mapping relationship can also reflect the mapping relationship between the subnode of the network adapter driver and the channel number of the virtual channel corresponding to the network adapter driver.

[0122] If the PCIE driver receives business data sent by the function driver, it can determine the channel number of the virtual channel corresponding to the function driver from the second mapping relationship based on the subnode of the function driver that sends the business data, and then determine the queue number of the corresponding hardware queue from the first mapping relationship to send the business data to the PCIE endpoint device.

[0123] In this embodiment, since the subnode is a unique number, even if the channel number changes or the first mapping relationship and the second mapping relationship change, the first target channel number can be accurately determined according to the subnode, thereby improving the reliability of communication.

[0124] In one embodiment, the PCIE-based communication method further includes: a PCIE driver obtains a working mode of the host side, and derives a corresponding sub-node according to the working mode.

[0125] The working mode may be the mode that the host side is in when starting up, and may be, but is not limited to, a normal mode, a debug mode, a burning mode, and a dump mode.

[0126] Specifically, the application can export corresponding child nodes according to the working mode of the host side to complete the functions of different states. In one embodiment, the application exports NetAdapter ports and GNSS ports in normal mode; exports all ports, such as log export ports, in debug mode; exports burning ports in burning mode for firmware burning function; and only exports coredump ports in dump mode.

[0127] In one embodiment, the step of sending the first business data into the hardware queue corresponding to the first target queue number includes: a PCIE driver generates a data packet according to the first target channel number and the first business data, and sends the data packet into the hardware queue corresponding to the first target queue number.

[0128] Specifically, when the PCIE driver receives the first service data sent by the upper layer function driver, it can group the first service data with the first target channel number, so that the header of the data packet includes the first target channel number, so that the PCIE endpoint device can determine the service type described in the first service data through the first target channel number and perform subsequent processing. Furthermore, the header of the data packet can also include the first target queue number. The PCIE driver can send the data packet to the corresponding hardware queue.

[0129] In one of the embodiments, similarly, the PCIE driver can also generate a data packet according to the second target channel number and the second service data, and send the data packet to the hardware queue corresponding to the second target queue number. The specific implementation process of this step can refer to the process of the PCIE driver generating a data packet according to the first target channel number and the first service data, and this application will not elaborate on this.

[0130] In another embodiment, the PCIE endpoint device may also obtain a third mapping relationship between the channel number of the virtual channel and the service type, and determine the service type of the service data according to the third mapping relationship.

[0131] To facilitate understanding of the solution of the present application, a specific example is provided below to illustrate the present invention. The PCIE-based driver architecture can be as follows: Figure 7 As shown, the host side (ie Figure 7 host side) and PCIE endpoint device (i.e. Figure 7 The PCIE EP in the device can communicate in PCIE mode.

[0132] The host side is configured with a PCIE driver (the PCIE driver is Figure 7 The PCIE driver includes a data path and a control path, and the data path and the control path respectively include their own hardware transceiver queues for realizing data transmission and reception. The hardware transceiver queue in the data path and the hardware transceiver queue in the control path are mapped to different virtual channels for data transmission from the function driver.

[0133] The PCIE driver generates different subnodes for mounting function drivers such as network adapter, GNSS, AT, FLASH, log and Coredump. These function drivers are mapped to different virtual channels at the bottom layer through certain mapping relationships. Other function drivers (i.e., upper-layer function drivers) except the network adapter driver can send data read requests and / or data write requests to send data to the specified hardware queue of the PCIE endpoint device.

[0134] Both the PCIE driver and the network adapter driver are configured in the kernel layer, while the remaining function drivers except the network adapter driver are configured in the user layer. Therefore, data can be transmitted between the PCIE driver and the network adapter driver through a preset function interface. There are two types of data in the network adapter driver, namely MBIM protocol data and IP data. MBIM protocol data can be transmitted through the control channel. Since the MBIM protocol data does not require a high rate, the transmission of MBIM protocol data can be completed by sending data read and write requests. IP data needs to be transmitted through a data channel. In order to speed up the transmission rate, the technology provided by the Microsoft WDF framework can be used to generate a preset function interface through UUID in the PCIE driver, and define the API interface for data transmission in the preset function interface to realize the sending and receiving of IP data. During data transmission, the network adapter driver can directly use the API interface defined by the preset function interface by exporting the preset function interface to transfer IP data to the PCIE driver and complete the sending of IP data without any request encapsulation and conversion.

[0135] In the driver architecture of this application, port export can be divided into multiple modes. This application can export the ports corresponding to the network adapter driver and the ports corresponding to the GNSS driver in normal mode; in debug mode, all ports are exported, including log export, etc.; in burning mode, the burning port is exported for the firmware burning function. In Dump mode, the Coredump port is exported. In this way, functions in different states can be completed.

[0136] This application relies on Microsoft's NetAdapterCx framework and is implemented through PCIE driver development to achieve the application of computer devices on the host side, so that 5G products can meet the high-speed and large-bandwidth effects on computer devices.

[0137] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0138] Based on the same inventive concept, the embodiment of the present application further provides a PCIE-based communication device for implementing the PCIE-based communication method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more PCIE-based communication device embodiments provided below can refer to the limitations of the PCIE-based communication method above, and will not be repeated here.

[0139] In one embodiment, Figure 8 As shown, a PCIE-based communication device is provided, the device includes a kernel driver configured on the host side, the kernel driver includes a PCIE driver, and the host side is also configured with an upper layer function driver. The PCIE driver includes:

[0140] A first mapping relationship establishing module, configured to establish a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel when the host side identifies a PCIE endpoint device; wherein the hardware queue is a hardware access channel of the PCIE endpoint device;

[0141] an allocation module, used for mounting each of the upper-layer function drivers and allocating a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel;

[0142] A business data writing module is used to determine the first target queue number corresponding to the first target channel number from the first mapping relationship when the first business data is received, and send the first business data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper-layer function driver that sends the first business data.

[0143] In one embodiment, the kernel driver also includes a network adapter driver. The allocation module is also used to mount the network adapter driver and allocate a corresponding virtual channel to the network adapter driver so that the network adapter driver sends the second service data through the corresponding virtual channel. The service data writing module is also used to determine the second target queue number corresponding to the second target channel number from the first mapping relationship when receiving the second service data, and send the second service data to the hardware queue corresponding to the second target queue number; wherein the second target channel number is the channel number of the virtual channel corresponding to the network adapter driver.

[0144] In one embodiment, the network adapter driver includes a first interface calling module, which is used to call a preset function interface to send the second service data to the PCIE driver. The preset function interface is a function interface generated according to the universal unique identifier of the PCIE driver and the universal unique identifier of the network adapter driver.

[0145] In one embodiment, the second service data includes sending IP data and sending MBIM protocol data. The first interface calling module includes an IP data sending unit and an MBIM protocol data sending unit. The IP data sending unit calls the preset function interface to send the sent IP data to the PCIE driver. The MBIM protocol data sending unit is used to generate a data write request according to the second target channel number and the sent MBIM protocol data, and send the data write request to the PCIE driver to send the sent MBIM protocol data to the PCIE driver.

[0146] In one embodiment, the PCIE driver further includes a second interface calling module. The second interface calling module is used to call a preset function interface to send the first return data to the network adapter driver when the first return data sent by the PCIE endpoint device is obtained. The preset function interface is a function interface generated according to the universal unique identifier of the PCIE driver and the universal unique identifier of the network adapter driver.

[0147] In one embodiment, the first return data is return IP data or return MBIM protocol data. The second interface calling module includes an IP data return unit and an MBIM protocol data return unit. The IP data return unit is used to call the preset function interface to send the return IP data to the network adapter driver when the first return data is the return IP data. The MBIM protocol data return unit is used to write the return MBIM data into the corresponding memory queue when the first return data is the return MBIM data; and is also used to send the return MBIM data to the network adapter driver when a data read request sent by the network adapter driver is received.

[0148] In one embodiment, the allocation module includes a subnode generation unit, a mounting unit, and a second mapping relationship establishment unit. The PCIE driver also includes a first target channel number determination module. The subnode generation unit is used to generate subnodes; the number of subnodes is determined according to the number of upper-layer function drivers. The mounting unit is used to mount each of the upper-layer function drivers through the subnodes; different upper-layer function drivers correspond to different subnodes. The second mapping relationship establishment unit is used to allocate a corresponding virtual channel to each of the upper-layer function drivers, and establish a second mapping relationship between the channel number of the subnode and the virtual channel. The first target channel number determination module is used to determine the first target channel number from the second mapping relationship according to the subnode corresponding to the upper-layer function driver that sends the first business data.

[0149] In one embodiment, the PCIE driver further includes an export module, which is used to obtain the working mode of the host side and export the corresponding sub-node according to the working mode.

[0150] In one embodiment, the service data writing module includes a data packet generating unit, which is used to generate a data packet according to the first target channel number and the first service data, and send the data packet to a hardware queue corresponding to the first target queue number.

[0151] In one embodiment, the PCIE driver further includes a target upper layer function driver module and a return module. The target upper layer function driver module is used to determine the target upper layer function driver corresponding to the second return data when the second return data sent by the PCIE endpoint device is obtained. The return module is used to write the second return data into the memory queue corresponding to the target upper layer function driver, and send the second return data to the target upper layer function driver when receiving a data read request sent by the target upper layer function driver.

[0152] Each module in the above PCIE communication device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0153] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory and a communication interface connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a PCIE communication method is implemented.

[0154] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0155] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0156] In one embodiment, the computer device may further include a PCIE endpoint device, which is connected to the processor via a PCIE bus. In one embodiment, the PCIE endpoint device is a 5G communication module. In one example, the PCIE endpoint device may be a 5G modem.

[0157] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0158] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0159] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited thereto. The processors involved in each embodiment provided in this application may be general-purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, data processing logic devices based on quantum computing, etc., but are not limited thereto.

[0160] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0161] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A communication method based on PCIE, It is characterized in that Applied to the host side, the host side is configured with an upper layer function driver and a kernel driver, and the kernel driver includes a PCIE driver; the method includes: If the host side identifies a PCIE endpoint device, the PCIE driver establishes a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel; wherein the hardware queue is a hardware access channel of the PCIE endpoint device; The PCIE driver mounts each of the upper-layer function drivers and allocates a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel; When receiving the first service data, the PCIE driver determines the first target queue number corresponding to the first target channel number from the first mapping relationship, and sends the first service data to the hardware queue corresponding to the first target queue number; wherein the first target channel number is the channel number of the virtual channel corresponding to the upper layer function driver that sends the first service data; The kernel driver also includes a network adapter driver; the method also includes: The PCIE driver mounts the network adapter driver and allocates a corresponding virtual channel to the network adapter driver, so that the network adapter driver sends the second service data through the corresponding virtual channel; When receiving the second business data, the PCIE driver determines the second target queue number corresponding to the second target channel number from the first mapping relationship, and sends the second business data to the hardware queue corresponding to the second target queue number; wherein the second target channel number is the channel number of the virtual channel corresponding to the network adapter driver.

2. The communication method according to claim 1, It is characterized in that The method further comprises: The network adapter driver calls a preset function interface to send the second service data to the PCIE driver; The preset function interface is a function interface generated according to the universal unique identifier of the PCIE driver and the universal unique identifier of the network adapter driver.

3. The communication method according to claim 2, It is characterized in that The second service data includes sent IP data and sent MBIM protocol data; The step of the network adapter driver calling the preset function interface to send the second service data to the PCIE driver includes: The network adapter driver calls the preset function interface to send the sent IP data to the PCIE driver; The network adapter driver generates a data write request according to the second target channel number and the sent MBIM protocol data, and sends the data write request to the PCIE driver to send the sent MBIM protocol data to the PCIE driver.

4. The communication method according to claim 1, It is characterized in that The method further comprises: When the PCIE driver obtains the first return data sent by the PCIE endpoint device, the PCIE driver calls a preset function interface to send the first return data to the network adapter driver; The preset function interface is a function interface generated according to the universal unique identifier of the PCIE driver and the universal unique identifier of the network adapter driver.

5. The communication method according to claim 4, It is characterized in that The first backhaul data is backhaul IP data or backhaul MBIM protocol data; The step of the PCIE driver calling a preset function interface to send the second service data to the network adapter driver includes: If the first return data is the return IP data, the PCIE driver calls the preset function interface to send the return IP data to the network adapter driver; If the first returned data is the returned MBIM protocol data, the PCIE driver writes the returned MBIM protocol data into a corresponding memory queue; When receiving the data read request sent by the network adapter driver, the PCIE driver sends the returned MBIM protocol data to the network adapter driver.

6. The communication method according to claim 1, It is characterized in that The step of mounting each of the upper-layer function drivers by the PCIE driver and allocating a corresponding virtual channel to each of the upper-layer function drivers comprises: The PCIE driver generates child nodes; the number of the child nodes is determined according to the number of upper-layer function drivers; The PCIE driver mounts each of the upper-layer function drivers through the sub-nodes; wherein different upper-layer function drivers correspond to different sub-nodes; The PCIE driver allocates a corresponding virtual channel to each of the upper-layer function drivers, and establishes a second mapping relationship between the subnode and the channel number of the virtual channel; Before the step of determining the first target queue number corresponding to the first target channel number from the first mapping relationship, the method further includes: The PCIE driver determines the first target channel number from the second mapping relationship according to the subnode corresponding to the upper layer function driver that sends the first service data.

7. The communication method according to claim 6, It is characterized in that The method further comprises: The PCIE driver obtains the working mode of the host side and derives the corresponding child node according to the working mode.

8. The communication method according to claim 1, It is characterized in that The step of sending the first service data into a hardware queue corresponding to the first target queue number includes: The PCIE driver generates a data packet according to the first target channel number and the first service data, and sends the data packet to a hardware queue corresponding to the first target queue number.

9. The communication method according to any one of claims 1 to 8, It is characterized in that The method further comprises: The PCIE driver determines a target upper layer function driver corresponding to the second return data when acquiring the second return data sent by the PCIE endpoint device; The PCIE driver writes the second return data into a memory queue corresponding to the target upper-layer function driver, and sends the second return data to the target upper-layer function driver upon receiving a data read request sent by the target upper-layer function driver.

10. A communication device based on PCIE, It is characterized in that The device includes a kernel driver configured on the host side, the kernel driver includes a PCIE driver, and the host side is also configured with an upper layer function driver; The PCIE driver includes: A first mapping relationship establishing module, configured to establish a first mapping relationship between a queue number of a hardware queue and a channel number of a virtual channel when the host side identifies a PCIE endpoint device; wherein the hardware queue is a hardware access channel of the PCIE endpoint device; an allocation module, used for mounting each of the upper-layer function drivers and allocating a corresponding virtual channel to each of the upper-layer function drivers, so that the upper-layer function driver sends the first service data through the corresponding virtual channel; a service data writing module, configured to, upon receiving the first service data, determine a first target queue number corresponding to a first target channel number from the first mapping relationship, and send the first service data to a hardware queue corresponding to the first target queue number; wherein the first target channel number is a channel number of a virtual channel corresponding to an upper-layer function driver that sends the first service data; The kernel driver also includes a network adapter driver; the device is also used for: The PCIE driver mounts the network adapter driver and allocates a corresponding virtual channel to the network adapter driver, so that the network adapter driver sends the second service data through the corresponding virtual channel; When receiving the second business data, the PCIE driver determines the second target queue number corresponding to the second target channel number from the first mapping relationship, and sends the second business data to the hardware queue corresponding to the second target queue number; wherein the second target channel number is the channel number of the virtual channel corresponding to the network adapter driver.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

12. The computer device according to claim 11, It is characterized in that The computer device also includes a PCIE endpoint device, and the PCIE endpoint device is connected to the processor via a PCIE bus.

13. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Dynamic bus-based virtual channel multiplexing device driver architecture

    CN101490637A

  • Methods for establishing virtual channels, data transmission methods, and line cards.

    CN102263698A

  • Data processing system and method

    CN103946828A

  • Data processing method and system and peripheral assembly rapid interconnection device and host

    CN107656884A

  • Message forwarding method, intermediate equipment and computer equipment

    CN110688237A