Communication method and device based on non-transparent bridge

By allocating additional BAR space to the device and setting the tag register, a one-to-many mapping is achieved, which solves the problem of excessive memory resource consumption in the existing technology and improves the memory utilization of the device system.

CN119292983APending Publication Date: 2025-01-10WELL CORE MICROELECTRONICS TECH (TIANJIN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411396555.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-30
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In existing communication methods based on non-transparent bridges, the one-to-one mapping of BAR spaces between devices leads to excessive memory resource consumption, affecting other operations of the device system.

Method used

Allocate new BAR space to the device and set the corresponding tag register. Map multiple initial BAR spaces through one new BAR space to achieve one-to-many mapping and reduce memory space usage.

Benefits of technology

This saves memory space used for mapping the BAR space of the peer device, increases the available memory resources of the device system, and avoids affecting other operations of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292983A_ABST
    Figure CN119292983A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method and device based on a non-transparent bridge, and relates to the technical field of communication. The method comprises the following steps: allocating a newly added base address register (BAR) space for first equipment, and allocating a tag register corresponding to the newly added BAR space equipment; setting a tag register corresponding to the newly added BAR space based on a target address space of the second equipment; and the first equipment realizes communication with the second equipment through mapping between the newly added BAR space of the first equipment and the target address space of the second equipment. Through the newly added BAR space and the corresponding tag register, the first device maps all the initial BAR spaces in the second device through the newly added BAR space, one-to-many mapping is realized, the memory space for mapping the BAR space of the opposite terminal device can be saved, the occupation of the memory space is reduced, available memory resources of the device system are increased, and the user experience is improved. Therefore, other work of the equipment is prevented from being influenced.
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 and device based on a non-transparent bridge. Background Art

[0002] PCI-Express (Peripheral Component Interconnect Express, referred to as PCIe) is a high-speed serial computer expansion bus standard used for communication between internal components of a computer, with high throughput and low latency transmission characteristics.

[0003] A non-transparent bridge (NTB) is a special PCIe bridge that provides an efficient way to achieve communication between multiple PCIe endpoints. Specifically, a non-transparent bridge includes two endpoints, which can be called a virtual side endpoint and a link side endpoint, respectively, to connect two different PCIe domains.

[0004] In the current technology, the communication method based on the non-transparent bridge is: pre-add a BAR space of the same size as the base address register BAR space of the opposite device to the local device, and map the BAR space of the opposite device to the BAR space added by the local device one-to-one, so as to realize the communication between the two devices through the mapping of the BAR space of the local device and the opposite device.

[0005] It can be seen from this that in the current communication method based on non-transparent bridges, the BAR space in the devices at both ends is mapped one-to-one, which requires a large memory space, resulting in less memory resources available to the device system, which may affect other work of the device. Summary of the invention

[0006] Based on the above problems, the present application provides a communication method and device based on a non-transparent bridge, which can save memory space used to map the BAR space of the peer device, reduce the occupancy of memory space, and increase the memory resources available to the device system, thereby avoiding affecting other operations of the device.

[0007] The embodiments of the present application disclose the following technical solutions:

[0008] In a first aspect, the present application discloses a communication method based on a non-transparent bridge, characterized in that corresponding unique labels are pre-assigned to one or more initial base address register BAR spaces in a first device and a second device, respectively, and the first device and the second device are devices connected to two ports of the non-transparent bridge respectively; the method comprises:

[0009] Allocate a newly added BAR space for the first device, and set a corresponding label register for the newly added BAR space;

[0010] Based on the target address space of the second device, set the label register corresponding to the newly added BAR space to map the target address space of the second device to the newly added BAR space of the first device; so that the first device can communicate with the second device through mapping its own newly added BAR space with the target address space of the second device.

[0011] Optionally, the setting, based on the target address space of the second device, a label register corresponding to the newly added BAR space includes:

[0012] Based on the target address space of the second device, determining an initial BAR space in the second device corresponding to the target address space;

[0013] The unique label corresponding to the corresponding initial BAR space is set to the label register corresponding to the newly added BAR space.

[0014] Optionally, allocating a new BAR space to the first device and setting a corresponding label register for the new BAR space includes:

[0015] Allocate a newly added BAR space for the first device, and reserve a space between an initial BAR space of the first device and the newly added BAR space; the newly added BAR space has the same size as an initial BAR space of the second device;

[0016] A label register corresponding to the newly added BAR space is set in the reserved space.

[0017] Optionally, pre-allocating corresponding unique labels to one or more initial base address register BAR spaces in the first device and the second device respectively includes:

[0018] In response to power-on startup of the first device, assigning corresponding unique tags to one or more initial BAR spaces in the first device;

[0019] And, in response to power-on startup of the second device, a corresponding unique label is allocated to one or more initial BAR spaces in the second device.

[0020] Optionally, the unique label includes: a label value; and a label register of the first device is used to store a label value corresponding to an initial BAR space corresponding to the second device.

[0021] Optionally, after setting the tag register corresponding to the newly added BAR space based on the target address space of the second device to realize the newly added BAR space of the first device and the target address space of the second device, the method further includes:

[0022] The first device receives a read request for a target address space of the second device;

[0023] In response to the read request, the first device reads the data stored in the newly added BAR space of the first device to read the data stored in the target address space of the second device.

[0024] Optionally, after setting the tag register corresponding to the newly added BAR space based on the target address space of the second device to realize the newly added BAR space of the first device and the target address space of the second device, the method further includes:

[0025] The first device receives a write request for a target address space of the second device; wherein the write request carries write data;

[0026] In response to the write request, the first device writes the write data carried by the write request into the newly added BAR space of the first device, so as to write the write data into the target address space of the second device.

[0027] In a second aspect, the present application discloses a communication device based on a non-transparent bridge, comprising:

[0028] A label allocation module, used to pre-allocate corresponding unique labels to one or more initial base address register BAR spaces in a first device and a second device, respectively, wherein the first device and the second device are devices connected to two ports of the non-transparent bridge;

[0029] a space allocation module, configured to allocate a newly added BAR space to the first device and set a corresponding label register for the newly added BAR space;

[0030] A space mapping module is used to set the label register corresponding to the newly added BAR space based on the target address space of the second device, so as to map the target address space of the second device to the newly added BAR space of the first device; so that the first device can communicate with the second device through mapping its own newly added BAR space with the target address space of the second device.

[0031] Optionally, the space mapping module is specifically used to:

[0032] Based on the target address space of the second device, determining an initial BAR space in the second device corresponding to the target address space;

[0033] The unique label corresponding to the corresponding initial BAR space is set to the label register corresponding to the newly added BAR space.

[0034] Optionally, the space allocation module is specifically used to:

[0035] Allocate a newly added BAR space for the first device, and reserve a space between an initial BAR space of the first device and the newly added BAR space; the newly added BAR space has the same size as an initial BAR space of the second device;

[0036] A label register corresponding to the newly added BAR space is set in the reserved space.

[0037] Optionally, the label allocation module 601 is specifically used to allocate corresponding unique labels to one or more initial BAR spaces in the first device in response to power-on startup of the first device; and, in response to power-on startup of the second device, allocate corresponding unique labels to one or more initial BAR spaces in the second device.

[0038] Compared with the prior art, the present application has the following beneficial effects: by adding a new BAR space and its corresponding label register, the first device can map all the initial BAR spaces in the second device through a newly added BAR space, that is, a one-to-many mapping is achieved, and there is no need to add a BAR space of the same size as all the BAR spaces in the second device. This can save memory space used to map the BAR space of the opposite device, reduce the occupancy of memory space, and increase the memory resources available to the device system, thereby avoiding affecting other operations of the device. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0040] Figure 1 A schematic diagram of the topological structure of a non-transparent bridge provided in an embodiment of the present application;

[0041] Figure 2 A schematic diagram of the mapping relationship between the BAR spaces of the devices at both ends of a non-transparent bridge in the current technology;

[0042] Figure 3 A flow chart of a communication method based on a non-transparent bridge provided in an embodiment of the present application;

[0043] Figure 4 A schematic diagram of the positional relationship between a newly added BAR space and its corresponding tag register provided in an embodiment of the present application;

[0044] Figure 5 A schematic diagram of a mapping relationship between the BAR spaces of a first device and a second device provided in an embodiment of the present application;

[0045] Figure 6 A schematic diagram of the structure of a communication device based on a non-transparent bridge provided in an embodiment of the present application. DETAILED DESCRIPTION

[0046] First combine Figure 1 , let’s take an example to introduce the topology of a non-transparent bridge.

[0047] like Figure 1 As shown, the virtual side host is connected to two PCI-to-PCI bridges (PCI-to-PCI Bridge) through an upstream bus (Upstream Bus), and the two PCI-to-PCI bridges are connected through an internal virtual PCI bus (Internal VirtualPCI Bus); the PCI bridge is connected to the virtual side port (Virtual Side Endpoint) in the non-transparent bridge through a downstream bus (Downstream Bus), and the link side port (Link Side Endpoint) in the non-transparent bridge is connected to the link side host through the downstream bus.

[0048] The virtual side host refers to the control unit in the system, which is responsible for processing PCIe bus transactions, such as the central processing unit CPU.

[0049] The link side host usually refers to a device or system component connected to a PCIe link and is responsible for handling PCIe link transactions. The link side host can be a physical device, a virtual machine, or other similar entity.

[0050] From the above description, we can Figure 1 The topological structure of the non-transparent bridge shown is understood as follows: a virtual-side port of the non-transparent bridge is connected to a virtual-side host, and a link-side port of the non-transparent bridge is connected to a link-side host.

[0051] In current technology, if we want to achieve Figure 1In order to realize communication between the virtual side host and the link side host through a non-transparent bridge, it is necessary to add a BAR space of the same size as the base address register (Base Address Register, BAR) space of the link side host to the virtual side host in advance, that is, to add the same number of BAR spaces as the base address register space of the link side host to the virtual side host, and map the BAR space of the link side host to the added BAR space in the virtual side host one-to-one; similarly, to add a BAR space of the same size as the BAR space of the virtual side host to the link side host in advance, that is, to add the same number of BAR spaces as the base address register space of the virtual side host to the link side host, and map the BAR space of the virtual side host to the added BAR space in the link side host one-to-one, and complete the mapping of the BAR space of the virtual side host and the BAR space of the link side host; based on the mapping of the BAR space between the virtual side host and the link side host, the communication between the virtual side host and the link side host is realized.

[0052] For ease of understanding, the following Figure 2 , an example is given to illustrate the mapping of the BAR space of the virtual side host and the link side host and the BAR space of the link side host in the current technology.

[0053] The virtual side host originally has three BAR spaces, namely BAR space 10, BAR space 11 and BAR space 12, and the link side host originally has two BAR spaces, namely BAR space 20 and BAR space 21. For the virtual side host, two BAR spaces need to be added, namely BAR space 13 and BAR space 14, and the BAR space 20 in the link side host is mapped to BAR space 13, and the BAR space 21 in the link side host is mapped to BAR space 14. Similarly, for the link side host, three BAR spaces need to be added, namely BAR space 22, BAR space 23 and BAR space 24, and the BAR space 10 in the virtual side host is mapped to BAR space 22, the BAR space 11 in the virtual side host is mapped to BAR space 23, and the BAR space 12 in the virtual side host is mapped to BAR space 24. Subsequently, the virtual side host and the link side host communicate based on the one-to-one mapping of BAR spaces.

[0054] To summarize, in the current communication method based on a non-transparent bridge, the BAR space in the devices connected by the two ports is mapped one-to-one, that is, the local device needs to increase the BAR space of the same size as the BAR space in the opposite device, resulting in the increased BAR space used to map the BAR space of the opposite device occupying a larger memory space, resulting in less memory resources available to the device system, and may even affect other operations of the device.

[0055] The present application provides a communication method based on a non-transparent bridge, including: allocating a newly added BAR space to a first device, and a label register corresponding to the newly added BAR space device; based on the target address space of the second device, setting the label register corresponding to the newly added BAR space; the first device realizes communication with the second device by mapping its own newly added BAR space with the target address space of the second device. In the embodiment of the present application, by adding a new BAR space and its corresponding label register, the first device can map all the initial BAR spaces in the second device through a newly added BAR space, that is, a one-to-many mapping is realized, and there is no need to add a BAR space of the same size as all the BAR spaces in the second device, which can save memory space used to map the BAR space of the opposite device, reduce the occupation of memory space, and increase the memory resources available to the device system, thereby avoiding affecting other work of the device.

[0056] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings 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.

[0057] Embodiment 1:

[0058] Combine the following Figure 3-Figure 5 , a communication method based on a non-transparent bridge provided in an embodiment of the present application is introduced in detail.

[0059] Before performing a communication method based on a non-transparent bridge provided in an embodiment of the present application, corresponding unique labels are pre-allocated to one or more initial base address register BAR spaces in the first device and the second device, respectively.

[0060] The first device and the second device are devices connected to two ports of the non-transparent bridge, respectively. Exemplarily, the non-transparent bridge includes two ports, namely, a first port (e.g., a virtual side port) and a second port (e.g., a link side port), and the device connected to the first port is the first device, and the device connected to the second port is the second device.

[0061] Among them, the base address register (BAR) is a special register used to store the physical address range of the device. The base address register space (BAR space) refers to the memory address range specified by these base address registers, defining the memory area that a device can use.

[0062] The initial BAR space is an initially existing BAR space of the first device and / or the second device.

[0063] The unique tag is used to uniquely identify the initial BAR space in the first device and / or the second device. Exemplarily, the unique tag may be a tag value.

[0064] In one possible implementation, in response to power-on startup of the first device, a corresponding unique tag is assigned to one or more initial BAR spaces in the first device; and in response to power-on startup of the second device, a corresponding unique tag is assigned to one or more initial BAR spaces in the second device.

[0065] The above ensures that before the first device and the second device communicate, corresponding unique tags are allocated to one or more initial BAR spaces in the first device and the second device, avoiding the failure to timely allocate corresponding unique tags to the initial BAR spaces of the first device and / or the second device, which affects the implementation of the overall solution.

[0066] After one or more initial BAR spaces in the first device and the second device have been assigned corresponding unique labels, such as Figure 3 As shown, a communication method based on a non-transparent bridge provided in an embodiment of the present application includes the following steps:

[0067] S301. Allocate a newly added BAR space for a first device, and create a label register corresponding to the newly added BAR space device.

[0068] The newly added BAR space allocated to the first device is the same size as any initial BAR space in the second device, that is, a BAR space is allocated / added to the first device as the newly added BAR space.

[0069] The tag register is used to identify the initial BAR space in the second device to which the newly added BAR space is mapped. That is, the tag register is used to store the unique identifier of the initial BAR space in the second device, thereby mapping the initial BAR space in the second device to the newly added BAR space.

[0070] In a possible implementation, a newly added BAR space is allocated to the first device, and a space is reserved between the initial BAR space of the first device and the newly added BAR space; a label register corresponding to the newly added BAR space is set in the reserved space.

[0071] For ease of understanding, the following Figure 4 The following example introduces the positional relationship between the newly added BAR space and its corresponding tag register. Figure 4In the example, it is taken that the first device includes four initial BAR spaces, namely BAR space 411, BAR space 412, BAR space 413 and BAR space 414, and the unique labels corresponding to the four initial BAR spaces are 411, 412, 413 and 414.

[0072] like Figure 4 As shown, a newly added BAR space is allocated to the first device, and the newly added BAR space is BAR space 415. A space is reserved between BAR space 415 and BAR space 414, and a label register corresponding to BAR space 415 is in the reserved space.

[0073] S302: Based on the target address space of the second device, set a label register corresponding to the newly added BAR space.

[0074] The target address space is the address space in the second device that the first device requests to access, or the address space in the second device that is requested to establish communication with the first device.

[0075] Specifically, based on the target address space of the second device, setting the label register corresponding to the newly added BAR space can map the target address space of the second device to the newly added BAR space of the first device, that is, completing the mapping of the newly added BAR space of the first device and the target address space of the second device.

[0076] In one possible implementation, based on the target address space of the second device, the initial BAR space in the second device corresponding to the target address space is determined; the unique label corresponding to the initial BAR space corresponding to the target address space is set to the label register corresponding to the newly added BAR space to complete the mapping of the initial BAR space corresponding to the target address space in the second device to the newly added BAR space of the first device, that is, to complete the mapping of the newly added BAR space of the first device and the initial BAR space of the second device.

[0077] For ease of understanding, the following Figure 5 An example is given to describe the mapping between the newly added BAR space of the first device and the initial BAR space of the second device.

[0078] like Figure 5As shown, the first device includes four initial BAR spaces, namely BAR space 511, BAR space 512, BAR space 513 and BAR space 514, wherein the unique label of BAR space 511 is 511, the unique label of BAR space 512 is 512, the unique label of BAR space 513 is 513, and the unique label of BAR space 514 is 514, and the first device also includes one newly added BAR space, which is BAR space 515, and a label register corresponding to BAR space 515 is set in a space reserved between BAR space 514 and BAR space 515. The second device includes three initial BAR spaces, namely BAR space 521, BAR space 522 and BAR space 523, wherein the unique label of BAR space 521 is 521, the unique label of BAR space 522 is 522, and the unique label of BAR space 523 is 523, and the second device also includes one newly added BAR space, which is BAR space 524. A label register corresponding to BAR space 524 is set in a space reserved between BAR space 523 and BAR space 524.

[0079] For example, Figure 5 As shown in (a), when it is determined that the initial BAR space corresponding to the target address space of the second device is BAR space 523, the unique tag 523 of BAR space 523 is set to the tag register corresponding to BAR space 515 to realize the mapping of BAR space 523 in the second device to BAR space 515 in the first device, thereby completing the mapping of BAR space 515 in the first device and BAR space 523 in the second device.

[0080] Exemplarily, when the initial BAR space corresponding to the target address space is switched from BAR space 5123 to BAR space 521, the unique label 523 stored in the label register corresponding to BAR space 515 is modified to the unique label 521 of BAR space 521, so as to realize the mapping of BAR space 521 in the second device to BAR space 515 in the first device, thereby completing the mapping of BAR space 515 in the first device and BAR space 521 in the second device.

[0081] S303: The first device communicates with the second device by mapping its newly added BAR space with the target address space of the second device.

[0082] In one possible implementation, the first device receives a read request for a target address space of the second device; in response to the read request, the first device reads data stored in a newly added BAR space of the first device to read data stored in the target address space of the second device.

[0083] In another possible implementation, the first device receives a write request for a target address space of a second device, the write request carrying write data; the first device responds to the write request by writing the write data carried by the write request into a newly added BAR space of the first device, so as to write the write data into the target address space of the second device.

[0084] It should be noted that the above only describes a communication method based on a non-transparent bridge provided in an embodiment of the present application from the perspective of the first device as an example; the second device can similarly achieve communication through the method described in the above embodiment 1, which will not be repeated here.

[0085] The embodiment of the present application provides a communication method based on a non-transparent bridge, including: allocating a newly added BAR space to a first device, and a label register corresponding to the newly added BAR space device; based on the target address space of the second device, setting the label register corresponding to the newly added BAR space; the first device realizes communication with the second device by mapping its own newly added BAR space with the target address space of the second device. In the embodiment of the present application, by adding a new BAR space and its corresponding label register, the first device can map all the initial BAR spaces in the second device through a newly added BAR space, that is, a one-to-many mapping is realized, and there is no need to add a BAR space of the same size as all the BAR spaces in the second device, which can save memory space used to map the BAR space of the opposite device, reduce the occupation of memory space, and increase the memory resources available to the device system, thereby avoiding affecting other work of the device.

[0086] Embodiment 2:

[0087] Combine the following Figure 6 , a communication device based on a non-transparent bridge provided in an embodiment of the present application is introduced in detail.

[0088] like Figure 6 As shown, a communication device based on a non-transparent bridge provided in an embodiment of the present application includes the following modules:

[0089] The label allocation module 601 is used to pre-allocate corresponding unique labels to one or more initial BAR spaces in the first device and the second device respectively;

[0090] A space allocation module 602, configured to allocate a newly added BAR space to the first device and set a corresponding label register for the newly added BAR space;

[0091] The space mapping module 603 is used to set the tag register corresponding to the newly added BAR space based on the target address space of the second device, so as to realize mapping the target address space of the second device to the newly added BAR space of the first device. After realizing mapping the target address space of the second device to the newly added BAR space in the first device, the first device realizes communication with the second device by mapping its own newly added BAR space with the target address space of the second device.

[0092] In one possible implementation, the space mapping module 603 is specifically used to determine the initial BAR space corresponding to the target address space in the second device based on the target address space of the second device; and set the unique label corresponding to the initial BAR space corresponding to the target address space to the label register corresponding to the newly added BAR space.

[0093] In a possible implementation, the space allocation module 602 is specifically configured to allocate a newly added BAR space to the first device, and reserve a space between the initial BAR space of the first device and the newly added BAR space; and set a tag register corresponding to the newly added BAR space in the reserved space. The size of the newly added BAR space is the same as the size of an initial BAR space in the second device.

[0094] In one possible implementation, the label allocation module 601 is specifically used to allocate corresponding unique labels to one or more initial BAR spaces in the first device in response to power-on startup of the first device; and, in response to power-on startup of the second device, allocate corresponding unique labels to one or more initial BAR spaces in the second device.

[0095] The embodiment of the present application provides a communication device based on a non-transparent bridge, including: a label allocation module 601, which is used to pre-allocate corresponding unique labels to one or more initial BAR spaces in the first device and the second device respectively; a space allocation module 602, which is used to allocate a newly added BAR space to the first device and set a corresponding label register for the newly added BAR space; a space mapping module 603, which is used to set a label register corresponding to the newly added BAR space based on the target address space of the second device, so as to achieve mapping the target address space of the second device to the newly added BAR space of the first device. The embodiment of the present application realizes that the first device can map all the initial BAR spaces in the second device through a newly added BAR space through the newly added BAR space and its corresponding label register, that is, one-to-many mapping is achieved, and there is no need to increase the BAR space of the same size as all the BAR spaces in the second device, which can save the memory space used to map the BAR space of the opposite device, reduce the occupation of the memory space, and increase the memory resources available to the device system, thereby avoiding affecting other work of the device.

[0096] It should be noted that each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the method and device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The method and device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0097] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A communication method based on a non-transparent bridge, characterized in that: Pre-allocating corresponding unique labels to one or more initial base address register BAR spaces in a first device and a second device, respectively, wherein the first device and the second device are devices connected to two ports of the non-transparent bridge; the method comprises: Allocate a newly added BAR space for the first device, and set a corresponding label register for the newly added BAR space; Based on the target address space of the second device, set the label register corresponding to the newly added BAR space to map the target address space of the second device to the newly added BAR space of the first device; so that the first device can communicate with the second device through mapping its own newly added BAR space with the target address space of the second device.

2. The method according to claim 1, characterized in that The setting, based on the target address space of the second device, a label register corresponding to the newly added BAR space includes: Based on the target address space of the second device, determining an initial BAR space in the second device corresponding to the target address space; The unique label corresponding to the corresponding initial BAR space is set to the label register corresponding to the newly added BAR space.

3. The method according to claim 1, characterized in that The allocating a new BAR space to the first device and setting a corresponding label register for the new BAR space includes: Allocate a newly added BAR space for the first device, and reserve a space between an initial BAR space of the first device and the newly added BAR space; the newly added BAR space has the same size as an initial BAR space of the second device; A label register corresponding to the newly added BAR space is set in the reserved space.

4. The method according to claim 1, characterized in that: The pre-allocating corresponding unique labels to one or more initial base address register BAR spaces in the first device and the second device respectively includes: In response to power-on startup of the first device, assigning corresponding unique tags to one or more initial BAR spaces in the first device; And, in response to power-on startup of the second device, a corresponding unique label is allocated to one or more initial BAR spaces in the second device.

5. The method according to claim 1, characterized in that The unique label includes: a label value; the label register of the first device is used to store the label value corresponding to the initial BAR space corresponding to the second device.

6. The method according to claim 1, characterized in that After setting the tag register corresponding to the newly added BAR space based on the target address space of the second device to realize the newly added BAR space of the first device and the target address space of the second device, the method further includes: The first device receives a read request for a target address space of the second device; In response to the read request, the first device reads the data stored in the newly added BAR space of the first device to read the data stored in the target address space of the second device.

7. The method according to claim 1, characterized in that After setting the tag register corresponding to the newly added BAR space based on the target address space of the second device to realize the newly added BAR space of the first device and the target address space of the second device, the method further includes: The first device receives a write request for a target address space of the second device; wherein the write request carries write data; In response to the write request, the first device writes the write data carried by the write request into the newly added BAR space of the first device, so as to write the write data into the target address space of the second device.

8. A communication device based on a non-transparent bridge, characterized in that: include: A label allocation module, used to pre-allocate corresponding unique labels to one or more initial base address register BAR spaces in a first device and a second device, respectively, wherein the first device and the second device are devices connected to two ports of the non-transparent bridge; a space allocation module, configured to allocate a newly added BAR space to the first device and set a corresponding label register for the newly added BAR space; A space mapping module is used to set the label register corresponding to the newly added BAR space based on the target address space of the second device, so as to map the target address space of the second device to the newly added BAR space of the first device; so that the first device can communicate with the second device through mapping its own newly added BAR space with the target address space of the second device.

9. The device according to claim 8, characterized in that The spatial mapping module is specifically used for: Based on the target address space of the second device, determining an initial BAR space in the second device corresponding to the target address space; The unique label corresponding to the corresponding initial BAR space is set to the label register corresponding to the newly added BAR space.

10. The device according to claim 8, characterized in that The space allocation module is specifically used for: Allocate a newly added BAR space for the first device, and reserve a space between an initial BAR space of the first device and the newly added BAR space; the newly added BAR space has the same size as an initial BAR space of the second device; A label register corresponding to the newly added BAR space is set in the reserved space.