Data transmission method based on CXL shared memory, and related devices
Through CXL shared memory technology, computing devices write data first and then send notifications after establishing a communication link, which solves the problem of data transmission occupying communication resources in traditional computing systems and realizes efficient and reliable data transmission.
Patent Information
- Application Number
- PCT/CN2024/128767
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-01
- Filing Date
- 2024-10-31
- Publication Date
- 2025-08-07
AI Technical Summary
In traditional computing systems, the transmission of big data between computing devices requires a large amount of communication resources, affecting the operation of services, and cannot meet the data transmission needs and business development needs at the same time.
Through CXL shared memory technology, after establishing a communication link between computing devices, data is first written into the shared memory and then sent notifications to reduce network delay, use shared memory for data transmission, and decouple communication links and data links.
It realizes that without occupying communication resources, improve data transmission efficiency, reduce network delay, ensure the reliability and integrity of data transmission, and meet the data transmission and service needs of computing equipment.
Smart Images

Figure CN2024128767_07082025_PF_FP_ABST
Abstract
Description
Data transmission method and related equipment based on CXL shared memory
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on February 1, 2024, with application number 202410147064.8 and application name “Data transmission method and related equipment based on CXL shared memory”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of communication technology, and in particular to a data transmission method and related equipment based on CXL shared memory. Background Art
[0003] In traditional computing system architectures, multiple computing devices within a system must communicate over communication links. Large amounts of data require significant communication resources, potentially impacting other services on the computing devices. In scenarios where computing devices have a large number of services and high data transmission demands, this solution cannot simultaneously meet both the data transmission and service requirements of the computing devices.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a data transmission method and related devices based on CXL shared memory, which can simultaneously meet the data transmission requirements and business development requirements of computing devices in a computing system.
[0006] In a first aspect, an embodiment of the present application provides a data transmission method based on a compute express link (CXL) shared memory, the method being applied to a first computing device; the method comprising:
[0007] Sending a data transmission notification to the second computing device; sending a data read notification to the second computing device when a response message from the second computing device is received; and writing the data to be transmitted into the shared memory based on the address information of the shared memory.
[0008] The data transmission notification includes address information of the shared memory, and is used to instruct establishment of a communication link between the first computing device and the second computing device; the shared memory is a memory space shared by the first computing device and the second computing device based on the CXL protocol.
[0009] The response message is used to indicate that a communication link has been established between the second computing device and the first device; and the data read notification is used to instruct the second computing device to read the data to be transmitted from the shared memory.
[0010] In an embodiment of the present application, the first computing device and the second computing device implement data transmission through shared memory, which can decouple the communication link and the data link. Data transmission does not need to occupy communication resources, and can simultaneously meet the data transmission needs and business development needs of both parties; at the same time, the first computing device can first send a data reading notification to the second computing device, and then write the data to be transmitted into the shared memory. Compared with the method of sending a notification after the data writing is completed, this can reduce the data transmission time caused by network delay.
[0011] In one possible implementation, the shared memory includes a response flag area; after sending the data read notification to the second computing device, the method further includes: determining whether the response flag area has a first preset identifier within a preset time length; wherein the first preset identifier is used to indicate that the second computing device has received the data read notification; if the response flag area does not have the first preset identifier within the preset time length, the data read notification is resent to the second computing device.
[0012] In the embodiment of the present application, by setting the response flag area, it can be ensured that the second computing device receives the data reading notification, thereby improving the reliability of data transmission.
[0013] In one possible implementation, the shared memory includes a completion flag area; after the data to be transmitted is written to the shared memory based on the address information of the shared memory, the method further includes: determining whether the data to be transmitted is all written into the shared memory; if the data to be transmitted is all written into the shared memory, writing a second preset flag in the completion flag area; wherein the second preset flag is used to indicate that the data to be transmitted has been all written into the shared memory.
[0014] In another possible implementation, the data transmission notification is also used to indicate a write start flag and a write completion flag; when writing the data to be transmitted, the first computing device can add the write start flag before the write start address of the data to be transmitted, and add the write completion flag after the write end address of the address to be transmitted; when the second computing device detects the write start flag and the write completion flag in the shared memory, it can read the data to be transmitted between the two.
[0015] In an embodiment of the present application, when the first computing device writes all the data to be transmitted into the shared memory, by adding a flag representing that the writing of the data to be transmitted is completed in the shared memory, it is possible to avoid the second computing device reading the data before the writing of the data to be transmitted is completed, resulting in incomplete received data, thereby improving the reliability of data transmission.
[0016] In a possible implementation, the data to be transmitted includes multiple data slices; the shared memory includes a slice count area, a slice data area corresponding to each of the data slices, and a slice completion flag area corresponding to each of the data slices; the slice count area is used to indicate the number of data slices written to the shared memory; each of the slice data areas is used to write a corresponding data slice; writing the data to be transmitted to the shared memory based on the address information of the shared memory includes: determining whether there is a data slice to be written; if there is a data slice to be written, writing the data slice to be written to the corresponding slice data area; writing a third preset identifier in the slice completion flag area corresponding to the data slice to be written, and updating the count of the data slices written to the shared memory in the slice count area; wherein the third preset identifier is used to indicate that all the data slices have been written to the slice data area.
[0017] In an embodiment of the present application, the first computing device writes the data to be transmitted into the shared memory in the form of data slices, and the second computing device reads the complete data slice when detecting that the corresponding slice completion flag area includes a third preset identifier, which can improve the read and write concurrency capability during data transmission, thereby improving the transmission performance; in addition, the slice transmission is realized through the shared memory, which can save a lot of communication resources compared with the slice transmission method through the communication link.
[0018] In one possible implementation, the shared memory includes a response flag area and / or a completion flag area; before sending the data read notification to the second computing device, the method further includes: clearing the response flag area and / or the completion flag area.
[0019] In an embodiment of the present application, by clearing the data in the functional areas, when the first computing device or the second computing device needs to make a judgment based on the data in these functional areas, misjudgment caused by the data originally existing in these functional areas can be avoided.
[0020] In a second aspect, an embodiment of the present application provides a data transmission method based on CXL shared memory, which is applied to a second computing device; the method includes:
[0021] Receive a data transmission notification sent by a first computing device; wherein the data transmission notification includes address information of a shared memory, and the data transmission notification is used to indicate that a communication link is established between the first computing device and the second computing device; the shared memory is a memory space shared by the first computing device and the second computing device based on the CXL protocol; send a response message to the first computing device based on the data transmission notification; wherein the response message is used to indicate that a communication link has been established between the second computing device and the first device; receive a data read notification sent by the first computing device; and read the data to be transmitted from the shared memory based on the data read notification and the address information of the shared memory.
[0022] In one possible implementation, the shared memory includes a response flag area; after receiving the data read notification sent by the first computing device, the method further includes: writing a first preset identifier in the response flag area in response to the data read notification; wherein the first preset identifier is used to indicate that the second computing device has received the data read notification.
[0023] In one possible implementation, the shared memory includes a completion flag area; reading the data to be transmitted from the shared memory includes: determining whether the completion flag area has a second preset flag; the second preset flag is used to indicate that all the data to be transmitted are written into the shared memory; if the completion flag area has the second preset flag, reading the data to be transmitted from the shared memory.
[0024] In one possible implementation, the data to be transmitted includes multiple data slices; the shared memory includes a slice count area, a slice data area corresponding to each of the data slices, and a slice completion flag area corresponding to each of the data slices; the slice count area is used to indicate the number of data slices written to the shared memory; each of the slice data areas is used to write a corresponding data slice; reading the data to be transmitted from the shared memory includes: determining whether the slice completion flag area corresponding to the data slice to be read has a third preset identifier; wherein the third preset identifier is used to indicate that the data slice has been completely written to the slice data area; if the slice completion flag area corresponding to the data slice to be read has the third preset identifier, reading the data slice to be read and updating the count of the read data slices.
[0025] The count of the read data slices is a count maintained by the second computing device. The second computing device increases the count by one each time a data slice is read and received.
[0026] In one possible implementation, the shared memory also includes a completion flag area; after updating the count of the read data slice, the method further includes: obtaining the count of the slice count area; if the count of the slice count area is the same as the count of the read data slice, and the completion flag area has a second preset identifier, it is determined that the reception of the data to be transmitted is completed.
[0027] In an embodiment of the present application, by determining whether the data transmission process is completed based on the second preset identifier and the count of the slice counting area written by the first computing device, and the count of the read data slices maintained by the second computing device itself, the integrity of the data received by the second computing device can be guaranteed.
[0028] In a third aspect, an embodiment of the present application provides a first computing device, comprising: a first memory and a first processor, the first processor being coupled to the first memory; computer program instructions being stored in the first memory; the computer program instructions being loaded and executed by the first processor, so that the first computing device implements any possible implementation method described in the first aspect.
[0029] In a fourth aspect, an embodiment of the present application provides a second computing device, comprising: a second memory and a second processor; the second processor is coupled to the second memory; computer program instructions are stored in the second memory; the computer program instructions are loaded and executed by the second processor, so that the second computing device implements any possible implementation method described in the second aspect.
[0030] In a fifth aspect, an embodiment of the present application provides a computing system, which includes the first computing device as described in the third aspect, the second computing device as described in the fourth aspect, and a shared memory; the first computing device and the second computing device are used to read and write the shared memory through the CXL protocol.
[0031] In a sixth aspect, an embodiment of the present application provides a first computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a first computing device to implement the CXL shared memory-based data transmission method involved in the first aspect and its possible implementation methods.
[0032] In a seventh aspect, an embodiment of the present application provides a second computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a second computing device to implement the CXL shared memory-based data transmission method involved in the second aspect and its possible implementation methods.
[0033] In an eighth aspect, an embodiment of the present application provides a first computer-readable storage medium, which stores computer-executable instructions. The computer-executable instructions are executed by a first computing device to implement the CXL shared memory-based data transmission method involved in the first aspect and its possible implementation methods.
[0034] In a ninth aspect, embodiments of the present application provide a second computer-readable storage medium storing computer-executable instructions. The computer-executable instructions are executed by a second computing device to implement the CXL shared memory-based data transmission method described in the second aspect and its possible implementations. It should be understood that the beneficial effects of the aforementioned aspects may be referenced in conjunction with each other. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] FIG1a is a schematic diagram of an application scenario of an embodiment of the present application;
[0036] FIG1b is a schematic diagram of another application scenario of an embodiment of the present application;
[0037] FIG2 is a schematic diagram of another application scenario of an embodiment of the present application;
[0038] FIG3 is a flow chart of a data transmission method based on CXL shared memory provided in an embodiment of the present application;
[0039] FIG4 is a flow chart of another CXL shared memory-based data transmission method provided in an embodiment of the present application;
[0040] FIG5 is a flow chart of another CXL shared memory-based data transmission method provided in an embodiment of the present application;
[0041] FIG6 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present application, rather than all the embodiments. Those skilled in the art will appreciate that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0043] The terms "first," "second," and the like in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.
[0044] The following is an explanation of some terminology concepts involved in the embodiments of this application.
[0045] (1) Compute Express Link (CXL) protocol
[0046] The CXL protocol is an open industry standard, based on the Peripheral Component Interconnect Express (PCIe) protocol, for high-bandwidth, low-latency device interconnection. The CXL protocol can be used to connect devices such as central processing units (CPUs), accelerators, memory caches, and smart network cards. The CXL protocol can be used in scenarios such as artificial intelligence (AI) and high-performance computing. Based on PCIe 5.0, CXL reuses three types of protocols: CXL.io, CXL.cache, and CXL.memory. The CXL.io protocol is used to detect devices, configurations, register accesses, and interrupts that support the CXL protocol. The CXL.cache protocol allows servers to access the memory of the server's internal processor and cache memory from the processor. The CXL.memory protocol allows the server's processor to access the server's internal memory.
[0047] (2) Computing equipment
[0048] A computing device is a computing unit in a computing system. A computing device may include components such as a CPU, a south bridge chip, an internal memory, a PCIe device, and their peripheral circuits. For example, a computing device may include one or more CPUs and / or one or more GPUs. The computing device may be a server, or a tablet computer, a personal computer, a mobile phone, or other terminal device. The computing device may also include an accelerator, for example, an accelerator may be a tensor processing unit (TPU), a graphics processing unit (GPU), a neural processing unit (NPU), a data processing unit (DPU), or a smart network interface card (smart NIC). The computing device may also be a virtual machine. The computing device in this embodiment supports the CXL protocol, and the computing device can communicate with the storage device via the CXL protocol.
[0049] In order to distinguish different computing devices in a computing cluster, embodiments of the present application use “first computing device”, “second computing device”, etc. to describe and distinguish multiple different computing devices.
[0050] (3) Storage devices
[0051] Storage devices are used to provide storage space for nodes to store data. Storage devices can be memory devices. A memory device can be random access memory (RAM). For example, the RAM is dynamic random access memory (DRAM) or storage class memory (SCM). DRAM is a type of semiconductor memory and, like most random access memory (RAM), is a volatile memory device. SCM is a hybrid storage technology that combines the characteristics of traditional storage devices and memory. Storage class memory can provide faster read and write speeds than hard drives, but has slower access speeds than DRAM and is also less expensive than DRAM. Memory can also include other random access memories, such as static random access memory (SRAM). Exemplarily, the storage device is a dual in-line memory module (DIM) or a dual in-line memory module (DIMM). For example, the storage device is a module composed of DRAM. Exemplarily, the storage device is a memory expansion card. Exemplarily, the storage device is a memory device having a PCIe interface.
[0052] The following is an example of an application scenario of the embodiment of the present application.
[0053] The embodiments of the present application can be applied to a scenario in which a first computing device and a second computing device in a computing system communicate with each other. For example, the embodiments of the present application can be applied to a scenario in which the first computing device transmits data to the second computing device.
[0054] For details, please refer to Figures 1a and 1b. As shown in Figure 1a, the embodiment of the present application can be applied to a distributed computing scenario. The computing system can be a distributed computing cluster 1. The first computing device 10, the second computing device 20 and the storage device 30 in the distributed computing cluster 1 can be communicatively connected through a communication network composed of one or more communication devices.
[0055] As shown in Figure 1b, the embodiment of the present application can also be applied to the whole cabinet server scenario, the computing system can be a whole cabinet server 2, the first computing device 10 and the second computing device 20 are computing nodes in the whole cabinet server 2, the storage device 30 is the storage device in the whole cabinet server 2, the first computing device 10, the second computing device 20 and the storage device 30 are arranged inside the cabinet 22, and the first computing device 10, the second computing device 20 and the storage device 30 can be communicatively connected through the cable backplane or bus of the whole cabinet server 2.
[0056] A computing device may be a server, wherein a server may include one or more CPUs, or multiple computing devices may be deployed as computing nodes on a server.
[0057] In the above application scenario, when the data to be transmitted is large, the first computing device 10 directly sends the data to be transmitted to the second computing device 20, which will occupy a large amount of communication resources and easily affect the operation of the business on the first computing device 10 and the second computing device 20.
[0058] Based on this, an embodiment of the present application provides a data transmission method and related equipment based on CXL shared memory. The first computing device 10 and the second computing device 20 are connected to the storage device 30 through the CXL protocol, and the storage device 30 is used as the CXL shared memory of the first computing device 10 and the second computing device 20. Then, based on the storage device 30, the transmission of big data between the first computing device 10 and the second computing device 20 is realized, and the communication link and the data link are separated, thereby simultaneously meeting the data transmission needs and business development needs of the first computing device 10 and the second computing device 20.
[0059] Exemplarily, the embodiments of the present application can be specifically used in an artificial intelligence training cluster, in which the data input node (first computing device 10) inputs the training samples into the storage device 30, and the training node (second computing device 20) obtains the training samples from the storage device 30 for training.
[0060] To facilitate understanding, the following first introduces CXL storage pooling technology.
[0061] In a traditional computing system architecture, as shown in Figure 2(a), memory sticks are directly connected to computing devices via a bus, and computing devices can only use the memory space provided by the memory sticks to which they are directly connected. For example, first computing device 10 is directly connected to memory sticks 1, 2, and 3. Second computing device 20 is directly connected to memory sticks 4, 5, and 6. The memory space of any of memory sticks 1, 2, and 3 can only be read and written by first computing device 10 and cannot be allocated for use by second computing device 20. The memory space of any of memory sticks 4, 5, and 6 can only be read and written by second computing device 20 and cannot be allocated for use by first computing device 10. As a result, each computing device can only use the memory space provided by three memory sticks. When the CPU in a computing device uses memory space, the memory capacity and bandwidth available to the CPU are limited by the number of CPU pins, making it difficult to expand the memory capacity and bandwidth.
[0062] The problem of memory capacity and bandwidth being limited by CPU pins can be solved by establishing a storage pool system using the CXL protocol. For example, a large number of memory sticks can be combined into a storage pool, and then the CXL protocol can be used to connect the storage pool to the CPUs of multiple computing devices, so that the CPUs of these multiple computing devices can use the memory space in the storage pool on demand. For example, please refer to Figure 2(b), which shows a scenario in which multiple computing devices and a storage pool are interconnected based on a CXL controller. Memory sticks 1 to 6 form a storage pool. A portion of the CXL controller's interfaces are connected to each of the memory sticks 1 to 6, and another portion of the CXL controller's interfaces are connected to the first computing device 10 and the second computing device 20, respectively. Management software can run on the CXL controller, and the CXL controller manages the allocation of memory space to each of the memory sticks 1 to 6 based on the management software. The first computing device 10 or the second computing device 20 can request the memory space of any of the memory sticks 1 to 6 from the CXL controller, allowing the first computing device 10 and the second computing device 20 to share the memory space of the six memory sticks. Since the various computing devices connected to the CXL controller can share the memory space of all memory sticks connected to the CXL controller, this can, to a certain extent, solve the problem of memory capacity and bandwidth being limited by the CPU pins within the node.
[0063] For example, see Figure 2(c), which illustrates a scenario where multiple computing devices and storage pools are interconnected using a CXL switch. Management software can also run on the CXL switch to manage and allocate memory space within the storage pool. Furthermore, compared to a CXL controller, a CXL switch provides more interfaces, enabling it to connect to more computing devices and storage pools within the computing system, allowing more computing devices to share the storage space within the storage pool.
[0064] It should be understood that the CXL-based storage pool (hereinafter referred to as the CXL storage pool) described above, consisting of memory sticks, is for illustrative purposes only and is not intended to be limiting. The CXL storage pool can also be composed of other types of storage devices. Furthermore, the storage capacity of each storage device in the CXL storage pool can be the same, or the storage capacity of each storage device in the CXL storage pool can be different. The types of storage devices in the CXL storage pool can be the same, or they can be different.
[0065] The storage devices in the above CXL storage pool can provide storage space as CXL shared memory for the first computing device 10 and the second computing device 20. In the embodiment of the present application, data transmission between the first computing device 10 and the second computing device 20 is implemented based on the CXL shared memory.
[0066] Please refer to Figure 3, which is a flowchart illustrating a data transmission method based on CXL shared memory, provided in an embodiment of the present application. First, the computing system used in this method is described. The computing system includes a first computing device 10, a second computing device 20, and a storage device 30. In the specific example of Figure 3, storage device 30 is a memory device 301.
[0067] The number of the first computing device 10, the second computing device 20, and the storage device 30 in the computing system may be one or more, and this is not specifically limited in the embodiments of the present application. For example, a scenario may be one in which multiple first computing devices 10 aggregate data to the second computing device 20 via the storage device 30, or a scenario may be one in which a first computing device 10 provides training samples to multiple second computing devices 20 via the storage device 30.
[0068] The first computing device 10 and the second computing device 20 can be used to read and write storage space in the storage device 30 via the CXL protocol and perform data transmission via the storage device 30. For further explanation of the first computing device 10 and the second computing device 20, please refer to (2) in the above terminology section. For example, the first computing device 10 may include one or more CPUs and one or more GPUs.
[0069] Illustratively, the first computing device 10 and the second computing device 20 may be different servers, or may be different computing nodes deployed in one server.
[0070] In some implementations, the storage device 30 is a device independent of the first computing device 10 and the second computing device 20 .
[0071] In some implementations, the storage device 30 may be integrated into the first computing device 10 or the second computing device 20 .
[0072] Optionally, the storage device 30 includes a management unit for implementing similar functions of the aforementioned CXL controller or CXL switch.
[0073] Illustratively, the storage device 30 may include multiple memory banks, and one of a CXL controller and a CXL switch, so that the computing system to which the method of the embodiment of the present application is applied is similar to the computing system shown in FIG. 2( b ) or ( c ).
[0074] The data transmission method provided in the embodiment of the present application may include steps 101 to 105.
[0075] Step 101: The first computing device 10 sends a data transmission notification to the second computing device 20.
[0076] The data transmission notification is used to instruct the establishment of a communication link between the first computing device 10 and the second computing device 20. Specifically, the first computing device 10 may send the data transmission notification to the second computing device 20 to request the establishment of a communication link between the two devices for subsequent message transmission.
[0077] In which, the data transmission notification includes the address information of the shared memory, which is the memory space shared by the first computing device 10 and the second computing device 20 based on the CXL protocol, that is, the memory space in the storage device 30; the address information of the shared memory is used to indicate the address range of the shared memory in the memory space of the entire storage device 30.
[0078] Using the CXL protocol, the first computing device 10 and the second computing device 20 can access the storage device 30 as if it were their own memory. In this case, the first computing device 10 and the second computing device 20 can use the storage device 30 as a shared area. The sender (i.e., the first computing device 10) writes data to the storage device 30, and the receiver (i.e., the second computing device 20) reads the data from the storage device 30. This allows for high-speed data transmission using the high bandwidth provided by the CXL protocol, without occupying communication link resources.
[0079] It can be understood that before performing data transmission in the above manner, the first computing device 10 can first apply for a storage space from the storage device 30 to perform data transmission through the storage space, and the storage space can be called shared memory; then, the first computing device 10 can send a data transmission notification to the second computing device 20, and inform the second computing device 20 of the address range of the shared memory in the storage device 30 through the data transmission notification.
[0080] The address information of the shared memory may include a storage address of the data to be transmitted in the shared memory, where the data to be transmitted is data to be transmitted from the first computing device 10 to the second computing device 20. Exemplarily, the data transmission notification may indicate that the starting address of the shared memory is the starting storage address of the data to be transmitted.
[0081] Optionally, the address information of the shared memory includes the starting address of the shared memory and the relative offset of the storage address of the data to be transmitted in the shared memory. The second computing device 20 can obtain the storage address of the data to be transmitted based on the starting address and the relative offset.
[0082] In addition to requesting to establish a communication link with the second computing device 20 through the data transmission notification, the first computing device 10 also agrees to perform data transmission with the second computing device 20 based on the shared memory through the address information of the shared memory in the data transmission notification.
[0083] Illustratively, the first computing device 10 can agree with the second computing device 20 through the data transmission notification, and the first computing device 10 will write the data to be transmitted at the address indicated by the address information of the shared memory; after the agreement is established, the second computing device 20 can obtain the data to be transmitted from the address.
[0084] Step 102: The second computing device 20 sends a response message to the first computing device 10 according to the data transmission notification.
[0085] The response message is used to indicate that a communication link has been established between the second computing device 20 and the first computing device 10 .
[0086] After receiving the data transmission notification, the second computing device 20 may record the agreed information in the data transmission notification, such as the address information of the shared memory; and then send a response message to the first computing device 10 to complete the establishment of the communication link.
[0087] Step 103 : The first computing device 10 sends a data read notification to the second computing device 20 .
[0088] After receiving the response message returned by the second computing device 20, a communication link is established between the first computing device 10 and the second computing device 20. The two agree to transmit data through the shared memory in the storage device 30. At this time, the first computing device 10 can send the data reading notification to the second computing device 20.
[0089] The data read notification is used to instruct the second computing device 20 to read the data to be transmitted from the shared memory. Specifically, the data read notification can be used to instruct the second computing device 20 to start monitoring the shared memory upon receiving the data read notification; and read the data to be transmitted after detecting that the data to be transmitted has been written.
[0090] The first computing device 10 can send a data read notification to the second computing device 20 before the data to be transmitted is written. In this way, the second computing device 20 can start monitoring the shared memory at an earlier time point and read the data to be transmitted as soon as the first computing device 10 completes writing the data to be transmitted, thereby reducing the data transmission time increased by network latency; more specifically, the delay time between the first computing device 10 completing writing the data to be transmitted and the second computing device 20 starting to read the data to be transmitted can be reduced.
[0091] Optionally, the first computing device 10 may send the data read notification to the second computing device 20 before starting to write the data to be transmitted into the shared memory.
[0092] Optionally, the first computing device 10 may send the data read notification to the second computing device 20 while writing the data to be transmitted into the shared memory.
[0093] Optionally, the shared memory also includes a response flag area, and the address information of the shared memory includes the address information of the response flag area; after sending a data reading notification to the second computing device 20, the first computing device 10 can detect whether the response flag area has a first preset identifier within a preset time length; if the response flag area does not have the first preset identifier within the preset time length, the data reading notification is sent to the second computing device 20 again.
[0094] The first preset identifier is used to indicate that the second computing device 20 has received the data read notification; upon receiving the data read notification, the second computing device 20 will write the first preset identifier in the response flag area based on the data read notification.
[0095] Optionally, the first computing device may cyclically detect or periodically detect whether the response mark area has the first preset identifier within the preset time period until the preset time period has passed or the response mark area is detected to have the first preset identifier.
[0096] After resending the data reading notification to the second computing device 20 , the first computing device 10 may repeat the above detection action.
[0097] Optionally, when the cumulative number of times the data reading notification is sent to the second computing device 20 reaches a preset value, the first computing device 10 may send a communication error or communication abnormality message to the management node of the computing cluster, or a computing device that the management personnel can perceive; at the same time, stop the above-mentioned cycle of sending data reading notifications and detecting the first preset identifier.
[0098] Optionally, the first computing device 10 will repeat the above cycle of sending the data reading notification and detecting the first preset identifier until it is detected that the response flag area has the first preset identifier.
[0099] By setting the response flag area, it is possible to ensure as much as possible that the second computing device 20 receives the data reading notification, thereby improving the reliability of data transmission.
[0100] Step 104 : The first computing device 10 writes the data to be transmitted into the shared memory in the storage device 30 .
[0101] After sending the data transmission notification to the second computing device 20 , the first computing device 10 may write the data to be transmitted into the storage address.
[0102] It is understood that first computing device 10 must first establish a communication link with second computing device 20 via a data transfer notification and agree to transfer data via shared memory; then, the data to be transferred is written to the agreed shared memory. As described in step 103 regarding the timing of sending the data read notification and writing the data to be transferred, first computing device 10 can send the data read notification before writing the data to be transferred, thereby shortening data transfer time.
[0103] Optionally, the shared memory includes a completion flag area, and the address information of the shared memory includes the address information of the completion flag area; specifically, the data transmission notification also includes the relative offset of the completion flag area in the shared memory. After determining that all the data to be transmitted has been written to the shared memory, the first computing device 10 may write a second preset identifier into the completion flag area, so that the second computing device 20 begins reading the data to be transmitted when it detects that the completion flag area has the second preset identifier.
[0104] The second preset flag is used to indicate that all the data to be transmitted have been written into the shared memory.
[0105] Optionally, the data transmission notification is also used to indicate a write start flag and a write completion flag; when writing the data to be transmitted, the first computing device 10 can add the write start flag before the write start address of the data to be transmitted, and add the write completion flag after the write end address of the address to be transmitted; when the second computing device 20 detects the write start flag and the write completion flag in the shared memory, it can read the data to be transmitted between the two.
[0106] When the first computing device 10 writes all the data to be transmitted into the shared memory, by adding a flag in the shared memory indicating that the writing of the data to be transmitted is completed, it is possible to avoid the second computing device reading the data before the writing of the data to be transmitted is completed, resulting in incomplete received data, thereby improving the reliability of data transmission.
[0107] Optionally, the shared memory includes a response flag area and / or a completion flag area, and the first computing device 10 clears the data in the response flag area and / or the completion flag area before writing the data to be transmitted.
[0108] By clearing the data in the functional areas, when the first computing device or the second computing device needs to make a judgment based on the data in these functional areas, misjudgment caused by the data originally existing in these functional areas can be avoided.
[0109] Step 105 : The second computing device 20 reads the data to be transmitted from the shared memory based on the address information of the shared memory.
[0110] Among them, the second computing device 20 can determine the shared memory based on the received data transmission notification, and then determine the storage address of the data to be transmitted based on the address information of the shared memory in the data transmission notification; and then read the data to be transmitted from the storage address based on the data reading notification.
[0111] Optionally, the second computing device 20 may detect whether the shared memory includes a flag indicating that writing of the data to be transmitted is complete; and when the flag is detected, the second computing device 20 reads the data to be transmitted from the shared memory.
[0112] In an embodiment of the present application, the first computing device 10 can first send a data reading notification to the second computing device 20, and then write the data to be transmitted into the shared memory. Compared with the method of sending a notification after the data writing is completed, the data transmission time caused by network delay can be reduced.
[0113] The above describes the overall method framework of the data transmission method provided in the embodiment of the present application. The following will further describe the data transmission method provided in the embodiment of the present application in combination with two specific embodiments.
[0114] Please refer to Figure 4, which is a flow chart of another data transmission method provided in an embodiment of the present application; the method is applied to a computing system including a first computing device, a second computing device and a storage device; the first computing device and the second computing device read and write storage space in the storage device through the CXL protocol.
[0115] The method specifically comprises the following steps:
[0116] Step 201: A first computing device sends a data transmission notification to a second computing device.
[0117] Among them, the first computing device can apply for storage space from the storage device for data transmission, and the storage space can be called shared memory; then, the first computing device can functionally divide the shared memory according to the needs of data transmission. As shown in Table 1, the shared memory can include a data area, a completion flag area, and a response flag area.
[0118] Table 1
[0119] The data area is used to store data to be transmitted, and the address range of the data area is the range of storage addresses of the data to be transmitted.
[0120] The response flag area is used to store a first preset identifier, which is used to indicate that the second computing device has received the data read notification in step 204. When the second computing device receives the data read notification, the second computing device writes the first preset identifier in the response flag area.
[0121] Among them, the completion flag area is used to store a second preset flag, which is used to indicate that the data to be transmitted has been completely written into the shared memory. When the first computing device writes all the data to be transmitted into the data area, the first computing device writes the second preset flag into the completion flag area.
[0122] It can be understood that the functional division shown in Table 1 is only an example and not a limitation. In actual applications, the first computing device can divide more functional areas in the shared memory; at the same time, the embodiment of the present application does not limit the order of the addresses of these areas in the shared memory. For example, the data area can be between the completion flag area and the response flag area, or after the completion flag area and the response flag area.
[0123] The data transmission notification includes address information of the shared content.
[0124] Optionally, the address information of the shared content may include the start address of the shared memory and the relative offset of the start address of the above region in the shared memory.
[0125] Optionally, the address information of the shared content may include the start address of the shared memory, and the order and occupied space size of the above areas in the shared memory.
[0126] Step 202: The second computing device returns a response message to the first computing device based on the data transmission notification.
[0127] After receiving the data transmission notification, the second computing device may return a response message to the first computing device indicating that the data transmission agreement is established and the communication link has been established; and will perform corresponding reading and writing in the shared memory according to the data transmission notification.
[0128] Step 203: The first computing device clears the completion flag area and the response flag area.
[0129] After receiving the response message, the first computing device may first clear the completion flag area and the response flag area to ensure that these functional areas are blank before data transmission begins. This prevents the first computing device or the second computing device from making misjudgments based on the data in these functional areas due to the data already existing in these functional areas. For example, if the completion flag area contains a 1, it indicates that the data to be transmitted has been written and the second computing device can begin reading the data to be transmitted. If the completion flag area already contains data 1, the second computing device may begin reading the data to be transmitted prematurely, resulting in incomplete data to be transmitted or an empty set.
[0130] Step 204: The first computing device sends a data read notification to the second computing device.
[0131] After clearing the functional area in the shared memory, the first computing device may send a data read notification to the second computing device to instruct the second computing device to start monitoring the shared memory and prepare to read the data to be transmitted.
[0132] Step 205: The first computing device writes the data to be transmitted into the data area.
[0133] Among them, after clearing the completion flag area and the response flag area, the first computing device can first execute step 204 and then execute step 205; it can also execute steps 204 and 205 in parallel, and it only needs to send the data reading notification before the first computing device completes writing the data to be transmitted.
[0134] By sending the data reading notification before completing the writing of the data to be transmitted, the delay time between the completion of writing the data to be transmitted by the first computing device and the start of reading the data to be transmitted by the second computing device can be reduced, that is, the data transmission time increased due to network delay is reduced.
[0135] In one possible implementation, the first computing device first sends the data read notification, and then, after detecting that the response flag area has a first preset identifier, begins writing the data to be transmitted into the data area. This ensures that the second computing device can obtain the data to be transmitted based on the data read notification, thereby ensuring the completion of the data transmission and improving the reliability of the data transmission.
[0136] In another possible implementation, the first computing device performs steps 204 and 205 in parallel. Because the first computing device is writing data to the storage device while sending the data read notification, the total time required to transmit the data read notification, write the data to be transmitted, and read the data to be transmitted is the sum of the larger of the data read notification transmission time and the data write time to be transmitted, plus the data read time to be transmitted. This possible implementation can minimize this total time.
[0137] Step 206: The first computing device writes a second preset identifier into the completion mark area.
[0138] After the data to be transmitted is written, the first computing device may write a second preset identifier in the completion mark area; when the second computing device detects that the completion mark area includes the second preset identifier, it may determine that the data to be transmitted in the data area is complete and may execute step 210.
[0139] By setting a completion flag area, the second computing device can read data when detecting that the completion flag area includes a second preset identifier, and obtain complete data to be transmitted, thereby avoiding the situation where incomplete data to be transmitted is received due to premature reading, thereby improving the reliability of data transmission.
[0140] Optionally, after writing the data to be transmitted in the data area, the first computing device verifies the integrity of the data to be transmitted in the data area; if the integrity check of the data to be transmitted passes, a second preset identifier is written to the completion mark area.
[0141] Step 207: The first computing device determines whether the response mark area has a first preset mark.
[0142] The first computing device may determine whether the second computing device has received the data reading notification by judging whether the response flag area has a first preset identifier.
[0143] Among them, step 207 is executed after step 204, specifically, it can be executed after step 206, or before step 205, or between step 205 and step 206.
[0144] Among them, the first computing device writes the data to be transmitted to the storage device through the CXL protocol at a faster speed. In a scenario where the data to be transmitted is small, the time it takes to write the data to be transmitted is usually less than the transmission time of the data read notification. Therefore, starting step 207 after step 206 can reduce the judgment actions performed before the second computing device receives the data read notification, thereby avoiding wasting computing resources.
[0145] Wherein, step 207 may be a periodic detection or a cyclic detection, and the step of detecting the first preset value is stopped until it is detected that the response mark area has the first preset identifier.
[0146] Optionally, after sending a data reading notification to the second computing device, the first computing device may detect whether the response mark area has a first preset identifier within a preset time period; if the response mark area does not have the first preset identifier within the preset time period, the first computing device may repeat step 204 once and resend the data reading notification to the second computing device; then loop through steps 207 and 204 until it is detected whether the response mark area includes the first preset identifier.
[0147] Optionally, if the data to be transmitted is not written or not completely written into the data area when the first computing device executes steps 207 and 204 in a loop, the first computing device may execute step 205 in the process; if the writing of the data to be transmitted is completed within the preset time length, the first computing device may also execute step 206 in the process.
[0148] If the first computing device has written the second preset flag into the completion flag area when resending the data read notification to the second computing device, the first computing device executes step 207 again after waiting for the preset time period.
[0149] It is understood that the first and second preset identifiers in the embodiments of the present application can be any type of character or character combination, such as numbers, letters, or symbols. This embodiment of the present application does not specifically limit this as long as the first and second computing devices can use the first and second preset identifiers as judgment conditions. The same applies to the third preset identifier below, and will not be further described below.
[0150] In the specific example of Figure 4, if the response flag area includes a first preset identifier, it means that the second computing device is ready to start reading the data to be transmitted, and the first computing device has completed writing the data to be transmitted in step 206. At this time, the first computing device can determine that the data to be transmitted has been sent and the data sending process ends.
[0151] By setting a response flag area, the second computing device writes a first preset identifier in the response flag area when receiving a data read notification, and the first computing device resends the data read notification when it detects that the response flag area does not include the first preset identifier after sending the data read notification. This can ensure that the second computing device receives the data read notification, thereby improving the reliability of data transmission.
[0152] Step 208: The second computing device writes a first preset identifier in the response flag area according to the data read notification.
[0153] After receiving the data reading notification, the second computing device may write a first preset identifier into the response flag area.
[0154] Optionally, the second computing device may determine the address of the response flag area according to the starting address of the shared memory and the relative offset of the response flag area in the shared memory; and then write the first preset identifier to the address.
[0155] Optionally, the second computing device can determine the address of the reply flag area based on the starting address of the shared memory, the order of the functional areas in the shared memory, and the size of the occupied space; and then write the first preset identifier to the address. For example, if the starting address is x, the order of the functional areas in the shared memory is the completion flag area, the reply flag area, and the data area, and the completion flag area occupies 4 bytes, the second computing device can determine the address of the reply flag area to be x+4.
[0156] Step 209: The second computing device determines whether the completion mark area has a second preset mark.
[0157] The manner in which the second computing device determines the completion flag area is similar to the manner in which the response flag area is determined in step 208 and will not be described in detail here.
[0158] After determining the address of the completion mark area, the second computing device can obtain the data in the completion mark area and determine whether the data has a second preset identifier. If so, step 210 is executed; if not, step 209 is repeated.
[0159] Step 210: If the completion mark area has a second preset identifier, the second computing device reads the data to be transmitted from the data area.
[0160] When the second computing device detects that the completion mark area has the second preset identifier, it can determine that the data to be transmitted in the data area is complete. At this time, the data to be transmitted can be read from the data area, and the data receiving process ends.
[0161] In this embodiment of the present application, by setting a completion flag area, the integrity of the data to be transmitted received by the second computing device can be ensured; by setting a response flag area, the second computing device can be ensured to receive data read notifications, thereby improving communication reliability. Furthermore, by reading and writing these functional areas, some of the message sending and receiving steps that would otherwise require communication links can be replaced, reducing the occupancy of the communication link and conserving communication resources.
[0162] Please refer to Figure 5, which is a flow chart of another data transmission method provided in an embodiment of the present application; the method is applied to a computing system including a first computing device, a second computing device and a storage device; the first computing device and the second computing device read and write storage space in the storage device through the CXL protocol.
[0163] The method specifically comprises the following steps:
[0164] Step 301: A first computing device sends a data transmission notification to a second computing device.
[0165] Among them, the first computing device can apply for storage space from the storage device for data transmission. The storage space can be called shared memory. Then, the first computing device can functionally divide the shared memory according to the needs of data transmission. As shown in Table 2, the shared memory can include a slice count area, a completion flag area, a response flag area, and a size area, a slice data area, and a slice completion flag area corresponding to each data slice to be written.
[0166] In this embodiment, the data to be transmitted that the first computing device needs to transmit to the second computing device includes multiple data slices.
[0167] Table 2
[0168] Among them, the response flag area has the same function as the response flag area in the above Table 1, and the completion flag area has the same function as the completion flag area in the above Table 1, which will not be repeated here.
[0169] The slice count area is used to indicate the number of data slices that the first computing device has written to the shared memory. Specifically, the slice count area is used to store a count of data slices written to the shared memory. This count is maintained by the first computing device and incremented by one each time the first computing device completes writing a data slice.
[0170] Among them, the size area of the data slice is used to store the data content size value of the corresponding data slice; the data area is used to store the specific data content of the corresponding data slice; the slice completion flag area is used to store a third preset identifier, which is used to indicate that the corresponding data slice has been written.
[0171] It is understandable that the data to be transmitted is divided into multiple data slices. According to different segmentation algorithms, the multiple data slices can be slices of different sizes or slices of the same size.
[0172] Optionally, to facilitate the first computing device's division of functional areas and the second computing device's calculation of data area addresses for different data slices, the data to be transmitted is divided into N data slices, where N is an integer greater than 1. Of these N data slices, N-1 data slices have a size equal to a preset value, and the remaining data slice has a size less than or equal to the preset value. For example, 850MB of data to be transmitted can be divided into eight 100MB data slices and one 50MB data slice.
[0173] The preset value may be an integer multiple of the minimum storage granularity of the storage device.
[0174] Optionally, the size of the size area and the slice completion flag area of each data slice are both 4 bytes.
[0175] After completing the area division in the shared memory, the first computing device may write information of these areas into the data transmission notification, so that the second computing device may perform corresponding operations during the data transmission process according to the information of these areas.
[0176] Optionally, the data transmission notification may include specific content as shown in Table 3; specifically, the data transmission notification may include a source internet protocol address (SRC IP), a source port (source port), a destination internet protocol address (DST IP), a destination port (DST PORT), a communication link number (LINK ID), a reply flag area (REPLAY), a slice count area (index count, INDEXCNT), a completion flag area (COMPLETE), a start address of the shared memory (start address, STARTADDR), a data slice size (SIZE), a timeout configuration (TIME OUT), and a notification flag (FLAG).
[0177] Table 3
[0178] Among them, the source IP address (IP address of the first computing device), source port (port through which the first computing device sends the data transmission notification), destination IP address (IP address of the second computing device), destination port (port through which the second computing device receives the data transmission notification), and communication link number in Table 3 are configuration information used to establish a communication link between the first computing device and the second computing device.
[0179] The relevant parts of the response flag area, the slice count area and the completion flag area in the data transmission notification are used to indicate the addresses of these areas in the shared memory.
[0180] Optionally, the data transfer notification may include the relative offsets of these regions in shared memory.
[0181] Optionally, the data transfer notification may include the order of these regions in the shared memory and the size of the space they occupy.
[0182] By combining the shared memory start address in the data transmission notification and the information of these areas, the second computing device can calculate the addresses of each of these areas in the shared memory.
[0183] The data slice size indicates the size of the space occupied by the data slice. Optionally, the space occupied by each data slice includes a slice size area, a data area, and a slice completion flag area. The data slice size may indicate the sum of the sizes of these three areas, and may specifically indicate the order and size of these three areas.
[0184] For example, based on the above information, the second computing device can determine the distribution order of the various regions in the shared memory as shown in Table 2 above. In ascending order of address, the order is: Response Flag Region, Slice Count Region, Completion Flag Region, Size Region, Data Region, and Slice Completion Flag Region of Data Slice 1, Size Region, Data Region, and Slice Completion Flag Region of Data Slice 2, and so on. Combined with the size of each region, the starting and ending addresses of each region can be determined. Therefore, the data transfer notification can be used to indicate the storage address of each data slice of the data to be transferred in the shared memory.
[0185] The timeout configuration is used to agree on a waiting time for communication. If the sender sends a notification message to the receiver and no response message is received within the waiting time, the sender can take appropriate measures, such as resending the notification message.
[0186] The notification tag is used to identify the type of the current message.
[0187] Step 302: The second computing device returns a response message to the first computing device.
[0188] The first computing device sends a data transmission notification to the second computing device, with the notification tag "notify." After receiving the data transmission notification, the second computing device records the configuration information in the data transmission notification and returns a response message, with the notification tag "response" (abbreviated as "rsp"). When the first computing device receives the response message, the communication link between the first computing device and the second computing device is established.
[0189] Step 303: The first computing device clears the shared memory.
[0190] After the communication link is established, the first computing device may clear the shared memory to prepare for data transmission.
[0191] Among them, the shared memory includes a response flag area, a completion flag area, and a slice completion flag area of multiple data slices. In order to avoid the first computing device or the second computing device making misjudgments due to the data originally existing in these functional areas when making judgments based on the data in these functional areas, the first computing device can clear the shared memory in advance.
[0192] After clearing the shared memory, the first computing device may execute step 304 first and then step 305, or execute step 305 first and then step 304, or execute steps 304 and 305 in parallel. It is only necessary to execute step 304 before all the data slices to be written are written to the shared memory, that is, before executing step 308. The specific principles and beneficial effects are similar to the corresponding parts described in step 205 in the embodiment shown in Figure 4, and will not be repeated here.
[0193] Step 304: The first computing device sends a data read notification to the second computing device.
[0194] After clearing the shared memory, the first computing device may send a data read notification to the second computing device, instructing the second computing device to prepare to read the data to be transmitted.
[0195] The data reading notification includes a communication link number; after receiving the data reading notification, the second computing device can call previously recorded configuration information according to the communication link number and execute steps 311 to 315 according to the configuration information.
[0196] Step 305: The first computing device determines whether the data to be transmitted has been written.
[0197] After clearing the shared memory, the first computing device may start writing the data to be transmitted. Since the data to be transmitted includes multiple data slices, the data slices that have not been written into the shared memory at this time may be referred to as data slices to be written.
[0198] The first computing device may first determine whether the data to be transmitted has been written, that is, whether there are still data slices to be written, and then determine whether a write operation needs to be performed.
[0199] If it exists, it means that a write operation needs to be performed, and the first computing device can execute step 306; if it does not exist, it means that a write operation does not need to be performed, and step 308 can be executed.
[0200] Step 306: If the data to be transmitted has not been written completely, the first computing device writes the data slice to be written into the slice data area.
[0201] The first computing device may first obtain the size of the data slice to be written, and write the size into the size area corresponding to the data slice to be written; and then write the data content of the data slice to be written into the corresponding slice data area.
[0202] Step 307: The first computing device updates the slice counting area and the slice completion flag area.
[0203] After the first computing device has written all the data contents of the data slice to be written into the corresponding slice data area, it may write a third preset flag into the corresponding slice completion flag area to indicate that the writing of the data slice to be written has been completed.
[0204] Then, the first computing device may update the write-completed data slice count in the slice count area, add one to the original count value, and return to execute step 305 .
[0205] Step 308: If the writing of the data to be transmitted is completed, the first computing device may write a second preset flag in the completion flag area.
[0206] When all the data to be transmitted have been written into the shared memory, the first computing device may update the completion flag area and write a second preset identifier into the completion flag area.
[0207] In some other possible implementations, the first computing device may determine whether the writing of the data to be transmitted is complete by judging other conditions, and then write a second preset flag to the completion flag area when it is determined that the writing of the data to be transmitted is complete.
[0208] Optionally, the first computing device can sense the progress of writing or copying the data to be transmitted to the shared memory. When the last byte of the last data slice of the data to be transmitted is written to the corresponding data area, the first computing device can write a second preset identifier to the completion mark area.
[0209] Optionally, the first computing device may obtain the total number of slices of data to be transmitted; after the first computing device updates the slice counting area in step 307, if the value in the slice counting area is consistent with the total number of slices, the first computing device may write a second preset flag to the completion flag area.
[0210] After completing the flag to write the second preset identifier, the first computing device may execute step 310 .
[0211] Step 309: The first computing device determines whether the response mark area has a first preset mark.
[0212] After executing step 304 and sending a data read notification to the second computing device, the first computing device may then determine whether the response flag area includes the first preset identifier. Specifically, step 309 need only be executed after step 304, and may be executed before step 305, after step 308, or between steps 305 and 308.
[0213] The specific implementation of step 309 in this embodiment is similar to the specific implementation of step 207 in the embodiment shown in FIG. 4 , and will not be described again here.
[0214] When the judgment result is yes, the first computing device may execute step 310 .
[0215] Each time it is detected that the response mark area does not have the first preset identifier, the first computing device may repeatedly execute step 304 .
[0216] Step 310: The first computing device determines whether the response mark area has a first preset mark and the completion mark area has a second preset mark.
[0217] When the response flag area has a first preset identifier, the first computing device can determine that the second computing device has received the data read notification, and the second computing device will read the data to be transmitted written in the shared memory.
[0218] Among them, when the completion flag area has a second preset flag, the first computing device can determine that the data to be transmitted has been written, and at the same time, the second computing device can determine the integrity of the data to be transmitted based on the second preset flag of the completion flag area, and then read the complete data to be transmitted from the shared memory.
[0219] It can be understood that the first computing device may not be aware of the specific reading situation of the second computing device. It only needs to determine that the data to be transmitted is completely written into the shared memory and that the second computing device receives the data reading notification; that is, when it is detected that the response flag area has a first preset flag and the completion flag area has a second preset flag, the first computing device can determine that its own work is completed and the data sending process in this data transmission is ended.
[0220] When the response flag area does not include the first preset identifier, the first computing device may return to execute step 309 ; when the completion flag area does not include the second preset identifier, the first computing device may return to execute step 305 .
[0221] It can be understood that when executing step 310, at least one of the two conditions, namely, the response mark area includes a first preset mark and the completion mark area includes a second preset mark, has been met. When the other condition is not met, the first computing device can return to execute the corresponding step.
[0222] Step 311: The second computing device writes a first preset identifier in the response flag area according to the data reading notification.
[0223] The second computing device may write a first preset identifier into the response flag area according to the received data read notification, so that the first computing device may determine that the second computing device has received the data read notification according to the first preset identifier.
[0224] Step 312: The second computing device determines whether the data to be transmitted has been received.
[0225] After writing the first preset identifier to the response flag area, the second computing device can begin data reception, that is, reading the data to be transmitted from the shared memory. It will be understood that the data to be transmitted in this embodiment includes multiple data slices, and the second computing device can read the data slices one by one as the first computing device's writing progresses. Therefore, before each data reception operation, the second computing device can determine whether further data reception is required.
[0226] Specifically, the second computing device itself maintains a count of data slices that have been read, and each time the reading of a data slice to be read is completed, the count of the data slice that has been read is increased by one; the second computing device can obtain the data in the slice count area and the completion flag area in the shared memory; if the completion flag area includes a second preset identifier, and the count of the data slice that has been read is the same as the value in the slice count area, then the second computing device can determine that the complete data to be transmitted has been received, thereby determining that its own work is completed, and the data receiving process in this data transmission is ended.
[0227] If the completion mark area or the count of the read data slices does not meet the above conditions, the second computing device may execute step 313 .
[0228] Step 313: The second computing device determines whether the slice completion flag area of the data slice to be read has a third preset flag.
[0229] The second computing device may first determine the starting address of the current data slice to be read in the shared memory and the address of the slice completion flag area of the data slice to be read.
[0230] Specifically, the second computing device may determine the relevant address of the data slice to be read according to the order and occupied space size of each functional area in the data transmission notification and the data slice that has been read.
[0231] Exemplarily, the starting address of the shared memory is x, and the various functional areas are shown in Table 2 above. In order from low to high addresses, they are the response flag area (4 bytes), the slice count area (4 bytes), the completion flag area (4 bytes), the size area of data slice 1 (4 bytes), the slice data area (size1) and the slice completion flag area (4 bytes), the size area of data slice 2 (4 bytes), the slice data area (size2) and the slice completion flag area (4 bytes)...
[0232] Among them, the data slice to be read is data slice 3, then the second computing device can calculate that the starting address of the slice data area of the data slice 3 in the shared memory is x+4+4+4+4+size1+4+4+size2+4+4=x+size1+size2+32; and after obtaining the size size3 of the data slice 3, it can be calculated that the starting address of the slice completion flag area of the data slice 3 is x+size1+size2+size3+32.
[0233] Among them, if the multiple data slices of the data to be transmitted are data slices obtained by equally dividing the data to be transmitted, the size SIZE of each data slice is the same. At this time, the second computing device can calculate the starting address of the data area of data slice 3 as x+4+4+4+SIZE*y+4=x+SIZE*y+16, where y is the count of data slices that have been read; then the starting address of the slice completion flag area of data slice 3 can be calculated as x+SIZE*y+16+size3.
[0234] It can be understood that, based on the size of the multiple data slices, the second computing device can calculate the starting address and ending address of the slice data area and the slice completion mark area of each data slice. The above example is only an example and not a limitation, and the embodiments of the present application do not make specific limitations on this.
[0235] After calculating the starting address of the slice completion flag area of the current data slice to be read, the second computing device can periodically detect whether the slice completion flag area includes a third preset identifier to determine whether the data slice to be read has been completely written into the corresponding data area.
[0236] If the slice completion flag area of the data slice to be read includes the third preset flag, the second computing device may execute step 314; if not, step 313 is repeated until the slice completion flag area includes the third preset flag.
[0237] Step 314: The second computing device reads the data slice to be read from the slice data area.
[0238] When it is detected that the slice completion flag area of the data slice to be read includes a third preset flag, the second computing device can read the complete data slice to be read from the slice data area according to the address of the slice data area of the data slice to be read calculated in step 313.
[0239] Step 315: The second computing device updates the count of the read data slices.
[0240] When the second computing device completes reading the data slice to be read, it may update the count of the data slices that have been read, add one to the original count, and then return to execute step 312.
[0241] In an embodiment of the present application, the first computing device writes the data to be transmitted into the storage device in the form of data slices, and the second computing device reads the complete data slice when detecting that the corresponding slice completion mark area has a third preset identifier, which can improve the read and write concurrency capability during data transmission, thereby improving the transmission performance; in addition, by using CXL to read and write storage devices for shard transmission, a large amount of communication resources can be saved compared to the shard transmission method through a communication link.
[0242] The present application also provides a computing device. See FIG6 , which illustrates a schematic diagram of the structure of a computing device provided in an embodiment of the present application. The computing device 100 may be one or more of the first computing device 10 and the second computing device 20 in the aforementioned embodiments, such that the functions of the first computing device 10 and the second computing device 20 may be implemented through the structure of the computing device 100 in FIG6 . The computing device 100 includes at least one processor 110, at least one memory 120, and at least one communication interface 130.
[0243] Among them, the processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect the various parts within the computing device 100, and executes the part implemented by the first computing device 10 and / or the second computing device 20 in the data transmission method provided in the embodiment of the present application by running or executing instructions, programs, code sets or instruction sets stored in the memory 120, and calling data stored in the memory 120. Optionally, the processor 110 can be implemented in the form of at least one hardware of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 110 can integrate one or more combinations of a CPU, a graphics processing unit (GPU), and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 310, but may be implemented separately through a communication chip.
[0244] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable storage medium. The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the method of the embodiment of the present application, etc.
[0245] The communication interface 130 is used to communicate with other devices in the computing system where the computing device 100 is located.
[0246] The processor 110, memory 120, and communication interface 130 are communicatively connected via a bus within the computing device 100. This bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, FIG6 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0247] Illustratively, the first computing device provided in an embodiment of the present application may include a first processor (the above-mentioned processor 110), a first memory (the above-mentioned memory 120) and a first communication interface (the above-mentioned communication interface 130); the second computing device provided in an embodiment of the present application may include a second processor (the above-mentioned processor 110), a second memory (the above-mentioned memory 120) and a second communication interface (the above-mentioned communication interface 130).
[0248] An embodiment of the present application also provides a computing system, which includes a first computing device, a second computing device, and a storage device in any of the above embodiments; the first computing device and the second computing device are used to read and write storage space of the storage device through the CXL protocol to implement the data transmission method described in any of the embodiments of Figures 3 to 5 above.
[0249] The specific architecture diagram of the computing system can be found in FIG1a and FIG1b.
[0250] In another embodiment of the present application, a computer-readable storage medium is further provided, in which computer-executable instructions are stored. When at least one processor of the device executes the computer-executable instructions, the device executes the part of the data transmission method described in any of the embodiments of Figures 3 to 5 above, which is implemented by the first computing device 10 and / or the second computing device 20.
[0251] In another embodiment of the present application, a computer program product is also provided, which includes computer-executable instructions stored in a computer-readable storage medium; at least one processor of the device can read the computer-executable instructions from the computer-readable storage medium, and at least one processor executes the computer-executable instructions so that the device executes the part of the data transmission method described in any of the embodiments of Figures 3 to 5 above, which is implemented by the first computing device 10 and / or the second computing device 20.
[0252] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.
[0253] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0254] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0255] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0256] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0257] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. A data transmission method based on a computing fast link CXL shared memory, characterized in that: The method is applied to a first computing device; the method includes: Sending a data transmission notification to the second computing device; wherein the data transmission notification includes address information of a shared memory, and the data transmission notification is used to instruct the establishment of a communication link between the first computing device and the second computing device; the shared memory is a memory space shared by the first computing device and the second computing device based on the CXL protocol; Upon receiving a response message from the second computing device, sending a data read notification to the second computing device; wherein the response message is used to indicate that a communication link has been established between the second computing device and the first device; and the data read notification is used to instruct the second computing device to read the data to be transmitted from the shared memory; The data to be transmitted is written into the shared memory based on the address information of the shared memory.
2. The method according to claim 1, characterized in that The shared memory includes a response flag area; After sending the data read notification to the second computing device, the method further includes: Determining whether the response flag area has a first preset identifier within a preset time period; wherein the first preset identifier is used to indicate that the second computing device has received the data read notification; If the response mark area does not have the first preset identifier within the preset time period, the data reading notification is resent to the second computing device.
3. The method according to claim 1 or 2, characterized in that The shared memory includes a completion flag area; After writing the data to be transmitted into the shared memory based on the address information of the shared memory, the method further includes: Determining whether all the data to be transmitted is written into the shared memory; If all the data to be transmitted are written into the shared memory, a second preset flag is written into the completion flag area; wherein the second preset flag is used to indicate that all the data to be transmitted have been written into the shared memory.
4. The method according to any one of claims 1 to 3, characterized in that The data to be transmitted includes multiple data slices; The shared memory includes a slice counting area, a slice data area corresponding to each data slice, and a slice completion flag area corresponding to each data slice; The slice count area is used to indicate the number of data slices written into the shared memory; Each of the slice data areas is used to write a corresponding data slice; Writing the data to be transmitted into the shared memory based on the address information of the shared memory includes: Determining whether the data slice to be written exists; If the data slice to be written exists, writing the data slice to be written into the corresponding slice data area; Writing a third preset identifier in the slice completion flag area corresponding to the data slice to be written, and updating the count of the data slices that have been written to the shared memory in the slice count area; wherein the third preset identifier is used to indicate that all the data slices have been written to the slice data area.
5. The method according to any one of claims 1 to 4, characterized in that The shared memory includes a response flag area and / or a completion flag area; Before sending the data read notification to the second computing device, the method further includes: Clear the response flag area and / or the completion flag area.
6. A data transmission method based on a computing fast link CXL shared memory, characterized in that: The method is applied to a second computing device; the method includes: Receiving a data transmission notification sent by a first computing device; wherein the data transmission notification includes address information of a shared memory and is used to instruct establishment of a communication link between the first computing device and the second computing device; the shared memory is a memory space shared by the first computing device and the second computing device based on the CXL protocol; Sending a response message to the first computing device based on the data transmission notification; wherein the response message is used to indicate that a communication link has been established between the second computing device and the first device; receiving a data read notification sent by the first computing device; wherein the data read notification is used to instruct the second computing device to read the data to be transmitted from the shared memory; Based on the address information of the shared memory, the data to be transmitted is read from the shared memory.
7. The method according to claim 6, characterized in that The shared memory includes a response flag area; After receiving the data reading notification sent by the first computing device, the method further includes: In response to the data read notification, a first preset identifier is written into the response flag area; wherein the first preset identifier is used to indicate that the second computing device has received the data read notification.
8. The method according to claim 6 or 7, characterized in that The shared memory includes a completion flag area; The step of reading the data to be transmitted from the shared memory comprises: Determining whether the completion flag area has a second preset identifier; the second preset identifier is used to indicate that all the data to be transmitted has been written into the shared memory; If the completion flag area has the second preset flag, the data to be transmitted is read from the shared memory.
9. The method according to claim 6 or 7, characterized in that The data to be transmitted includes multiple data slices; The shared memory includes a slice counting area, a slice data area corresponding to each data slice, and a slice completion flag area corresponding to each data slice; The slice count area is used to indicate the number of data slices written into the shared memory; Each of the slice data areas is used to write a corresponding data slice; The step of reading the data to be transmitted from the shared memory comprises: Determining whether a slice completion flag area corresponding to the data slice to be read has a third preset identifier; wherein the third preset identifier is used to indicate that the data slice has been completely written into the slice data area; If the slice completion flag area corresponding to the data slice to be read has the third preset identifier, the data slice to be read is read, and the count of the read data slices is updated.
10. The method according to claim 9, characterized in that The shared memory also includes a completion flag area; After updating the count of the read data slices, the method further includes: Obtaining a count of the slice counting area; If the count in the slice count area is the same as the count of the read data slice, and the completion flag area has a second preset flag, it is determined that the reception of the data to be transmitted is completed.
11. A first computing device, characterized in that: The first computing device includes: a first memory and a first processor, wherein the first processor is coupled to the first memory; The first memory stores computer program instructions; The computer program instructions are loaded and executed by the first processor to enable the first computing device to implement the method of any one of claims 1 to 5.
12. A second computing device, characterized in that: The second computing device includes: a second memory and a second processor; the second processor is coupled to the second memory; The second memory stores computer program instructions; The computer program instructions are loaded and executed by the second processor to enable the second computing device to implement the method of any one of claims 6 to 10.
13. A computing system, characterized in that: The computing system comprises the first computing device of claim 11, the second computing device of claim 12, and a memory device; The first computing device and the second computing device are used to read and write the memory device through a computing express link (CXL) protocol.
Citation Information
Patent Citations
Shared-memory-based message transmission method, system and device
CN108833477A
Communication establishment method and system
CN116074230A
Data transmission method and device, electronic equipment and computer readable storage medium
CN116932454A
Data transmission method based on CXL shared memory and related equipment
CN117992393A
Techniques to share memory across nodes in a system
US20230236995A1
Cited By
Data transmission method and device, storage medium and computer program product
CN120631662A