Inter-device point-to-point communication method, system and apparatus, device, and storage medium

By designing a common target protocol, point-to-point communication between heterogeneous PCIE devices is realized, which solves the problem of heterogeneous device communication needing to occupy the host address space, and improves the throughput and CPU resource utilization of the data center.

WO2024174689A1PCT designated stage expired Publication Date: 2024-08-29INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/139247
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-23
Filing Date
2023-12-15
Publication Date
2024-08-29

AI Technical Summary

Technical Problem

In data centers, point-to-point communication between heterogeneous devices requires a large amount of physical address space on the host, resulting in increased CPU resource consumption, and products from different manufacturers do not support point-to-point communication.

Method used

A universal target protocol is designed. Through point-to-point communication between PCIE devices, the internal address of the target receiving device is determined by the target protocol carried in the target data packet to avoid occupying a large number of physical addresses on the host side.

Benefits of technology

It realizes efficient communication and mutual access between heterogeneous PCIE devices, reduces CPU processing load, reduces network IO consumption, and improves the throughput of the data center.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023139247_29082024_PF_FP_ABST
    Figure CN2023139247_29082024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of communications, and specifically discloses an inter-device point-to-point communication method, system and apparatus, a device, and a storage medium, applied to a target sending device. The method comprises: acquiring an internal address of a target receiving device, wherein both the target sending device and the target receiving device are PCIE devices; according to a preset protocol format, constructing a target protocol containing the internal address of the target receiving device, and generating a target data packet carrying the target protocol; and sending the target data packet to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing on the internal address. According to the present application, by designing a general target protocol, communication and mutual access between heterogeneous PCIE devices are realized without occupying a large number of physical addresses of a host terminal.
Need to check novelty before this filing date? Find Prior Art

Description

Point-to-point communication method, system, device, equipment and storage medium between devices CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to a Chinese patent application filed with the China Patent Office on February 23, 2023, with application number 202310154607.4 and application name “Method, system, device, equipment and storage medium for point-to-point communication between devices”, the entire contents of which are incorporated by reference in this application. Technical Field The present application relates to the field of communication technology, and in particular to a method, system, device, equipment and computer non-volatile readable storage medium for point-to-point communication between devices. Background Art With the rapid development of emerging high-tech industries such as cloud computing, big data, and artificial intelligence, the data center network interface rate has evolved to 100G and above, and the network bandwidth growth rate is much faster than the CPU (Central Processing Unit) computing power growth rate, which makes the CPU-based cloud infrastructure bottleneck in the network data forwarding stage. In many scenarios, the large amount of data generated by different network devices or heterogeneous devices does not actually need to be processed by the CPU. In these scenarios, if the CPU is required to process, the proportion of CPU resources consumed by network IO (Input, Output, i.e. input and output) will increase, and the increased CPU computing power resources of the data center will be consumed more in network IO processing. Although the existing point-to-point communication method that bypasses the host to access each other can reduce the CPU's processing flow of unnecessary processing data generated between different devices to a certain extent, it requires the communication equipment to be products of the same manufacturer. Products from different manufacturers do not support mutual access through point-to-point communication, and even products from the same manufacturer still need to occupy a large amount of host address space. Summary of the invention In view of this, the purpose of this application is to provide a point-to-point communication method, device, equipment and computer non-volatile readable storage medium between devices, which realizes communication and mutual access between heterogeneous PCIE (Peripheral Component Interconnect Express, a high-speed serial computer expansion bus standard, mainly used to expand the data throughput of the computer system bus and improve the communication speed of the device) devices without occupying a large number of physical addresses on the host side. The specific scheme is as follows: The embodiment of the present application provides a point-to-point communication method between devices, which is applied to a target sending device, including: Obtain the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; Construct a target protocol containing the internal address of the target receiving device according to the preset protocol format, and generate a target protocol The target data packet; The target data packet is sent to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing according to the internal address. In some embodiments of the present application, before obtaining the internal address of the target receiving device, the method further includes: The device key information of the target sending device is sent to the host side so that the host side can register the target sending device and return the internal address of the target receiving device. In some embodiments of the present application, the device key information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, available addresses inside the device, and a callback function. In some embodiments of the present application, the internal available address of the device includes at least a host mapping address, an internal address, an address length, and an address type. In some embodiments of the present application, before the host registers the target sending device, the following steps are further included: Determine whether the preset information sending conditions are currently met. If the preset information sending conditions are currently met, send its own device key information to the host end, so that the host end can perform the step of registering the target sending device after monitoring the device key information using the preset service driver. In some embodiments of the present application, the service driver is a program that is pre-run on the host side and performs device registration. In some embodiments of the present application, the host sends its own device key information to the host, so that the host performs the step of registering the target sending device after monitoring the device key information using a preset service driver, including: The key information of the device itself is sent to the host side by calling the pre-generated registration function interface, so that the host side can use the service driver to monitor the calling of the registration function interface. If the registration function interface is monitored to be called, it is determined that the key information of the device is monitored, and the steps of registering the target sending device are executed. In some embodiments of the present application, the registration function interface is exported by the service driver by executing a symbolic export library function. In some embodiments of the present application, the execution symbol export library function is an EXPORT_SYMBOL_GPL function. In some embodiments of the present application, sending device key information of a target sending device to a host end so that the host end registers the target sending device includes: The device key information of the target sending device is sent to the host side, so that the host side stores the device key information sent by the target sending device locally. In some embodiments of the present application, after sending the device key information of the target sending device to the host end so that the host end stores the device key information sent by the target sending device locally, it also includes: Send a device matching command to the host so that the host can match the device from the registered devices according to the device matching command. A target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device, and reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device; wherein the target receiving device has been registered on the host side. In some embodiments of the present application, obtaining the internal address of the target receiving device includes: The receiving host returns the internal address and corresponding address type of the target receiving device by calling the callback function in the device key information of the target sending device; wherein the host also sends the device key information of the target sending device to the target receiving device by calling the callback function in the device key information of the target sending device. In some embodiments of the present application, data processing includes reading data from an internal address or writing data to an internal address; the type of data processing depends on the target receiving device according to the type of the target data packet; the type of the target data packet depends on the address type of the internal address of the target receiving device. In some embodiments of the present application, after sending the target data packet to the target receiving device so that the target receiving device processes the data according to the internal address, the method further includes: Receive a confirmation data packet returned by the target sending device; wherein the confirmation data packet is generated and returned by the target receiving device according to the device key information of the target sending device. In some embodiments of the present application, after obtaining the internal address of the target receiving device, the method further includes: The receiving host returns the host mapping address in the device key information of the target receiving device by calling the callback function in the device key information of the target sending device, so that the target data packet also carries the host mapping address in the device key information of the target receiving device. In some embodiments of the present application, sending a target data packet to a target receiving device includes: The target data packet is sent to the target receiving device so that the target receiving device parses the target data packet to obtain the host mapping address in the device key information of the target receiving device, and determines whether the host mapping address is a host mapping address for point-to-point communication. If the host mapping address is a host mapping address for point-to-point communication, the step of performing data processing on the internal address is executed. In some embodiments of the present application, the data packets transmitted between the target sending device and the target receiving device are TLP packets. The embodiment of the present application provides a point-to-point communication method between devices, which is applied to a target receiving device, including: Receive a target data packet carrying a target protocol generated and sent by a target sending device; wherein both the target sending device and the target receiving device are PCIE devices; the target protocol is a protocol including the internal address of the target receiving device and constructed according to a preset protocol format after the target sending device obtains the internal address of the target receiving device; The target protocol carried by the target data packet is parsed to obtain the internal address, and data processing is performed on the internal address. The embodiment of the present application provides a point-to-point communication system between devices, including a target sending device and a target receiving device, wherein: A target sending device is used to obtain an internal address of a target receiving device; wherein both the target sending device and the target receiving device are PCIE devices; and a target protocol including the internal address of the target receiving device is constructed according to a preset protocol format, and a target data packet carrying the target protocol is generated; and the target data packet is sent to the target receiving device; The target receiving device is used to parse the target protocol carried in the target data packet to obtain the internal address after receiving the target data packet, and perform data processing according to the internal address. In some embodiments of the present application, the inter-device point-to-point communication system further includes a host end; Correspondingly, the target sending device is also used to send the device key information of the target sending device to the host end; The host is used to register the target sending device and return the internal address of the target receiving device. A fourth aspect of the present application provides a device for point-to-point communication between devices, which is applied to a target sending device, including: An acquisition module, used to acquire the internal address of a target receiving device; wherein both the target sending device and the target receiving device are PCIE devices; A data packet generation module, used to construct a target protocol including an internal address of a target receiving device according to a preset protocol format, and generate a target data packet carrying the target protocol; The data packet sending module is used to send the target data packet to the target receiving device, so that the target receiving device can parse the target protocol carried by the target data packet to obtain the internal address after receiving the target data packet, and perform data processing on the internal address. An embodiment of the present application provides an electronic device, which includes a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the aforementioned point-to-point communication method between devices. An embodiment of the present application provides a computer non-volatile readable storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the aforementioned point-to-point communication method between devices is implemented. In the embodiment of the present application, the target sending device first obtains the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; then the target protocol containing the internal address of the target receiving device is constructed according to the preset protocol format, and a target data packet carrying the target protocol is generated; finally, the target data packet is sent to the target receiving device, so that after the target receiving device receives the target data packet, it parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing on the internal address. It can be seen that the embodiment of the present application realizes communication and mutual access between heterogeneous PCIE devices by designing a universal target protocol. When point-to-point communication is performed between PCIE devices, the internal address of the target receiving device is determined by the target protocol carried in the target data packet, thereby eliminating the need to occupy a large number of physical addresses on the host side. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work. FIG1 is a flow chart of a method for point-to-point communication between devices provided in an embodiment of the present application; FIG. 2 is a diagram showing a specific TLP packet format example provided in an embodiment of the present application; FIG3 is a diagram showing a specific target protocol format example provided in an embodiment of the present application; FIG4 is a flowchart of a specific method for point-to-point communication between devices provided in an embodiment of the present application; FIG5 is a schematic diagram of a specific device registration method provided in an embodiment of the present application; FIG6 is a schematic diagram of a specific device key information callback method provided in an embodiment of the present application; FIG7 is a schematic diagram of a specific device actual communication method provided in an embodiment of the present application; FIG8 is a diagram showing a specific example of address type definition provided in an embodiment of the present application; FIG9 is a schematic diagram of the structure of a point-to-point communication device between devices provided in an embodiment of the present application; FIG10 is a structural diagram of an electronic device for point-to-point communication between devices provided in an embodiment of the present application; FIG11 is a structural diagram of a computer non-volatile readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. In the prior art, although point-to-point communication between heterogeneous devices can temporarily meet the need to bypass the host to access each other, it still has the disadvantages of incompatibility and the need to occupy a large amount of address space of the host. In view of the above technical defects, the present application provides a point-to-point communication solution between devices, which realizes communication and mutual access between heterogeneous PCIE devices by designing a universal target protocol. When point-to-point communication is performed between PCIE devices, the internal address of the target receiving device is determined by the target protocol carried in the target data packet, thereby eliminating the need to occupy a large number of physical addresses on the host side. FIG1 is a flow chart of a method for point-to-point communication between devices provided in an embodiment of the present application. Referring to FIG1 , the method for point-to-point communication between devices is applied to a target sending device, including: S11: Obtain the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices. In the embodiment of the present application, the target sending device obtains the internal address of the target receiving device, and the target sending device and the target receiving device are both PCIE devices, specifically heterogeneous PCIE devices. PCIE is a high-speed serial computer expansion bus standard, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission. The connected devices are allocated exclusive channel bandwidth and do not share bus bandwidth. They mainly support active power management, error reporting, end-to-end reliability transmission, hot plugging and quality of service (QOS) and other functions. There are two major categories of PCIE devices: RP (root port) and EP (Endpoint). RP is equivalent to a root node, connecting multiple EP devices to one node, and it completes the routing of data, and EP is the final data receiver and the executor of the command. RC device (Root Complex, the interface between CPU and PCIe topology) is used to connect CPU / memory subsystem and I / O device. In RC mode, the type value in the PCIE configuration header is 1, which supports configuration and I / O transactions. There can be multiple RPs under one RC. Peer-to-Peer (P2P) means that a PCIE device directly accesses another PCIE device. In an embodiment of the present application, before obtaining the internal address of the target receiving device, the target receiving device needs to be registered on the host side. Specifically, the device key information of the target sending device is sent to the host side so that the host side registers the target sending device and returns the internal address of the target receiving device. The device key information of the target sending device includes at least the device identification, the matching receiving device type, the number of addresses, the internal available addresses of the device and the callback function. The internal available addresses of the device include at least the host mapping address, the internal address, the address length and the address type. It should be noted here that the target receiving device also needs to be registered on the host side in the same way. After the target sending device sends its device key information to the host side, the host side monitors the device key information sent by the target sending device. If the device key information sent by the target sending device is monitored, the step of registering the target sending device is executed. The specific registration process will be described in detail in the following embodiment. S12: Constructing a target protocol including an internal address of a target receiving device according to a preset protocol format, and generating a target data packet carrying the target protocol. In an embodiment of the present application, after the target sending device obtains the internal address of the target receiving device, it first constructs a target protocol containing the internal address of the target receiving device according to a preset protocol format, and then generates a target data packet carrying the target protocol. The target data packet is a TLP packet (Total Loss Package), and the target protocol is a specially designed general communication protocol. Although the P2P receiving device can receive the TLP packet sent by the original device in terms of mechanism, the address needs to be within the bus address of the receiving device. When a large amount of continuous data is transmitted, a continuous mapping is required. This can be effectively avoided by setting a general protocol. By means of the protocol, only a small number of registers are used to avoid the need to occupy a large number of physical addresses of the host during P2P transmission. Figure 2 shows a 64-bit memory read / write request TLP packet format, where Address is the destination address of the transmission (host mapping address). Usually, in DMA (Direct Memory Access) transmission, this The value increases according to the amount of data sent. Therefore, when a large amount of data is transmitted, a corresponding address space is required. In the embodiment of the present application, this value is only a few specific values ​​registered by the opposite device, and the specific address that needs to be transmitted to the opposite device is determined by the target protocol, and the content of the target protocol is shown in Figure 3. S13: Send the target data packet to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried in the target data packet to obtain an internal address, and performs data processing according to the internal address. In an embodiment of the present application, the target sending device sends the target data packet to the target receiving device, so that the target receiving device parses the target protocol carried by the target data packet to obtain an internal address after receiving the target data packet, and performs data processing on the internal address. In some embodiments of the present application, the target sending device can also obtain the host mapping address of the target receiving device while obtaining the internal address of the target receiving device, and fill the host mapping address into the Address field when generating a TLP packet. The target receiving device parses the target data packet to obtain the host mapping address, and determines whether the host mapping address is a host mapping address for point-to-point communication. If the host mapping address is a host mapping address for point-to-point communication, the step of performing data processing on the internal address is performed. It can be seen that the target sending device in the embodiment of the present application first obtains the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; then a target protocol containing the internal address of the target receiving device is constructed according to a preset protocol format, and a target data packet carrying the target protocol is generated; finally, the target data packet is sent to the target receiving device, so that after the target receiving device receives the target data packet, it parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing on the internal address. The embodiment of the present application realizes communication and mutual access between heterogeneous PCIE devices by designing a universal target protocol. When point-to-point communication is performed between PCIE devices, the internal address of the target receiving device is determined by the target protocol carried in the target data packet, thereby eliminating the need to occupy a large number of physical addresses on the host side. FIG4 is a flowchart of a specific method for point-to-point communication between devices provided in an embodiment of the present application. Referring to FIG4 , the method for point-to-point communication between devices includes: S21: The host runs a service driver; the service driver is used to register the device. In the embodiment of the present application, if the key information of each device supporting the above design is actively collected, it will become extremely complicated in the face of many heterogeneous devices. For this reason, a service driver is designed, and the service driver is used to register the device. First, the service driver needs to be run on the host side. Through the service driver, the common key information of the device is defined. The device driver only needs to call a small number of interface functions to realize the support of P2P between different PCIE devices. S22: The target sending device sends the device key information of the target sending device to the host side by calling a pre-generated registration function interface; the registration function interface is exported by the service driver by executing a symbol export library function. In the embodiment of the present application, the target sending device sends the device key information of the target sending device to the host side by calling the pre-generated registration function interface. The symbol export library function is exported, and the execution symbol export library function is EXPORT_SYMBOL_GPL function. The P2P communication device defines the device key information according to its own situation, and calls the registration function interface to register its own device key information to the service driver. The above process is shown in Figure 5. It can be seen that by defining a small amount of universal device key information, the problem of mutual identification between the target sending device and the target receiving device is solved. Through the address information in the device key information, a large amount of host address space does not need to be occupied when a large amount of data is transmitted. The data structure of the registration function interface is as follows: struct devinfo{ U64unid; / / Device identification, that is, different heterogeneous devices have different unique IDs U16Devtype

[0064] ; / / Matched receiving device type, that is, the device type expected to match, 0xFFFF is invalid U8Num; / / Number of addresses struct p2paddr addr

[0064] ; / / available address inside the device U8(*cb)(u64unid,struct p2paddr*addr,u8num); / / callback function }; Among them, the definition of p2paddr is as follows: struct p2paddr{ U64host; / / Host mapping address, usually also bar address U64dev; / / internal address U16len; / / Address length U8type; / / Address type }; S23: The host side monitors the calling of the registration function interface by using the service driver. If the registration function interface is detected to be called, it is determined that the device key information sent by the target sending device is detected. S24: The host side stores the device key information sent by the target sending device locally, and matches a target receiving device from the registered devices whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device; the target receiving device has been registered on the host side. S25: The host side calls the callback function in the device key information of the target sending device to return the internal address and the corresponding address type of the target receiving device to the target sending device, and sends the device key information of the target sending device to the target receiving device. In the embodiment of the present application, the host side uses the service driver to monitor the calling of the registration function interface. If the registration function interface is monitored to be called, it is determined that the device key information sent by the target sending device is monitored. The device key information sent by the target sending device is stored locally, and the target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device is matched from the registered devices. As mentioned above, the target receiving device has been registered on the host side. That is, when the service driver receives the device request, it performs the registration work and tries to match the device according to the "Devtype" field in the registered device. When the match is successful, both parties are notified through the callback function in the device key information. The above process is shown in Figure 6. Specifically, the host side calls the callback function in the device key information of the target sending device to return the internal address and the corresponding address type of the target receiving device to the target sending device, and sends the device key information of the target sending device to the target receiving device. That is, the host side reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device. S26: The target sending device constructs a target protocol including the internal address of the target receiving device according to a preset protocol format, generates a target data packet carrying the target protocol, and sends the target data packet to the target receiving device. S27: After receiving the target data packet, the target receiving device parses the target protocol carried in the target data packet to obtain an internal address, and performs data processing according to the internal address. S28: The target receiving device generates a confirmation data packet according to the device key information of the target sending device, and returns the confirmation data packet to the target sending device. In an embodiment of the present application, the target receiving device generates a confirmation data packet according to the device key information of the target sending device, and returns the confirmation data packet to the target sending device. The entire communication process is shown in FIG. 7 . As mentioned above, when the target sending device generates a target data packet, in addition to carrying the target protocol, it also needs to fill in the host mapping address of the opposite device in the Address field. For this reason, when the host returns the information, it also needs to return the host mapping address in the device key information of the target receiving device to the target sending device, so that the target data packet generated by the target sending device also carries the host mapping address in the device key information of the target receiving device. The target receiving device parses the target data packet to obtain the host mapping address in the device key information of the target receiving device, and determines whether the host mapping address is the host mapping address of point-to-point communication. If the host mapping address is the host mapping address of point-to-point communication, the step of processing data for the internal address is executed. That is, when the target receiving device receives the TLP packet, if the address of the Address field in the TLP packet is the host mapping address set by p2p, it further unpacks and saves the data according to the target protocol. In some embodiments of the present application, the target data packet is type-restricted, and the type of the target data packet depends on the address type of the internal address of the target receiving device, that is, the "U8type" field, and the address type definition is shown in Figure 8. The target receiving device reads the data in the internal address or writes data to the internal address according to the type of the target data packet. For example, when the address type of the internal address is 0, it means that the internal address is used to receive data, and the type of the received TLP packet is the type of writing data to the internal address. The present application embodiment accordingly provides a device-to-device point-to-point communication method applied to a target receiving device, including: The target receiving device first receives the target data packet carrying the target protocol generated and sent by the target sending device; wherein the target sending device and the target receiving device are both PCIE devices; the target protocol is a protocol containing the internal address of the target receiving device constructed according to a preset protocol format after the target sending device obtains the internal address of the target receiving device; then the target protocol carried by the target data packet is parsed to obtain the internal address, and data processing is performed on the internal address. The embodiment of the present application accordingly provides a point-to-point communication system between devices, including a target sending device and a target receiving device, wherein: A target sending device is used to obtain an internal address of a target receiving device; wherein both the target sending device and the target receiving device are PCIE devices; and a target protocol including the internal address of the target receiving device is constructed according to a preset protocol format, and a target data packet carrying the target protocol is generated; and the target data packet is sent to the target receiving device; The target receiving device is used to parse the target protocol carried in the target data packet to obtain the internal address after receiving the target data packet, and perform data processing according to the internal address. In some embodiments of the present application, the inter-device point-to-point communication system further includes a host end; Correspondingly, the target sending device is also used to send the device key information of the target sending device to the host end; The host is used to register the target sending device and return the internal address of the target receiving device. As shown in FIG. 9 , the embodiment of the present application further discloses a device for point-to-point communication between devices, which is applied to a target sending device, including: The acquisition module 11 is used to acquire the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; The data packet generation module 12 is used to construct a target protocol including an internal address of a target receiving device according to a preset protocol format, and generate a target data packet carrying the target protocol; The data packet sending module 13 is used to send the target data packet to the target receiving device, so that the target receiving device can parse the target protocol carried in the target data packet to obtain the internal address after receiving the target data packet, and perform data processing according to the internal address. It can be seen that in the embodiment of the present application, the target sending device first obtains the internal address of the target receiving device; wherein, the target sending device and the target receiving device are both PCIE devices; then, a target protocol including the internal address of the target receiving device is constructed according to a preset protocol format, and a target data packet carrying the target protocol is generated; finally, the target data packet is sent to the target receiving device, so that after the target receiving device receives the target data packet, it parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing on the internal address. The embodiment of the present application realizes communication and mutual access between heterogeneous PCIE devices by designing a universal target protocol. When point-to-point communication is performed between PCIE devices, the internal address of the target receiving device is The address is determined by the target protocol carried in the target data packet, so there is no need to occupy a large number of physical addresses on the host side. In some specific embodiments, the device-to-device point-to-point communication apparatus further includes: The device key information sending module is used to determine whether the preset information sending conditions are currently met. If the preset information sending conditions are currently met, the device key information of the device itself is sent to the host end, so that the host end can perform the step of registering the target sending device after monitoring the device key information using the preset service driver; The device matching module is used to send a device matching instruction to the host side, so that the host side matches a target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device from the registered devices according to the device matching instruction, and reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device; wherein the target receiving device has been registered on the host side; The confirmation module is used to receive a confirmation data packet returned by the target sending device; wherein the confirmation data packet is generated and returned by the target receiving device according to the device key information of the target sending device. In some specific embodiments, the data packets transmitted between the target sending device and the target receiving device in the inter-device point-to-point communication apparatus are TLP packets. In some embodiments of the present application, an electronic device is also provided. FIG10 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of use of the present application. FIG10 is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement at least the following steps: Obtain the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; Constructing a target protocol including an internal address of a target receiving device according to a preset protocol format, and generating a target data packet carrying the target protocol; The target data packet is sent to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing according to the internal address. In some embodiments of the present application, before obtaining the internal address of the target receiving device, the method further includes: The device key information of the target sending device is sent to the host side so that the host side can register the target sending device and return the internal address of the target receiving device. In some embodiments of the present application, the device key information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, available addresses inside the device, and a callback function. In some embodiments of the present application, the available addresses within the device include at least the host mapping address, the internal address, the address length and address type. In some embodiments of the present application, before the host registers the target sending device, the following steps are further included: Determine whether the preset information sending conditions are currently met. If the preset information sending conditions are currently met, send its own device key information to the host end, so that the host end can perform the step of registering the target sending device after monitoring the device key information using the preset service driver. In some embodiments of the present application, the service driver is a program that is pre-run on the host side and performs device registration. In some embodiments of the present application, the host sends its own device key information to the host, so that the host performs the step of registering the target sending device after monitoring the device key information using a preset service driver, including: The key information of the device itself is sent to the host side by calling the pre-generated registration function interface, so that the host side can use the service driver to monitor the calling of the registration function interface. If the registration function interface is monitored to be called, it is determined that the key information of the device is monitored, and the steps of registering the target sending device are executed. In some embodiments of the present application, the registration function interface is exported by the service driver by executing a symbolic export library function. In some embodiments of the present application, the execution symbol export library function is an EXPORT_SYMBOL_GPL function. In some embodiments of the present application, sending device key information of a target sending device to a host end so that the host end registers the target sending device includes: The device key information of the target sending device is sent to the host side, so that the host side stores the device key information sent by the target sending device locally. In some embodiments of the present application, after sending the device key information of the target sending device to the host end so that the host end stores the device key information sent by the target sending device locally, it also includes: A device matching instruction is sent to the host side, so that the host side matches a target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device from the registered devices according to the device matching instruction, and reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device; wherein the target receiving device has been registered on the host side. In some embodiments of the present application, obtaining the internal address of the target receiving device includes: The receiving host returns the internal address and corresponding address type of the target receiving device by calling the callback function in the device key information of the target sending device; wherein the host also sends the device key information of the target sending device to the target receiving device by calling the callback function in the device key information of the target sending device. In some embodiments of the present application, data processing includes reading data from an internal address or writing data to an internal address; the type of data processing depends on the type of the target receiving device according to the target data packet; the target data The type of packet depends on the address type of the internal address of the intended receiving device. In some embodiments of the present application, after sending the target data packet to the target receiving device so that the target receiving device processes the data according to the internal address, the method further includes: Receive a confirmation data packet returned by the target sending device; wherein the confirmation data packet is generated and returned by the target receiving device according to the device key information of the target sending device. In some embodiments of the present application, after obtaining the internal address of the target receiving device, the method further includes: The receiving host returns the host mapping address in the device key information of the target receiving device by calling the callback function in the device key information of the target sending device, so that the target data packet also carries the host mapping address in the device key information of the target receiving device. In some embodiments of the present application, sending a target data packet to a target receiving device includes: The target data packet is sent to the target receiving device so that the target receiving device parses the target data packet to obtain the host mapping address in the device key information of the target receiving device, and determines whether the host mapping address is a host mapping address for point-to-point communication. If the host mapping address is a host mapping address for point-to-point communication, the step of performing data processing on the internal address is executed. In some embodiments of the present application, the data packets transmitted between the target sending device and the target receiving device are TLP packets. In the embodiment of the present application, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to the specific application needs, and is not specifically limited here. In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon may include an operating system 221, a computer program 222 and data 223, etc. The storage method can be temporary storage or permanent storage. The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the device-to-device point-to-point communication method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. The data 223 can include internal addresses collected by the electronic device 20. In some embodiments of the present application, the present application also discloses a computer non-volatile readable storage medium, in which a computer program is stored. When the computer program is loaded and executed by a processor, Implement at least the following steps: Obtain the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; Constructing a target protocol including an internal address of a target receiving device according to a preset protocol format, and generating a target data packet carrying the target protocol; The target data packet is sent to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain an internal address, and performs data processing on the internal address. In some embodiments of the present application, before obtaining the internal address of the target receiving device, it also includes: The device key information of the target sending device is sent to the host side so that the host side can register the target sending device and return the internal address of the target receiving device. In some embodiments of the present application, the device key information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, available addresses inside the device, and a callback function. In some embodiments of the present application, the internal available address of the device includes at least a host mapping address, an internal address, an address length, and an address type. In some embodiments of the present application, before the host registers the target sending device, the following steps are further included: Determine whether the preset information sending conditions are currently met. If the preset information sending conditions are currently met, send its own device key information to the host end, so that the host end can perform the step of registering the target sending device after monitoring the device key information using the preset service driver. In some embodiments of the present application, the service driver is a program that is pre-run on the host side and performs device registration. In some embodiments of the present application, the host sends its own device key information to the host, so that the host performs the step of registering the target sending device after monitoring the device key information using a preset service driver, including: The key information of the device itself is sent to the host side by calling the pre-generated registration function interface, so that the host side can use the service driver to monitor the calling of the registration function interface. If the registration function interface is monitored to be called, it is determined that the key information of the device is monitored, and the steps of registering the target sending device are executed. In some embodiments of the present application, the registration function interface is exported by the service driver by executing a symbolic export library function. In some embodiments of the present application, the execution symbol export library function is an EXPORT_SYMBOL_GPL function. In some embodiments of the present application, sending device key information of a target sending device to a host end so that the host end registers the target sending device includes: The device key information of the target sending device is sent to the host side, so that the host side stores the device key information sent by the target sending device locally. In some embodiments of the present application, after sending the device key information of the target sending device to the host end so that the host end stores the device key information sent by the target sending device locally, it also includes: A device matching instruction is sent to the host side, so that the host side matches a target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device from the registered devices according to the device matching instruction, and reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device; wherein the target receiving device has been registered on the host side. In some embodiments of the present application, obtaining the internal address of the target receiving device includes: The receiving host returns the internal address and corresponding address type of the target receiving device by calling the callback function in the device key information of the target sending device; wherein the host also sends the device key information of the target sending device to the target receiving device by calling the callback function in the device key information of the target sending device. In some embodiments of the present application, data processing includes reading data from an internal address or writing data to an internal address; the type of data processing depends on the target receiving device according to the type of the target data packet; the type of the target data packet depends on the address type of the internal address of the target receiving device. In some embodiments of the present application, after sending the target data packet to the target receiving device so that the target receiving device processes the data according to the internal address, the method further includes: Receive a confirmation data packet returned by the target sending device; wherein the confirmation data packet is generated and returned by the target receiving device according to the device key information of the target sending device. In some embodiments of the present application, after obtaining the internal address of the target receiving device, the method further includes: The receiving host returns the host mapping address in the device key information of the target receiving device by calling the callback function in the device key information of the target sending device, so that the target data packet also carries the host mapping address in the device key information of the target receiving device. In some embodiments of the present application, sending a target data packet to a target receiving device includes: The target data packet is sent to the target receiving device so that the target receiving device parses the target data packet to obtain the host mapping address in the device key information of the target receiving device, and determines whether the host mapping address is the host mapping address for point-to-point communication. If the host mapping address is the host mapping address for point-to-point communication, the step of performing data processing on the internal address is executed. In some embodiments of the present application, the data packets transmitted between the target sending device and the target receiving device are TLP packets. The embodiment of the present application also provides a computer non-volatile readable storage medium, as shown in FIG11 , a computer program 1101 is stored on the computer non-volatile readable storage medium, and when the computer program 1101 is executed by the processor, each process of the above data acquisition method embodiment is implemented, and the same technical effect can be achieved, so it will not be repeated here to avoid repetition. Computer non-volatile readable storage media, such as read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part. Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements. The above is a detailed introduction to the point-to-point communication method, system, apparatus, device and computer non-volatile readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A point-to-point communication method between devices, It is characterized in that Applied to target sending devices, including: Obtaining an internal address of a target receiving device; wherein both the target sending device and the target receiving device are PCIE devices; Constructing a target protocol including the internal address of the target receiving device according to a preset protocol format, and generating a target data packet carrying the target protocol; The target data packet is sent to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain the internal address, and performs data processing on the internal address.

2. The device-to-device point-to-point communication method according to claim 1, It is characterized in that Before obtaining the internal address of the target receiving device, the method further includes: The device key information of the target sending device is sent to the host end, so that the host end registers the target sending device and returns the internal address of the target receiving device.

3. The device-to-device point-to-point communication method according to claim 2, It is characterized in that The key device information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, available addresses inside the device, and a callback function.

4. The device-to-device point-to-point communication method according to claim 3, It is characterized in that The available addresses inside the device include at least a host mapping address, an internal address, an address length and an address type.

5. The device-to-device point-to-point communication method according to claim 4, It is characterized in that Before the host end registers the target sending device, the method further includes: Determine whether the preset information sending conditions are currently met. If the preset information sending conditions are currently met, send its own device key information to the host end, so that the host end can perform the step of registering the target sending device after monitoring the device key information using the preset service driver.

6. The device-to-device point-to-point communication method according to claim 5, It is characterized in that The service driver is a program that is pre-run on the host side and performs device registration.

7. The device-to-device point-to-point communication method according to claim 5, It is characterized in that The step of sending the key device information of the host side so that the host side registers the target sending device after monitoring the key device information by using a preset service driver includes: The key information of the device is sent to the host side by calling the pre-generated registration function interface, so that the host side uses the service driver to monitor the calling of the registration function interface. If the registration function interface is called, it is determined that the key information of the device is monitored, and the host side executes the calling of the registration function interface. Describe the steps for registering the target sending device.

8. The device-to-device point-to-point communication method according to claim 7, It is characterized in that The registration function interface is exported by the service driver through executing a symbol export library function.

9. The device-to-device point-to-point communication method according to claim 8, It is characterized in that The execution symbol export library function is the EXPORT_SYMBOL_GPL function.

10. The device-to-device point-to-point communication method according to claim 4, It is characterized in that The sending of the device key information of the target sending device to the host end so that the host end registers the target sending device includes: The device key information of the target sending device is sent to the host end, so that the host end stores the device key information sent by the target sending device locally.

11. The device-to-device point-to-point communication method according to claim 10, It is characterized in that After sending the device key information of the target sending device to the host end so that the host end stores the device key information sent by the target sending device locally, the method further includes: A device matching instruction is sent to the host end so that the host end matches the target receiving device whose device type is consistent with the matching receiving device type in the device key information sent by the target sending device from the registered devices according to the device matching instruction, and reads the internal address in the device key information of the target receiving device stored locally, and returns the internal address of the target receiving device; wherein the target receiving device has been registered on the host end.

12. The device-to-device point-to-point communication method according to claim 11, It is characterized in that Get the internal address of the target receiving device, including: Receive the internal address and corresponding address type of the target receiving device returned by the host side by calling the callback function in the device key information of the target sending device; wherein the host side also sends the device key information of the target sending device to the target receiving device by calling the callback function in the device key information of the target sending device.

13. The device-to-device point-to-point communication method according to claim 12, It is characterized in that Data processing includes reading data from the internal address or writing data to the internal address; the type of data processing depends on the type of the target data packet according to the target receiving device; the type of the target data packet depends on the address type of the internal address of the target receiving device.

14. The device-to-device point-to-point communication method according to claim 13, It is characterized in that After sending the target data packet to the target receiving device so that the target receiving device processes the data according to the internal address, the method further includes: Receive a confirmation data packet returned by the target sending device; wherein the confirmation data packet is generated and returned by the target receiving device according to the device key information of the target sending device.

15. The device-to-device point-to-point communication method according to claim 12, It is characterized in that After obtaining the internal address of the target receiving device, the method further includes: The host end receives the host mapping address in the device key information of the target receiving device returned by calling the callback function in the device key information of the target sending device, so that the target data packet also carries the host mapping address in the device key information of the target receiving device.

16. The device-to-device point-to-point communication method according to claim 15, It is characterized in that The sending of the target data packet to the target receiving device comprises: The target data packet is sent to the target receiving device so that the target receiving device parses the target data packet to obtain the host mapping address in the device key information of the target receiving device, and determines whether the host mapping address is a host mapping address for point-to-point communication. If the host mapping address is a host mapping address for point-to-point communication, the step of performing data processing on the internal address is executed.

17. The device-to-device point-to-point communication method according to any one of claims 1 to 16, It is characterized in that The data packets transmitted between the target sending device and the target receiving device are TLP packets.

18. A point-to-point communication method between devices, It is characterized in that Applied to target receiving devices, including: Receive a target data packet carrying a target protocol generated and sent by a target sending device; wherein both the target sending device and the target receiving device are PCIE devices; the target protocol is a protocol including the internal address of the target receiving device and constructed according to a preset protocol format after the target sending device obtains the internal address of the target receiving device; The target protocol carried by the target data packet is parsed to obtain the internal address, and data processing is performed on the internal address.

19. The device-to-device point-to-point communication method according to claim 18, It is characterized in that The target sending device obtains the internal address of the target receiving device in the following manner: The target sending device sends the device key information of the target sending device to the host end, so that the host end registers the target sending device and returns the internal address of the target receiving device; the device key information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, an internal available address of the device, and a callback function; the internal available address of the device includes at least a host mapping address, an internal address, an address length, and an address type; The target sending device receives the internal address of the target receiving device returned by the host end by calling the callback function in the device key information of the target sending device.

20. A point-to-point communication system between devices, It is characterized in that It includes a target sending device and a target receiving device, wherein: The target sending device is used to obtain the internal address of the target receiving device; wherein the target sending device and the target receiving device are both PCIE devices; and construct a target protocol containing the internal address of the target receiving device according to a preset protocol format, generate a target data packet carrying the target protocol; and send the target data packet to the target receiving device; The target receiving device is used to parse the target protocol carried by the target data packet to obtain the internal address after receiving the target data packet, and perform data processing on the internal address.

21. The device-to-device point-to-point communication system according to claim 20, It is characterized in that It also includes the host side; Correspondingly, the target sending device is also used to send the device key information of the target sending device to the host end; The host end is used to register the target sending device and return the internal address of the target receiving device.

22. The device-to-device point-to-point communication system according to claim 20 or 21, It is characterized in that The target sending device is further used to send the device key information of the target sending device to the host end; the device key information of the target sending device at least includes the device identification, the matching receiving device type, the number of addresses, the device internal available addresses and the callback function; the device internal available addresses at least include the host mapping address, the internal address, the address length and the address type; The target sending device is also used to receive the internal address of the target receiving device returned by the host end by calling the callback function in the device key information of the target sending device.

23. A point-to-point communication device between devices, It is characterized in that Applied to target sending devices, including: An acquisition module, used to acquire an internal address of a target receiving device; wherein both the target sending device and the target receiving device are PCIE devices; A data packet generation module, used to construct a target protocol including the internal address of the target receiving device according to a preset protocol format, and generate a target data packet carrying the target protocol; The data packet sending module is used to send the target data packet to the target receiving device, so that after receiving the target data packet, the target receiving device parses the target protocol carried by the target data packet to obtain the internal address and performs data processing on the internal address.

24. The device for point-to-point communication between devices according to claim 23, It is characterized in that The inter-device point-to-point communication device is also used for: Sending the device key information of the target sending device to the host side so that the host side registers the target sending device and returns the internal address of the target receiving device; the device key information of the target sending device includes at least a device identifier, a matching receiving device type, a number of addresses, a device internal available address, and a callback function; the device internal available address includes at least a host mapping address, an internal address, an address length, and an address type; The host receives the internal address of the target receiving device returned by calling a callback function in the device key information of the target sending device.

25. An electronic device, It is characterized in that The electronic device comprises a processor and a memory; wherein the memory is used to store a computer program, and the computer program is loaded and executed by the processor to implement the inter-device point-to-point communication method as described in any one of claims 1 to 19.

26. A computer non-volatile readable storage medium, It is characterized in that Used to store computer executable instructions, which, when loaded and executed by a processor, implement the inter-device point-to-point communication method as described in any one of claims 1 to 19.

Citation Information

Patent Citations

  • Method, device and system for transmitting messages on PCIE bus

    CN102694717A

  • Data transmission equipment, data processing system, message distribution method and message distribution device

    CN111224851A

  • Data transmission method and system and computer readable storage medium

    CN114389947A

  • Point-to-point communication method, system and device between equipment, equipment and storage medium

    CN115865944A

  • Transaction layer packet format

    US20200226091A1