Process communication method, apparatus, device, storage medium, and program product

CN121116505BActive Publication Date: 2026-09-25DAWNING INFORMATION IND (BEIJING) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511247861.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2026-09-25
Estimated Expiration
2045-09-02

AI Technical Summary

Technical Problem

但在实际的并行计算中,分布式系统中包括的进程数一般为非2的幂次方的情况,使部分进程无对端进程,从而导致通信失败,因此,对于非2的幂次方进程数的分布式系统,需剔除多余进程

Benefits of technology

[0032]本申请实施例所述的方法,通过对相邻的进程对采用奇数和偶数交替的方式进行进程剔除操作,在保证各计算节点上的进程数均衡的情况下,还保证了各计算节点上核心Die上的资源是均衡的,确保每个计算节点上参与后续通信的进程分布尽可能均衡,并且每个Die上参与后续通信的进程分布尽可能均衡。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121116505B_ABST
    Figure CN121116505B_ABST
Patent Text Reader

Abstract

The application relates to a process communication method, device, equipment, storage medium and program product. The method comprises the following steps: determining the total number of processes to be processed according to the number of processes contained in a distributed system and process communication requirements; controlling all the computing nodes to process the total number of processes according to the process carrying capacity of each computing node in the distributed system; and performing communication by using each process on the computing node after processing the process. In the method, the process distribution on each computing node is changed as a condition for processing the process, so that the processes participating in subsequent communication on each computing node are balanced, the situation that the number of processes on part of the computing nodes is too small or too large is avoided, the communication load imbalance problem caused by the traditional method is effectively solved, and the overall communication efficiency of the distributed system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed computing technology, and in particular to a process communication method, apparatus, device, storage medium, and program product. Background Technology

[0002] With the development of distributed computing technology, distributed systems, with their advantages of high scalability and fault tolerance, have been widely applied in various fields. A distributed system consists of multiple parallel computing nodes, each running multiple processes. Inter-process communication typically uses a global reduction technique, which requires processes to communicate in pairs at distances that are powers of 2. Therefore, the total number of processes must be a power of 2 to ensure successful communication. However, in actual parallel computing, the number of processes in a distributed system is generally not a power of 2, resulting in some processes having no peer processes, leading to communication failures. Therefore, for distributed systems with a process count not exceeding a power of 2, redundant processes need to be removed.

[0003] However, the methods of process elimination in related technologies can affect the communication performance of distributed systems. Summary of the Invention

[0004] Therefore, it is necessary to provide a process communication method, apparatus, device, storage medium, and program product that can balance the processes of a distributed system to improve the communication performance of the distributed system, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a process communication method, the method comprising:

[0006] Determine the total number of processes that need to be processed based on the number of processes in the distributed system and their communication requirements.

[0007] Based on the process carrying capacity of each computing node in the distributed system, control all computing nodes to process the total number of processes, and use the processes on the computing nodes after processing to communicate with each other.

[0008] The process communication method provided in this application determines the total number of processes to be processed based on the number of processes in the distributed system and the process communication requirements. Then, based on the process carrying capacity of each computing node in the distributed system, it controls all computing nodes to process the total number of processes, and utilizes the processes on the processed computing nodes for communication. In this method, by changing the process processing logic and using the process distribution on each computing node as a condition for process processing, the number of processes participating in subsequent communication on each computing node is balanced, avoiding situations where some computing nodes have too few or too many processes. This effectively solves the problem of unbalanced communication load caused by traditional methods, thereby improving the overall communication efficiency of the distributed system.

[0009] In some embodiments, the total number of processes processed by all computing nodes is controlled according to the process carrying capacity of each computing node in the distributed system, including:

[0010] The initial number of processes corresponding to each computing node is determined based on the number of computing nodes and the total number of computing nodes.

[0011] The initial number of processes is adjusted according to the process carrying capacity of each computing node to obtain the target number of processes for each computing node.

[0012] Controls the number of processes that each computing node can process, corresponding to the target number of processes.

[0013] The method described in this application determines the initial number of processes for each computing node by considering the number of computing nodes and the total number of processes, thus initially and reasonably allocating processes to each computing node. Based on this, the initial number of processes is adjusted according to the process handling capacity of each computing node, ensuring that the number of processes processed by each computing node matches its own processing capacity. This avoids situations where some nodes are idle while others are overloaded, achieving efficient utilization of system resources.

[0014] In some embodiments, the initial number of processes is adjusted according to the process carrying capacity of each computing node to obtain the target number of processes for each computing node, including:

[0015] For each computing node, if the initial number of processes on the computing node is within the range of the number of processes corresponding to the process carrying capacity, then the initial number of processes is taken as the target number of processes.

[0016] If the initial number of processes on a computing node is not within the range of the process capacity, the initial number of processes is adjusted according to the boundary value of the process capacity range and the initial number of processes to obtain the target number of processes for each computing node.

[0017] In some embodiments, the boundary values ​​include an upper boundary value and a lower boundary value. The initial process number is adjusted based on the boundary values ​​of the process number range and the initial process number to obtain the target process number for each computing node, including:

[0018] If the initial number of processes is greater than the upper boundary value, the initial number of processes is reduced to obtain the adjusted target number of processes.

[0019] If the initial number of processes is less than the lower boundary value, the initial number of processes is adjusted incrementally to obtain the adjusted target number of processes, or the initial number of processes is used as the target number of processes.

[0020] The method described in this application, when the initial number of processes on a computing node is within its process capacity range, directly uses the initial number of processes as the target number of processes. This ensures that the computing node's resources are used fully and reasonably. When the initial number of processes exceeds the capacity range, adjustments are made using the boundary values ​​of the process number range to avoid resource waste due to overload. For computing nodes exceeding their capacity, timely adjustment of the number of processes can prevent node crashes due to overload. Each computing node running with an appropriate number of processes can process tasks more efficiently. With a reasonable number of processes, node resources can be effectively utilized, task processing response time will be shortened, and throughput will be increased.

[0021] In some embodiments, controlling each computing node to process the corresponding target number of processes includes:

[0022] For each computing node, the processes contained on the computing node are grouped according to the target number of processes, resulting in multiple groups of process pairs;

[0023] Some processes in each process pair are removed.

[0024] The method described in this application embodiment, by grouping processes and removing some processes, can ensure that the number of processes ultimately retained on each computing node exactly matches the target number of processes, so that system resources are precisely matched with actual needs, avoiding overuse or underuse of resources, ensuring resource balance on each computing node, and thus improving the overall communication efficiency of the distributed system.

[0025] In some embodiments, the process pair includes two processes, and a subset of processes in each process pair is removed, including:

[0026] For each process pair in a group, remove processes with odd process IDs, or remove processes with even process IDs in each process pair in a group.

[0027] The method described in this application embodiment can ensure that the number of processes on each computing node is balanced by performing odd-number elimination or even-number operation on the process IDs of process pairs in the computing node, so that the number of processes participating in subsequent communication on each computing node is balanced.

[0028] In some embodiments, the process pair includes four processes, and a subset of processes in each process pair is removed, including:

[0029] For any pair of processes in adjacent groups, perform a first elimination operation on the process pairs in the first group of the adjacent group, and a second elimination operation on the process pairs in the second group of the adjacent group.

[0030] The first removal operation includes removing processes with odd process IDs from the process pairs in the first group; the corresponding second removal operation includes removing processes with even process IDs from the process pairs in the second group.

[0031] Alternatively, the first removal operation includes removing processes with even process IDs from the process pairs in the first group; the corresponding second removal operation includes removing processes with odd process IDs from the process pairs in the second group.

[0032] The method described in this application embodiment performs process elimination operations on adjacent process pairs using an alternating pattern of odd and even numbers. This ensures that the number of processes on each computing node is balanced, as well as that the resources on the core die on each computing node are balanced. This ensures that the distribution of processes participating in subsequent communication on each computing node is as balanced as possible, and that the distribution of processes participating in subsequent communication on each die is as balanced as possible.

[0033] In some embodiments, the processes contained on the computing node are grouped according to the target number of processes, resulting in multiple groups of process pairs, including:

[0034] Determine the grouping range based on the number of target processes;

[0035] Within the grouping range, the processes of the target number of processes are grouped to obtain multiple process pairs; the process IDs of the processes in the process pairs are consecutive.

[0036] The method described in this application, by grouping the target number of processes within a grouping range, can solve the problems of unreasonable process distribution and unbalanced load on computing nodes, and effectively reduce communication latency.

[0037] In some embodiments, communication is performed using processes on the computing node following the processing process, including:

[0038] Assign new process IDs to each process on the compute node after the processing is completed, and determine the mapping relationship between the new process IDs and the original process IDs of each process.

[0039] The communication data associated with each process is obtained based on the mapping relationship, and communication is performed based on the communication data of each process.

[0040] The method described in this application allows the system to flexibly adjust the process identifier according to actual needs by assigning a new process ID to the process. Then, based on the mapping relationship, it can obtain the communication data associated with each process, ensuring that the communication data can still be accurately delivered to the corresponding process even if the process ID changes. Even if the process identifier changes, the system can still correctly route the communication data to the corresponding process according to the mapping relationship.

[0041] In some embodiments, the total number of processes to be processed is determined based on the number of processes in the distributed system and their inter-process communication requirements, including:

[0042] The number of multiple communication requests is determined based on the process communication requirements;

[0043] The number of communication requests that is closest to the number of processes is selected from multiple communication request numbers as the intermediate communication request number.

[0044] The difference between the number of processes and the number of intermediate communication requirements is taken as the total number.

[0045] The method described in this application, by filtering out the number of intermediate communication requests that is closest to the number of processes, can avoid over-allocation or under-allocation of communication resources. If the number of communication requests is too large, it will lead to resource waste; while if it is too small, it will be unable to meet the communication needs of the processes, affecting system performance.

[0046] Secondly, this application also provides a process communication device, the device comprising:

[0047] The determination module is used to determine the total number of processes that need to be processed based on the number of processes in the distributed system and the process communication requirements.

[0048] The communication module is used to control the total number of processes processed by all computing nodes according to the process carrying capacity of each computing node in the distributed system, and to enable communication between the processes on the computing nodes after processing.

[0049] Thirdly, this application also provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0050] Determine the total number of processes that need to be processed based on the number of processes in the distributed system and their communication requirements.

[0051] Based on the process carrying capacity of each computing node in the distributed system, control all computing nodes to process the total number of processes, and use the processes on the computing nodes after processing to communicate with each other.

[0052] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0053] Determine the total number of processes that need to be processed based on the number of processes in the distributed system and their communication requirements.

[0054] Based on the process carrying capacity of each computing node in the distributed system, control all computing nodes to process the total number of processes, and use the processes on the computing nodes after processing to communicate with each other.

[0055] Fifthly, this application also provides a computer program product, which includes a computer program that, when executed by a processor, performs the following steps:

[0056] Determine the total number of processes that need to be processed based on the number of processes in the distributed system and their communication requirements.

[0057] Based on the process carrying capacity of each computing node in the distributed system, control all computing nodes to process the total number of processes, and use the processes on the computing nodes after processing to communicate with each other.

[0058] The aforementioned process communication method, apparatus, device, storage medium, and program product determine the total number of processes to be processed based on the number of processes in the distributed system and their communication needs. Then, based on the process handling capacity of each computing node in the distributed system, the method controls all computing nodes to process the total number of processes, and utilizes the processes on the processed computing nodes for communication. By modifying the process processing logic and using the process distribution on each computing node as a condition for process processing, the method ensures a balanced distribution of processes participating in subsequent communication on each computing node. This avoids situations where some computing nodes have too few or too many processes, effectively solving the communication load imbalance problem caused by traditional methods, and thus improving the overall communication efficiency of the distributed system. Attached Figure Description

[0059] Figure 1 These are internal structural diagrams of the computer device in some embodiments;

[0060] Figure 2 This is one of the flowcharts illustrating the inter-process communication method in some embodiments;

[0061] Figure 3 This is a second flowchart illustrating the process communication method in some embodiments;

[0062] Figure 4 This is the third flowchart illustrating the process communication method in some embodiments;

[0063] Figure 5 This is the fourth flowchart illustrating the process communication method in some embodiments;

[0064] Figure 6 This is the fifth flowchart illustrating the process communication method in some embodiments;

[0065] Figure 7This is one of the structural diagrams of a distributed system in some embodiments;

[0066] Figure 8 This is the second schematic diagram of the structure of a distributed system in some embodiments;

[0067] Figure 9 This is the third schematic diagram of the structure of a distributed system in some embodiments;

[0068] Figure 10 This is one of the schematic diagrams illustrating the test results of the inter-process communication method in some embodiments;

[0069] Figure 11 This is the second schematic diagram illustrating the test results of the inter-process communication method in some embodiments;

[0070] Figure 12 This is the sixth flowchart illustrating the process communication method in some embodiments;

[0071] Figure 13 This is the seventh flowchart illustrating the inter-process communication method in some embodiments;

[0072] Figure 14 This is the eighth flowchart of a process communication method in some embodiments;

[0073] Figure 15 This is the ninth flowchart of a process communication method in some embodiments;

[0074] Figure 16 This is a structural block diagram of a process communication device in some embodiments. Detailed Implementation

[0075] In the embodiments of this application, the term "and / or" describes the relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following associated objects have an "or" relationship.

[0076] In the embodiments of this application, the term "multiple" refers to two or more, and other quantifiers are similar.

[0077] In the embodiments of this application, the term "at least one" means one or more. For example, at least one of A, B and C can represent six situations: A exists alone, B exists alone, C exists alone, A and B exist simultaneously, A and C exist simultaneously, B and C exist simultaneously, and A, B and C exist simultaneously.

[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0079] With the development of distributed computing technology, distributed systems, due to their advantages such as high scalability and fault tolerance, have been widely applied in various fields. A distributed system consists of multiple parallel computing nodes, each running multiple processes, and inter-process communication typically uses global reduction techniques. Global reduction operations reduce the data of each process to the corresponding data in other processes within the communication domain, and broadcast the result to all processes to achieve global data aggregation and synchronization. It is a key set communication primitive in the field of high-performance computing, crucial for ensuring synchronization and data consistency. In the message passing process of parallel computing, different algorithms are used for global reduction operations depending on the message size. For short and medium-sized messages, the recursive doubling algorithm is commonly used. The recursive doubling algorithm is a pairwise exchange algorithm, a commonly used algorithm in communication processes. It continuously divides processes into pairs and performs data exchange operations in each round, ultimately achieving the goal of global communication. Specifically, the global reduction operation implemented by the recursive doubling algorithm proceeds as follows: First, processes separated by 1 unit exchange data. The receiving process first reduces the received data with its local data and then places the data into its receive buffer. Second, processes separated by 2 units exchange data in their receive buffers, and the receiving process performs a similar operation. The distance doubles in each subsequent step. This next step (where p is the number of processes) completes the global reduction operation. As shown above, the global reduction technique requires processes to communicate in pairs at distances that are powers of 2; therefore, the total number of processes must be a power of 2 to ensure successful communication.

[0080] In practical parallel computing applications, communication scenarios involving non-power-of-two process numbers are quite common in distributed systems, where the number of processes is often not strictly selected according to the power-of-two rule. This occurs for two reasons: First, parallel computing tasks are affected by factors such as the characteristics of the input data, the complexity of the problem, and communication overhead, leading to a situation where the number of processes participating in communication is often not a power of two. Second, the nodes participating in communication and the number of processes on each node are dynamically adjusted according to real-time needs. This dynamic resource adjustment makes it impossible to strictly guarantee that the number of processes is a power of two during communication. Communication scenarios involving non-power-of-two process numbers can result in some processes having no peer processes, leading to communication failures. Therefore, for distributed systems with non-power-of-two process numbers, redundant processes need to be removed. However, traditional methods, when adjusting the number of processes to match a power of two, do not consider the process distribution on the nodes; they simply treat all processes as a whole and subtract processes within the first 2r range. When this processing method involves global reduction operations on multiple nodes, it can lead to a reduction in the number of processes participating in communication on some nodes, resulting in an unbalanced overall communication load and thus affecting the communication performance of the distributed system.

[0081] In view of this, embodiments of this application propose a process communication method, apparatus, device, storage medium, and program product, which can improve the load balancing of communication by processing the processes on each computing node, thereby balancing the distribution of processes participating in subsequent communication on each computing node.

[0082] It should be noted that the beneficial effects or technical problems solved by the embodiments of this application are not limited to this one, but may also be other implicit or related problems. For details, please refer to the description of the embodiments below.

[0083] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0084] In some embodiments, the process communication method provided in this application can be applied to, for example... Figure 1 The computer device shown is connected to a distributed system and is used for process processing on multiple computing nodes of the distributed system. This computer device can be a standalone device with the distributed system or integrated into it. This computer device can be a terminal or a server, and its internal structure diagram can be as follows. Figure 1As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a process communication method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0085] Those skilled in the art will understand that Figure 1 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0086] In some embodiments, such as Figure 2 As shown, a process communication method is provided, which can be applied to... Figure 1 Taking a computer device as an example, the explanation includes the following steps:

[0087] S201, based on the number of processes in the distributed system and the process communication requirements, determine the total number of processes that need to be processed.

[0088] In a distributed system, multiple computing nodes are involved, and each node runs multiple processes. The required inter-process communication is expressed as a power of two for the number of processes.

[0089] In this embodiment, the computer device can obtain the number of processes contained in the distributed system in real time. Specifically, it can directly obtain the total number of processes in the distributed system, or it can first obtain the total number of processes on each computing node, and then sum the total number of processes on all computing nodes in the distributed system to obtain the total number of processes contained in the distributed system. The computer device can receive user-inputted process communication requests through its user interface. For example, the process communication request may include the number of processes that the user instructs to communicate. Optionally, the computer can use its built-in preset process communication requests. For example, the process communication request may include a preset value for the number of processes that need to communicate, which is a power of two. After obtaining the number of processes contained in the distributed system and the process communication request, the computer device can calculate the difference between the number of processes contained in the distributed system and the number of processes requested in the process communication request, obtain the difference result, and use the difference result as the total number of processes that need to be processed.

[0090] S202 controls the total number of processes processed by all computing nodes based on the process carrying capacity of each computing node in the distributed system, and utilizes the processes on the computing nodes after processing to communicate with each other.

[0091] Among them, process carrying capacity represents the maximum number of processes that a computing node can carry, or the optimal number of processes that a computing node can carry when its performance is at its best.

[0092] In this embodiment, the computer device can obtain the process carrying capacity of each computing node in the distributed system, thus obtaining the number of processes that each computing node can handle. After obtaining the total number of processes that the current distributed system needs to process based on the above steps, the computer device then, under the condition that the processes processed by each computing node meet the process carrying capacity of the corresponding computing node, and that the number of processes on each computing node is balanced after processing, controls all computing nodes to process the total number of processes required and the number of processes that each computing node can handle, thereby obtaining the processes on each computing node after processing. Optionally, when the number of processes on each computing node in the distributed system is similar or the same, after the computer device obtains the total number of processes that the current distributed system needs to process, it can evenly distribute the total number of processes to be processed to each computing node, then obtain the number of processes that each computing node needs to process, and control each computing node to process the corresponding number of processes, thus obtaining the processes on each computing node after processing. After obtaining the processes on the computing nodes after processing, the computer device obtains a distributed system with a total number of processes that is a power of two. Then, it can use the processes on the computing nodes after processing to communicate through global reduction and recursive doubling.

[0093] The process of controlling the total number of processes handled by all computing nodes can be divided into two scenarios: First, the number of processes in the distributed system exceeds the number of processes required for inter-process communication. This indicates that the distributed system contains redundant processes, which can be removed to make the number of processes in the distributed system after removal match the number required for inter-process communication. Second, the number of processes in the distributed system is less than the number required for inter-process communication. This indicates that the distributed system has insufficient processes. While ensuring that the process capacity is not exceeded, new processes can be added to the computing nodes in the distributed system to make the number of processes in the distributed system after adding processes match the number required for inter-process communication.

[0094] The process communication method provided in this application determines the total number of processes to be processed based on the number of processes in the distributed system and the process communication requirements. Then, based on the process carrying capacity of each computing node in the distributed system, it controls all computing nodes to process the total number of processes, and utilizes the processes on the processed computing nodes for communication. In this method, by changing the process processing logic and using the process distribution on each computing node as a condition for process processing, the number of processes participating in subsequent communication on each computing node is balanced, avoiding situations where some computing nodes have too few or too many processes. This effectively solves the problem of unbalanced communication load caused by traditional methods, thereby improving the overall communication efficiency of the distributed system.

[0095] In some embodiments, a specific implementation of a process for controlling the total number of processes handled by all computing nodes is also provided, such as... Figure 3 As shown, the phrase "controlling the total number of processes processed by all computing nodes according to the process carrying capacity of each computing node in the distributed system" in S202 above includes:

[0096] S301, determine the initial number of processes corresponding to each computing node based on the number of computing nodes and the total number of computing nodes.

[0097] The number of compute nodes refers to the total number of compute nodes in the distributed system; for example, a distributed system may have 10 compute nodes. The initial number of processes indicates the initial number of processes that each compute node needs to process.

[0098] In this embodiment, the computer device can obtain the number of computing nodes in the distributed system. Then, after obtaining the total number of processes to be processed, the computer device can distribute the total number evenly across each computing node, resulting in an initial number of processes for each computing node. For example, if the total number of processes to be processed is 12 and the number of computing nodes is 4, then the initial number of processes for each computing node is 3. For cases where the numbering is not integer, the remainder can be allocated to computing nodes with earlier or later numbers, or randomly allocated to computing nodes, ensuring that the initial number of processes for each computing node is similar or the same.

[0099] S302, adjust the initial number of processes according to the process carrying capacity of each computing node to obtain the target number of processes for each computing node.

[0100] The target number of processes represents the final number of processes that the computing node needs to process.

[0101] In this embodiment, the computer device can determine the number of processes that each computing node can support based on its process capacity. After obtaining the initial number of processes on each computing node based on the above steps, the computer device can adjust the initial number of processes on each computing node according to its process capacity to obtain the target number of processes on each computing node. Specifically, the initial number of processes can be adjusted based on the number of processes that each computing node can support. If the initial number of processes is greater than the number of processes that can be supported, some processes can be allocated to other computing nodes. If the initial number of processes is less than the number of processes that can be supported, the allocated processes can be accepted, ultimately obtaining the target number of processes on each computing node.

[0102] S303 controls the number of processes that each computing node can process, corresponding to the target number of processes.

[0103] In this embodiment, after obtaining the target number of processes processed by each computing node based on the above steps, the computer device can control each computing node to remove or add the target number of processes. Specifically, there are two scenarios: First, the number of processes in the distributed system is greater than the number of processes required for inter-process communication. This scenario indicates that the distributed system contains redundant processes, which can be removed. In this case, the computing nodes can be controlled to remove the target number of processes, ensuring that the number of processes in the distributed system after removal matches the number of processes required for inter-process communication. Second, the number of processes in the distributed system is less than the number of processes required for inter-process communication. This scenario indicates that the distributed system has insufficient processes. In this case, while ensuring that the process carrying capacity is not exceeded, new processes can be added to the computing nodes in the distributed system. In this case, the computing nodes can be controlled to add the target number of processes, ensuring that the number of processes in the distributed system after adding the processes matches the number of processes required for inter-process communication.

[0104] The method described in this application determines the initial number of processes for each computing node by considering the number of computing nodes and the total number of processes, thus initially and reasonably allocating processes to each computing node. Based on this, the initial number of processes is adjusted according to the process handling capacity of each computing node, ensuring that the number of processes processed by each computing node matches its own processing capacity. This avoids situations where some nodes are idle while others are overloaded, achieving efficient utilization of system resources.

[0105] In some embodiments, a specific implementation method is also provided for adjusting the initial number of processes according to the process carrying capacity of each computing node, such as... Figure 4 As shown, the "adjusting the initial number of processes according to the process carrying capacity of each computing node to obtain the target number of processes for each computing node" in S302 above includes:

[0106] S401, for each computing node, if the initial number of processes of the computing node is within the range of the number of processes corresponding to the process carrying capacity, then the initial number of processes is taken as the target number of processes.

[0107] In this embodiment, after obtaining the process capacity of each computing node, the computer device can further determine the range of the number of processes corresponding to the process capacity, thus obtaining the range of the number of processes for each computing node. Then, after obtaining the initial number of processes for each computing node, the computer device can compare the initial number of processes with the range of the number of processes for each computing node to determine whether the initial number of processes is within the range. If the initial number of processes is within the range, then the initial number of processes is taken as the target number of processes.

[0108] S402, if the initial number of processes of a computing node is not within the range of the number of processes corresponding to the process carrying capacity, the initial number of processes is adjusted according to the boundary value of the range of process numbers and the initial number of processes to obtain the target number of processes for each computing node.

[0109] The range of the number of processes includes boundary values.

[0110] In this embodiment of the application, if the initial number of processes is not within the range of the number of processes, the boundary value of the range of the number of processes is further obtained, and then the initial number of processes and the boundary value of the range of the number of processes are compared. The initial number of processes is adjusted according to the comparison result to obtain the target number of processes for each computing node.

[0111] Specifically, such as Figure 5 As shown, S402 above includes:

[0112] S4021, If ​​the initial number of processes is greater than the upper boundary value, the initial number of processes is reduced to obtain the adjusted target number of processes.

[0113] The boundary values ​​include the upper boundary value and the lower boundary value.

[0114] In this embodiment of the application, the computer device can compare the initial number of processes with the upper and lower boundary values ​​of the range of process numbers. If the initial number of processes is greater than the upper boundary value, the initial number of processes is reduced to obtain the adjusted target number of processes.

[0115] S4022, If the initial number of processes is less than the lower boundary value, the initial number of processes is incrementally adjusted to obtain the adjusted target number of processes, or the initial number of processes is used as the target number of processes.

[0116] In this embodiment of the application, if the initial number of processes is less than the lower boundary value, the initial number of processes is adjusted incrementally, that is, the initial number of processes is increased to obtain the adjusted target number of processes, or the initial number of processes is used as the target number of processes.

[0117] The method described in this application, when the initial number of processes on a computing node is within its process capacity range, directly uses the initial number of processes as the target number of processes. This ensures that the computing node's resources are used fully and reasonably. When the initial number of processes exceeds the capacity range, adjustments are made using the boundary values ​​of the process number range to avoid resource waste due to overload. For computing nodes exceeding their capacity, timely adjustment of the number of processes can prevent node crashes due to overload. Each computing node running with an appropriate number of processes can process tasks more efficiently. With a reasonable number of processes, node resources can be effectively utilized, task processing response time will be shortened, and throughput will be increased.

[0118] In some embodiments, a specific implementation method for controlling each computing node to process the corresponding target number of processes is also provided, such as... Figure 6 As shown, the "processes that control each computing node to process the corresponding target number of processes" in S303 above includes:

[0119] S501: For each computing node, the processes contained on the computing node are grouped according to the target number of processes to obtain multiple groups of process pairs.

[0120] A process pair consists of multiple processes, including an even number of processes.

[0121] In this embodiment of the application, after the computer device obtains the target number of processes that each computing node needs to process based on the aforementioned steps, for each computing node, the processes on the computing node can be grouped into an even number of groups according to a preset even number, resulting in multiple groups of process pairs.

[0122] S502, removes some processes from each process pair in each group.

[0123] In this embodiment of the application, after the computer device obtains multiple pairs of processes on the computing node based on the above steps, for each pair of processes, some processes in the pair can be removed, so that the total number of removed processes is the same as the target number of processes.

[0124] The method described in this application embodiment, by grouping processes and removing some processes, can ensure that the number of processes ultimately retained on each computing node exactly matches the target number of processes, so that system resources are precisely matched with actual needs, avoiding overuse or underuse of resources, ensuring resource balance on each computing node, and thus improving the overall communication efficiency of the distributed system.

[0125] In some embodiments, the process pair includes two processes. Based on this, a specific implementation method is provided for removing some processes from each process pair. The "removing some processes from each process pair" in S502 includes:

[0126] For each process pair in a group, remove processes with odd process IDs, or remove processes with even process IDs in each process pair in a group.

[0127] A process pair consists of two processes.

[0128] In this embodiment, for each computing node, the computer device can pair the processes on the computing node into multiple process pairs. Then, a process with an odd process ID is removed from each process pair, or a process with an even process ID is removed from each process pair. For example, if the multiple process pairs are: (P0, P1)(P2, P3)(P4, P5)(P6, P7), if a process with an odd process ID is removed from each process pair, then P1, P3, P5, and P7 are removed, and P0, P2, P4, and P6 remain; if a process with an even process ID is removed from each process pair, then P0, P2, P4, and P6 are removed, and P1, P3, P5, and P7 remain.

[0129] The method described in this application embodiment can ensure that the number of processes on each computing node is balanced by performing odd-number elimination or even-number operation on the process IDs of process pairs in the computing node, so that the number of processes participating in subsequent communication on each computing node is balanced.

[0130] In some embodiments, the above process pair includes four processes. Based on this, a specific implementation method is also provided for removing some processes from each process pair. The "removing some processes from each process pair" in S502 above includes:

[0131] For any pair of processes in adjacent groups, perform a first elimination operation on the process pairs in the first group of the adjacent group, and a second elimination operation on the process pairs in the second group of the adjacent group.

[0132] The first elimination operation includes eliminating processes with odd process IDs in the first group of processes; the corresponding second elimination operation includes eliminating processes with even process IDs in the second group of processes; or, the first elimination operation includes eliminating processes with even process IDs in the first group of processes; the corresponding second elimination operation includes eliminating processes with odd process IDs in the second group of processes. (This describes several possible implementations of S201.)

[0133] In this embodiment, the pairwise teaming method described above ensures that the processes processed on each computing node are balanced. However, there is a special type of distributed system where each computing node includes multiple cores (dies), and each die includes multiple processes. For this special type of distributed system, the pairwise teaming method described above may not guarantee a balanced distribution of processes across each die on the computing node. Figure 7 As shown, the distributed system includes 4 compute nodes (Node0~Node3), each node contains 4 dies, and each die has 7 processes, meaning each compute node starts 28 processes. The numbers within the dies represent process IDs. Initially, processes are arranged according to the dies, and multi-track communication is enabled. Since the total number of processes is 112, which is not a power of two, process eviction is necessary. If the above-mentioned method of pairing processes is used, and processes with even-numbered process IDs are evicted from each pair, then the eviction result will have an imbalance across dies. The eviction result can be found in [reference needed]. Figure 8 As shown. In Figure 8 In the process, although the process is balanced from the perspective of the computing nodes, with 14 remaining processes per computing node, the process is not balanced from the perspective of the dies. The processes on each computing node are concentrated on the odd-numbered dies, while there are no processes on the even-numbered dies.

[0134] Therefore, to address the aforementioned issues, this embodiment further employs different elimination methods for adjacent process pairs to ensure a balanced number of processes per die on each computing node. Specifically, for any adjacent process pair, a first elimination operation is performed on the process pairs in the first group, and a second elimination operation is performed on the process pairs in the second group, i.e., process elimination is performed using an alternating odd-even or even-odd method. For example, in a computing node, for any adjacent process pair, if processes with odd process IDs in the first process group are eliminated, then processes with even process IDs in the second process group are eliminated, resulting in a balanced number of processes per die in the elimination process. If the process pairs are: (P0,P1,P2,P3)(P4,P5,P6,P7)(P8,P9,P10,P11)(P12,P13,P14,P15), there are two adjacent process pairs. For the first adjacent process pair, remove the odd-numbered processes (i.e., P1 and P3) from the first process pair and remove the even-numbered processes (i.e., P4 and P6) from the second process pair. For the second adjacent process pair, remove the odd-numbered processes (i.e., P9 and P11) from the first process pair and remove the even-numbered processes (i.e., P12 and P14) from the second process pair. Optionally, for different computing nodes, within any adjacent process pair on one computing node, processes with odd process IDs in the first process group can be removed, and processes with even process IDs in the second process group can be removed, i.e., alternating removal of odd and even process IDs; similarly, within any adjacent process pair on another computing node, processes with even process IDs in the first process group can be removed, and processes with odd process IDs in the second process group can be removed, i.e., alternating removal of even and odd process IDs. For example... Figure 9 The elimination results shown indicate that Node0 and Node2 use an alternating odd-even elimination method, while Node1 and Node3 use an alternating even-odd elimination method. This demonstrates that the number of processes on each Die is balanced. It should be noted that the process pairs described above can also include other even numbers of processes; for example, a process pair may contain six processes. The number of processes in a process pair can be determined by the number of Dies in the compute node.

[0135] For example, this method is illustrated using the "Songshan" supercomputer system (hereinafter referred to as the "Songshan" supercomputing system). On the "Songshan" supercomputing system, enabling four virtual network cards can achieve full network card bandwidth. Due to the Socket Direct technology, processes prioritize using the network card directly connected to their respective dies. If a process uses another network card, it needs to first transmit data to the other dies via the GMI bus, and then transmit the data to the network card, exchanging data with processes on other nodes through the network card. Therefore, when using compute nodes, enabling cores as evenly as possible on each die can effectively reduce memory access latency and communication latency. When using non-directly connected network cards across dies, message transmission on the GMI bus takes time, leading to increased communication latency, thus preventing the Socket Direct technology from realizing its advantages. Taking the aforementioned scenario as an example, after processing by the original algorithm, only half of the dies on Node 0-Node 2 are bound to processes, while the remaining half are idle. To maximize the use of network card bandwidth, processes bound to specific dies will transmit data to other idle dies via the GMI bus, which increases communication latency. Therefore, this embodiment, tailored to the characteristics of the "Songshan" architecture, adjusts the process subtraction logic based on balance optimization to ensure that the distribution of processes participating in subsequent communication on each node is as balanced as possible, and that the distribution of processes participating in subsequent communication on each die is as balanced as possible.

[0136] Comparing the two process elimination methods mentioned above with the traditional elimination method, the first method is a process elimination method that includes two processes, and the second method is a process elimination method that includes four processes.

[0137] The OSU Micro-Benchmarks benchmark tool was used to test data, performing global reduction operations (i.e., Allreduce operations) tests using the traditional elimination method, the first elimination method, and the second elimination method. On the "Songshan" supercomputing system, each chassis contains 20 nodes connected by the same switch. To conduct cross-node testing, computing nodes within the same chassis were selected for experiments. Using a 1MB packet length as a baseline, tests were conducted on three communication scales: 4 nodes, 8 nodes, and 16 nodes. For fixed parameters, four virtual network interfaces were enabled simultaneously, with the Rendezvous protocol and Zcopy threshold both set to 16K. The highest priority tuned module under the coll framework was selected, and each process was bound to one core and arranged according to the die layout. For the choice of communication channels, two tests were conducted: one with the network interface card (rc) enabled and the other with both network interfaces and shared memory (rc, knem) enabled. For the two implementations of global reduction, two types of tests were conducted based on the first and second methods mentioned above (recursive_doubling balance optimization test and reduce_scatter_allgather balance optimization test, referred to as test A and test B). By comparing the latency of the traditional process culling method with the latency after optimization of the two process culling methods in this application, the maximum performance improvement of the two process culling methods in this application was obtained. The test results of the first and second culling methods are shown in Table 1 and Table 2, respectively.

[0138] Table 1. Maximum performance improvement of Allreduce operations when enabling the rc channel.

[0139]

[0140] Table 2. Maximum performance improvement of Allreduce when enabling rc and knem channels.

[0141]

[0142] Specifically, taking four tests at a scale of 16 nodes as examples, Figure 10 and Figure 11 This shows Allreduce test data with a 1MB packet length under different PPNs. Figure 10 This represents the test data for implementing the Allreduce algorithm using the 16-node recursive_doubling algorithm. Figure 11The graph shows the Allreduce test implementation of the reduce_scatter_allgather algorithm on a 16-node node. The horizontal axis represents the number of cores used per node, and the vertical axis represents the communication latency. Each core is bound to one process for communication. Figure (a) shows only the network interface card (NIC) channel being enabled, and Figure (b) shows both the NIC and shared memory channels being enabled. The original algorithm in the graph corresponds to the traditional elimination method, the balance optimization corresponds to the first elimination method, and the adaptation architecture optimization corresponds to the second elimination method. It can be seen from the graph that regardless of which channel is enabled, when the total number of processes is not a power of two (i.e., PPN is not 2, 4, 8, 16, or 32), the latency results for both types of algorithms are: adaptation architecture optimization < balance optimization < original algorithm. Furthermore, enabling both algorithms simultaneously with the NIC and shared memory reduces the average latency compared to enabling only the NIC. Enabling shared memory has no significant impact on the optimization of recursive_doubling, while enabling shared memory can improve the optimization of reduce_scatter_allgather.

[0143] Experimental results show that, in scenarios with non-power-of-two process numbers, the improvement in load balancing and architecture adaptation for both algorithms increases with the scale of communication. Firstly, regarding load balancing, the algorithm effectively addresses the problem of unreasonable process distribution on nodes, eliminating bottlenecks caused by heavy network card loads on some nodes. With increasing communication scale, the algorithm achieves better load balancing performance. Secondly, regarding architecture adaptation, the algorithm, based on load balancing optimization, effectively addresses the problem of unreasonable process distribution on each die. With increasing communication scale, optimization for specific environments and hardware allows for more efficient utilization of system resources, significantly improving overall system performance and reducing communication latency. Furthermore, to verify the optimization effect of this invention, in addition to benchmark testing, the OpenFOAM scientific computing application was run on the "Songshan" supercomputing system. The application used the pisoFOAM solver, with a program termination time of 2, a step size of 0.001, and a total of 2000 iterations. This section selects three node scales (10, 20, and 30 nodes) and sets the PPN to 16 to test the execution time of OpenFOAM programs before and after implementing the MPI optimization strategy. Observing the test results, the speedup using OpenMPI is 1.18 for 10 nodes and 1.24 for 20 nodes.

[0144] The method described in this application embodiment performs process elimination operations on adjacent process pairs using an alternating pattern of odd and even numbers. This ensures that the number of processes on each computing node is balanced, as well as that the resources on the core die on each computing node are balanced. This ensures that the distribution of processes participating in subsequent communication on each computing node is as balanced as possible, and that the distribution of processes participating in subsequent communication on each die is as balanced as possible.

[0145] In some embodiments, a specific implementation method for grouping processes contained on a computing node according to the target number of processes is also provided, such as... Figure 12 As shown, the "grouping the processes contained on the computing node according to the target number of processes to obtain multiple groups of process pairs" in S501 above includes:

[0146] S601 determines the grouping range based on the number of target processes.

[0147] The grouping range represents the range of process IDs in the process pair, and the grouping range is an even multiple of the number of target processes.

[0148] In this embodiment of the application, after determining the number of target processes that each computing node needs to process, the computer device can determine the grouping range based on the number of target processes. Specifically, the grouping range can be determined based on an even multiple of the number of target processes. For example, the grouping range is twice the number of target processes, i.e., the range of 2r. Remove represents the number of target processes. The specific grouping range can be (n, 2r+n-1), such as (0, 2r-1), or (1, 2r).

[0149] S602, group the processes within the target number of processes within the grouping range to obtain multiple process pairs; the process IDs of the processes in the process pairs are consecutive.

[0150] In this embodiment of the application, after the computer device obtains the grouping range based on the above steps, for each computing node, it can group the processes on the computing node into an even number of groups according to a preset even number, and ensure that the process IDs of the processes in the process pair are consecutive, to obtain multiple groups of process pairs.

[0151] The method described in this application, by grouping the target number of processes within a grouping range, can solve the problems of unreasonable process distribution and unbalanced load on computing nodes, and effectively reduce communication latency.

[0152] In some embodiments, a specific implementation method is also provided for communication between processes on a computing node following the processing process, such as... Figure 13 As shown, "using the processes on the computing node after the processing process to communicate" in S202 above includes:

[0153] S701 assigns new process IDs to each process on the computing node after the processing process, and determines the mapping relationship between the new process IDs and the original process IDs of each process.

[0154] The mapping relationship includes the correspondence between the new process ID and the original process ID of all processes.

[0155] In this embodiment of the application, after the computer device obtains the processes on the computing node after the processing process, since the process numbers of the processes on the computing node after the processing process are not consecutive, it is necessary to assign new process numbers to the processes on the computing node after the processing process. Specifically, the get_newrank function can be used to assign a newrank value according to the different positions of the processes, so as to obtain the newrank (new process number) and record the mapping relationship between the newrank (new process number) of each process and the rank (original process number) of each process.

[0156] S702 obtains the communication data associated with each process based on the mapping relationship, and performs communication based on the communication data of each process.

[0157] In this embodiment, after the computer device obtains the mapping relationship between the new process IDs and the original process IDs of each process based on the above steps, it can pair processes using the power of 2 distance between the new process IDs. Then, it obtains the communication data associated with the corresponding original process IDs based on the mapping relationship, and communicates using global reduction and recursive doubling based on this communication data. Specifically, the key to retaining a power of 2 number of processes and allowing them to participate in subsequent recursive doubling communication steps lies in the mapping between rank (original process ID) and newrank (new process ID). When executing the process subtraction logic, the get_newrank function assigns a newrank value based on the different positions of the processes. In subsequent recursive doubling communication, processes are divided into pairs based on the power of 2 distance between the newranks of the processes. Since each process has a unique process ID in the communication domain, the get_remote function needs to be executed to restore the rank based on the different positions of the newrank. The original rank is then used to lock the communication between the peer processes in the communication domain. Finally, full synchronization is performed on all processes on each node whose original process ID is in the range of 2r. That is, the processes that participated in the recursive doubling communication step send data to the adjacent processes that did not participate in the communication.

[0158] The method described in this application allows the system to flexibly adjust the process identifier according to actual needs by assigning a new process ID to the process. Then, based on the mapping relationship, it can obtain the communication data associated with each process, ensuring that the communication data can still be accurately delivered to the corresponding process even if the process ID changes. Even if the process identifier changes, the system can still correctly route the communication data to the corresponding process according to the mapping relationship.

[0159] In some embodiments, a specific implementation method for determining the total number of processes that need to be processed is also provided, such as... Figure 14 As shown, the phrase "determine the total number of processes to be processed based on the number of processes in the distributed system and the process communication requirements" in S201 above includes:

[0160] S801 determines the number of multiple communication requests based on process communication needs.

[0161] The number of communication requirements is a power of two.

[0162] In this embodiment of the application, after the computer device obtains the process communication request, it can determine the number of multiple communication requests by powers of two. For example, the number of multiple communication requests can be 2 to the power of 1 (i.e., 2), 2 to the power of 2 (i.e., 4), 2 to the power of 3 (i.e., 8), and so on.

[0163] S802 selects the number of communication requests that is closest to the number of processes from multiple communication request numbers as the intermediate communication request number.

[0164] The number of intermediate communication requirements is a power of two equal to the number of the closest processes.

[0165] In this embodiment of the application, after obtaining the number of processes in the distributed system, the computer device can filter from multiple communication request numbers to select the communication request number closest to the number of processes as the intermediate communication request number. Specifically, the communication request number closest to but less than the number of processes can be used as the intermediate communication request number. For example, if the number of processes is 112, the intermediate communication request number is 2 to the power of 6 (i.e., 64). Optionally, the communication request number closest to but greater than the number of processes can also be used as the intermediate communication request number. For example, if the number of processes is 112, the intermediate communication request number is 2 to the power of 7 (i.e., 128).

[0166] S803 uses the difference between the number of processes and the number of intermediate communication requirements as the total number.

[0167] In this embodiment of the application, after the computer device obtains the number of processes and the number of intermediate communication requests based on the above steps, it can calculate the difference between the number of processes and the number of intermediate communication requests to obtain the total number. For example, if the number of processes is 112 and the number of intermediate communication requests is 64, then the total number is 48.

[0168] The method described in this application, by filtering out the number of intermediate communication requests that is closest to the number of processes, can avoid over-allocation or under-allocation of communication resources. If the number of communication requests is too large, it will lead to resource waste; while if it is too small, it will be unable to meet the communication needs of the processes, affecting system performance.

[0169] In summary, based on all the above embodiments, a process communication method is also provided, such as... Figure 15 As shown, the method includes:

[0170] S901, determine the number of multiple communication requests based on the process communication needs, and select the number of communication requests that is closest to the number of processes as the intermediate number of communication requests.

[0171] S902, the difference between the number of processes and the number of intermediate communication requirements is taken as the total number, and the initial number of processes corresponding to each computing node is determined according to the number of computing nodes and the total number.

[0172] S903: For each computing node, if the initial number of processes of the computing node is within the range of the number of processes corresponding to the process carrying capacity, then the initial number of processes is taken as the target number of processes.

[0173] S904 If the initial number of processes of the computing node is not within the range of the number of processes corresponding to the process carrying capacity, the initial number of processes is incrementally adjusted to obtain the adjusted target number of processes, or the initial number of processes is used as the target number of processes.

[0174] S905, if the initial number of processes is greater than the upper boundary value, then the initial number of processes is reduced to obtain the adjusted target number of processes.

[0175] S906 If the initial number of processes is less than the lower boundary value, the initial number of processes is adjusted incrementally to obtain the adjusted target number of processes.

[0176] S907: For each computing node, the grouping range is determined based on the target number of processes, and the processes within the grouping range are grouped according to the target number of processes, resulting in multiple process pairs. The process IDs of the processes within a process pair are consecutive.

[0177] S908, a process pair consists of two processes. The process with an odd process ID in each process pair is removed, or the process with an even process ID in each process pair is removed.

[0178] S909, a process pair includes four processes. For any adjacent group of process pairs, a first elimination operation is performed on the process pairs in the first group of the adjacent group, and a second elimination operation is performed on the process pairs in the second group of the adjacent group. The first elimination operation includes eliminating processes with odd process IDs in the first group, and the corresponding second elimination operation includes eliminating processes with even process IDs in the second group; or, the first elimination operation includes eliminating processes with even process IDs in the first group, and the corresponding second elimination operation includes eliminating processes with odd process IDs in the second group.

[0179] S910 involves removing a subset of processes from each process pair. The number of these removed processes is the same as the target number.

[0180] S911 assigns new process IDs to each process on the computing node after the processing process, and determines the mapping relationship between the new process IDs of each process and the original process IDs of each process.

[0181] S912 obtains the communication data associated with each process based on the mapping relationship, and performs communication based on the communication data of each process.

[0182] The methods described in each of the above steps have been described in the foregoing embodiments. For details, please refer to the foregoing descriptions. They will not be repeated here.

[0183] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0184] Based on the same inventive concept, this application also provides a process communication device for implementing the process communication method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more process communication device embodiments provided below can be found in the limitations of the process communication method described above, and will not be repeated here.

[0185] In some embodiments, such as Figure 16 As shown, a process communication device is provided, comprising:

[0186] The determination module 11 is used to determine the total number of processes that need to be processed based on the number of processes contained in the distributed system and the process communication requirements.

[0187] The communication module 12 is used to control all computing nodes to process the total number of processes based on the process carrying capacity of each computing node in the distributed system, and to use the processes on the computing nodes after processing to communicate with each other.

[0188] In some embodiments, the communication module described above includes:

[0189] The first determining unit is used to determine the initial number of processes corresponding to each computing node based on the number of computing nodes and the total number of computing nodes.

[0190] The adjustment unit is used to adjust the initial number of processes according to the process carrying capacity of each computing node, so as to obtain the target number of processes for each computing node.

[0191] The processing unit is used to control each computing node to process the corresponding target number of processes.

[0192] In some embodiments, the adjustment unit includes:

[0193] The first adjustment subunit is used to determine the target number of processes for each computing node if the initial number of processes on the computing node is within the range of the process carrying capacity.

[0194] The second adjustment subunit is used to adjust the initial number of processes based on the boundary value of the process number range and the initial number of processes if the initial number of processes of the computing node is not within the range of the number of processes corresponding to the process carrying capacity, so as to obtain the target number of processes for each computing node.

[0195] In some embodiments, the second adjustment subunit is specifically used to: if the initial number of processes is greater than the upper boundary value, then reduce the initial number of processes to obtain the adjusted target number of processes; if the initial number of processes is less than the lower boundary value, then increase the initial number of processes to obtain the adjusted target number of processes; or, use the initial number of processes as the target number of processes.

[0196] In some embodiments, the above-mentioned processing unit includes:

[0197] The grouping unit is used to group the processes contained on each computing node according to the target number of processes, resulting in multiple groups of process pairs.

[0198] The elimination unit is used to eliminate a portion of the processes in each process pair.

[0199] In some embodiments, the above-mentioned elimination unit is specifically used to eliminate processes with odd process IDs in each process pair, or to eliminate processes with even process IDs in each process pair.

[0200] In some embodiments, the aforementioned elimination unit is specifically configured to perform a first elimination operation on process pairs in the first group of adjacent process pairs, and a second elimination operation on process pairs in the second group of adjacent process pairs. The first elimination operation includes eliminating processes with odd process IDs in the first group of process pairs; the corresponding second elimination operation includes eliminating processes with even process IDs in the second group of process pairs; or, the first elimination operation includes eliminating processes with even process IDs in the first group of process pairs; the corresponding second elimination operation includes eliminating processes with odd process IDs in the second group of process pairs.

[0201] In some embodiments, the above-mentioned grouping unit includes:

[0202] Determine the sub-unit, which is used to determine the grouping range based on the number of target processes.

[0203] The grouping subunit is used to group the target number of processes within the grouping range to obtain multiple process pairs; the process IDs of the processes in the process pairs are consecutive.

[0204] In some embodiments, the communication module described above includes:

[0205] The allocation unit is used to assign new process IDs to each process on the computing node after the processing process, and to determine the mapping relationship between the new process IDs of each process and the original process IDs of each process.

[0206] The communication unit is used to obtain the communication data associated with each process based on the mapping relationship, and to conduct communication based on the communication data of each process.

[0207] In some embodiments, the determining module includes:

[0208] The second determining unit is used to determine the number of multiple communication requirements based on the process communication needs.

[0209] The filtering unit is used to select the number of communication requests that is closest to the number of processes from multiple communication request numbers as the intermediate number of communication requests.

[0210] The third determining unit is used to take the difference between the number of processes and the number of intermediate communication requirements as the total number.

[0211] Each module in the aforementioned process communication device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0212] In some embodiments, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the inter-process communication method described in any of the above embodiments.

[0213] In some embodiments, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the inter-process communication method described in any of the above embodiments.

[0214] In some embodiments, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the inter-process communication method described in any of the above embodiments.

[0215] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0216] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0217] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A process communication method, characterized in that, The method includes: Determine the total number of processes that need to be processed based on the number of processes in the distributed system and their communication requirements. Based on the process carrying capacity of each computing node in the distributed system, control all computing nodes to process the total number of processes, including: determining the initial number of processes corresponding to each computing node based on the number of computing nodes and the total number; adjusting the corresponding initial number of processes based on the process carrying capacity of each computing node to obtain the target number of processes for each computing node; and controlling each computing node to process the corresponding target number of processes. The processes on the computing nodes following the processing process communicate with each other.

2. The method according to claim 1, characterized in that, The step of adjusting the initial number of processes according to the process carrying capacity of each computing node to obtain the target number of processes for each computing node includes: For each computing node, if the initial number of processes of the computing node is within the range of the number of processes corresponding to the process carrying capacity, then the initial number of processes is taken as the target number of processes. If the initial number of processes of the computing node is not within the range of the number of processes corresponding to the process carrying capacity, the initial number of processes is adjusted according to the boundary value of the range of the number of processes and the initial number of processes to obtain the target number of processes for each computing node.

3. The method according to claim 2, characterized in that, The boundary values ​​include an upper boundary value and a lower boundary value. Adjusting the initial process number based on the boundary values ​​of the process number range and the initial process number to obtain the target process number for each computing node includes: If the initial number of processes is greater than the upper boundary value, the initial number of processes is reduced to obtain the adjusted target number of processes. If the initial number of processes is less than the lower boundary value, the initial number of processes is incrementally adjusted to obtain the adjusted target number of processes, or the initial number of processes is used as the target number of processes.

4. The method according to claim 1, characterized in that, The process that controls each computing node to process the corresponding target number of processes includes: For each computing node, the processes contained on the computing node are grouped according to the target number of processes to obtain multiple groups of process pairs; A subset of processes in each group's process pairs are removed.

5. The method according to claim 4, characterized in that, The process pair comprises two processes, and the process of removing a portion of the processes in each process pair includes: For each process pair in a group, remove processes with odd process IDs, or remove processes with even process IDs in each process pair in a group.

6. The method according to claim 4, characterized in that, The process pair comprises four processes, and the process of removing a portion of the processes in each process pair includes: For any pair of processes in adjacent groups, a first elimination operation is performed on the process pairs in the first group of the adjacent group, and a second elimination operation is performed on the process pairs in the second group of the adjacent group. The first removal operation includes removing processes with odd process IDs from the process pairs in the first group; the corresponding second removal operation includes removing processes with even process IDs from the process pairs in the second group. Alternatively, the first removal operation includes removing processes with even process IDs from the process pairs in the first group; the corresponding second removal operation includes removing processes with odd process IDs from the process pairs in the second group.

7. The method according to claim 4, characterized in that, The process on the computing node is grouped according to the target number of processes to obtain multiple pairs of process pairs, including: The grouping range is determined based on the target number of processes; The processes of the target number of processes are grouped within the grouping range to obtain the multiple groups of process pairs; the process IDs of the processes in the process pairs are consecutive.

8. The method according to any one of claims 1-7, characterized in that, The communication between processes on the computing node following the processing process includes: Assign new process IDs to each process on the computing node following the processing process, and determine the mapping relationship between the new process IDs of each process and the original process IDs of each process; Based on the mapping relationship, the communication data associated with each process is obtained, and communication is performed based on the communication data of each process.

9. The method according to any one of claims 1-7, characterized in that, Determining the total number of processes to be processed based on the number of processes in the distributed system and their inter-process communication needs includes: The number of multiple communication requirements is determined based on the process communication requirements; The number of communication requests that is closest to the number of processes is selected from the plurality of communication request numbers as the intermediate number of communication requests; The difference between the number of processes and the number of intermediate communication requirements is taken as the total number.

10. A process communication device, characterized in that, The apparatus for implementing the inter-process communication method as described in claim 1 includes: The determination module is used to determine the total number of processes that need to be processed based on the number of processes in the distributed system and the process communication requirements. The communication module is used to control all computing nodes to process the total number of processes according to the process carrying capacity of each computing node in the distributed system, and to use the processes on the computing nodes after processing to communicate.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.

13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.