A multi-process parallel communication method, device and equipment and storage medium

By adding a central proxy service on the server side and generating a unique communication identifier using timestamps and global variables, the problem of port sharing in multi-process communication is solved, achieving efficient and reliable data transmission and improving the communication efficiency of gRPC services.

CN121078103BActive Publication Date: 2026-07-24LINGSHU TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LINGSHU TECH CO LTD
Filing Date
2025-09-29
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In multi-process parallel communication, existing technologies cannot effectively solve the problem of communication port sharing between multiple processes, resulting in low efficiency of gRPC service in remote service communication.

Method used

By adding a central proxy service to each server, a unique communication identifier is generated using the current date's timestamp and preset global variables. The central proxy service then assigns identifiers to each child process, enabling data encapsulation and dynamic allocation of communication ports, thus establishing a target remote call communication channel.

Benefits of technology

It improves the reliability and efficiency of multi-process communication, solves the obstacles to inter-process communication in remote services, and ensures the accuracy and efficiency of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121078103B_ABST
    Figure CN121078103B_ABST
Patent Text Reader

Abstract

The application discloses a multi-process parallel communication method and device, equipment and a storage medium. The method comprises the following steps: determining a unique communication identifier according to a timestamp of a current date and a preset global variable through a local center agent service; allocating the unique communication identifier for a local sub-process through the local center agent service, and allocating the unique communication identifier for a remote sub-process through a remote center agent service; encapsulating to-be-transmitted data according to the unique communication identifier and a remote service address of the remote center agent service through the local sub-process, obtaining target transmission data, and forwarding the target transmission data to the remote center agent service through the local center agent service; determining a target communication port according to the target transmission data through the remote center agent service, and establishing a remote call communication channel of the target communication port, so as to send the target transmission data to the remote sub-process through the remote call communication channel. The above scheme improves the reliability and efficiency of multi-process communication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more particularly to the field of communication technology, specifically to a multi-process parallel communication method, apparatus, device, and storage medium. Background Technology

[0002] Large model fine-tuning involves retraining a pre-trained large language model using data from a specific domain or task to adapt the model to a particular application scenario. To accelerate the training process, large models are typically fine-tuned on two machines: a primary server equipped with a GPU (Graphics Processing Unit) for faster training, and a secondary server for auxiliary training.

[0003] During training, the services on the two machines need to communicate periodically to exchange training data. The distribution and synchronization of training tasks generally use the HTTP (Hypertext Transfer Protocol) protocol, while information synchronization during training typically uses the gRPC (Google Remote Procedure Call) service. gRPC, as a high-performance remote communication framework, is widely used in various types of microservice architectures. Like HTTP, gRPC services need to listen on a specified local port upon startup to communicate with remote services. In single-process mode, i.e., when training only a single task, the port used by the gRPC service can be shared among services through simple configuration, thus achieving inter-service communication. If machine resources are sufficient, multiple model fine-tuning tasks can be started concurrently through multiple child processes. In this scenario, since the number of processes started is unknown, the ports used by each process cannot be fixed at service startup, thus limiting the use of gRPC for remote service communication. Summary of the Invention

[0004] This application provides a multi-process parallel communication method, apparatus, device, and storage medium to improve the reliability and efficiency of multi-process communication.

[0005] According to one aspect of this application, a multi-process parallel communication method is provided, which is applied to a remote service communication system; the remote service communication system includes a local server and a remote server; the local server includes a local central agent service and at least one local child process; the remote server includes a remote central agent service and at least one remote child process; the local central agent service is communicatively connected to the remote central agent service and the at least one local child process respectively; the remote central agent service is communicatively connected to the at least one remote child process; the method includes:

[0006] The local central proxy service determines a unique communication identifier between the local child process and the remote child process based on the timestamp of the current date and preset global variables, and sends the unique communication identifier to the remote central proxy service.

[0007] The unique communication identifier is assigned to the local child process through the local central proxy service, and the unique communication identifier is assigned to the remote child process through the remote central proxy service;

[0008] When it is detected that the local subprocess is sending data to be transmitted to the remote subprocess, the local subprocess encapsulates the data to be transmitted according to the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service to obtain the target transmission data, and forwards the target transmission data to the remote central proxy service through the local central proxy service.

[0009] The remote central proxy service determines the target communication port between the local subprocess and the remote subprocess based on the target transmission data, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote subprocess using the target remote call communication channel.

[0010] According to another aspect of this application, a multi-process parallel communication device is provided, configured in a remote service communication system; the remote service communication system includes a local server and a remote server; the local server includes a local central agent service and at least one local child process; the remote server includes a remote central agent service and at least one remote child process; the local central agent service is communicatively connected to the remote central agent service and the at least one local child process respectively; the remote central agent service is communicatively connected to the at least one remote child process; the device includes:

[0011] The identifier generation module is used to determine a unique communication identifier between the local subprocess and the remote subprocess based on the timestamp of the current date and preset global variables through the local central proxy service, and send the unique communication identifier to the remote central proxy service;

[0012] The identifier allocation module is used to allocate the unique communication identifier to the local child process through the local central agent service, and to allocate the unique communication identifier to the remote child process through the remote central agent service;

[0013] The data encapsulation module is used to encapsulate the data to be transmitted by the local subprocess according to the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service when it is detected that the local subprocess sends data to be transmitted to the remote subprocess, so as to obtain the target transmission data, and forward the target transmission data to the remote central proxy service through the local central proxy service.

[0014] The data communication module is used to determine the target communication port between the local subprocess and the remote subprocess based on the target transmission data through the remote central agent service, and to establish a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote subprocess using the target remote call communication channel.

[0015] According to another aspect of this application, an electronic device is provided, the electronic device comprising:

[0016] One or more processors;

[0017] Memory, used to store one or more programs;

[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement any of the multi-process parallel communication methods provided in the embodiments of this application.

[0019] According to another aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements any of the multi-process parallel communication methods provided in the embodiments of this application.

[0020] According to another aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the multi-process parallel communication methods provided in the embodiments of this application.

[0021] This application uses a local central proxy service to determine a unique communication identifier between a local child process and a remote child process based on the current date's timestamp and preset global variables, and sends this unique identifier to the remote central proxy service. The local central proxy service assigns unique communication identifiers to both the local and remote child processes. When a local child process is detected sending data to a remote child process, the local child process encapsulates the data based on the remote child process's unique communication identifier and the remote service address of the remote central proxy service to obtain the target data. This target data is then forwarded to the remote central proxy service via the local central proxy service. The remote central proxy service determines the target communication port between the local and remote child processes based on the target data and establishes a target remote call communication channel for that port. This target remote call communication channel is then used to send the target data to the remote child process. This technical solution, by adding a central proxy service to each server, using this service as an intermediary, and using the identifier as the basis for port and communication channel identification, solves the problem of inter-process communication in remote services, improving the reliability and efficiency of multi-process communication. Attached Figure Description

[0022] Figure 1a This is a flowchart of a multi-process parallel communication method provided according to Embodiment 1 of this application;

[0023] Figure 1b This is an interaction diagram of multi-process parallel communication provided according to Embodiment 1 of this application;

[0024] Figure 2 This is a flowchart of a multi-process parallel communication method provided according to Embodiment 2 of this application;

[0025] Figure 3 This is a schematic diagram of the structure of a multi-process parallel communication device according to Embodiment 3 of this application;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device that implements the multi-process parallel communication method of Embodiment 4 of this application. Detailed Implementation

[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0029] Furthermore, it should be noted that the collection, storage, use, processing, transmission, provision, and disclosure of data related to timestamps and preset global variables involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0030] Example 1

[0031] Figure 1a This is a flowchart of a multi-process parallel communication method according to Embodiment 1 of this application. This embodiment is applicable to gRPC communication based on a multi-subprocess concurrency mechanism and can be executed by a multi-process parallel communication device. This device can be implemented in hardware and / or software and can be configured in a computer device, such as a remote service communication system. The remote service communication system includes a local server and a remote server. The local server includes a local central agent service and at least one local subprocess. The remote server includes a remote central agent service and at least one remote subprocess. The local central agent service is communicatively connected to both the remote central agent service and at least one local subprocess. The remote central agent service is communicatively connected to at least one remote subprocess. Figure 1a As shown, the method includes:

[0032] S110. Based on the current date's timestamp and preset global variables, the local central agent service determines a unique communication identifier between the local child process and the remote child process, and sends the unique communication identifier to the remote central agent service.

[0033] In this embodiment, the local central proxy service refers to a high-efficiency, open-source, cross-platform remote procedure call framework service set up on the local server. This service listens on a specified port, is responsible for receiving external requests, and distributes the requests to a specified local subprocess, aiming to simplify communication between different services. It should be noted that the local central proxy service in this application can specifically refer to the gRPC service. The gRPC service is a service implemented based on the gRPC framework, which enables different modules in a distributed system to call each other through a simple and efficient communication method, thereby simplifying cross-language and cross-platform system integration. The current date refers to the current date when the communication identifier is generated. The timestamp is a number representing a specific point in time, used to identify the exact time when the communication identifier is generated; it should be noted that the timestamp in this application can be accurate to the millisecond to maximize the generation of conflict-free communication identifiers. Preset global variables refer to variables that can be accessed and modified throughout the entire program's execution. Local subprocesses refer to the subprocesses used by the local server when training multiple model fine-tuning tasks; there is at least one such subprocess, started concurrently. A remote subprocess refers to a subprocess used by a remote server during the training of multiple model fine-tuning tasks. There is at least one such subprocess, and they are started concurrently. A unique communication identifier refers to the unique ID (identifier) ​​between the local and remote subprocesses during this communication process. A remote central proxy service refers to a high-efficiency, open-source, cross-platform remote procedure call framework service set up on the remote server. This service listens on a specified port, receives external requests, and distributes them to a specified local subprocess, aiming to simplify communication between different services. It should be noted that the remote central proxy service in this application can specifically refer to the gRPC service.

[0034] Optionally, the timestamp of the current date is converted into a data field of the first preset field length through the local central proxy service to obtain the timestamp field; the variable field of the second preset field length is determined through the local central proxy service based on the current variable value of the preset global variable; the timestamp field and the variable field are concatenated through the local central proxy service to obtain a unique communication identifier between the local child process and the remote child process.

[0035] In this embodiment, the first preset field length and the second preset field length are manually preset based on actual conditions or experience. For example, the first preset field length of the timestamp field can be 15, and the second preset field length of the variable field can be 5. The timestamp field is the field used to represent the timestamp of the current date. The current variable value refers to the current field value of the global variable; for example, the current variable value can be the initial value 00000. The variable field is the field used to represent the current value of the global variable.

[0036] For example, the child process ID consists of two parts. The first part is 15 characters long and is the timestamp of the current date, accurate to the millisecond, to generate a conflict-free ID as much as possible. The second part is 5 characters long and is controlled by a global variable V. The initial value of V is 00000. When an ID needs to be generated, the current value of V is obtained and incremented by 1 to get the suffix of the current ID. When the value of V reaches 99999, the value of V is restored to 00000. By concatenating the first part, which represents the timestamp, and the second part, which represents the value of the global variable, a unique communication identifier between the local child process and the remote child process can be obtained.

[0037] It should be noted that the unique communication identifier is generated before the local child process and the remote child process start.

[0038] S120. Assign a unique communication identifier to the local child process through the local central agent service, and assign a unique communication identifier to the remote child process through the remote central agent service.

[0039] Specifically, a local child process is started through the local central agent service, and a unique communication identifier is assigned to the local child process; a remote child process is started through the remote central agent service, and a unique communication identifier is assigned to the remote child process.

[0040] For example, see Figure 1b Assuming the local central proxy service is A central proxy service and the remote central proxy service is B central proxy service, the local child process for this communication is child process A1 and the remote child process for this communication is B1. Before child processes A1 and B1 start, the main service A generates a unique ID for this communication between the two parties and sends it to the main service B through the HTTP interface. Then, A and B each start child processes A1 and B1 and assign a unique ID to their respective child processes.

[0041] S130. When it is detected that the local subprocess is sending data to be transmitted to the remote subprocess, the local subprocess encapsulates the data to be transmitted according to the unique communication identifier of the remote subprocess and the remote service address of the remote central agent service to obtain the target data to be transmitted, and forwards the target data to the remote central agent service through the local central agent service.

[0042] In this embodiment, the data to be transmitted refers to the message that the local child process needs to send to the remote child process. The specific content of this data is not limited in this embodiment. The remote service address refers to the communication address of the remote central proxy service. The target transmission data refers to the transmission data after data encapsulation. This transmission data includes not only the message sent by the local child process, but also the unique communication identifier of the remote child process and the remote service address of the remote central proxy service.

[0043] In one alternative implementation, when it is detected that a local subprocess is sending data to be transmitted to a remote subprocess, the local subprocess performs a unique communication identifier verification between itself and the unique communication identifier of the receiver (i.e., the remote subprocess), and encapsulates the data to be transmitted if the consistency verification passes.

[0044] Understandably, the unique communication identifier is a unique ID for this communication between the local child process and the remote child process. By verifying the communication identifier, the accuracy of the sender and receiver of this data transmission can be ensured.

[0045] S140. Based on the target transmission data, the remote central agent service determines the target communication port between the local child process and the remote child process, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote child process using the target remote call communication channel.

[0046] In this embodiment, the target communication port refers to the logical interface used to identify the remote child process, typically used in conjunction with an IP address to establish a network connection with an external device or service. The target remote call communication channel refers to the data transmission path between the local and remote child processes during this communication, enabling data to flow between them; this channel can be physical or virtual.

[0047] This application embodiment uses a local central proxy service to determine a unique communication identifier between a local child process and a remote child process based on the current date's timestamp and preset global variables, and sends this unique communication identifier to the remote central proxy service. The local central proxy service assigns a unique communication identifier to the local child process, and the remote central proxy service assigns a unique communication identifier to the remote child process. When it is detected that the local child process is sending data to be transmitted to the remote child process, the local child process encapsulates the data to be transmitted based on the remote child process's unique communication identifier and the remote service address of the remote central proxy service to obtain the target transmission data, and forwards the target transmission data to the remote central proxy service through the local central proxy service. The remote central proxy service determines the target communication port between the local and remote child processes based on the target transmission data, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote child process using the target remote call communication channel. This technical solution, by adding a central proxy service to each server, using this service as an intermediary, and using the identifier as the basis for port and communication channel identification, solves the problem of inter-process communication in remote services, improving the reliability and efficiency of multi-process communication.

[0048] Example 2

[0049] Figure 2 This is a flowchart of a multi-process parallel communication method according to Embodiment 2 of this application. Based on the technical solutions of the above embodiments, this embodiment refines the process of "encapsulating the data to be transmitted by the local subprocess according to the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service to obtain the target transmission data" to "encapsulating the unique communication identifier of the remote subprocess and the data to be transmitted by the local subprocess to obtain candidate transmission data; encapsulating the candidate transmission data and the remote service address of the remote central proxy service by the local subprocess to obtain the target transmission data." It should be noted that for parts not detailed in this embodiment, please refer to the relevant descriptions in other embodiments. Figure 2 As shown, the method includes:

[0050] S210. Based on the current date's timestamp and preset global variables, the local central agent service determines a unique communication identifier between the local child process and the remote child process, and sends the unique communication identifier to the remote central agent service.

[0051] S220. Assign a unique communication identifier to a local child process through the local central agent service, and assign a unique communication identifier to a remote child process through the remote central agent service.

[0052] S230. When it is detected that the local subprocess is sending data to be transmitted to the remote subprocess, the local subprocess encapsulates the unique communication identifier of the remote subprocess and the data to be transmitted to obtain candidate data for transmission.

[0053] In this embodiment, candidate transmission data refers to a data set that encapsulates communication identifiers and transmission data.

[0054] S240. The candidate transmission data and the remote service address of the remote central agent service are encapsulated by the local subprocess to obtain the target transmission data, and the target transmission data is forwarded to the remote central agent service through the local central agent service.

[0055] Optionally, when the target transmission data is received, the local central proxy service parses the target transmission data to obtain candidate transmission data and remote service address; based on the remote service address, the local central proxy service establishes a candidate remote call communication channel between the local central proxy service and the remote central proxy service, and sends the candidate transmission data to the remote central proxy service through the candidate remote call communication channel.

[0056] In this embodiment, the candidate remote call communication channel refers to the data transmission path between the local central agent service and the remote central agent service in this communication, which enables data to flow between the local central agent service and the remote central agent service; the channel can be physical or virtual.

[0057] For example, see Figure 1b When a child process A1 of service A needs to send a message to a child process B1 of service B, it first encapsulates the message content m to be sent and the ID of the receiver B1 (which is the same as the ID of A1) into a message body M1. Then, it encapsulates M1 and the central proxy service address of the receiver B into a message M2 and sends M2 to its own central proxy service. When the central proxy service of server A receives the message M2 from the child process A1, it parses the central proxy service address of the receiver in M2, establishes gRPC communication with that address, and then sends the message body M1 in M2 to the central proxy service of the receiver B.

[0058] S250. Based on the target transmission data, the remote central agent service determines the target communication port between the local child process and the remote child process, and establishes a target remote call communication channel on the target communication port, so as to send the target transmission data to the remote child process using the target remote call communication channel.

[0059] Optionally, the candidate transmission data is parsed through the remote central agent service to obtain a unique communication identifier and the data to be transmitted; the target communication port between the local child process and the remote child process is determined from the remote process registry based on the unique communication identifier through the remote central agent service; wherein, the process registry is the process identifier and process communication port registered with the remote central agent service by at least one remote child process when it starts.

[0060] In this embodiment, the process registry refers to a table that integrates process identifiers and information related to process communication ports, along with their corresponding relationships. The process identifier is an identifier used to characterize the communication identity of a child process; this identifier can be a unique communication identifier for the child process during this communication process. The process communication port refers to the communication port that the child process's gRPC service listens on.

[0061] Furthermore, the remote center agent service uses the target remote call communication channel to send the data to be transmitted to the remote child process.

[0062] For example, see Figure 1bAfter receiving message M1 from central agent service A, B's central agent service obtains the child process ID from the message, retrieves the port P1 corresponding to the ID from the local registry, and establishes gRPC communication with that port; through the established communication channel, it sends the message content m in M1 to child process B1.

[0063] In one optional implementation, since the range of ports available to users on the server is 1024~65535, arbitrary random numbers cannot be generated as the listening port for the child process. When generating a unique ID for the child process, since the last 5 bits of the ID are 5, which is consistent with the maximum length of the port that the user can use, this 5-bit number is used as a seed to generate a random port when generating the inter-process communication port for the local or remote child process. This generates a random port P in the range of 1024~65535. Subsequently, it can be checked whether the port P is occupied. If it is occupied, P can be incremented by 1 to determine whether a new port P is occupied. This process continues until an available port is found, thus obtaining the inter-process communication port for the local or remote child process. When the child process starts, it initiates a registration request for the inter-process communication port to the local or remote central agent service. After receiving the registration request from the child process, the central agent service records the child process ID and the child process listening port P in the process registry.

[0064] In this embodiment, the local central proxy service determines a unique communication identifier between the local child process and the remote child process based on the current date's timestamp and preset global variables, and sends the unique communication identifier to the remote central proxy service. The local central proxy service assigns a unique communication identifier to the local child process, and the remote central proxy service assigns a unique communication identifier to the remote child process. When it is detected that the local child process is sending data to be transmitted to the remote child process, the local child process encapsulates the unique communication identifier of the remote child process and the data to be transmitted to obtain candidate transmission data. The local child process then encapsulates the candidate transmission data and the remote service address of the remote central proxy service to obtain target transmission data, and forwards the target transmission data to the remote central proxy service through the local central proxy service. Based on the target transmission data, the remote central proxy service determines the target communication port between the local child process and the remote child process, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote child process using the target remote call communication channel. The above technical solution solves the problem of inter-process communication in remote services by adding a central proxy service on each server, using this service as an intermediary and the identifier as the basis for identifying ports and communication channels, thereby improving the reliability and efficiency of multi-process communication.

[0065] Example 3

[0066] Figure 3 This is a schematic diagram of a multi-process parallel communication device according to Embodiment 3 of this application. It is applicable to gRPC communication based on a multi-subprocess concurrency mechanism. This multi-process parallel communication device can be implemented in hardware and / or software and can be configured in a computer device, such as a remote service communication system. The remote service communication system includes a local server and a remote server. The local server includes a local central agent service and at least one local subprocess. The remote server includes a remote central agent service and at least one remote subprocess. The local central agent service is communicatively connected to both the remote central agent service and at least one local subprocess. The remote central agent service is communicatively connected to at least one remote subprocess. Figure 3 As shown, the device includes:

[0067] The identifier generation module 310 is used to determine the unique communication identifier between the local child process and the remote child process based on the timestamp of the current date and preset global variables through the local central agent service, and send the unique communication identifier to the remote central agent service;

[0068] The identifier allocation module 320 is used to allocate a unique communication identifier to a local child process through the local central agent service, and to allocate a unique communication identifier to a remote child process through the remote central agent service.

[0069] The data encapsulation module 330 is used to encapsulate the data to be transmitted by the local subprocess according to the unique communication identifier of the remote subprocess and the remote service address of the remote central agent service when it is detected that the local subprocess is sending data to be transmitted to the remote subprocess. The local subprocess encapsulates the data to be transmitted according to the unique communication identifier of the remote subprocess and the remote service address of the remote central agent service, and forwards the target data to the remote central agent service through the local central agent service.

[0070] The data communication module 340 is used to determine the target communication port between the local child process and the remote child process based on the target transmission data through the remote center agent service, and to establish a target remote call communication channel for the target communication port so as to send the target transmission data to the remote child process using the target remote call communication channel.

[0071] This application embodiment uses a local central proxy service to determine a unique communication identifier between a local child process and a remote child process based on the current date's timestamp and preset global variables, and sends this unique communication identifier to the remote central proxy service. The local central proxy service assigns a unique communication identifier to the local child process, and the remote central proxy service assigns a unique communication identifier to the remote child process. When it is detected that the local child process is sending data to be transmitted to the remote child process, the local child process encapsulates the data to be transmitted based on the remote child process's unique communication identifier and the remote service address of the remote central proxy service to obtain the target transmission data, and forwards the target transmission data to the remote central proxy service through the local central proxy service. The remote central proxy service determines the target communication port between the local and remote child processes based on the target transmission data, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote child process using the target remote call communication channel. This technical solution, by adding a central proxy service to each server, using this service as an intermediary, and using the identifier as the basis for port and communication channel identification, solves the problem of inter-process communication in remote services, improving the reliability and efficiency of multi-process communication.

[0072] Optional, the data encapsulation module 330 is specifically used for:

[0073] Candidate transmission data is obtained by encapsulating the unique communication identifier of the remote subprocess and the data to be transmitted in the local subprocess;

[0074] The target data to be transmitted is obtained by encapsulating the candidate data to be transmitted and the remote service address of the remote central agent service through a local subprocess.

[0075] Optional, the data encapsulation module 330 is specifically used for:

[0076] When the target transmission data is received through the local central proxy service, the target transmission data is parsed to obtain candidate transmission data and remote service address;

[0077] Based on the remote service address, the local central agent service establishes a candidate remote call communication channel between the local central agent service and the remote central agent service, and sends the candidate transmission data to the remote central agent service through this candidate remote call communication channel.

[0078] Optional, data communication module 340, specifically used for:

[0079] The candidate transmission data is parsed through the remote central agent service to obtain a unique communication identifier and the data to be transmitted;

[0080] The remote central agent service determines the target communication port between the local child process and the remote child process from the remote process registry based on the unique communication identifier. The process registry is the process identifier and process communication port registered with the remote central agent service by at least one remote child process when it starts.

[0081] Optional, data communication module 340, specifically used for:

[0082] The remote center agent service uses the target remote call communication channel to send the data to be transmitted to the remote child process.

[0083] Optionally, the identifier generation module 310 is specifically used for:

[0084] The local central proxy service converts the current date's timestamp into a data field of the first preset field length to obtain the timestamp field.

[0085] By using a preset global variable through the local central proxy service, the variable field with the second preset field length is determined based on the current value of the preset global variable.

[0086] By concatenating the timestamp field and the variable field through the local central proxy service, a unique communication identifier between the local child process and the remote child process can be obtained.

[0087] The multi-process parallel communication device provided in this application can execute the multi-process parallel communication method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing each multi-process parallel communication method.

[0088] According to embodiments of this application, this application also provides an electronic device, a readable storage medium, and a computer program product.

[0089] Example 4

[0090] Figure 4 This is a schematic diagram of the structure of an electronic device 410 implementing the multi-process parallel communication method of the embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or claimed herein.

[0091] like Figure 4As shown, the electronic device 410 includes at least one processor 411 and a memory, such as a read-only memory (ROM) 412 or a random access memory (RAM) 413, communicatively connected to the at least one processor 411. The memory stores computer programs executable by the at least one processor. The processor 411 can perform various appropriate actions and processes based on the computer program stored in the ROM 412 or loaded from storage unit 418 into the RAM 413. The RAM 413 may also store various programs and data required for the operation of the electronic device 410. The processor 411, ROM 412, and RAM 413 are interconnected via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.

[0092] Multiple components in electronic device 410 are connected to I / O interface 415, including: input unit 416, such as keyboard, mouse, etc.; output unit 417, such as various types of displays, speakers, etc.; storage unit 418, such as disk, optical disk, etc.; and communication unit 419, such as network card, modem, wireless transceiver, etc. Communication unit 419 allows electronic device 410 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0093] Processor 411 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 411 performs the various methods and processes described above, such as multi-process parallel communication methods.

[0094] In some embodiments, the multi-process parallel communication method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 410 via ROM 412 and / or communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the multi-process parallel communication method described above may be performed. Alternatively, in other embodiments, processor 411 may be configured for the multi-process parallel communication method by any other suitable means (e.g., by means of firmware).

[0095] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0096] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable multi-process parallel communication device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on the machine, partially on the machine, or as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0097] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0098] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0099] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0100] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0101] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.

[0102] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A multi-process parallel communication method, characterized in that, This is applied to a remote service communication system; the remote service communication system includes a local server and a remote server; the local server includes a local central agent service and at least one local subprocess; the remote server includes a remote central agent service and at least one remote subprocess; the local central agent service is communicatively connected to the remote central agent service and the at least one local subprocess respectively; The remote central agent service communicates with the at least one remote child process; the method includes: The local central proxy service determines a unique communication identifier between the local child process and the remote child process based on the timestamp of the current date and preset global variables, and sends the unique communication identifier to the remote central proxy service. The unique communication identifier is assigned to the local child process through the local central proxy service, and the unique communication identifier is assigned to the remote child process through the remote central proxy service; When it is detected that the local subprocess is sending data to be transmitted to the remote subprocess, the local subprocess encapsulates the data to be transmitted according to the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service to obtain the target transmission data, and forwards the target transmission data to the remote central proxy service through the local central proxy service. The remote central proxy service determines the target communication port between the local subprocess and the remote subprocess based on the target transmission data, and establishes a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote subprocess using the target remote call communication channel.

2. The method according to claim 1, characterized in that, The local subprocess encapsulates the data to be transmitted based on the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service to obtain the target transmission data, including: The local subprocess encapsulates the unique communication identifier of the remote subprocess and the data to be transmitted to obtain candidate transmission data. The target transmission data is obtained by encapsulating the candidate transmission data and the remote service address of the remote central agent service through the local subprocess.

3. The method according to claim 2, characterized in that, Forwarding the target transmission data to the remote central proxy service through the local central proxy service includes: When the target transmission data is received by the local central proxy service, the target transmission data is parsed to obtain the candidate transmission data and the remote service address. The local central agent service establishes a candidate remote call communication channel between itself and the remote central agent service based on the remote service address, and sends the candidate transmission data to the remote central agent service through the candidate remote call communication channel.

4. The method according to claim 3, characterized in that, The remote central proxy service determines the target communication port between the local child process and the remote child process based on the target transmission data, including: The candidate transmission data is parsed through the remote central proxy service to obtain the unique communication identifier and the data to be transmitted; The remote central agent service determines the target communication port between the local child process and the remote child process from the remote process registry based on the unique communication identifier; wherein, the process registry is the process identifier and process communication port registered with the remote central agent service by the at least one remote child process when the at least one remote child process starts.

5. The method according to claim 4, characterized in that, Sending target transmission data to the remote subprocess using the target remote call communication channel includes: The remote center agent service uses the target remote call communication channel to send the data to be transmitted to the remote subprocess.

6. The method according to claim 1, characterized in that, The local central proxy service determines a unique communication identifier between the local child process and the remote child process based on the current date's timestamp and preset global variables, including: The local central agent service converts the current date's timestamp into a data field of a first preset field length to obtain the timestamp field. The local central proxy service determines the variable field of the second preset field length based on the current variable value of the preset global variable; The local central proxy service concatenates the timestamp field and the variable field to obtain a unique communication identifier between the local child process and the remote child process.

7. A multi-process parallel communication device, characterized in that, Configured in a remote service communication system; the remote service communication system includes a local server and a remote server; the local server includes a local central agent service and at least one local subprocess; the remote server includes a remote central agent service and at least one remote subprocess; the local central agent service is communicatively connected to the remote central agent service and the at least one local subprocess respectively; The remote central agent service is communicatively connected to the at least one remote subprocess; the apparatus includes: The identifier generation module is used to determine a unique communication identifier between the local subprocess and the remote subprocess based on the timestamp of the current date and preset global variables through the local central proxy service, and send the unique communication identifier to the remote central proxy service; The identifier allocation module is used to allocate the unique communication identifier to the local child process through the local central agent service, and to allocate the unique communication identifier to the remote child process through the remote central agent service; The data encapsulation module is used to encapsulate the data to be transmitted by the local subprocess according to the unique communication identifier of the remote subprocess and the remote service address of the remote central proxy service when it is detected that the local subprocess sends data to be transmitted to the remote subprocess, so as to obtain the target transmission data, and forward the target transmission data to the remote central proxy service through the local central proxy service. The data communication module is used to determine the target communication port between the local subprocess and the remote subprocess based on the target transmission data through the remote central agent service, and to establish a target remote call communication channel for the target communication port, so as to send the target transmission data to the remote subprocess using the target remote call communication channel.

8. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the multi-process parallel communication method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the multi-process parallel communication method as described in any one of claims 1-6.

10. A computer program product comprising a computer program that, when executed by a processor, implements the multi-process parallel communication method according to any one of claims 1-6.