Data processing method, system, electronic device and readable storage medium
Through the connection between the heterogeneous device memory and the memory interconnection protocol of the client and server, data is directly stored and transmitted in the heterogeneous device memory, which solves the problem of low data transmission efficiency in the existing technology and achieves efficient data interaction.
Patent Information
- Application Number
- CN202410712069.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-03
AI Technical Summary
Existing technologies fail to fully utilize the potential of Compute Express Link (CXL) when transmitting data between devices, resulting in increased memory consumption and low data transmission efficiency, relying on existing network transmission mechanisms.
Through the memory interconnection protocol connection between the heterogeneous device memory and the client and the server, expensive network round-trips and memory copies are avoided, data is stored and transmitted directly in the heterogeneous device memory, and the memory interconnection protocol is used to achieve high bandwidth and low latency. data transmission.
It improves the data transmission efficiency between the client and the server, reduces the data serialization and deserialization process, and achieves more efficient data interaction.
Smart Images

Figure CN118283114B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data transmission, and in particular to a data processing method, system, electronic device and readable storage medium. Background Art
[0002] At present, when data is transmitted between devices, shared memory technology is mainly used to facilitate the transmission of tensor data within a single physical host. This method is suitable for data interaction between multiple virtual machines running on a physical host.
[0003] However, although the above method can realize data interaction between multiple virtual machines, it does not give full play to the potential of Compute Express Link (CXL), such as memory pooling and inter-node access. Therefore, this method increases memory consumption and relies heavily on the existing network transmission mechanism, and has the technical problem of low data transmission efficiency.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present application provide a data processing method, system, electronic device and readable storage medium to at least solve the technical problem of low data transmission efficiency.
[0006] According to one aspect of an embodiment of the present application, a data processing method is provided, which is applied to a data communication terminal, wherein the data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol. The method includes: using the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol; obtaining a request message corresponding to the data to be transmitted, wherein the request message is used to request the transmission of the data to be transmitted to the server; sending the request message to the server; using the heterogeneous device memory to store the response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; and sending the response result to the client.
[0007] According to one aspect of an embodiment of the present application, a data processing method is provided, which is applied to a data communication terminal, and the data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol. The method includes: using the heterogeneous device memory to store the tensor data to be transmitted sent by the client through the memory interconnection protocol; obtaining a request message corresponding to the tensor data to be transmitted, wherein the request message is used to request the transmission of the tensor data to be transmitted to the server; responding to the first polling request of the server, sending the polled request message to the server; using the heterogeneous device memory to store the response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the tensor data to be transmitted; responding to the second polling request of the client, sending the polled response result to the client, wherein the response result is used to train the target model.
[0008] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: a first storage unit, used to use heterogeneous device memory to store data to be transmitted sent by a client through a memory interconnection protocol; a first acquisition unit, used to obtain a request message corresponding to the data to be transmitted, wherein the request message is used to request transmission of the data to be transmitted to a server; a first sending unit, used to send the request message to the server; a second storage unit, used to use heterogeneous device memory to store a response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; and a second sending unit, used to send the response result to the client.
[0009] According to another aspect of an embodiment of the present application, a data processing device is also provided, including: a third storage unit, used to use heterogeneous device memory to store tensor data to be transmitted sent by a client through a memory interconnection protocol; a second acquisition unit, used to obtain a request message corresponding to the tensor data to be transmitted, wherein the request message is used to request transmission of the tensor data to be transmitted to a server; a third sending unit, used to respond to a first polling request of the server and send the polled request message to the server; a fourth storage unit, used to use heterogeneous device memory to store a response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the tensor data to be transmitted; a fourth sending unit, used to respond to a second polling request of the client and send the polled response result to the client, wherein the response result is used to train a target model.
[0010] According to another aspect of an embodiment of the present application, a data processing system is also provided, including: a data communication terminal, at least one client and at least one server, wherein the data communication terminal includes a heterogeneous device memory respectively connected to the at least one client and the at least one server through a memory interconnection protocol, wherein the client is used to send data to be transmitted; the data communication terminal is used to use the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol; obtain a request message corresponding to the data to be transmitted, wherein the request message is used to request to transmit the data to be transmitted to the server; send the request message to the server; the server is used to respond to the request message and output a response result corresponding to the data to be transmitted through the memory interconnection protocol; wherein the data communication terminal is used to use the heterogeneous device memory to store the response result; and send the response result to the client.
[0011] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the data processing method in each embodiment of the present application is executed when the program is running.
[0012] According to another aspect of the embodiments of the present application, a computer terminal is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the data processing method in each embodiment of the present application is executed when the program is running.
[0013] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the data processing method in each embodiment of the present application.
[0014] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the data processing method in each embodiment of the present application is implemented.
[0015] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data processing method in each embodiment of the present application is implemented.
[0016] According to another aspect of the embodiments of the present application, a computer program is also provided, and when the computer program is executed by a processor, the methods in the various embodiments of the present application are implemented.
[0017] In an embodiment of the present application, a data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol, wherein the heterogeneous device memory is used to store data to be transmitted sent by the client through the memory interconnection protocol; obtain a request message corresponding to the data to be transmitted, wherein the request message is used to request the transmission of the data to be transmitted to the server; send the request message to the server; use the heterogeneous device memory to store the response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; send the response result to the client. That is, in an embodiment of the present application, the data to be transmitted sent by the client through the memory interconnection protocol is stored by using the heterogeneous device memory, and the response result corresponding to the data to be transmitted output through the memory interconnection protocol by the server in response to the request message is stored by using the heterogeneous device memory, that is, the client and the server are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory replication, and data serialization / deserialization processes, thereby achieving the purpose of more efficient data transmission and data interaction, and realizing the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0018] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0020] Figure 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data processing method according to an embodiment of the present application;
[0021] Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application;
[0022] Figure 3 is a structural block diagram of a service grid according to an embodiment of the present application;
[0023] Figure 4 is a flow chart of a data processing method according to an embodiment of the present application;
[0024] Figure 5 is a flow chart of another data processing method according to an embodiment of the present application;
[0025] Figure 6is a schematic diagram of a data processing system according to an embodiment of the present application;
[0026] Figure 7 is a schematic diagram of the difference between a memory pool already supported in CXL2.0 and consistent memory sharing in CXL3.0 according to an embodiment of the present application;
[0027] Figure 8 is a schematic diagram of TensorPipe data communication according to an embodiment of the present application;
[0028] Fig. 9 is a schematic diagram of a transport layer according to an embodiment of the present application;
[0029] Fig.10 is a schematic diagram of a CXL-based TensorPipe according to an embodiment of the present application;
[0030] Fig.11 is a schematic diagram of a data processing device according to an embodiment of the present application;
[0031] Fig.12 is a schematic diagram of another data processing device according to an embodiment of the present application;
[0032] Fig.13 It is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:
[0036] A heterogeneous device memory connected to at least one client and at least one server via a memory interconnection protocol, and used to store a request message from at least one client and response data generated by at least one server in response to the request data from the client;
[0037] CXL, a memory interconnect protocol, is used for high-bandwidth and low-latency device interconnection, aiming to help data be transmitted more efficiently.
[0038] Example 1
[0039] According to an embodiment of the present application, a data processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0040] The method embodiment provided in the first embodiment of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 1 is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a data processing method according to an embodiment of the present application. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0041] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).
[0042] The memory 104 can be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the methods in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, implementing the methods in the above embodiments. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0043] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0044] The display may be, for example, a touch screen liquid crystal display (LCD), which enables a user to interact with a user interface of the computer terminal 10 (or mobile device).
[0045] Figure 1 The hardware structure block diagram shown can be used not only as an exemplary block diagram of the above-mentioned computer terminal 10 (or mobile device), but also as an exemplary block diagram of the above-mentioned server. In an optional embodiment, Figure 2 is a structural block diagram of a computing environment according to an embodiment of the present application, Figure 2 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) shown is an embodiment of a computing node in the computing environment 201. Figure 2 As shown, the computing environment 201 includes multiple ( Figure 2 210-1, 210-2, ..., are used to illustrate computing nodes (such as servers). The computing nodes all contain local processing and memory resources, and end users 202 can remotely run applications or store data in the computing environment 201. The applications can be provided as multiple services 220-1, 220-2, 220-3 and 220-4 in the computing environment 201, representing services "A", "D", "E" and "H" respectively.
[0046] The end user 202 can provide and access services through a web browser or other software application on the client, and in some embodiments, the end user 202's provision and / or request can be provided to the entry gateway 230. The entry gateway 230 can include a corresponding agent to handle the provision and / or request for the service (one or more services provided in the computing environment 201).
[0047] Services are provided or deployed based on various virtualization technologies supported by the computing environment 201. In some embodiments, services can be provided based on virtual machine (VM)-based virtualization, container-based virtualization, and / or similar methods. Virtual machine-based virtualization can be to simulate a real computer by initializing a virtual machine, and execute programs and applications without directly contacting any actual hardware resources. While the virtual machine virtualizes the machine, according to container-based virtualization, a container can be started to virtualize the entire operating system (Operating System, referred to as OS) so that multiple workloads can run on a single operating system instance.
[0048] In an embodiment based on container virtualization, several containers of a service can be assembled into a container group (Pod) (e.g., Kubernetes Pod). Figure 2 As shown, service 220-2 can be equipped with one or more Pods 240-1, 240-2, ..., 240-N (collectively referred to as Pods). Pods can include a proxy 245 and one or more containers 242-1, 242-2, ..., 242-M (collectively referred to as containers). One or more containers in a Pod process requests related to one or more corresponding functions of the service, and the proxy 245 generally controls network functions related to the service, such as routing, load balancing, etc. Other services can also be equipped with similar container groups.
[0049] During operation, executing a user request from end user 202 may require invoking one or more services in computing environment 201, and executing one or more functions of a service may require invoking one or more functions of another service. Figure 2 As shown, service "A" 220-1 receives a user request from end user 202 from ingress gateway 230, service "A" 220-1 may call service "D" 220-2, and service "D" 220-2 may request service "E" 220-3 to perform one or more functions.
[0050] The computing environment described above can be a cloud computing environment, where the allocation of resources is managed by the cloud service provider, allowing the development of functions without considering the implementation, adjustment or expansion of servers. The computing environment allows developers to execute code in response to events without building or maintaining complex infrastructure. Services can be divided into a set of functions that can be automatically and independently scaled, rather than expanding a single hardware device to handle potential loads.
[0051] In another optional embodiment, Figure 3 The block diagram shows the use of the above Figure 1 The computer terminal 10 (or mobile device) is shown as an embodiment of the service grid. Figure 3 is a structural block diagram of a service grid according to an embodiment of the present application, such as Figure 3 As shown, the service grid 300 is mainly used to facilitate secure and reliable communication between multiple microservices. Microservices refer to decomposing an application into multiple smaller services or instances and distributing them on different clusters / machines.
[0052] like Figure 3 As shown, the microservice may include an application service instance B and an application service instance C, which form a functional application layer of the service grid 300. In one embodiment, the application service instance B runs in the form of a container / process 308 on a machine / workload container group 314 (Pod), and the application service instance C runs in the form of a container / process 310 on a machine / workload container group 316 (Pod).
[0053] In one implementation, application service instance B may be a service for sending a request message, and application service instance C may be a service for receiving a response result corresponding to the request message.
[0054] like Figure 3As shown, application service instance B and grid proxy (sidecar) 303 coexist in machine workload container group 314, and application service instance C and grid proxy 305 coexist in machine workload container 316. Grid proxy 303 and grid proxy 305 form the data plane layer (data plane) of service grid 300. Grid proxy 303 and grid proxy 305 run in the form of container / process 304 and container / process 306 respectively, and can receive request 312 for commodity query service, and grid proxy 303 and application service instance B can communicate bidirectionally, and grid proxy 305 and application service instance C can communicate bidirectionally. In addition, grid proxy 303 and grid proxy 305 can also communicate bidirectionally.
[0055] In one embodiment, the traffic of application service instance B is routed to a suitable destination through grid proxy 303, and the network traffic of application service instance C is routed to a suitable destination through grid proxy 305. It should be noted that the network traffic mentioned here includes but is not limited to Hyper Text Transfer Protocol (HTTP), Representational State Transfer (REST), high-performance, general open source framework (google Remote Procedure Call, gRPC), open source in-memory data structure storage system (Redis), etc.
[0056] In one embodiment, the function of extending the data plane layer can be realized by writing a custom filter for the proxy (Envoy) in the service grid 300. The service grid proxy configuration can be to enable the service grid to correctly proxy service traffic and realize service intercommunication and service governance. The grid proxy 303 and the grid proxy 305 can be configured to perform at least one of the following functions: service discovery, health checking, routing, load balancing, authentication and authorization, and observability.
[0057] like Figure 3 As shown, the service grid 300 also includes a control plane layer. The control plane layer can be a group of services running in a dedicated namespace, and these services are hosted by a hosting control plane component 301 in a machine / workload container group (machine / Pod) 302. Figure 3 As shown, the managed control plane component 301 performs bidirectional communication with the grid agent 303 and the grid agent 305. The managed control plane component 301 is configured to perform some control and management functions. For example, the managed control plane component 301 receives telemetry data transmitted by the grid agent 303 and the grid agent 305, and can further aggregate the telemetry data. For these services, the managed control plane component 301 can also provide a user-oriented application programming interface (Application Programming Interface, referred to as API) to more easily manipulate network behavior and provide configuration data to the grid agent 303 and the grid agent 305.
[0058] Under the above operating environment, this application provides Figure 4 The data processing method shown is applied to a data communication terminal, which includes a heterogeneous device memory connected to at least one client and at least one server via a memory interconnection protocol. Figure 4 is a flow chart of a data processing method according to an embodiment of the present application. Figure 4 As shown, the method may include the following steps:
[0059] Step S401: utilizing the memory of a heterogeneous device to store data to be transmitted sent by a client through a memory interconnection protocol.
[0060] In the technical solution provided in the above step S401 of the present application, the heterogeneous device memory is connected to at least one client and at least one server through a memory interconnection protocol, and is used to store the request data of at least one client and the response data generated by at least one server in response to the request data of the client. Among them, the heterogeneous device memory can be called CXL attachment memory. The memory interconnection protocol is used to indicate the interconnection protocol of CXL cache consistency, which is used for high-bandwidth and low-latency device interconnection, aiming to help data be transmitted more efficiently. Optionally, the data to be transmitted can be user-defined request data.
[0061] In this embodiment, the client and the server can be connected to the same CXL-connected heterogeneous device memory through a physical connection or a CXL switch, and for each client or server, there are two message queues and corresponding data storage areas in the CXL-connected heterogeneous device memory, wherein the message queue is used to pass a reference as a request message or a response message, and the data storage area is used to store the original data of the request message / response message.
[0062] For example, after responding to the data to be transmitted sent by the client through the memory interconnection protocol, the data to be transmitted can be stored in a data storage area corresponding to the requested data in the memory of the heterogeneous device.
[0063] Step S402: Obtain a request message corresponding to the data to be transmitted.
[0064] In the technical solution provided in the above step S402 of the present application, after using the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol, a request message corresponding to the data to be transmitted can be obtained, and the request message is used to request the data to be transmitted to be transmitted to the server.
[0065] In this embodiment, the request message can be used to indicate the transmission order of the data to be transmitted. As can be seen from the introduction of step S401 above, the heterogeneous device memory includes two message queues. Among them, the request message queue includes multiple request entries corresponding to the data to be transmitted, and the request entry is used to indicate the transmission order of the data to be transmitted. Based on this, after the data to be transmitted is stored in the heterogeneous device memory through step S401, the request entry corresponding to the data to be transmitted can be determined, and then the request entry is appended to the request message queue, and the request entry is used as the request message corresponding to the data to be transmitted.
[0066] In this step, after the data to be transmitted is stored in the memory of the heterogeneous device, the request entry corresponding to the data to be transmitted can be determined and appended to the request message queue to indicate the transmission order of the data to be transmitted. The request message queue includes multiple request entries corresponding to the data to be transmitted, so that the multiple data to be transmitted can be transmitted in the correct order.
[0067] Step S403: Send the request message to the server.
[0068] In the technical solution provided in the above step S403 of the present application, after obtaining the request message corresponding to the data to be transmitted, the request message can be sent to the server.
[0069] In this embodiment, the server may send a first polling request, and the first polling request is used to indicate a request message in a polling request message queue. After responding to the first polling request sent by the server, the request message to be polled by the server in the request message queue may be determined according to the first polling request. That is, the request entry corresponding to the to-be-transmitted data to be polled by the server is determined according to the first polling request, and the polled request entry is sent to the server.
[0070] For example, the first polling request may be an arrival mark of the request entry at the end of the polling request message queue, that is, identification information of the last request entry in the request message queue. After the last request entry in the request message queue is obtained according to the first polling request, the request entry may be sent to the server.
[0071] Step S404: Using the memory of the heterogeneous device, storing the response result obtained by the server in response to the request message.
[0072] In the technical solution provided in the above step S404 of the present application, since the request message is used to indicate the request entry in the request message queue to be polled by the server, based on this, after the request entry is sent to the server through step S403. The server can access the data to be transmitted corresponding to the request entry in the memory of the heterogeneous device according to the request entry, and generate a corresponding response result according to the accessed data to be transmitted. That is, the response result is the response data generated by the server corresponding to the data to be transmitted, and the response result is output by the server through the memory interconnection protocol.
[0073] In this embodiment, after generating a response result corresponding to the data to be transmitted, the server may output the response result through a memory interconnection protocol. After responding to the response result output by the server, the response result may be stored in the memory of the heterogeneous device.
[0074] Step S405: Send the response result to the client.
[0075] In the technical solution provided in the above step S405 of the present application, after the response result is stored in the data storage area in the memory of the heterogeneous device through step S404, the response result can also be sent to the client so that the client receives the response result corresponding to the data to be transmitted.
[0076] In this embodiment, after the response result generated by the server is stored in the memory of the heterogeneous device, the response entry corresponding to the response result can be determined, and the response entry can be appended to the response message queue. Based on this, after receiving the second polling request sent by the client, the response entry corresponding to the response result to be polled by the client can be determined based on the second polling request, and then the response result corresponding to the response entry can be determined, and the response result is sent to the client. The second polling request is used to indicate the response message in the polling response message queue, and the response message is used to indicate the response entry corresponding to the response result stored in the response message queue.
[0077] In the above steps S401 to S405, the data to be transmitted sent by the client through the memory interconnection protocol is stored in the memory of the heterogeneous device, and the server responds to the request message by using the memory of the heterogeneous device, and the response result corresponding to the data to be transmitted is output through the memory interconnection protocol. That is, the client and the server of the embodiment of the present application are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory copying, and data serialization / deserialization processes, achieve the purpose of more efficient data transmission and data interaction, and realize the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0078] As an optional implementation, step S401, using a heterogeneous device memory, stores data to be transmitted sent by a client through a memory interconnection protocol, including: in the heterogeneous device memory, using a service corresponding to a data communication terminal, determining a first data area corresponding to the client; in the first data area, storing the monitored data to be transmitted of the client.
[0079] In this embodiment, for each client and server, there are two message queues and corresponding data storage areas in the memory of the heterogeneous device, wherein the message queue includes a request message queue for the client to send data to be transmitted to the server, and a response message queue for the server to send response results to the client. The request message queue is used to store request entries corresponding to the data to be transmitted sent by the client to the server, and the response message queue is used to store response entries corresponding to the response results sent by the server to the client, wherein the request entries in the request message queue are used to indicate the order of the data to be transmitted sent by the client to the server, and the response entries in the response message queue are used to indicate the order of the server sending response results to the client. The data storage area includes a first data area for the data to be transmitted sent by the client to the server, and a second data area for the client to receive the response results sent by the server.
[0080] Optionally, since the data communication end includes a server and a client, based on this, the service corresponding to the data communication end may include: the client sends the data to be transmitted through the memory interconnection protocol, or the server responds to the data to be transmitted and generates a response result. Among them, the data to be transmitted sent by the client through the memory interconnection protocol can be stored in the first data area in the memory of the heterogeneous device, and the response result generated by the server in response to the data to be transmitted can be stored in the second data area in the memory of the heterogeneous device.
[0081] For example, if the service corresponding to the data communication terminal is that the client sends data to be transmitted through a memory interconnection protocol, a first data area corresponding to the client can be determined in the memory of the heterogeneous device, and then the detected data to be transmitted of the client can be stored in the first data area.
[0082] As an optional implementation, storing the monitored data to be transmitted of the client in the first data area includes: controlling the memory allocator to allocate a first memory in the first data area for the data to be transmitted; and storing the data to be transmitted in the first memory.
[0083] In this embodiment, when the monitored data to be transmitted of the client is stored in the first data area, the memory allocator can be controlled to allocate a first memory in the first data area for the data to be transmitted, and then the data to be transmitted is stored in the first memory.
[0084] Optionally, by controlling the memory allocator to allocate memory, problems of memory overflow and data loss can be avoided to help improve the efficiency and security of data management.
[0085] As an optional implementation, sending a request message to a server includes: determining address information in the request message, wherein the address information is used to represent a storage location of data to be transmitted in a first memory; and in response to a first polling request from the server, sending the address information in the polled request message to the server.
[0086] In this embodiment, as can be seen from the above introduction, the request message can be a request entry corresponding to the data to be transmitted in the request message queue, and the request entry is used to indicate the transmission order of the data to be transmitted. The request entry corresponds to the data to be transmitted, and the storage location of the data to be transmitted in the first memory can be determined based on the request entry. Based on this, the request message in the request message queue can be polled, and then the polled request message is sent to the server.
[0087] For example, since the request message includes address information, based on this, after responding to the first polling request of the server, the address information in the polled request message can be sent to the server. Since the address information is used to represent the storage location of the data to be transmitted in the first memory, based on this, after receiving the address information in the request message, the server can access the data to be transmitted stored in the first memory according to the address information.
[0088] In this step, since the address information is added in the request message, based on this, after the request message is polled, the address information in the request message can be sent to the server, so that the server can directly access the data to be transmitted stored in the first memory according to the address information, thereby simplifying the data acquisition process, reducing unnecessary data processing steps, and improving the response speed of the server.
[0089] As an optional implementation, step S402, obtaining a request message corresponding to the data to be transmitted, includes: in the memory of the heterogeneous device, using the service corresponding to the data communication end, determining the request message queue corresponding to the client; and adding the request message to the request message queue.
[0090] In this embodiment, the services corresponding to the data communication terminal include the request service of the client and the response service of the server, and it can be known from the above introduction that the heterogeneous device memory includes the request message queue corresponding to the client and the response message queue corresponding to the client. Among them, the request message queue is used to store the request entry corresponding to the data to be transmitted sent by the client to the server, and the response message queue is used to store the response entry of the response result sent by the client to the server. Based on this, when obtaining the request message corresponding to the data to be transmitted, it can be determined first whether the service corresponding to the data communication terminal is the client sending the data to be transmitted to the server, or the client receiving the response result sent by the server. If the client sends the data to be transmitted to the server, the request message queue corresponding to the client can be determined in the heterogeneous device memory, and then the request message can be added to the request message queue, wherein the request message can be a request entry.
[0091] For example, after determining the request message queue corresponding to the client, a request entry may be appended to the end of the request message queue to achieve the purpose of adding a request message to the request message queue, wherein the request entry is used to indicate the transmission order of the client's data to be transmitted.
[0092] As an optional implementation, in the request message queue, after adding the request message, the data processing method further includes: adjusting the initial state of the request message to a first valid state, wherein the first valid state is used to indicate that the request message is allowed to be polled by the server.
[0093] In this embodiment, the first valid state is used to indicate that the request message is successfully added to the request message queue, that is, the first valid state is used to indicate the arrival mark of the request message in the request message queue. That is, in the request message queue, after the request message is added, the initial state of the request message can be adjusted to the first valid state to indicate that the request message is successfully added to the request message queue, and the server can poll the request message.
[0094] Optionally, the first valid state can be represented by the number 1, that is, when the initial state of the request message is adjusted to the number 1, it indicates that the request message is successfully added to the request message queue, and conversely, if the initial state of the request message is adjusted to the number 0, it indicates that the request message is not added to the request message queue. This is only an illustrative example, and the representation method of the first valid state is not limited.
[0095] In this step, since the first valid state is used to indicate that the request message is allowed to be polled by the server, based on this, after the request message is added to the request message queue, the initial state of the request message can be adjusted to the first valid state to improve the real-time nature of the message, so that the server can respond to the client's request in a timely manner without having to wait for the client to actively notify, thereby improving data interaction efficiency.
[0096] As an optional implementation, step S403, sending the request message to the server, includes: when the processor reads a request message in a first valid state, responding to a first polling request from the server, sending the polled request message to the server.
[0097] In this embodiment, before waiting for the polling request from the server, the processor can poll the request message at the tail of the request message queue. When the status of the request message read by the processor is the first valid state, it responds to the first polling request from the server and can send the polled request message to the server so that the server can access the data to be transmitted corresponding to the request message.
[0098] For example, the processor may read an arrival flag in a request entry at the end of the request message queue. When the arrival flag is read, the polled request entry may be sent to the server in response to the first polling request of the server.
[0099] In this step, during the idle time waiting for the server polling request, the processor can poll and read the request message at the tail of the processing message queue, and then when responding to the first polling request from the server, the request message in the first valid state polled can be directly sent to the server, so that the server can access the data to be transmitted more quickly, reducing the waiting time of the server, thereby achieving the purpose of speeding up the server's access to the data to be transmitted.
[0100] As an optional implementation, the data processing method includes: in response to a change in the initial state of the request message, waking up the processor to read the request message.
[0101] In this embodiment, when the initial state of the request message changes, the processor is awakened to read the request message.
[0102] For example, when the initial state of the request message is adjusted to the first valid state, the processor will be awakened to read the request message.
[0103] In this step, when the initial state of the request message changes, the processor is promptly awakened to read the request message, which can reduce the low processing efficiency of the processor caused by message backlog. Moreover, when the initial state of the request message changes, the processor is awakened to read the request message, which can better utilize the resources of the processor and avoid the waste of resources caused by the processor being in a reading state all the time, thereby improving the utilization rate of the processor resources.
[0104] Optionally, the foregoing mainly introduces a process in which the client sends data to be transmitted to the server, and next further introduces a process in which the server generates a response result corresponding to the data to be transmitted after responding to the data to be transmitted from the client.
[0105] As an optional implementation, step S404, using a heterogeneous device memory, stores a response result obtained by the server in response to the request message, including: in the heterogeneous device memory, using a service corresponding to the data communication end, determining a second data area corresponding to the client; in the second data area, storing a response result corresponding to the data to be transmitted.
[0106] In this embodiment, as can be seen from the foregoing introduction, the second data area is used to store the response result generated by the server in response to the client's data to be transmitted. Based on this, if it is determined that the data is a response result generated by the server based on the client's data to be transmitted, a second data area corresponding to the client can be determined in the memory of the heterogeneous device, wherein the second data area is used to store the response result generated by the server corresponding to the data to be transmitted.
[0107] For example, a first data area and a second data area are pre-allocated in the memory of a heterogeneous device, wherein the first data area is used to store the data to be transmitted sent by the client to the server, and the second data area is used to store the response result generated by the server in response to the data to be transmitted by the client. Based on this, after the response is received from the server outputting the response result through the memory interconnection protocol, the response result can be stored in the second data area.
[0108] As an optional implementation, storing a response result corresponding to the data to be transmitted in the second data area includes: controlling the memory allocator to allocate a second memory for the response result in the second data area; and storing the response result in the second memory.
[0109] In this embodiment, when storing the response result corresponding to the data to be transmitted in the second data area, the memory allocator can be controlled to allocate the second memory for the data to be transmitted in the second data area, and then store the response result in the second memory.
[0110] Optionally, by controlling the memory allocator to allocate memory to store the response results, problems of memory overflow and data loss can be avoided to help improve the efficiency and security of data management.
[0111] As an optional implementation, the data processing method also includes: in the memory of the heterogeneous device, using the service corresponding to the data communication end, determining the response message queue corresponding to the client; in the response message queue, adding a response message corresponding to the response result, wherein the response message is used to indicate that the server has completed generating the response result; sending the response result to the client, including: responding to the client's second polling request, polling the response message in the response message queue, and using the response message to send the response result in the second data area to the client.
[0112] In this embodiment, since the heterogeneous device memory includes a response message queue corresponding to the response result generated by the server based on the client's data to be transmitted. As can be seen from the above introduction, the service corresponding to the data communication terminal can be the client sending the data to be transmitted to the server, or the client receiving the response result sent by the server. Based on this, if the service corresponding to the data communication terminal is the client receiving the response result sent by the server, then the response message queue corresponding to the client can be determined in the heterogeneous device memory, and then the response message corresponding to the response result sent by the server is added to the response message queue. Among them, the response message can be a response entry, and the response entry is used to indicate the transmission order of the response result.
[0113] Optionally, the second polling request is used to instruct the client to poll the response result generated by the server. Based on this, after receiving the second polling request from the client, the response message in the response message queue can be polled to determine the response result of the response message in the second data area, and the response result is sent to the client.
[0114] As an optional implementation, after adding a response message corresponding to the response result in the response message queue, the data processing method also includes: adjusting the initial state of the response message to a second valid state, wherein the second valid state is used to indicate that the response message allows polling by the client.
[0115] In this embodiment, the second valid state is used to indicate that the response message is successfully added to the response message queue, that is, the second valid state is used to indicate the arrival mark of the response message in the response message queue. In the response message queue, after the response message is added, the initial state of the response message can be adjusted to the second valid state to indicate that the response message is successfully added to the response message queue. After the response message is successfully added to the response message queue, the client can poll the response message.
[0116] Optionally, the second valid state can be represented by the number 1, that is, when the initial state of the response message is adjusted to the number 1, it means that the response message is successfully added to the response message queue. Conversely, if the initial state of the response message is adjusted to the number 0, it means that the response message is not added to the response message queue.
[0117] In this step, after the response message corresponding to the response result is successfully added to the response message queue, the initial state of the response message can be adjusted to the second valid state in time to achieve effective management of the response message. Moreover, after the initial state of the response message is adjusted to the second valid state, the client can poll the response message in time to obtain the response result corresponding to the response message, which improves the real-time nature of the response result, reduces the waiting time of the client, and improves the user experience.
[0118] As an optional implementation, responding to the second polling request of the client, polling a response message in a response message queue, and sending the response result in the second data area to the client using the response message, includes: when the processor reads a response message in a second valid state, responding to the second polling request of the client, polling a response message in a response message queue, and sending the response result in the second data area to the client using the response message.
[0119] In this embodiment, the processor can poll the response message queue. When the status corresponding to the response message in the response message queue polled by the processor is the second valid status, it means that the response message is successfully added to the response message series. At this time, if the second polling request of the client is responded to, the response message in the response message queue can be polled, and the response result corresponding to the response message in the second data area can be determined, and the response result is sent to the client.
[0120] For example, the processor may poll and read the arrival flag in the response entry at the end of the response message queue. When the arrival flag is read, in response to the second polling request of the client, the response result corresponding to the polled response entry may be sent to the client.
[0121] As an optional implementation, the data processing method further includes: in response to a change in the initial state of the response message, waking up the processor to read the response message.
[0122] In this embodiment, when the initial state of the response message changes, the processor is awakened to read the response message.
[0123] For example, when the initial state of the response message is adjusted to the second valid state, the processor will be awakened to read the response message.
[0124] In this step, when the initial state of the response message changes, the processor is promptly awakened to read the response message, which can reduce the low processing efficiency of the processor caused by message backlog. Moreover, when the initial state of the response message changes, the processor is awakened to read the response message, which can better utilize the resources of the processor, avoid the waste of resources caused by the processor being in a reading state all the time, and thus improve the utilization rate of the processor resources.
[0125] As an optional implementation, the data processing method further includes: sending a response notification message to the server, wherein the response notification message is used to indicate the time when the response message is sent to the client.
[0126] In this embodiment, a notification mechanism is provided in the processor, which is used to send a response notification message to the server after the server sends a response message to the client, so as to remind the server of the time when the response message arrives at the client.
[0127] For example, when the processor responds to the server sending a response message to the client, and after the client receives the response message, a response notification message may be sent to the server to remind the server of the time when the client receives the response message.
[0128] As an optional implementation, the data processing method further includes: sending a request notification message to the server, wherein the request notification message is used to indicate the time when the request message is sent to the server.
[0129] In this embodiment, the request notification message is used to send the request notification message to the client after the client sends the request message to the server, so as to remind the client of the time when the request message arrives at the server.
[0130] For example, when the processor responds to the client sending a request message to the server, and after the server receives the request message, a request notification message may be sent to the client to remind the client of the time when the server receives the request message.
[0131] In the above steps, the heterogeneous device memory is used to store the data to be transmitted sent by the client through the memory interconnection protocol, and the heterogeneous device memory is used to store the server response request message, and the response result corresponding to the data to be transmitted is output through the memory interconnection protocol, that is, the client and the server are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory copying and data serialization / deserialization processes, achieve the purpose of more efficient data transmission and data interaction, and realize the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0132] Under the above operating environment, this application provides Figure 5Another data processing method shown is applied to a data communication terminal, where the data communication terminal includes heterogeneous device memories respectively connected to at least one client and at least one server via a memory interconnection protocol. Figure 5 is a flowchart of another data processing method according to an embodiment of the present application.
[0133] Step S501, using heterogeneous device memory to store tensor data to be transmitted sent by the client through the memory interconnection protocol.
[0134] In the technical solution provided in the above step S501 of the present application, the heterogeneous device memory is connected to at least one client and at least one server through a memory interconnection protocol, and is used to store the request data of at least one client and the response data generated by at least one server in response to the request data of the client, wherein the heterogeneous device memory can be referred to as CXL attachment memory. The memory interconnection protocol is used to indicate the interconnection protocol of CXL cache consistency, which is used for high-bandwidth and low-latency device interconnection, and is intended to help data be transmitted more efficiently. Optionally, the data to be transmitted can be user-defined request data.
[0135] In this embodiment, the client and the server may be connected to the same CXL-connected heterogeneous device memory via a physical connection or a CXL switch. For each client or server, there are two message queues and corresponding data storage areas in the CXL-connected heterogeneous device memory, wherein the message queue is used to pass references as request messages or response messages, and the data storage area is used to store the original data of the request message / response message.
[0136] For example, after responding to the tensor data to be transmitted sent by the client through the memory interconnection protocol, the tensor data to be transmitted can be stored in the data storage area corresponding to the request message in the memory of the heterogeneous device.
[0137] Step S502, obtaining a request message corresponding to the tensor data to be transmitted.
[0138] In the technical solution provided in the above step S502 of the present application, the request message is used to request the transmission of the tensor data to be transmitted to the server.
[0139] In this embodiment, since the request message queue includes request entries corresponding to multiple request messages, based on this, after the tensor data to be transmitted is stored in the heterogeneous device memory through step S501, the request entry corresponding to the tensor data to be transmitted can be determined, and then the request entry can be appended to the request message queue, wherein the request entry is used to indicate the transmission order of the tensor data to be transmitted.
[0140] In this step, after the tensor data to be transmitted is stored in the heterogeneous device memory, the request entry corresponding to the tensor data to be transmitted can be determined and appended to the request message queue to indicate the transmission order of the tensor data to be transmitted. The request message queue includes request entries corresponding to multiple request messages, which can ensure that the data is transmitted in the correct order.
[0141] Step S503: In response to the first polling request from the server, the polled request message is sent to the server.
[0142] In the technical solution provided in the above step S503 of the present application, the first polling request is used to indicate a request message in the polling request message queue.
[0143] In this embodiment, the server can send a first polling request. After responding to the first polling request sent by the server, the server can determine the request message to be polled in the request message queue according to the first polling request, that is, determine the request entry corresponding to the tensor data to be transmitted that the server wants to poll according to the first polling request, and send the polled request message to the server.
[0144] For example, the first polling request may be an arrival mark of the request entry at the end of the polling request message queue, that is, identification information of the last request entry in the request message queue. After the last request entry in the request message queue is obtained according to the first polling request, the request entry may be sent to the server.
[0145] Step S504: Using the memory of the heterogeneous device, storing the response result obtained by the server in response to the request message.
[0146] In the technical solution provided in the above step S504 of the present application, since the request message is used to indicate the request entry in the request message queue to be polled by the server, based on this, after sending the request entry to the server through step S503, the server can access the tensor data to be transmitted corresponding to the request entry in the memory of the heterogeneous device according to the request entry, and generate a corresponding response result according to the accessed tensor data to be transmitted. The response result is output by the server through the memory interconnection protocol and corresponds to the tensor data to be transmitted.
[0147] In this embodiment, after generating a response result corresponding to the tensor data to be transmitted, the server can output the response result through a memory interconnection protocol, and after responding to the response result output by the server, the response result can be stored in the memory of the heterogeneous device.
[0148] Step S505, responding to the second polling request of the client, and sending the polling response result to the client.
[0149] In the technical solution provided in the above step S505 of the present application, the second polling request is used to indicate a response message in the polling response message queue, wherein the response message is used to indicate a response entry corresponding to a response result stored in the response message queue.
[0150] In this embodiment, after the response result generated by the server is stored in the memory of the heterogeneous device, the response entry corresponding to the response result can be determined and the response entry can be appended to the response message queue. Based on this, after receiving the second polling request sent by the client, the response entry corresponding to the response result to be polled by the client can be determined based on the second polling request, and then the response result corresponding to the response entry can be determined, and the response result can be sent to the client.
[0151] In the above steps S501 to S505, the heterogeneous device memory is used to store the tensor data to be transmitted sent by the client through the memory interconnection protocol, and the heterogeneous device memory is used to store the server response request message, and the response result corresponding to the tensor data to be transmitted is output through the memory interconnection protocol, that is, the client and the server are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory copying and data serialization / deserialization processes, achieve the purpose of more efficient data transmission and data interaction, and realize the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0152] Figure 6 6 is a schematic diagram of a data processing system according to an embodiment of the present application. The data processing system 600 includes: a data communication terminal 601, at least one client 602 and at least one server 603, wherein the data communication terminal 601 includes a heterogeneous device memory connected to the at least one client 602 and the at least one server 603 through a memory interconnection protocol.
[0153] The client 602 is used to send data to be transmitted.
[0154] In this embodiment, the data to be transmitted may be tensor data to be transmitted, which is used to indicate user-defined request data. The client 602 may send the data to be transmitted to the data communication terminal 601 .
[0155] The data communication terminal 601 is connected to at least one client 602 and is used to utilize the memory of a heterogeneous device to store the data to be transmitted sent by the client through a memory interconnection protocol; obtain a request message corresponding to the data to be transmitted, wherein the request message is used to request transmission of the data to be transmitted to a server 603; and send the request message to the server.
[0156] In this embodiment, the heterogeneous device memory is connected to at least one client and at least one server through a memory interconnection protocol, and is used to store the request data of at least one client and the response data generated by at least one server in response to the request data of the client, wherein the heterogeneous device memory can be referred to as CXL attachment memory. The memory interconnection protocol is used to indicate the interconnection protocol of CXL cache consistency, which is used for high-bandwidth and low-latency device interconnection, and is intended to help data be transmitted more efficiently. Optionally, the data to be transmitted can be user-defined request data. The data communication terminal is used to utilize the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol, and obtain the request message corresponding to the data to be transmitted, and then send the request message to the server. Among them, the request message is used to request the transmission of the data to be transmitted to the server.
[0157] The server 603 is connected to the data communication terminal 601, and is used to respond to the request message and output the response result corresponding to the data to be transmitted through the memory interconnection protocol; wherein the data communication terminal is used to utilize the memory of the heterogeneous device to store the response result; and send the response result to the client.
[0158] In this embodiment, after responding to the request message, the server can access the data to be transmitted corresponding to the request message in the first data area based on the request message, and then generate a response result corresponding to the data to be transmitted, and output the response result to the data communication end through the memory interconnection protocol.
[0159] Optionally, after receiving the response result, the data communication end may store the response result in the memory of the heterogeneous device and send the response result to the client.
[0160] In this embodiment, the data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol, wherein the client is used to send data to be transmitted; the data communication terminal is used to use the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol; obtain a request message corresponding to the data to be transmitted, wherein the request message is used to request to transmit the data to be transmitted to the server; send the request message to the server; the server is used to respond to the request message and output a response result corresponding to the data to be transmitted through the memory interconnection protocol; wherein the data communication terminal is used to use the heterogeneous device memory to store the response result; and send the response result to the client. That is, the data communication terminal uses the heterogeneous device memory to store the tensor data to be transmitted sent by the client through the memory interconnection protocol, and uses the heterogeneous device memory to store the server responding to the request message, and the response result corresponding to the tensor data to be transmitted output through the memory interconnection protocol. By connecting the client and the server to the same heterogeneous device memory, expensive network round trips, memory replication, and data serialization / deserialization processes can be avoided, achieving the purpose of more efficient data transmission and data interaction, and achieving the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0161] The technical solution of the embodiment of the present application is further introduced below with examples in combination with the preferred implementation manner.
[0162] At present, when transferring data between devices, shared memory technology is mainly used to facilitate the transfer of tensor data within a single physical host. This method is suitable for data interaction between multiple virtual machines running on a physical host, but it does not fully utilize the potential of CXL, such as memory pooling and inter-node access. Therefore, this method increases memory consumption and relies heavily on the existing network transmission mechanism, which has the technical problem of low data transmission efficiency.
[0163] However, the embodiment of the present application proposes a data processing method, which implements the client's request, the server's execution, and the client's response through three steps. In the request phase, the client first writes the user-defined request data into the pre-allocated memory in the data area of the heterogeneous device memory, which is aligned by cache lines to achieve non-cacheable sharing. Next, the client appends a request entry to the request message queue. Before waiting for the server's response, the server polls the arrival flag in the request entry at the end of the request message queue. In the execution phase, when a new request is responded to, the server uses the offset in the request entry to process the request. If the server has prepared the response data, it will write the response data to the pre-allocated memory in the data area of the heterogeneous device memory. In order to reduce memory duplication, the server can directly use the pre-allocated memory during the execution process. In the response phase, the server appends a response entry to the response message queue. Then, the client that sends the request message polls the response entry in the response message queue, and the process is considered complete when the client confirms receipt of the response message. That is, by setting up heterogeneous device memory to store the client's request data and the server's response data, expensive network round trips, memory copying, and data serialization / deserialization processes can be avoided, achieving the purpose of more efficient data transmission and data interaction, and realizing the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0164] Next, the memory interconnect protocol is introduced.
[0165] The memory interconnect protocol is used to indicate the interconnect protocol of CXL cache consistency, which is used for high-bandwidth and low-latency device interconnection, aiming to help the system, especially the system with accelerators, run efficiently. It can be used to connect devices such as processors (Central Processing Unit, referred to as CPU), accelerators (Accelerator), memory buffers (Memory Buffer, referred to as), and intelligent network interface cards (Network Interface Card, referred to as NIC), and even used in machine learning, high-performance computing and other scenarios. CXL reuses three types of protocols based on PCIe 5.0, namely CXL.io, CXL.cache, and CXL.memory.
[0166] CXL.io is a protocol for initialization, linking, device detection and enumeration, as well as register access. It provides a non-coherent load / store interface for input / output (I / O) devices, similar to PCIe Gen5. CXL.cache is a protocol that defines the interaction between the host (usually the CPU) and the device (for example, a CXL memory module or accelerator). It allows CXL devices to access data cached in the host memory with low latency.
[0167] CXL.memory is responsible for resolving the processor's access to the device's internal memory. CXL maintains a consistent memory space between the CPU and the device.
[0168] As the latest version, the core function of the CXL3.0 protocol is to support data sharing between different hosts and ensure consistency.
[0169] Optionally, the CXL additional memory is also referred to as host management device memory (Hard Disk Memory, HDM for short).
[0170] Currently, starting from Linux kernel 5.10, CXL2.0 drivers are gradually merged into Linux upstream. In Linux, CXL memory devices are identified as a new ACPI namespace device (e.g., ACPI0017) and are detected and configured like typical PCIe devices, as well as passing messages through the MMIO mailbox. The operating system can obtain relevant information about resources on CXL through the PCIe driver by reading the CXL Early Description Table (CEDT), and then the CXL driver can help the host bridge (HB) establish the connection point for memory interleaving. Once kernel memory space is reserved for CXL attached memory through the CXL driver, both applications and the kernel can access CXL attached memory. There are multiple utilities to manage CXL attached memory, such as ndctl, cxl, and daxctl. When a CXL-equipped operating system is running, developers can use the EFI_MEMORY_SP property of the BIOS tag to identify memory on CXL even if there is no CXL 2.0 driver installed. Developers can then use daxctl to initialize CXL additional memory in two modes: application-managed memory (e.g., devdax) or system-ramOS kernel-managed memory (e.g., system-ram). In devdax mode, users can map CXL additional memory to the application's virtual memory space through the mmap system direct call. In system-ram, CXL additional memory is configured as a "CPUless" NUMA node, similar to the tier-memory solution for persistent memory. Therefore, developers can freely use CXL additional memory by setting memory affinity. Among them, the CXL3.0 standard supports memory sharing of CXL additional memory pools.
[0171] Figure 7 FIG. 1 is a schematic diagram of the difference between a memory pool already supported in CXL 2.0 and consistent memory sharing in CXL 3.0 according to an embodiment of the present application. Figure 7As shown, in CXL2.0, the memory spaces of different devices can build a single remote memory pool, which can be further divided and attached to multiple hosts. The partitioned memory space is attached to the host as a continuous range of host physical addresses. Each host can access the memory assigned to them. However, each partition of the remote memory pool can only be connected to one host, so data sharing capabilities cannot be provided. In contrast, CXL3.0 allows CXL attached memory to be shared by all hosts in a consistency domain. Therefore, CXL3.0 provides the ability to share remote memory pools to multiple hosts. It defines a mechanism to implement hardware cache consistency between copies of the same data stored on different machines. For example, host A and host B can both access the same partition, for example, Figure 7 Partition 2 shown. In CXL 3.0, device memory that is exposed from a host and shared between multiple hosts is called Fabric Attached Memory (FAM stands for Flash-Associated Memory). FAM uses a Port-Based Routing (PBR) link to support scalable sharing, and it is called a global FAM. Global FAM devices are currently built with a single link that supports multiple host interfaces. This means that the host interface of an incoming CXL.mem request is determined by the Source PBR ID field contained in the PBR message.
[0172] The following section introduces the tensor pipeline (TensorPipe) for tensor data transmission in distributed machine learning systems.
[0173] TensorPipe is a library designed specifically for machine learning applications to efficiently transfer tensor data between different machines.
[0174] In distributed machine learning training scenarios, especially when using multiple graphics processing units (GPUs) and multiple nodes, it is necessary to efficiently transfer large amounts of data between different devices. The design goal of TensorPipe is to simplify and optimize this cross-device and cross-machine data transfer.
[0175] TensorPipe provides a simple application programming interface (API). It can transparently handle various hardware and network technologies, such as CPU, GPU, InfiniBand, and Ethernet. The core advantages of TensorPipe include its asynchronous and non-blocking performance, which means that data transfer can be started without blocking the calculation, thereby improving the overall operation efficiency.
[0176] TensorPipe is generally designed to be seamlessly integrated with deep learning frameworks such as PyTorch, but TensorPipe can also be used with other systems. In PyTorch, TensorPipe is used as the underlying communication backend of the remote procedure call framework to support distributed model training and reasoning. In summary, TensorPipe is designed to meet the needs of high-performance cross-device communication in deep learning. It improves the efficiency of distributed training and reasoning by reducing latency and increasing throughput.
[0177] TensorPipe is the same as the zeroMQ communication library. It abstracts the communication path between the first client and the second client into a pipe. The two client processes write data from one end of the pipe and read data from the other end of the pipe. Figure 8 is a schematic diagram of a TensorPipe data communication according to an embodiment of the present application, such as Figure 8 As shown, TensorPipe has two sub-components in the process of transmitting information: the transport component (Transport) and the channel component (Channel). Among them, the transport component is mainly responsible for transmitting some control information between two clients and metadata in the message (Message). For example: the sender, receiver, timestamp and other information of the message, as well as the valid data (payloads). Among them, the valid data is the actual content of the message, that is, the actual content that the user wants to transmit. Since these data are usually small, it is necessary to pursue the lowest possible transmission delay, and the channel component (Channel) is mainly responsible for transmitting the tensor data in the message, and the channel is mainly optimized for high throughput.
[0178] For example, Figure 8 As shown, the data transmission between the first client and the second client can be represented by the following steps:
[0179] Step S801, the transmission component transmits control information and metadata in the message.
[0180] In this embodiment, the transport component Transport is mainly responsible for transmitting the control information of the first client and metadata in the message to the second client.
[0181] Step S802: The transmission component receives a response message.
[0182] In this embodiment, after the control information and metadata in the message are transmitted to the second client in step S801, the second client may generate a response message, and then transmit the response message to the first client through the transmission component.
[0183] Step S803: the transmission component transmits valid data.
[0184] In this embodiment, the transmission component can transmit the valid data to be sent by the first client to the second client.
[0185] Step S804, the channel component transmits tensor data.
[0186] In this embodiment, the channel component can transfer tensor data of a first client to a second client.
[0187] Fig. 9 is a schematic diagram of a transmission layer according to an embodiment of the present application, such as Fig. 9 As shown in the figure, at the transport layer, the transport mechanisms currently supported by TensorPipe include shared memory (SHM), remote direct memory access (RDMA), and transmission control protocol (TCP). Through the transport layer, a connection object representing point-to-point communication can be created, which supports basic write and read operations. The initialization of the connection and the specific implementation of its write / read operations depend on the type of transport used. For example, RDMA transmission uses ibverbs to complete the write / read tasks of the connection, while TCP transmission relies on the libuv library to perform these operations.
[0188] Fig.10 FIG. 1 is a schematic diagram of a CXL-based TensorPipe according to an embodiment of the present application. Fig.10As shown in the figure, the heterogeneous device memory of the CXL connection is utilized to avoid expensive network round trips, memory copies, and (de)serialization of data. Multiple clients / servers are connected to the heterogeneous device memory of the same CXL connection through physical links or CXL switches. For each TensorPipe client / server, there are two message queues and corresponding data areas in the HDM of the CXL connection. Among them, the two message queues include a request message queue and a response message queue. The message queue is responsible for passing references as request / response buffers, while the data area stores the original data of the request / response. Each entry in the message queue is 64 bits in size, including an embedded reference (offset) to the data area and a one-bit arrival flag. A user space-level memory allocator is used to allocate memory for the request / response data. The memory allocator manages the heterogeneous device memory of the CXL connection by mapping the device memory area.
[0189] Control plane, similar to regular remote procedure calls (RPCs), TensorPipe maintains at least one TensorPipe service on each physical server. When an application is deployed, it connects to such a service, and the service allocates the global addresses of the message queues and data areas in the HDM of the CXL connection to the server and client. Then, the server and client follow the typical handshake protocol to establish a transport connection.
[0190] In the data plane, TensorPipe consists of three steps: the request of the TensorPipe client, the execution of the TensorPipe server, and the response to the TensorPipe client. Request phase: The client first writes the user-defined request data to the pre-allocated memory in the data area, which is aligned by cache lines to achieve uncacheable sharing. Next, the client appends an entry to the request message queue. There is no need to wait for the next request to be sent before waiting for the server's response. At the same time, the server polls the arrival flag in the tail entry of the request message queue. Execution phase: Once a new request is received, the server uses the offset in the entry to process the request. If the server has the response data ready, it writes it to the pre-allocated memory in the data area. In order to reduce memory copying, the server can directly use the pre-allocated memory during execution. Response phase: The server appends an entry to the response message queue. Then, the client sending the request polls the entry in the response message queue. The process is considered complete when the client confirms that the response has been received.
[0191] Optionally, the CXL optimized TensorPipe requires a notification mechanism to inform the client or server when the request / response arrives to ensure that both parties can process these requests / responses in a timely manner. For this purpose, an optimization-based polling mechanism is used. However, when pursuing low latency, the use of interrupts may be costly. To achieve the desired low latency effect, a polling mechanism can be used on CXLHDM to detect incoming requests / responses. In this approach, the CPU reads the arrival flag of the request / response entry and starts processing when the flag is valid. However, because the arrival flag needs to be read and verified multiple times, the CPU may perform unnecessary repetitive work. To reduce the problem of repeated accesses to memory locations during busy polling, two unique features designed for Intel processors with Streaming SIMD Extensions 3 (SSE3) are used (monitor and mwait), as well as their user-mode equivalent instructions (umonitor and umwait). The client / server can use the monitor instruction for the cache line of the circular buffer. Then the mwait instruction is executed to suspend the CPU to save energy. When the monitored data is modified by the other party, the CPU is awakened. This method can effectively reduce the CPU usage burden and improve the performance of memory polling.
[0192] Table 1 Data transmission delay corresponding to different transmission mechanisms
[0193] Delay time (μs) UV SHM CXL Average latency 29.579 10.535 13.004 Latency at 90% 30.258 11.086 13.338 Latency at 96% 30.717 13.222 13.470
[0194] As shown in Table 1, using TensorPipe based on CXL as a transport mechanism has at least 2x lower latency than using UV as a transport mechanism. It shows a similar performance degradation (only 20%) when compared to the SHM transport, which leverages local shared memory but cannot support inter-node communication.
[0195] In an embodiment of the present application, the heterogeneous device memory connected by CXL technology is used to avoid network transmission delays, memory replication and data serialization / deserialization processes, and efficient data interaction is achieved. Between multiple clients and servers, a shared memory mechanism connected by a physical link or a CXL switch is used to efficiently transmit messages and data. Two message queues and corresponding data storage areas are allocated to each client in the heterogeneous device memory connected by CXL, wherein the message queue is used to transmit request / response references, and the data storage area is used to store actual request / response data; a memory allocator is used to manage the heterogeneous device memory connected by CXL by mapping the device memory area, thereby reducing memory consumption and improving memory usage efficiency. In order to reduce the delay caused by interrupts, an optimized polling mechanism based on CXL heterogeneous device memory is used to detect incoming requests / responses, thereby reducing the performance overhead caused by processor polling.
[0196] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0197] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0198] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD), including several instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0199] Example 2
[0200] According to an embodiment of the present application, a data processing device for implementing the above data processing method is also provided. Fig.11 It is a schematic diagram of a data processing device according to an embodiment of the present application. As shown in 11, the data processing device 1100 includes: a first storage unit 1101, a first acquisition unit 1102, a first sending unit 1103, a second storage unit 1104 and a second sending unit 1105.
[0201] The first storage unit 1101 is used to store the data to be transmitted sent by the client through the memory interconnection protocol by using the memory of the heterogeneous device;
[0202] A first acquiring unit 1102 is configured to acquire a request message corresponding to the data to be transmitted, wherein the request message is used to request transmission of the data to be transmitted to the server;
[0203] The first sending unit 1103 is used to send a request message to a server;
[0204] The second storage unit 1104 is used to store the response result obtained by the server in response to the request message by using the memory of the heterogeneous device, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted;
[0205] The second sending unit 1105 is used to send the response result to the client.
[0206] It should be noted that the first storage unit 1101, the first acquisition unit 1102, the first sending unit 1103, the second storage unit 1104 and the second sending unit 1105 correspond to steps S401 to S405 in Example 1, and the five modules are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0207] According to an embodiment of the present application, a data processing device for implementing the above data processing method is also provided. Fig.12 is a schematic diagram of another data processing device according to an embodiment of the present application, such as Fig.12 As shown, the data processing device 1200 includes: a third storage unit 1201 , a second acquiring unit 1202 , a third sending unit 1203 , a fourth storage unit 1204 and a fourth sending unit 1205 .
[0208] The third storage unit 1201 is used to use the heterogeneous device memory to store the tensor data to be transmitted sent by the client through the memory interconnection protocol;
[0209] A second acquiring unit 1202 is used to acquire a request message corresponding to the tensor data to be transmitted, wherein the request message is used to request to transmit the tensor data to be transmitted to the server;
[0210] The third sending unit 1203 is used to send the polled request message to the server in response to the first polling request of the server;
[0211] The fourth storage unit 1204 is used to store the response result obtained by the server in response to the request message by using the heterogeneous device memory, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the tensor data to be transmitted;
[0212] The fourth sending unit 1205 is used to respond to the second polling request of the client and send the polled response result to the client, wherein the response result is used to train the target model.
[0213] It should be noted that the third storage unit 1201, the second acquisition unit 1202, the third sending unit 1203, the fourth storage unit 1204 and the fourth sending unit 1205 correspond to steps S501 to S505 in Example 1, and the five modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units can be hardware components or software components stored in a memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n), and the above-mentioned modules can also be run in the computer terminal 10 provided in Example 1 as part of the device.
[0214] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.
[0215] Example 3
[0216] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.
[0217] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0218] In this embodiment, the computer terminal can execute the program code in the method.
[0219] Optionally, Fig.13 is a structural block diagram of an electronic device according to an embodiment of the present application. Fig.13 As shown, the electronic device may include: one or more ( Fig.13 (only one is shown) processor 1302, memory 1304, storage controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.
[0220] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application, and the processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the methods in the above embodiments. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0221] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: using the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol; obtaining a request message corresponding to the data to be transmitted, wherein the request message is used to request the transmission of the data to be transmitted to the server; sending the request message to the server; using the heterogeneous device memory to store the response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; and sending the response result to the client.
[0222] Optionally, the processor may also execute program code of the following steps: determining, in the memory of the heterogeneous device, a first data area corresponding to the client using a service corresponding to the data communication terminal; and storing the monitored data to be transmitted of the client in the first data area.
[0223] Optionally, the processor may also execute program codes of the following steps: controlling the memory allocator to allocate a first memory in the first data area for the data to be transmitted; and storing the data to be transmitted in the first memory.
[0224] Optionally, the processor may also execute the following program code steps: determining address information in a request message, wherein the address information is used to represent a storage location of data to be transmitted in a first memory; and sending the address information in the polled request message to the server in response to a first polling request from the server.
[0225] Optionally, the processor may also execute program code of the following steps: in the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determine the request message queue corresponding to the client; and add a request message to the request message queue.
[0226] Optionally, the processor may further execute program code of the following steps: adjusting the initial state of the request message to a first valid state, wherein the first valid state is used to indicate that the request message is allowed to be polled by the server.
[0227] Optionally, the processor may further execute program code of the following steps: adjusting the initial state of the request message to a first valid state, wherein the first valid state is used to indicate that the request message is allowed to be polled by the server.
[0228] Optionally, the processor may also execute program code of the following steps: in response to a change in the initial state of the request message, waking up the processor to read the request message.
[0229] Optionally, the processor may also execute program code of the following steps: determining, in the memory of the heterogeneous device, a second data area corresponding to the client using a service corresponding to the data communication terminal; and storing, in the second data area, a response result corresponding to the data to be transmitted.
[0230] Optionally, the processor may also execute program code of the following steps: determining, in the memory of the heterogeneous device, a second data area corresponding to the client using a service corresponding to the data communication terminal; and storing, in the second data area, a response result corresponding to the data to be transmitted.
[0231] Optionally, the processor may also execute program code for the following steps: in the memory of a heterogeneous device, using a service corresponding to a data communication terminal, determining a response message queue corresponding to the client; in the response message queue, adding a response message corresponding to the response result, wherein the response message is used to indicate that the server has completed generating a response result; sending the response result to the client, including: responding to a second polling request from the client, polling a response message in the response message queue, and using the response message to send the response result in the second data area to the client.
[0232] Optionally, the processor may further execute program code of the following steps: adjusting the initial state of the response message to a second valid state, wherein the second valid state is used to indicate that the response message allows polling by the client.
[0233] Optionally, the processor may also execute the following program code: when the processor reads a response message in a second valid state, respond to the client's second polling request, poll the response message in the response message queue, and send the response result in the second data area to the client using the response message.
[0234] Optionally, the processor may also execute program code of the following steps: in response to a change in the initial state of the response message, waking up the processor to read the response message.
[0235] Optionally, the processor may also execute the program code of the following steps: sending a response notification message to the server, wherein the response notification message is used to indicate the time when the response message is sent to the client.
[0236] Optionally, the processor may also execute the program code of the following steps: sending a request notification message to the server, wherein the request notification message is used to indicate the time when the request message is sent to the server.
[0237] By adopting the embodiment of the present application, the data to be transmitted sent by the client through the memory interconnection protocol is stored in the memory of a heterogeneous device, and the server response request message is stored in the memory of a heterogeneous device, and the response result corresponding to the data to be transmitted is output through the memory interconnection protocol. That is, the client and the server are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory copying, and data serialization / deserialization processes, thereby achieving the purpose of more efficient data transmission and data interaction, and realizing the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0238] Those skilled in the art will understand that Fig.13 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a PDA, a mobile Internet device (Mobile Internet Devices, referred to as MID), a tablet computer (Portable Android Device, referred to as PAD), and other terminal devices. Fig.13 The structure of the electronic device is not limited. For example, the electronic device may also include Fig.13 More or fewer components (such as network interfaces, display devices, etc.) shown in the figure, or having Fig.13 Different configurations are shown.
[0239] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0240] Example 4
[0241] The embodiment of the present application further provides a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store the program code executed by the method provided in the above embodiment.
[0242] Optionally, in this embodiment, the above storage medium may be located in any electronic device in a group of electronic devices in a computer network, or in any mobile terminal in a group of mobile terminals.
[0243] Optionally, in this embodiment, the computer-readable storage medium is configured to store program codes for executing the following steps: using heterogeneous device memory to store data to be transmitted sent by the client through a memory interconnection protocol; obtaining a request message corresponding to the data to be transmitted, wherein the request message is used to request transmission of the data to be transmitted to a server; sending the request message to the server; using heterogeneous device memory to store a response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; and sending the response result to the client.
[0244] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: in the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determining a first data area corresponding to the client; in the first data area, storing the monitored client's data to be transmitted.
[0245] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: controlling the memory allocator to allocate a first memory in the first data area for the data to be transmitted; and storing the data to be transmitted in the first memory.
[0246] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: determining address information in a request message, wherein the address information is used to characterize a storage location of data to be transmitted in a first memory; and in response to a first polling request from the server, sending the address information in the polled request message to the server.
[0247] Optionally, the computer-readable storage medium is also configured to store program code for executing the following steps: in the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determining the request message queue corresponding to the client; and adding a request message to the request message queue.
[0248] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: adjusting the initial state of the request message to a first valid state, wherein the first valid state is used to indicate that the request message allows polling by the server.
[0249] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: when the processor reads a request message in a first valid state, in response to a first polling request of the server, sending the polled request message to the server.
[0250] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to a change in the initial state of the request message, waking up the processor to read the request message.
[0251] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: in the memory of the heterogeneous device, using the service corresponding to the data communication end, determining a second data area corresponding to the client; in the second data area, storing a response result corresponding to the data to be transmitted.
[0252] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: controlling the memory allocator to allocate a second memory in the second data area for the response result; and storing the response result in the second memory.
[0253] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: in the memory of a heterogeneous device, using a service corresponding to a data communication terminal, determining a response message queue corresponding to a client; in the response message queue, adding a response message corresponding to a response result, wherein the response message is used to indicate that the server has completed generating a response result; sending the response result to the client, including: responding to a second polling request of the client, polling a response message in the response message queue, and using the response message to send the response result in the second data area to the client.
[0254] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: adjusting the initial state of the response message to a second valid state, wherein the second valid state is used to indicate that the response message allows polling by the client.
[0255] Optionally, the computer-readable storage medium is also configured to store program code for performing the following steps: when the processor reads a response message in a second valid state, respond to a second polling request from the client, poll a response message in a response message queue, and send a response result in the second data area to the client using the response message.
[0256] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: in response to a change in an initial state of the response message, waking up the processor to read the response message.
[0257] Optionally, the computer-readable storage medium is further configured to store program codes for executing the following steps: sending a response notification message to the server, wherein the response notification message is used to indicate the time when the response message is sent to the client.
[0258] Optionally, the computer-readable storage medium is further configured to store program code for executing the following steps: sending a request notification message to the server, wherein the request notification message is used to indicate the time when the request message is sent to the server.
[0259] By adopting the embodiment of the present application, the data to be transmitted sent by the client through the memory interconnection protocol is stored in the memory of a heterogeneous device, and the server response request message is stored in the memory of a heterogeneous device, and the response result corresponding to the data to be transmitted is output through the memory interconnection protocol. That is, the client and the server are connected to the same heterogeneous device memory, which can avoid expensive network round trips, memory copying, and data serialization / deserialization processes, thereby achieving the purpose of more efficient data transmission and data interaction, and realizing the technical effect of improving the data transmission efficiency between the client and the server, thereby solving the technical problem of low data transmission efficiency.
[0260] Example 5
[0261] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.
[0262] Example 6
[0263] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.
[0264] Example 7
[0265] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.
[0266] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0267] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0268] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, 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 units or modules, which can be electrical or other forms.
[0269] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0270] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0271] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk, etc., and other media that can store program codes.
[0272] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data processing method, It is characterized in that Applied to a data communication terminal, the data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol, including: Using the heterogeneous device memory, storing the data to be transmitted sent by the client through the memory interconnection protocol; Obtaining a request message corresponding to the data to be transmitted, wherein the request message is used to request transmission of the data to be transmitted to the server; Sending the request message to the server; Using the heterogeneous device memory, storing a response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the data to be transmitted; The response result is sent to the client.
2. The method according to claim 1, It is characterized in that Utilizing the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol, including: In the memory of the heterogeneous device, using a service corresponding to the data communication terminal, determining a first data area corresponding to the client; The monitored data to be transmitted of the client is stored in the first data area.
3. The method according to claim 2, It is characterized in that The monitored data to be transmitted of the client is stored in the first data area, including: Controlling the memory allocator to allocate a first memory for the data to be transmitted in the first data area; The data to be transmitted is stored in the first memory.
4. The method according to claim 3, It is characterized in that Sending the request message to the server includes: Determining address information in the request message, wherein the address information is used to represent a storage location of the data to be transmitted in the first memory; In response to the first polling request of the server, the address information in the polled request message is sent to the server.
5. The method according to claim 1, It is characterized in that Obtaining a request message corresponding to the data to be transmitted, including: In the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determining a request message queue corresponding to the client; In the request message queue, the request message is added.
6. The method according to claim 5, It is characterized in that After adding the request message to the request message queue, the method further includes: The initial state of the request message is adjusted to a first valid state, wherein the first valid state is used to indicate that the request message allows polling by the server.
7. The method according to claim 6, It is characterized in that Sending the request message to the server includes: When the processor reads the request message in the first valid state, the processor sends the polled request message to the server in response to the first polling request of the server.
8. The method according to claim 7, It is characterized in that The method further comprises: In response to a change in the initial state of the request message, waking up the processor to read the request message.
9. The method according to claim 1, It is characterized in that Utilizing the memory of the heterogeneous device to store a response result obtained by the server in response to the request message includes: In the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determining a second data area corresponding to the client; In the second data area, the response result corresponding to the data to be transmitted is stored.
10. The method according to claim 9, It is characterized in that In the second data area, storing the response result corresponding to the data to be transmitted includes: Control the memory allocator to allocate a second memory for the response result in the second data area; The response result is stored in the second memory.
11. The method according to claim 9, It is characterized in that The method further comprises: In the memory of the heterogeneous device, using the service corresponding to the data communication terminal, determining a response message queue corresponding to the client; Adding a response message corresponding to the response result to the response message queue, wherein the response message is used to indicate that the server has completed generating the response result; Sending the response result to the client includes: responding to a second polling request of the client, polling the response message in the response message queue, and sending the response result in the second data area to the client using the response message.
12. The method according to claim 11, It is characterized in that After adding a response message corresponding to the response result in the response message queue, the method further includes: The initial state of the response message is adjusted to a second valid state, wherein the second valid state is used to indicate that the response message allows polling by the client.
13. The method according to claim 12, It is characterized in that Responding to the second polling request of the client, polling the response message in the response message queue, and sending the response result in the second data area to the client by using the response message, including: When the processor reads the response message in the second valid state, it responds to the second polling request of the client, polls the response message in the response message queue, and uses the response message to send the response result in the second data area to the client.
14. The method according to claim 13, It is characterized in that The method further comprises: In response to a change in the initial state of the response message, waking up the processor to read the response message.
15. The method according to claim 11, It is characterized in that The method further comprises: Sending a response notification message to the server, wherein the response notification message is used to indicate the time when the response message is sent to the client.
16. The method according to any one of claims 1 to 15, It is characterized in that The method further comprises: Sending a request notification message to the server, wherein the request notification message is used to indicate the time when the request message is sent to the server.
17. A data processing method, It is characterized in that Applied to a data communication terminal, the data communication terminal includes a heterogeneous device memory connected to at least one client and at least one server through a memory interconnection protocol, including: Using the heterogeneous device memory, storing the tensor data to be transmitted sent by the client through the memory interconnection protocol; Obtaining a request message corresponding to the tensor data to be transmitted, wherein the request message is used to request transmission of the tensor data to be transmitted to the server; In response to a first polling request from the server, sending the polled request message to the server; Using the heterogeneous device memory, storing a response result obtained by the server in response to the request message, wherein the response result is output by the server through the memory interconnection protocol and corresponds to the tensor data to be transmitted; In response to the second polling request of the client, the response result obtained by polling is sent to the client, wherein the response result is used to train the target model.
18. A data processing system, It is characterized in that include: A data communication terminal, at least one client and at least one server, wherein the data communication terminal includes a heterogeneous device memory connected to the at least one client and the at least one server through a memory interconnection protocol, the heterogeneous device memory includes a request message queue corresponding to the client and a response message queue corresponding to the client, wherein: The client is used to send data to be transmitted; The data communication terminal is used to use the heterogeneous device memory to store the data to be transmitted sent by the client through the memory interconnection protocol; obtain a request message corresponding to the data to be transmitted, and add the request message to the request message queue, wherein the request message is used to request the transmission of the data to be transmitted to the server; and send the request message to the server; The server is used to respond to the request message, output a response result corresponding to the data to be transmitted through the memory interconnection protocol, and add a response message corresponding to the response result to the response message queue, wherein the response message is used to indicate that the server has completed generating the response result; The data communication terminal is used to utilize the memory of the heterogeneous device to store the response result; and send the response result to the client.
19. An electronic device, It is characterized in that include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 17 when running.
20. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 17.
21. A computer program product, It is characterized in that It comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 17.
Citation Information
Patent Citations
Data consistency storage method and system for object storage device
CN111124301A
Method for realizing efficient and intelligent data storage of distributed database client
CN116578561A
