Communication method based on RDMA (Remote Direct Memory Access) and related device

By creating a one-to-one mapping between communication threads and modules in the RDMA system, the communication and computing functions are decoupled, the thread blocking problem caused by communication module limitations is solved, and parallel processing of big data tasks and improved computing efficiency are achieved.

CN120705108APending Publication Date: 2025-09-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510316609.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In existing RDMA technology, due to the limited number of communication modules, after the execution thread is bound to the communication module, the remaining threads cannot perform computing tasks, causing thread blocking, wasting CPU resources and reducing computing efficiency.

Method used

By creating a one-to-one mapping between multiple communication threads and communication modules in the first node, the target communication module is determined after monitoring the RDMA communication connection request, and an RDMA communication channel is established through the target communication thread for data transmission, decoupling the communication function and the computing function, ensuring that each execution thread is focused on the computing task.

Benefits of technology

It achieves parallel processing of computing and communication of big data tasks, avoids waste of CPU resources and improves overall computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120705108A_ABST
    Figure CN120705108A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a communication method based on RDMA (Remote Direct Memory Access) and a related device, which realize parallel processing of calculation and communication of a big data task, avoid waste of CPU (Central Processing Unit) resources and improve the overall calculation efficiency. The method comprises the following steps: a first node creates a plurality of communication threads, wherein the plurality of communication threads and a plurality of communication modules have a one-to-one mapping relationship; when an RDMA communication connection request of a target execution thread is monitored, the first node determines a target communication module corresponding to the target execution thread from a plurality of communication modules, and sends the RDMA communication connection request of the target execution thread of the first node and the RDMA communication request to a target communication thread having a mapping relationship with the target communication module; the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request; and the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel, so that a target execution thread and the second node carry out data transmission processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a communication method and related devices based on RDMA. Background Art

[0002] Remote direct memory access (RDMA) is a technology that directly accesses remote memory, that is, it can quickly migrate data from one system to another remote system memory without any impact on the operating system, reducing the consumption of the central processing unit in the data transmission process.

[0003] In current data transmission using RDMA technology, a worker node typically launches multiple executors and binds a dedicated communication module (worker) to each executor. This allows computation and communication functions to be coupled within the same executor thread. This allows the executor thread to retrieve data through the communication module and then perform computations and other processing. However, the number of communication modules responsible for creating queue pair contexts (QPCs) is limited, far fewer than the number of executors. This can easily lead to a situation where, after all communication modules have been bound to executors for communication connections, the remaining executors, lacking additional communication modules to bind to, are unable to perform subsequent computations and other operations. This leads to thread blocking, wasting central processing unit (CPU) resources and reducing computing efficiency. Summary of the Invention

[0004] The embodiments of the present application provide a communication method and related devices based on RDMA, which realize parallel processing of calculation and communication of big data tasks, avoid waste of CPU resources, and improve overall computing efficiency.

[0005] In view of this, the present application provides a communication method based on remote direct memory access (RDMA) on one hand. The method can be applied to a communication system, which includes a first node and a second node. Among them, the first node includes multiple execution threads. The communication method includes: the first node creates multiple communication threads, and the multiple communication threads have a one-to-one mapping relationship with the multiple communication modules; when monitoring the RDMA communication connection request of the target execution thread, the first node determines the target communication module corresponding to the target execution thread from the multiple communication modules, and sends the RDMA communication connection request and RDMA communication request of the target execution thread of the first node to the target communication thread that has a mapping relationship with the target communication module, and the target execution thread is one or more of the multiple execution threads; the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request, and the RDMA communication channel is used to connect the first node and the second node; the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel, so as to be used for the target execution thread and the second node to perform data transmission processing.

[0006] Another aspect of the present application provides a first node. The first node is deployed in a communication system, the communication system also includes a second node, and the first node includes multiple execution threads. The first node includes:

[0007] A creation unit is used to create multiple communication threads, and there is a one-to-one mapping relationship between the multiple communication threads and the multiple communication modules;

[0008] a determining unit configured to, upon detecting an RDMA communication connection request of a target execution thread, determine a target communication module corresponding to the target execution thread from the plurality of communication modules, and send the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node to the target communication thread having a mapping relationship with the target communication module, where the target execution thread is one or more of the plurality of execution threads;

[0009] A creating unit, configured for a target communication thread of the first node to establish an RDMA communication channel based on an RDMA communication connection request, wherein the RDMA communication channel is used to connect the first node and the second node;

[0010] The sending unit is configured to send an RDMA communication request from a target communication thread of the first node to the second node based on the RDMA communication channel, so as to perform data transmission processing with the second node.

[0011] In one possible design, in an implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:

[0012] Monitoring the task size of the subtask assigned to the target execution thread, where the subtask assigned to the target execution thread is any subtask in the task to be processed;

[0013] Monitoring the communication load of each communication module in the plurality of communication modules;

[0014] Based on the task size of the subtask allocated to the target execution thread and the communication load size of each communication module, a target communication module corresponding to the target execution thread is determined from multiple communication modules.

[0015] In one possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:

[0016] Monitoring the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the multiple execution threads and has been assigned a communication module;

[0017] When detecting that the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread, obtaining a first module identifier from the communication module corresponding to the first execution thread, the first module identifier being used to indicate the communication module corresponding to the first execution thread;

[0018] Obtaining a target module identifier based on the sum of the first module identifier and a preset value, where the target module identifier is used to identify a target communication module;

[0019] A target communication module corresponding to the target execution thread is determined from the plurality of communication modules based on the target module identifier.

[0020] In one possible design, in another implementation of another aspect of the embodiment of the present application, each communication module includes a module identifier, and the module identifiers of the multiple communication modules are arranged in sequence; the determining unit is specifically configured to:

[0021] Determine the arrangement position of the first module identifier in sequence;

[0022] The module identifier at the arrangement position following the arrangement position where the first module identifier is located is determined as the target module identifier.

[0023] In one possible design, in another implementation of another aspect of the embodiment of the present application, the determining unit is specifically configured to:

[0024] Monitoring the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the multiple execution threads and has been assigned a communication module;

[0025] When it is detected that the task size of the subtask assigned to the target execution thread is different from the task size of the subtask assigned to the first execution thread, based on the communication load size of each communication module, the communication module with the smallest communication load size is selected from multiple communication modules as the target communication module.

[0026] In one possible design, in another implementation of another aspect of the embodiments of the present application, the first node further includes an acquisition unit;

[0027] The acquisition unit is specifically used to: receive a big data job script sent by the platform scheduling device, where the big data job script includes a target number of threads, and the target number of threads is used to reflect the number of communication threads that need to be created;

[0028] The creation unit is specifically used to create multiple communication threads based on the target number of threads.

[0029] In one possible design, in another implementation of another aspect of the embodiment of the present application, the first node further includes an acquisition unit and a generation unit; the acquisition unit is specifically configured to: before sending the RDMA communication connection request and the RDMA communication request generated by the target execution thread of the first node to the target communication thread having a mapping relationship with the target communication module, the target execution thread of the first node acquires the thread identifier, data block information, memory address of the data block, and callback information of the execution thread;

[0030] The generating unit is specifically configured for the target execution thread of the first node to generate an RDMA communication request based on the thread identifier of the execution thread, the data block information, the memory address of the data block information, and the callback information.

[0031] In one possible design, in another implementation of another aspect of the embodiment of the present application, an establishing unit is specifically configured to:

[0032] The target communication thread of the first node allocates memory for the data block information based on the memory address of the data block information, and generates End Point information based on the destination address, memory address and callback information of the data block information;

[0033] The target communication thread of the first node creates queue pair context information based on End Point information;

[0034] The target communication thread of the first node establishes an RDMA communication channel based on the queue pair context information.

[0035] In one possible design, in another implementation of another aspect of the embodiment of the present application, the target communication thread of the first node includes multiple communication sub-threads; and the establishing unit is specifically configured to:

[0036] Monitor the thread status of each communication sub-thread;

[0037] When the thread state of the first communication sub-thread is an idle state, the first communication sub-thread establishes an RDMA communication channel based on the RDMA communication connection request, and the first communication sub-thread is any one of the multiple communication sub-threads.

[0038] In one possible design, in another implementation of another aspect of the embodiment of the present application, the sending unit is further specifically used to: after the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node, when the first node detects that the data has been successfully transmitted, the first communication sub-thread sends callback information to the target communication thread, and the callback information is used to instruct the target communication thread to process the next RDMA communication request.

[0039] In one possible design, in another implementation of another aspect of the embodiment of the present application, the sending unit is further specifically used to: after the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node, when the first node detects that the transmission data has failed, the first communication sub-thread sends a retransmission message to the target communication thread of the first node, and the retransmission message is used to instruct the target communication thread to re-send the RDMA communication request to the second node.

[0040] On the other hand, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned methods when executing the computer program.

[0041] Another aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned methods when the computer program is executed by a processor.

[0042] Another aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned methods when executed by a processor.

[0043] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:

[0044] In an embodiment of the present application, the first node includes multiple execution threads, and multiple communication threads are created in advance through the first node to establish a one-to-one mapping relationship between the multiple communication threads and the multiple communication modules. In this way, when the RDMA communication connection request of the target execution thread is monitored, the first node determines the target communication module corresponding to the target execution thread from the multiple communication modules, and sends the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node to the target communication thread that has a mapping relationship with the target communication module, and the target execution thread is one or more of the multiple execution threads. In this way, the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request, and the RDMA communication channel is used to connect the first node and the second node. In this way, after the RDMA communication channel is established, the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node. Through the above method, the present application assigns an independent communication thread to each communication module, and uses the independent communication thread to be responsible for the communication tasks of the relevant communication modules, thereby ensuring that the communication function and the computing function are decoupled from the execution thread, so that the execution thread can focus on the computing task, thereby achieving that the execution thread of the assigned communication module will not block the computing tasks performed by the execution threads of other unassigned communication modules, realizing parallel processing of computing and communication of big data tasks, avoiding waste of CPU resources, and improving overall computing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0046] Figure 1 Schematic diagram of the system framework of the RDMA-based communication method in an embodiment of the present application;

[0047] Figure 2 This is a flow chart of an RDMA-based communication method provided in an embodiment of the present application;

[0048] Figure 3 This is another flow chart of the RDMA-based communication method provided in an embodiment of the present application;

[0049] Figure 4 This is an optional schematic diagram of a target communication module provided by the present application;

[0050] Figure 5This is a schematic diagram of an embodiment of the first node in the embodiment of the present application;

[0051] Figure 6 This is a schematic diagram of an optional hardware structure of the computer device provided in this application. DETAILED DESCRIPTION

[0052] The embodiments of the present application provide a communication method and related devices based on RDMA, which realize parallel processing of calculation and communication of big data tasks, avoid waste of CPU resources, and improve overall computing efficiency.

[0053] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0054] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0055] The terms "first," "second," "third," "fourth," and the like (if any) in the specification and claims of the present application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the implementation of the present application described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to such processes, methods, products, or apparatus.

[0056] In the information age, the surge in data volumes and the increasing complexity of business logic have posed unprecedented challenges to distributed computing, storage, and databases. These areas are placing increasing demands on networks, particularly high bandwidth and low latency. To address this, RDMA technology has been proposed to enable rapid, direct data migration from one system to another remote system's memory without impacting the operating system, reducing CPU overhead during data transfer.

[0057] In the big data job processing process, the platform's scheduling device breaks down the task into multiple subtasks and assigns each subtask to different worker nodes in the cluster. Each worker node then launches multiple execution threads to execute the specific tasks assigned by the platform's scheduling device.

[0058] However, if a worker node needs to perform RDMA communication to accelerate data transfer during task execution, each execution thread must be bound to a dedicated communication module, which is responsible for establishing and maintaining the RDMA communication connection. Only after the execution thread is bound to the communication module through thread mapping can it pull data from other nodes for computation. In other words, in the current RDMA data transfer process, the execution thread needs to couple both computation and communication functions.

[0059] However, due to the limitations of the cache on the RDMA network card, the QPC information that can be stored on the RDMA network card is limited, and the excess QPC information will be stored in the main memory, which will cause additional overhead for switching between the network card cache and the main memory. In other words, in the current process of realizing data transmission through RDMA technology, the number of communication modules responsible for creating QPC information is limited, far less than the number of execution threads. Since each execution thread needs to pull data through the bound communication module before performing data calculations and other processing, when all existing communication modules are bound to the execution thread for communication connection, the remaining execution threads will not be able to perform subsequent data reading and calculations because there are no extra communication modules to be bound. This causes a small number of execution threads bound to communication modules to block the data processing of other execution threads that are not bound to communication modules, wasting CPU resources and reducing computing efficiency.

[0060] For example, suppose there are three execution threads, such as executor1, executor2, executor3, and executor4. In addition, suppose there are two communication modules, namely worker1 and worker2. In the traditional solution, executor1 needs to bind to worker1 for RDMA communication and to execute subtask 1. Similarly, executor2 needs to bind to worker2 for RDMA communication and to execute subtask 2. At this time, after executor1 binds to worker1 and executor2 binds to worker2, executor3 and executor4 will not be able to send or receive data for the relevant subtasks because there are no extra workers to bind to, and thus cannot execute the subtasks. In other words, executor1 and executor2 block the task execution process of executor3 and executor4.

[0061] This can easily cause some execution threads that aren't assigned a communication module to remain in a waiting state for extended periods. Big data jobs require each subtask to complete before the next one can proceed, causing some jobs to complete unexpectedly late. This can also prevent some execution threads from being assigned a communication module in a timely manner, leading to communication congestion caused by other execution threads that have already received a communication module. This can also cause differences in the proportion of communication time between different tasks.

[0062] To address the technical issues mentioned in the above-mentioned traditional solutions, this application provides a communication method based on RDMA. The communication method of this application can be applied to scenarios where network card resources are limited and the computing task volume is large, or it can also be applied to scenarios where the workload of a big data platform is high. For example, it can be applied to application scenarios such as distributed storage, big data computing, data backup and synchronization, etc. This application does not impose specific scenario restrictions.

[0063] For example, the RDMA-based communication method provided by this application can be applied to Figure 1 In the communication framework shown in Figure 1 As shown, the communication system includes at least a first node and a second node. In the first node, there are multiple execution threads (executor), such as executor1, executor2, executor3, executor4, executor5, etc. The number of execution threads is not limited in this application. In addition, for the first node, it is also necessary to create multiple communication threads, such as communication thread 1, communication thread 2, communication thread 3, communication thread 4, communication thread 5, etc. The number of communication threads is not limited in this application. After creating multiple communication threads, the first node also needs to establish a one-to-one mapping relationship between multiple communication threads and multiple communication modules (workers), so that one communication thread can manage one communication module. For example, Figure 1 As shown, a mapping relationship between communication thread 1 and worker 1 is constructed, a mapping relationship between communication thread 2 and worker 2 is constructed, and a mapping relationship between communication thread 3 and worker 3 is constructed. Alternatively, a mapping relationship between communication thread 4 and worker 4 can also be constructed, and a mapping relationship between communication thread 5 and worker 5 can be constructed.

[0064] In this way, when the RDMA communication connection request of one or more target execution threads among the multiple execution threads is monitored, the first node determines the target communication module corresponding to the target execution thread from the multiple communication modules. In this way, after determining the target communication module corresponding to the target execution thread, the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node are sent to the target communication thread that has a mapping relationship with the target communication module. Furthermore, the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request. Through the RDMA communication channel, the first node and the second node can be connected. Thus, the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel, so that the target execution thread and the second node can perform data transmission processing. For example, taking executor1 as the target execution thread that needs to perform RDMA communication as an example, the present application can select a suitable target communication module for the executor1 through a gate mechanism or the like, such as worker1, and can determine that the relevant target communication thread is communication thread 1 through the mapping relationship. In this way, after establishing an RDMA communication channel based on the RDMA communication connection request of executor 1, communication thread 1 can send an RDMA communication request to the second node through the RDMA communication channel, thereby implementing data transmission processing between executor 1 and the second node. For example, communication thread 1 performs data transmission processing with the remote network interface card (RNIC) in the second node through the DCT module based on the RDMA communication channel. Similarly, for other execution threads that need to perform RDMA communication, you can also refer to the process of executor 1 for understanding, and will not be repeated here.

[0065] So passed Figure 1 The system framework shown in the present application assigns an independent communication thread to each communication module, and the independent communication thread is responsible for the communication tasks of the relevant communication modules, ensuring that the communication function and the computing function are decoupled from the execution thread, so that the execution thread can focus on the computing task, thereby achieving that the execution thread of the assigned communication module will not block the computing tasks performed by the execution threads of other unassigned communication modules, realizing parallel processing of computing and communication of big data tasks, avoiding waste of CPU resources, and improving overall computing efficiency.

[0066] The first node involved in this application includes but is not limited to servers, etc. The server involved can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence (AI) platforms. The second node involved in this application also includes but is not limited to servers, etc., which can be understood with reference to the aforementioned first node and will not be elaborated here.

[0067] In combination with the above introduction, the RDMA-based communication method in this application will be introduced below. Figure 2 , is a flow chart of a communication method based on RDMA provided in an embodiment of the present application. Figure 2 As shown, the RDMA-based communication method in the embodiment of the present application includes at least the following steps:

[0068] 201. A first node creates multiple communication threads, where the multiple communication threads have a one-to-one mapping relationship with multiple communication modules.

[0069] In one or more embodiments, to decouple the computational functionality of execution threads used to perform computational tasks from the communication module used to perform communication tasks in conventional solutions, the present application can manage the communication module by creating multiple communication threads, such as communication thread 1, communication thread 2, and communication thread 3, though this is not limited in this application. As an illustrative example, while a first node is creating multiple communication threads, the first node can also receive a big data job script sent by a platform scheduling device. This big data job script can provide information about the target number of communication threads to be created, i.e., the target number of threads. For example, the target number of threads can be specified using the code `conf spark.shuffle.ucx.numWorkers`. Thus, after receiving the big data job script, the first node creates multiple communication threads based on the target number of threads. By creating communication threads using the pre-configured number of threads in the script, not only can the number of communication threads created be precisely controlled, thereby avoiding resource over-allocation or under-allocation, but the number of threads can also be easily adjusted by modifying parameters in the script, without requiring in-depth configuration, allowing for flexible response to different task requirements.

[0070] After creating multiple communication threads, the first node also needs to establish a one-to-one mapping relationship between the multiple communication threads and the multiple communication modules. For example, the first node establishes a mapping relationship between a communication thread and a communication module. Figure 1 In the example, communication thread 1 is bound to communication module (worker) 1, communication thread 2 is bound to worker 2, communication thread 3 is bound to worker 3, communication thread 4 is bound to worker 4, communication thread 5 is bound to worker 5, and so on, which are not limited in this application. This application establishes a mapping relationship between communication threads and communication modules, so that after locating the communication module required in the subsequent communication connection process, the corresponding target communication thread can be quickly used for communication connection and other processing.

[0071] In some optional examples, after creating multiple communication threads, the present application also configures a module identifier for the communication module corresponding to each communication thread. The module identifier can be used to quickly locate the corresponding communication module, thereby further quickly locating the corresponding communication thread.

[0072] 202. When monitoring the RDMA communication connection request of the target execution thread, the first node determines the target communication module corresponding to the target execution thread from multiple communication modules, and sends the RDMA communication connection request and RDMA communication request of the target execution thread of the first node to the target communication thread that has a mapping relationship with the target communication module. The target execution thread is one or more of the multiple execution threads.

[0073] In one or more embodiments, since the communication module can support RDMA communication, after creating multiple threads, the first node also needs to monitor whether these multiple execution threads need to perform RDMA communication. If one or more execution threads (i.e., the target execution threads mentioned in this application) have RDMA communication connection requests, the first node can determine the target communication module corresponding to the target execution thread from the multiple communication modules. For example, if execution thread (executor) 1 and executor 2 need to perform RDMA communication at the same time, the target communication module corresponding to executor 1 can be determined from the multiple communication modules, and the target communication module corresponding to executor 2 can be determined from the multiple communication modules.

[0074] In this way, after the first node determines the target communication module corresponding to the target execution thread from multiple communication modules, it can send the RDMA communication connection request and RDMA communication request of the target execution thread of the first node to the target communication thread that has a mapping relationship with the target communication module. It should be noted that the difference between the RDMA communication connection request and the RDMA communication request mentioned in this application is that the RDMA communication connection request is used to request the establishment of an RDMA communication channel, while the RDMA communication request is used to request data transmission through the RDMA communication channel.

[0075] In other optional examples, before sending the RDMA communication connection request and the RDMA communication request to the target communication thread mapped to the target communication module, the target execution thread of the first node may also first obtain the thread identifier, data block information, memory address of the data block, and callback information of the execution thread. Subsequently, the target execution thread of the first node generates an RDMA communication request based on the thread identifier, data block information, memory address of the data block information, and callback information of the execution thread. This RDMA communication request can be used to request data transmission with the second node.

[0076] It should be noted that the thread identifier of the execution thread involved in this application can be used to identify the execution thread when requesting data transmission. The data block information involved can be understood as the data content used for transmission, including but not limited to text, images, audio, etc. The memory address of the data block information involved can be understood as the storage location of the data block information in the memory. The callback information involved in this application is understood as the feedback information triggered by the callback function when the data is successfully transmitted.

[0077] 203. The target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request. The RDMA communication channel is used to connect the first node and the second node.

[0078] In one or more embodiments, after determining the target communication module corresponding to the target execution thread, the first node may determine the target communication thread corresponding to the target execution thread based on the mapping relationship between communication modules and communication threads. Thus, the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request of the target execution thread. Thus, the first node and the second node can be connected via this RDMA communication channel.

[0079] As an exemplary description, regarding how to establish the RDMA communication channel in step 203, the target communication thread of the first node can allocate memory for the data block information based on the memory address of the data block information, and generate End Point information based on the destination address, memory address and callback information of the data block information. It should be noted that the destination address of the data block information involved in this application can be understood as the address of the node (such as the second node of this application) to which the database information is to be sent, such as an IP address, port number or other identifier, etc. The End Point information involved in this application can be used to clarify the access point information of the two parties involved in the communication (i.e., the first node and the second node of this application) in the RMDA communication network. The End Point information may include various information and resources necessary for RDMA communication, such as the memory address of the data block information and communication parameters.

[0080] After generating the End Point information, the target communication thread of the first node creates queue pair context information based on the End Point information. In this way, the target communication thread of the first node establishes an RDMA communication channel based on the queue pair context information.

[0081] As another example, the target communication thread of the first node includes multiple communication sub-threads. During the process of the target communication thread of the first node establishing the RDMA communication channel based on the RDMA communication connection request, the first node may monitor the thread state of each communication sub-thread, and then, when the thread state of any communication sub-thread (such as the first communication sub-thread of the present application) is idle, the first communication sub-thread is called, and the first communication sub-thread establishes the RDMA communication channel based on the RDMA communication connection request.

[0082] 204. The target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel, so that the target execution thread and the second node perform data transmission processing.

[0083] In one or more embodiments, after the target communication thread of the first node establishes an RDMA communication channel, it can send an RDMA communication request to the second node through the RDMA communication channel. Through the RDMA communication request, data transmission processing between the target execution thread and the second node can be realized. For example, after receiving the RDMA communication request sent by the target execution thread, the target communication thread of the first node puts the RDMA communication request into a queue, and then directly transfers the data in the RDMA communication request to the memory address of the second node through the established RDMA communication channel. In this way, after receiving the data in the RDMA communication request, the second node can also place it in the queue for processing by the application program, etc.

[0084] In an embodiment of the present application, an independent communication thread is assigned to each communication module, and the independent communication thread is responsible for the communication tasks of the relevant communication modules, thereby ensuring that the communication function and the computing function are decoupled from the execution thread, so that the execution thread can focus on the computing task, thereby achieving that the execution thread of the assigned communication module will not block the computing tasks performed by the execution threads of other unassigned communication modules, realizing parallel processing of computing and communication of big data tasks, avoiding waste of CPU resources, and improving overall computing efficiency.

[0085] Optional in the aforementioned Figure 2 Based on the corresponding one or more embodiments, in another optional embodiment provided by the present application, after the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node, the first node can also monitor whether the data has been transmitted.

[0086] If the first node detects that data has been successfully transferred, it can send a callback message to the target communication thread through the execution thread performing the data transfer (such as the first communication sub-thread mentioned in step 203). The callback message is used to instruct the target communication thread to process the next RDMA communication request. In this way, using the callback message to promptly process the next RDMA communication request not only increases communication options but also reduces waiting time and overall communication latency.

[0087] Conversely, if the first node detects that data transmission has failed, the first communication sub-thread sends a retransmission message to the target communication thread of the first node. The retransmission message is used to instruct the target communication thread to resend the RDMA communication request to the second node. In this way, the current RDMA communication request is processed by retransmission information, ensuring a high success rate for RDMA communication requests and reducing the number of retries caused by request failures.

[0088] Optional, in the aforementioned Figure 2 On the basis of one or more corresponding embodiments, the present application can determine the target communication module in combination with the task size of the subtask assigned to the current target execution thread and the communication load size of the communication module. Figure 2 How to determine the target communication module in step 202 can refer to Figure 3 The framework flow diagram is shown for understanding.

[0089] like Figure 3As shown, the first node can monitor the task size of the subtask assigned to the target execution thread in the process of determining the target communication module. The subtask assigned to the target execution thread is any subtask in the task to be processed. In other words, after the platform scheduling device divides the task to be processed into multiple subtasks, these multiple subtasks are sent to different working nodes, such as the first node. The first node can start multiple execution threads to process the assigned subtasks. At this time, the subtask assigned to the target execution thread can be understood as any subtask in the task to be processed. The task size of the subtask mentioned can be understood as the amount of data involved in the subtask.

[0090] Furthermore, the target communication module is affected not only by the size of the subtask but also by the communication load of the communication module itself. Therefore, the first node also needs to monitor the communication load of each of the multiple communication modules. The communication load of a communication module can be understood as the amount of data that the communication module needs to process or transmit.

[0091] In this way, after monitoring the task size of the subtask assigned to the target execution thread and the communication load size of each communication module, the first node can determine the target communication module corresponding to the target execution thread from multiple communication modules based on the task size of the subtask assigned to the target execution thread and the communication load size of each communication module.

[0092] For example, taking executor1 as the target execution thread, by monitoring the subtasks assigned to executor1, the task size of the subtask assigned to executor1 can be obtained, such as 20GB. Figure 1 For example, the communication modules shown include workers 1 through 5. By monitoring the communication load of workers 1 through 5, we can determine that worker 1's communication load is 31 GB, worker 2's is 30.5 GB, worker 3's is 32 GB, and worker 4 and worker 5's are both 31.8 GB. Based on the size of the subtask assigned to executor 1 and the communication load sizes of workers 1 through 5, we can determine the target communication module corresponding to executor 1, such as worker 2.

[0093] In the above manner, the target communication module is determined by the task size assigned to the target execution thread and the communication load size of the communication module, which can quickly and accurately identify the target communication module corresponding to the target execution thread, facilitate better execution of communication requests, and optimize resource allocation.

[0094] Optional, in the aforementioned Figure 3 Based on one or more corresponding embodiments, when the task sizes of the subtasks assigned to the execution threads are the same or different, different methods are used to determine the target communication module. Specifically, the following description of Case 1 and Case 2 can be used for understanding.

[0095] Case 1: The subtasks assigned to the execution threads have the same size

[0096] For example, Figure 4 FIG. 1 shows an optional schematic diagram of a target communication module provided by the present application. Figure 4 As shown, combined with the above Figure 3 In an embodiment, the platform scheduling device usually divides the pending tasks into multiple subtasks in an equal manner during the process of dividing the pending tasks into multiple subtasks. In this way, the first node can assign subtasks to multiple execution threads in a round-robin manner. For example, taking subtasks 1 to subtask 5 as an example, subtask 1 can be assigned to executor 1, subtask 2 can be assigned to executor 2, and subtask 3 can be assigned to executor 3, subtask 4 can be assigned to executor 4, and subtask 5 can be assigned to executor 5. When a target execution thread needs to perform RDMA communication, at this time, since the execution thread closest to the current time (such as the first execution thread of the present application) has been assigned a communication module among other execution threads that need to perform RDMA communication earlier than the target execution thread, the first node can monitor the task size of the subtask assigned to the first execution thread. For example, assuming the target execution thread is executor2, at this time, since executor1 needs to perform RDMA communication earlier than executor2, a communication module has been allocated to executor1 in advance. At this time, the task size of the subtask assigned to executor1 and the task size of the subtask assigned to executor2 can be monitored.

[0097] Further, if Figure 4As shown, the first node determines whether the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread. If it is detected that the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread, it can be said that the communication load size of the first execution thread currently assigned to the communication module is basically the same, and the target communication module can be determined from the remaining communication modules. Specifically, when the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread, the first node can obtain the first module identifier from the communication module corresponding to the first execution thread, and the first module identifier is used to indicate the communication module corresponding to the first execution thread.

[0098] At this point, the first node obtains a target module identifier based on the sum of the first module identifier and a preset value. This target module identifier can be used to identify the target communication module. As an illustrative example, the module identifiers of each of the multiple communication modules can be arranged in sequence. In determining the target module identifier, the first node can sequentially determine the arrangement position of the first module identifier, and then determine the module identifier at the arrangement position immediately following the arrangement position of the first module identifier as the target module identifier.

[0099] For example, suppose the module identifier of worker1 is "1", the module identifier of worker2 is "2", the module identifier of worker3 is "3", the module identifier of worker4 is "4", and the module identifier of worker5 is "5", and the module identifiers of worker1 to worker5 are arranged in order. If the communication module assigned to executor1 is worker2, then by querying worker2, it can be learned that the module identifier of worker2 is "2". In this way, when executor2 needs to perform RDMA communication, if it is monitored that the task size of the subtask assigned to executor1 is 20GB and the task size of the subtask assigned to executor2 is also 20GB, then the module identifier (such as "3") after the module identifier "2" of worker2 can be used as the target module identifier.

[0100] Thus, after obtaining the target module identifier, the first node determines the target communication module corresponding to the target execution thread from multiple communication modules based on the target module identifier. For example, the communication module corresponding to the module identifier "3" (such as worker3) can be used as the target communication module corresponding to executor2.

[0101] Through the above method, when the task size assigned to each execution thread is the same, the target communication module is determined by the module identifier, without the need for complex matching calculations, and the target communication module corresponding to the target execution thread can be quickly and accurately identified, which not only efficiently executes communication requests but also reduces the use of computing resources.

[0102] Case 2: The subtasks assigned to the execution threads have different sizes

[0103] For example, Figure 4 As shown, from the aforementioned Figure 3 As can be seen from the description of Case 1, since the execution thread closest to the current time (such as the first execution thread of this application) has been allocated a communication module among other execution threads that need to perform RDMA communication earlier than the target execution thread, the first node can monitor the task size of the subtask allocated to the first execution thread.

[0104] Furthermore, the first node determines whether the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread. If it is detected that the task size of the subtask assigned to the target execution thread is different from the task size of the subtask assigned to the first execution thread, the target communication module can be directly determined by the communication load size of each communication module. Specifically, when the first node detects that the task size of the subtask assigned to the target execution thread is different from the task size of the subtask assigned to the first execution thread, the first node selects the communication module with the smallest communication load size from the multiple communication modules as the target communication module based on the communication load size of each communication module.

[0105] For example, Figure 1Taking the communication module shown as including workers 1 through 5 as an example, by monitoring the communication load of workers 1 through 5, it can be determined that the communication load size of worker 1 is 31GB, the communication load size of worker 2 is 30.5GB, the communication load size of worker 3 is 32GB, and the communication load sizes of worker 4 and worker 5 are both 31.8GB. Assuming that executor 2 needs to perform RDMA communication, if the task size of the subtask assigned to executor 1 is monitored to be 20GB and the task size of the subtask assigned to executor 2 is also 25GB, it can be determined that the task size of the subtask assigned to executor 1 is different from the task size of the subtask assigned to executor 2. At this time, by comparing the communication load sizes of worker1 to worker5, we can see that: 32GB>31.8GB>31.8>31GB>30.5GB, so the communication module corresponding to 30.5GB (such as worker2) can be selected as the target communication module corresponding to executor2.

[0106] It should be noted that this application only uses the contents shown in Case 1 and Case 2 as examples to illustrate how to determine the target communication module. In actual applications, other methods can also be included to determine the target communication module, which is not specifically limited in this application.

[0107] Through the above method, when the task size assigned to each execution thread is different, the target communication module is determined by the minimum value of the communication load size, and the communication task can be assigned to the communication module with a smaller load, which helps to achieve load balancing and reduce the waiting time of the communication task, which is conducive to the efficient execution of communication requests and can also reduce the use of computing resources.

[0108] In the embodiment of the present application, the RDMA communication-based method provided by the present application is deployed in the scenario of a large-scale big data platform, which can greatly improve the system throughput and network bandwidth utilization. In addition, for servers such as the first node or the second node, the RDMA communication-based method of the present application can effectively alleviate the problem of uneven distribution of communication resources, making the communication load of the communication module more balanced and the network card resources fully utilized. In addition, for users, the RDMA-based communication method provided by the present application can significantly reduce the job completion time, greatly improve the user experience, and reduce the job tail delay, which greatly alleviates the phenomenon of abnormal growth of individual business execution time.

[0109] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. It can be understood that in order to realize the above functions, the hardware structure and / or software modules corresponding to the execution of each function are included. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiment disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0110] The first node in this application is described in detail below. Figure 5 , Figure 5 This is a schematic diagram of an embodiment of a first node in an embodiment of the present application. The first node is deployed in a communication system. The communication system also includes a second node. The first node includes multiple execution threads. The first node includes:

[0111] A creation unit 501 is configured to create multiple communication threads, where the multiple communication threads have a one-to-one mapping relationship with the multiple communication modules;

[0112] a determining unit 502 configured to, upon detecting an RDMA communication connection request of a target execution thread, determine a target communication module corresponding to the target execution thread from the plurality of communication modules, and send the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node to the target communication thread having a mapping relationship with the target communication module, where the target execution thread is one or more of the plurality of execution threads;

[0113] A creating unit 501 is configured to establish an RDMA communication channel based on an RDMA communication connection request by a target communication thread of a first node, where the RDMA communication channel is used to connect the first node and the second node;

[0114] The sending unit 503 is configured for the target communication thread of the first node to send an RDMA communication request to the second node based on the RDMA communication channel, so as to perform data transmission processing with the second node.

[0115] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in the embodiment of the present application, the determining unit 502 is specifically configured to:

[0116] Monitoring the task size of the subtask assigned to the target execution thread, where the subtask assigned to the target execution thread is any subtask in the task to be processed;

[0117] Monitoring the communication load of each communication module in the plurality of communication modules;

[0118] Based on the task size of the subtask allocated to the target execution thread and the communication load size of each communication module, a target communication module corresponding to the target execution thread is determined from multiple communication modules.

[0119] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in the embodiment of the present application, the determining unit 502 is specifically configured to:

[0120] Monitoring the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the multiple execution threads and has been assigned a communication module;

[0121] When detecting that the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread, obtaining a first module identifier from the communication module corresponding to the first execution thread, the first module identifier being used to indicate the communication module corresponding to the first execution thread;

[0122] Obtaining a target module identifier based on the sum of the first module identifier and a preset value, where the target module identifier is used to identify a target communication module;

[0123] A target communication module corresponding to the target execution thread is determined from the plurality of communication modules based on the target module identifier.

[0124] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in an embodiment of the present application, each communication module includes a module identifier, and the module identifiers of the multiple communication modules are arranged in sequence; the determining unit 502 is specifically configured to:

[0125] Determine the arrangement position of the first module identifier in sequence;

[0126] The module identifier at the arrangement position following the arrangement position where the first module identifier is located is determined as the target module identifier.

[0127] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in the embodiment of the present application, the determining unit 502 is specifically configured to:

[0128] Monitoring the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the multiple execution threads and has been assigned a communication module;

[0129] When it is detected that the task size of the subtask assigned to the target execution thread is different from the task size of the subtask assigned to the first execution thread, based on the communication load size of each communication module, the communication module with the smallest communication load size is selected from multiple communication modules as the target communication module.

[0130] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in the embodiment of the present application, the first node further includes an acquiring unit 504;

[0131] The acquisition unit 504 is specifically configured to: receive a big data job script sent by the platform scheduling device, where the big data job script includes a target number of threads, which is used to reflect the number of communication threads that need to be created;

[0132] The creating unit 501 is specifically configured to create multiple communication threads based on the target number of threads.

[0133] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided by the embodiment of the present application, the first node further includes an acquisition unit 504 and a generation unit 505; the acquisition unit 504 is specifically configured to: before sending the RDMA communication connection request and the RDMA communication request generated by the target execution thread of the first node to the target communication thread having a mapping relationship with the target communication module, the target execution thread of the first node acquires the thread identifier, data block information, memory address of the data block, and callback information of the execution thread;

[0134] The generating unit 505 is specifically configured for the target execution thread of the first node to generate an RDMA communication request based on the thread identifier of the execution thread, the data block information, the memory address of the data block information, and the callback information.

[0135] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided in the embodiment of the present application, the creating unit 501 is specifically configured to:

[0136] The target communication thread of the first node allocates memory for the data block information based on the memory address of the data block information, and generates End Point information based on the destination address, memory address and callback information of the data block information;

[0137] The target communication thread of the first node creates queue pair context information based on End Point information;

[0138] The target communication thread of the first node establishes an RDMA communication channel based on the queue pair context information.

[0139] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided by the embodiment of the present application, the target communication thread of the first node includes multiple communication sub-threads; the creation unit 501 is specifically configured to:

[0140] Monitor the thread status of each communication sub-thread;

[0141] When the thread state of the first communication sub-thread is an idle state, the first communication sub-thread establishes an RDMA communication channel based on the RDMA communication connection request, and the first communication sub-thread is any one of the multiple communication sub-threads.

[0142] Optionally, in the above Figure 5 On the basis of one or more corresponding embodiments, in another embodiment of the first node provided by the embodiment of the present application, the sending unit 503 is specifically further used for: after the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node, when the first node detects that the data has been successfully transmitted, the first communication sub-thread sends a callback information to the target communication thread, and the callback information is used to instruct the target communication thread to process the next RDMA communication request.

[0143] Optionally, in the above Figure 5 On the basis of the corresponding one or more embodiments, in another embodiment of the first node provided by the embodiment of the present application, the sending unit 503 is specifically further used for: after the target communication thread of the first node sends an RDMA communication request to the second node based on the RDMA communication channel for data transmission processing with the second node, when the first node detects that the data transmission has failed, the first communication sub-thread sends a retransmission message to the target communication thread of the first node, and the retransmission message is used to instruct the target communication thread to re-send the RDMA communication request to the second node.

[0144] The first node in the embodiment of the present application is described above from the perspective of a modular functional entity, and the computer device in the embodiment of the present application is described below from the perspective of hardware processing. Figure 6 This is an optional hardware structure diagram of the computer device provided by this application. The computer device may have relatively large differences due to different configurations or performances, such as but not limited to the aforementioned Figure 5 The first node described in etc. Figure 6As shown, the computer device may have relatively large differences due to different configurations or performance, and may include one or more central processing units (CPUs) 322 (for example, one or more processors) and memory 332, and one or more storage media 330 (for example, one or more mass storage devices) for storing applications 342 or data 344. Among them, the memory 332 and the storage medium 330 can be temporary storage or permanent storage. The program stored in the storage medium 330 may include one or more modules (not shown in the figure), each of which may include a series of instruction operations in the computer device. Furthermore, the central processing unit 322 can be configured to communicate with the storage medium 330 and execute a series of instruction operations in the storage medium 330 on the computer device. Exemplarily, the central processing unit 322 is used to execute the application 342 stored in the storage medium 330, thereby implementing the RDMA-based communication method provided in the above-mentioned embodiment of the present application.

[0145] The computer device may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input and output interfaces 358, and / or one or more operating systems 341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0146] For example, Figure 6 The central processing unit 322 in the memory 332 can call the computer execution instructions stored in the memory 332 to make the computer device execute the following Figures 2 to 3 The method in the corresponding method embodiment.

[0147] Specifically, Figure 5 The functions / implementation processes of the creation unit 501, the determination unit 502, and the generation unit 505 can be realized by Figure 6 The central processing unit 322 in the memory 332 calls the computer execution instructions stored in the memory 332 to achieve this. Figure 5 The functions / implementation processes of the acquisition unit 504 and the sending unit 503 can be realized by Figure 6 It is implemented by the input and output interface 358 in.

[0148] The steps performed by the computer device in the above embodiment can be based on the Figure 6 The computer device structure shown.

[0149] A computer-readable storage medium is also provided in an embodiment of the present application, on which a computer program is stored. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.

[0150] A computer program product is also provided in an embodiment of the present application, including a computer program. When the computer program is executed by a processor, the steps of the methods described in the above embodiments are implemented.

[0151] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0152] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0153] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0154] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0155] 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 is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a server or terminal device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store computer programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0156] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A communication method based on RDMA, characterized in that: The communication method is applied to a communication system, the communication system including a first node and a second node, the first node including a plurality of execution threads, and the method including: The first node creates a plurality of communication threads, and a one-to-one mapping relationship exists between the plurality of communication threads and the plurality of communication modules; When an RDMA communication connection request of a target execution thread is detected, the first node determines a target communication module corresponding to the target execution thread from the plurality of communication modules, and sends the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node to the target communication thread having the mapping relationship with the target communication module, where the target execution thread is one or more of the plurality of execution threads; The target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request, where the RDMA communication channel is used to connect the first node and the second node; The target communication thread of the first node sends the RDMA communication request to the second node based on the RDMA communication channel, so that the target execution thread and the second node perform data transmission processing.

2. The method according to claim 1, characterized in that The first node determines a target communication module corresponding to the target execution thread from the plurality of communication modules, including: The first node monitors the task size of the subtask assigned to the target execution thread, where the subtask assigned to the target execution thread is any subtask in the task to be processed; The first node monitors the communication load size of each of the plurality of communication modules; The first node determines a target communication module corresponding to the target execution thread from the plurality of communication modules based on the task size of the subtask allocated to the target execution thread and the communication load size of each communication module.

3. The method according to claim 2, characterized in that The first node determines, based on the task size of the subtask assigned to the target execution thread and the communication load size of each of the communication modules, a target communication module corresponding to the target execution thread from the plurality of communication modules, including: The first node monitors the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the plurality of execution threads and to which the communication module is assigned; When detecting that the task size of the subtask assigned to the target execution thread is the same as the task size of the subtask assigned to the first execution thread, the first node obtains a first module identifier from the communication module corresponding to the first execution thread, where the first module identifier is used to indicate the communication module corresponding to the first execution thread; The first node obtains a target module identifier based on the sum of the first module identifier and a preset value, where the target module identifier is used to identify the target communication module; The first node determines a target communication module corresponding to the target execution thread from the plurality of communication modules based on the target module identifier.

4. The method according to claim 3, characterized in that Each of the communication modules includes a module identifier, and the module identifiers of the plurality of communication modules are arranged in order; the first node obtains a target module identifier based on the sum of the first module identifier and a preset value, including: The first node determines, according to the sequence, an arrangement position of the first module identifier; The first node determines the module identifier at the next arrangement position after the arrangement position where the first module identifier is located as the target module identifier.

5. The method according to claim 2, characterized in that The first node determines, based on the task size of the subtask assigned to the target execution thread and the communication load size of each of the communication modules, a target communication module corresponding to the target execution thread from the plurality of communication modules, including: The first node monitors the task size of the subtask assigned to the first execution thread, where the first execution thread is the execution thread closest to the current time among the plurality of execution threads and to which the communication module is assigned; When it is detected that the task size of the subtask assigned to the target execution thread is different from the task size of the subtask assigned to the first execution thread, the first node selects the communication module with the smallest communication load size from the multiple communication modules as the target communication module based on the communication load size of each communication module.

6. The method according to any one of claims 1 to 5, characterized in that The communication system also includes a platform scheduling device; The first node creates multiple communication threads, including: The first node receives a big data job script sent by the platform scheduling device, where the big data job script includes a target number of threads, where the target number of threads is used to reflect the number of communication threads that need to be created; The first node creates a plurality of communication threads based on the target number of threads.

7. The method according to any one of claims 1 to 6, characterized in that Before sending the RDMA communication connection request and the RDMA communication request generated by the target execution thread of the first node to the target communication thread having the mapping relationship with the target communication module, the method further includes: The target execution thread of the first node obtains the thread identifier, data block information, memory address of the data block, and callback information of the execution thread; The target execution thread of the first node generates an RDMA communication request based on the thread identifier of the execution thread, the data block information, the memory address of the data block information, and the callback information.

8. The method according to claim 7, characterized in that The target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request, including: The target communication thread of the first node allocates memory for the data block information based on the memory address of the data block information, and generates End Point information based on the destination address of the data block information, the memory address and the callback information; The target communication thread of the first node creates queue pair context information based on the End Point information; The target communication thread of the first node establishes an RDMA communication channel based on the queue pair context information.

9. The method according to any one of claims 7 to 8, characterized in that The target communication thread of the first node includes a plurality of communication sub-threads; the target communication thread of the first node establishes an RDMA communication channel based on the RDMA communication connection request, including: The first node monitors the thread state of each of the communication sub-threads; When the thread state of the first communication sub-thread is an idle state, the first communication sub-thread establishes an RDMA communication channel based on the RDMA communication connection request, and the first communication sub-thread is any one of the multiple communication sub-threads.

10. The method according to claim 9, characterized in that After the target communication thread of the first node sends the RDMA communication request to the second node based on the RDMA communication channel for performing data transmission processing with the second node, the method further includes: When the first node detects that the data has been successfully transmitted, the first communication sub-thread sends the callback information to the target communication thread, where the callback information is used to instruct the target communication thread to process the next RDMA communication request.

11. The method according to claim 9, characterized in that After the target communication thread of the first node sends the RDMA communication request to the second node based on the RDMA communication channel for performing data transmission processing with the second node, the method further includes: When the first node detects that the transmission data has failed, the first communication sub-thread sends a retransmission message to the target communication thread of the first node, and the retransmission message is used to instruct the target communication thread to resend the RDMA communication request to the second node.

12. A first node, characterized in that: The first node is deployed in a communication system, the communication system further includes a second node, the first node includes multiple execution threads, and the first node includes: A creating unit, configured to create a plurality of communication threads, wherein a one-to-one mapping relationship exists between the plurality of communication threads and the plurality of communication modules; a determining unit configured to, upon monitoring an RDMA communication connection request of a target execution thread, determine a target communication module corresponding to the target execution thread from the plurality of communication modules, and send the RDMA communication connection request and the RDMA communication request of the target execution thread of the first node to the target communication thread having the mapping relationship with the target communication module, wherein the target execution thread is one or more of the plurality of execution threads; A creating unit, configured for the target communication thread of the first node to establish an RDMA communication channel based on the RDMA communication connection request, wherein the RDMA communication channel is used to connect the first node and the second node; A sending unit is configured to cause the target communication thread of the first node to send the RDMA communication request to the second node based on the RDMA communication channel, so as to perform data transmission processing with the second node.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the RDMA-based communication method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the RDMA-based communication method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the steps of the RDMA-based communication method according to any one of claims 1 to 11.