Method, apparatus, and program product for transmitting data among multiple processes

By establishing communication connections between processes and allocating shared memory blocks, the problem of low efficiency in inter-process communication in existing technologies is solved, achieving efficient and low-latency data transmission and unified communication services, adapting to the inter-process communication needs of different programming languages.

CN115686875BActive Publication Date: 2026-03-03EMC IP HLDG CO LLC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110833108.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-22
Publication Date
2026-03-03
Estimated Expiration
2041-07-22

AI Technical Summary

Technical Problem

Existing inter-process communication methods are inefficient when transmitting large amounts of data, and they are difficult to synchronize data between multiple processes, leading to complex conflicts and load imbalances.

Method used

By establishing a communication connection between the client process and the server process and allocating shared memory blocks to them, data transmission is carried out using the shared memory blocks. Combined with address mapping technology, processes of different programming languages ​​can access the shared memory blocks.

Benefits of technology

It improves the efficiency of inter-process data transmission, reduces transmission latency, and provides a unified communication service to meet the inter-process communication needs of different programming languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115686875B_ABST
    Figure CN115686875B_ABST
Patent Text Reader

Abstract

The present disclosure relates to methods, devices and program products for transferring data between multiple processes. In one method, in response to receiving a request for transferring data between a client process and a server process in a computing device, a communication connection is established between the client process and the server process. In response to determining that there is an available shared memory block in the computing device, a shared memory block is allocated to the communication connection. Data is transferred between the client process and the server process using the shared memory block. Further, corresponding devices and program products are provided. With exemplary implementations of the present disclosure, a shared memory block can provide higher bandwidth for inter-process data transfer, thereby improving the performance of data transfer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The various implementations of this disclosure relate to process management, and more specifically, to methods, apparatus, and computer program products for managing the transfer of data between multiple processes in a computing device. Background Technology

[0002] With the development of computer technology, multiple processes can run on a single computing device, and these processes can cooperate to achieve more complex functions. Various inter-process communication (IPC) methods have been proposed. However, existing communication methods have low performance and may experience unacceptable latency when transmitting large amounts of data. Therefore, how to transfer data between multiple processes with higher efficiency has become a significant technical challenge. Summary of the Invention

[0003] Therefore, it is desirable to develop and implement a technical solution for transferring data between multiple processes in a more efficient manner. This solution is expected to be compatible with existing process management technologies and, by modifying various configurations of existing processes, manage inter-process communication more effectively.

[0004] According to a first aspect of this disclosure, a method for transferring data between multiple processes is provided. In this method, in response to receiving a request to transfer data between a client process and a server process in a computing device, a communication connection is established between the client process and the server process. In response to determining that an available shared memory block exists in the computing device, a shared memory block is allocated to the communication connection. Data is transferred between the client process and the server process using the shared memory block.

[0005] According to a second aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory coupled to the at least one processor, the memory having instructions stored therein, the instructions causing the device to perform a method according to a first aspect of this disclosure when executed by the at least one processor.

[0006] According to a third aspect of this disclosure, a computer program product is provided, which is tangibly stored on a non-transient computer-readable medium and includes machine-executable instructions for performing the method according to a first aspect of this disclosure. Attached Figure Description

[0007] The features, advantages, and other aspects of various implementations of this disclosure will become more apparent from the accompanying drawings and the following detailed description, which illustrate, by way of example and not limitation, several implementations of this disclosure. In the drawings:

[0008] Figure 1A block diagram illustrating inter-process communication according to a technical solution is shown schematically.

[0009] Figure 2 A block diagram illustrating an exemplary implementation of this disclosure for transferring data between multiple processes is shown.

[0010] Figure 3 A flowchart illustrating an exemplary implementation of this disclosure for transferring data between multiple processes is shown.

[0011] Figure 4 The diagram illustrates a block diagram of establishing a communication connection between a client process and a server process according to an exemplary implementation of the present disclosure.

[0012] Figure 5 The diagram illustrates a block diagram of an exemplary implementation of this disclosure, in which the I / O threads of a server process manage various communication connections.

[0013] Figure 6 The diagram illustrates a polling-based approach by which multiple I / O threads of a server process manage individual communication connections according to an exemplary implementation of this disclosure.

[0014] Figure 7 A block diagram illustrating the interaction between a client process and a server process according to an exemplary implementation of this disclosure is shown schematically.

[0015] Figure 8 A block diagram illustrating the interaction between a client process and a server process according to an exemplary implementation of this disclosure is shown schematically.

[0016] Figure 9 A block diagram illustrating the address mapping between physical blocks and identifiers of a computing device according to an exemplary implementation of this disclosure is shown; and

[0017] Figure 10 A block diagram of an exemplary implementation of a device for transferring data between multiple processes is shown schematically. Detailed Implementation

[0018] Preferred implementations of this disclosure will now be described in more detail with reference to the accompanying drawings. While preferred implementations of this disclosure are shown in the drawings, it should be understood that this disclosure may be implemented in various forms and should not be limited to the implementations set forth herein. Rather, these implementations are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.

[0019] The term “comprising” and its variations, as used herein, signify open inclusion, i.e., “including but not limited to.” Unless otherwise stated, the term “or” means “and / or.” The term “based on” means “at least partially based on.” The terms “one example implementation” and “one implementation” mean “at least one example implementation.” The term “another implementation” means “at least one additional implementation.” The terms “first,” “second,” etc., may refer to different or the same objects. Other explicit and implicit definitions may also be included below.

[0020] Multiple processes can run on computing devices, and these processes can cooperate to achieve more complex functions. Currently, technical solutions based on shared memory for communication between multiple processes have been proposed. However, due to limitations such as multi-process, multi-threading, memory size constraints, thread load balancing, race conditions, error handling, programming language differences, and large pages, these technical solutions are difficult to implement in complex environments.

[0021] For example, the Figure 1 A block diagram 100 schematically illustrates an inter-process communication scheme based on Unix Domain Sockets (UDS). This communication scheme requires interaction between user space and kernel space. For example, a regular cache read operation 122 can be performed on socket cache 120 according to the size of the regular cache. At this time, the data to be transferred in the large page cache 124 needs to be processed via one or more regular cache read operations 122. The NVMe engine 110 can act as a transfer intermediary between the two socket caches 120 and 128, and can write data to socket cache 128 via a large page cache write operation 126.

[0022] It will become clear that existing inter-process communication (IPC) methods are complex, and this complexity increases when data synchronization is required across multiple processes. When a process comprises multiple threads, further consideration must be given to thread conflicts and load balancing. Furthermore, when multiple processes are written in different programming languages ​​(e.g., Java and C++), the different ways these languages ​​access physical storage on computing devices necessitate additional address translation services. Therefore, existing IPC methods are inefficient and struggle to provide a unified communication service for multiple processes.

[0023] To address the shortcomings of existing technical solutions, this disclosure provides an exemplary implementation of a method for transferring data between multiple processes in a computing device. See below for details. Figure 2 This describes a summary of an exemplary implementation according to the present disclosure. Figure 2A block diagram 200 illustrating an exemplary implementation of this disclosure for transferring data between multiple processes is shown. Figure 2 As shown, the processes can be divided into two types: client process 210 and server process 220. Client process 210 can request to establish a communication connection 230 with server process 220. Subsequently, server process 220 can allocate one or more shared memory blocks 240 to the communication connection 230 so that client process 210 and server process 220 can transfer data via the shared memory block 240.

[0024] Using the exemplary implementation of this disclosure, client process 210 and server process 220 can transmit data via shared storage block 240 instead of via communication connection 230 itself. This significantly improves data transmission efficiency and avoids splitting a large block to be transmitted into multiple smaller transmission blocks supported by communication connection 230.

[0025] See below. Figure 3 Further details describe an exemplary implementation according to this disclosure. Figure 3 A flowchart illustrating an exemplary implementation of this disclosure for transferring data between multiple processes is shown. Figure 3 As shown, at block 310, in response to receiving a request to transfer data between client process 210 and server process 220, a communication connection 230 is established between client process 210 and server process 220. According to an exemplary implementation of this disclosure, the process initiating the request may be referred to as client process 210, and the other process as server process 220. A method 300 according to an exemplary implementation of this disclosure may be run at server process 220. Specifically, a management thread may be started in client process 210 to monitor incoming connection requests from client process 210.

[0026] Upon receiving a request from client process 210, a communication connection 230 can be established between client process 210 and server process 220. Here, communication connection 230 can be a UDS-based connection, and a unique connection identifier can be assigned to the established communication connection 230. According to an exemplary implementation of this disclosure, one or more communication connections can be established between client process 210 and server process 220, in which case each communication connection has a corresponding connection identifier.

[0027] It will be understood that client process 210 may include one or more threads, and each thread may have its own communication connection. See below for more details. Figure 4 Describe more details about the communication connection. Figure 4 A block diagram 400 schematically illustrates the establishment of a communication connection between client process 210 and server process 220 according to an exemplary implementation of this disclosure. Figure 4 In this process, client process 210 includes multiple threads 410, ..., 412. Each thread can send a connection request to server process 220. Service thread 440 in server process 220 can listen for requests from client process 210. If it receives a request from a client thread in client process 210, it can establish a communication connection between the client thread and server process 220. Specifically, a communication connection 420 can be established for thread 410, a communication connection 422 can be established for thread 412, and so on.

[0028] According to one exemplary implementation of this disclosure, server process 220 may include multiple I / O threads 420, ..., 422. Specifically, I / O thread 420 may manage communication connection 430, and I / O thread 422 may manage communication connection 432. It will be understood that, although Figure 4 This illustrates a scenario where one I / O thread manages one communication connection. According to an exemplary implementation of this disclosure, each I / O thread can manage one or more communication connections. Although Figure 4 This is just one example of establishing a communication connection between a client process 210 and a server process 220. According to one exemplary implementation of this disclosure, a client process 210 may establish a communication connection with one or more other server processes, and a server process 220 may establish a communication connection with one or more other client processes.

[0029] According to one exemplary implementation of this disclosure, the roles of the client process and the server process are relative, and when a process communicates with multiple other processes, that process can assume the functions of multiple roles. For example, when server process 220 initiates communication with another process, server process 220 can further operate as a client relative to that other process. It will be understood that, although Figure 4 The illustration only shows the case where multiple IO threads 420, ..., 422 manage multiple connections from the same client process 210. According to an exemplary implementation of this disclosure, when multiple client processes connect to the server process 220, these IO threads 420, ..., 422 can each manage multiple communication connections with multiple threads in multiple client processes.

[0030] According to one exemplary implementation of this disclosure, the number of I / O threads can be determined based on the number of processor cores in the computing device. In this way, one I / O thread can be scheduled for each processor core, thereby improving the performance of the I / O threads and the overall performance of the server process 220. It will be understood that the number of I / O threads cannot be increased indefinitely; when there are a large number of communication connections, one I / O thread can manage multiple communication connections. Specifically, Figure 5 A block diagram 500 schematically illustrates a method for managing various communication connections by an I / O thread of server process 220, according to an exemplary implementation of this disclosure. Figure 5 In this context, IO thread 420 can manage communication connections 430, 510, ..., 512 from one or more client processes, and IO thread 422 can manage communication connections 432, 514, ..., 516 from one or more client processes, etc.

[0031] Further, see Figure 6 Describe how to schedule multiple communication connections. Figure 6 A block diagram 600 schematically illustrates a polling-based approach by which multiple I / O threads of a server process manage individual communication connections according to an exemplary implementation of this disclosure. Figure 6 As shown, the service thread of server process 220 can continuously monitor whether new communication connections appear. If a new communication connection 610 is detected, a block 620 can be allocated to that communication connection 610. Furthermore, based on the principle of load balancing, the IO thread with a lower workload can be selected from multiple IO threads 420, ..., 422. For example, an IO thread can be selected sequentially from multiple IO threads using a round-robin method 630 to control the newly created communication connection 610.

[0032] The above text has described the specific process of establishing and managing communication connections. In the following text, we will return to... Figure 3 This describes more details about allocating shared storage blocks to communication connections. Figure 3 At box 320, in response to determining that an available shared memory block exists in the computing device, a shared memory block 240 is allocated to the communication connection 230. The computing device may include a shared block pool and may search for available shared memory blocks from this shared block pool. Here, the shared block pool has a predetermined size, and the blocks may be defined as, for example, 2M, 4M, or other sizes. See also... Figure 6Shared storage blocks can be allocated to each communication connection. For example, block 520 can be allocated to communication connection 430, block 522 can be allocated to communication connection 510, block 524 can be allocated to communication connection 512, block 530 can be allocated to communication connection 434, block 532 can be allocated to communication connection 514, block 534 can be allocated to communication connection 516, and so on.

[0033] According to an exemplary implementation of this disclosure, if a shared storage block 240 has been allocated to the communication connection 230, the attribute of the communication connection 230 can be set to "shared storage mode" to instruct the client process 210 and the server process 220 to transfer data via the shared storage block 240. In this case, the shared storage block 240 can act as an intermediary between the client process 210 and the server process 220, thereby achieving the purpose of data transfer.

[0034] return Figure 3 At box 330, shared memory block 240 is used to transfer data between client process 210 and server process 220. Specifically, client process 210 can write I / O requests to shared memory block 240 so that server process 220 can respond accordingly. See below for further details. Figure 7 More details are described regarding data transfer between client process 210 and server process 220. Figure 7 A block diagram 700 schematically illustrates the interaction between a client process and a server process according to an exemplary implementation of this disclosure. Figure 7 As shown, client process 210 can send a connection request (710) to server process 220 to establish a communication connection between them. Server process 220 can check (712) whether there are available blocks in the shared block pool. If so, client process 210 can allocate shared storage blocks to the established communication connection.

[0035] At this point, the shared memory block has been allocated for data transfer between client process 210 and server process 220. Subsequently, client process 210 can send 716 IO requests to server process 220 via the shared memory block. IO requests can include send requests and receive requests; an example of a send request is described first. In "shared memory mode," client process 210 can write IO requests for sending data into the shared memory block. For example, a send request and the data to be sent can be written into the shared memory block for the server process to read.

[0036] The server process can retrieve and execute a 718 I / O request from the shared memory block. Server process 220 can determine the type of I / O request; for a send request, server process 220 can read the sent data from the shared memory block. After executing the I / O request, server process 220 can send a 720 response to client process 210 to notify client process 210 of the result of the I / O execution. The response to the send request can indicate that server process 220 has received the sent data, allowing client process 210 to process the 722 response based on the shared memory block.

[0037] For receiving requests, client process 210 can write an I / O request for receiving data to the shared memory block. For example, it can write a receive request to the shared memory block and wait for server process 220 to write data to the shared memory block. Server process 220 can write the data to be received to the shared memory block, and at this time, an acknowledgment can notify client process 210 to retrieve the data written by server process 220 from the shared memory block.

[0038] It will be understood that as server process 220 runs, the available blocks in the shared block pool may be exhausted. When service thread 440 in server process 220 detects a new communication connection, there may no longer be any allocatable blocks in the shared block pool. In this case, the communication connection's attribute can be set to "non-shared storage mode" to instruct client process 210 and server process 220 to transfer data via the communication connection.

[0039] When the communication connection is set to "non-shared storage mode," client process 210 and server process 220 can transfer data using the UDS connection method found in existing technologies. For example, client process 210 can transfer data to server process 220 via this UDS communication connection. Although the transmission speed based on the UDS communication connection may be lower than that using shared storage blocks, the UDS communication connection can still support data transfer between the two processes even when storage blocks are exhausted.

[0040] See below. Figure 8 Describe the inter-process communication process using the UDS communication connection. Figure 8 A block diagram 800 schematically illustrates the interaction between a client process and a server process according to an exemplary implementation of this disclosure. Figure 8As shown, client process 210 can send a connection request (810) to server process 220 to establish a communication connection. Server process 220 can check if there are available storage blocks. If it determines (812) that there are no available storage blocks, it can notify (814) that no shared storage block has been allocated. At this time, client process 210 can send an I / O request (816) through the established communication connection based on the existing UDS connection method.

[0041] Server process 220 can obtain and execute an IO request from the UDS communication connection. After executing the IO request, it can send an IO response to client process 210 to notify client process 210 to perform subsequent steps. Then, client process 210 can retrieve data from server process 220 or acknowledgement that server process 220 has received the data via the UDS communication connection. Figure 8 The specific operation of step 822 in the middle and Figure 7 The specific operation of step 722 is similar, except that step 822 is performed via the UDS communication connection, and step 722 is performed based on the shared storage block allocated to the UDS.

[0042] According to an exemplary implementation of this disclosure, the existence of available blocks in the storage resource pool can be continuously checked. If available, shared storage blocks can be allocated for the established communication connection. In subsequent communication, the client process 210 can further perform inter-process communication based on the shared storage blocks. According to an exemplary implementation of this disclosure, the method used to facilitate inter-process communication can be adjusted at any time: data can be transmitted using the UDS communication connection when storage space is insufficient, and data can be transmitted using shared storage space when storage space is sufficient. In this way, the available storage space in the computing device can be utilized as fully as possible, thereby improving the performance of inter-process communication.

[0043] It will be understood that, as the computing device operates, if the inter-process data transfer requirement has been fulfilled, the communication connection between the two processes can be disconnected. At this point, the shared memory blocks allocated to that communication connection are no longer needed and can therefore be released. The number of available blocks in the shared resource pool will then increase, and the released blocks can be allocated to other communication connections. According to one exemplary implementation of this disclosure, these blocks can be allocated to established communication connections that have not yet been allocated shared memory blocks. Alternatively and / or additionally, these blocks can be allocated to newly established communication connections.

[0044] In a real-world operating environment, client process 210 and server process 220 can be written in the same or different programming languages. Since different programming languages ​​have different formats and access methods for their accessible address spaces, processes written in different languages ​​cannot directly access the allocated shared memory blocks. According to an exemplary implementation of this disclosure, an address mapping can be established to allocate shared memory blocks accessible to processes of different types to the communication connection.

[0045] See below. Figure 9 Describe more details about address mapping. Figure 9 A block diagram 900 schematically illustrates the address mapping between physical blocks and identifiers of a computing device according to an exemplary implementation of this disclosure. As shown, the addresses of each shared memory block in the computing device (i.e., the addresses of physical blocks 920, ..., 930) can be obtained. Furthermore, a mapping relationship between the aforementioned addresses and the identifiers of the shared memory blocks can be established. In other words, as shown in address mapping 910, each physical block can be represented using an identifier. For example, physical block 920 can be represented using identifier 922, physical block 930 can be represented using identifier 932, and so on. At this time, client processes can be instructed to access the shared memory blocks via the identifiers.

[0046] As shown by arrow 924, identifier 922 can be used to represent shared memory block 240 allocated to communication connection 230; as shown by arrow 934, identifier 932 can be used to represent shared memory block 522 allocated to communication connection 510. Table 1 below schematically illustrates an address mapping according to an exemplary implementation of this disclosure.

[0047] Table 1 Examples of Address Mapping

[0048] Starting address End address property node File Name 0x02…00 0x04…00 rw-s 1582040 / dev / hugepages / spdk_map0 0x04…00 0x06…00 rw-s 1878272 / dev / hugepages / spdk_map1 … 0x14…00 0x16…00 rw-s 1701715 / dev / hugepages / spdk_map9

[0049] In Table 1, the first column represents the start address of the physical block's physical address on the computing device, the second column represents the end address of the physical block's physical address on the computing device (in this example, the block size is 2MB), the third column represents the read / write attributes of the physical block, the fourth column represents the unique node identifier of the physical block, and the fifth column represents the filename corresponding to the physical block, i.e., the identifier. At this point, the client process 210 can directly access the data within the allocated shared storage block through the filename. It will be understood that although Table 1 shows an example where each block is 2MB in size, according to an exemplary implementation of this disclosure, each block can also have other sizes.

[0050] According to an exemplary implementation of this disclosure, shared storage space of different sizes can be allocated to communication connections based on the amount of data to be transferred between processes. For example, with a block size of 2MB, one block can be allocated to one communication connection, and two or more blocks can be allocated to another. Using this exemplary implementation, it is unnecessary to consider the programming language used to write each process; instead, each process can directly access the data in the allocated shared storage blocks using identifiers. In this way, a unified access point to the shared storage blocks can be provided to each process, eliminating the influence of different programming languages.

[0051] Compared to existing technologies that rely solely on UDS communication connections for data transmission, allocating shared memory blocks for UDS communication connections allows for the allocation of more shared memory space between two processes based on data transmission needs. This approach increases the bandwidth of inter-process data transmission and reduces transmission latency.

[0052] As mentioned above Figures 2 to 9 Examples of methods according to this disclosure have been described in detail, and implementations of corresponding apparatuses will be described below. According to exemplary implementations of this disclosure, the following are provided...

[0053] According to an exemplary implementation of this disclosure, the apparatus further includes modules for performing other steps in the method 300 described above.

[0054] Figure 10 A block diagram of a device 1000 for transferring data between multiple processes, according to an exemplary implementation of the present disclosure, is shown schematically. As shown, the device 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 1002 or loaded from storage unit 1008 into random access memory (RAM) 1003. Various programs and data required for the operation of the device 1000 may also be stored in RAM 1003. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. An input / output (I / O) interface 1005 is also connected to bus 1004.

[0055] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0056] The various processes and procedures described above, such as method 300, can be executed by processing unit 1001. For example, in some implementations, method 300 can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1008. In some implementations, part or all of the computer program can be loaded and / or installed on device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by CPU 1001, one or more steps of method 300 described above can be performed. Alternatively, in other implementations, CPU 1001 can also be configured in any other suitable manner to implement the above-described processes / methods.

[0057] According to an exemplary implementation of this disclosure, an electronic device is provided, including: at least one processor; volatile memory; and a memory coupled to the at least one processor, the memory having instructions stored therein, which, when executed by the at least one processor, cause the device to perform actions for transferring data between a plurality of processes. The actions include: establishing a communication connection between the client process and the server process in response to receiving a request to transfer data between a client process and a server process in a computing device; allocating a shared memory block to the communication connection in response to determining that a shared memory block is available in the computing device; and transferring data between the client process and the server process using the shared memory block.

[0058] According to an exemplary implementation of this disclosure, allocating a shared storage block to a communication connection includes setting the communication connection's attributes to "shared storage mode" to instruct the client process and the server process to transfer data via the shared storage block.

[0059] According to an exemplary implementation of this disclosure, in response to determining that there is no available shared memory block in the computing device, the attribute of the communication connection is set to "non-shared memory mode" to instruct the client process and the server process to transfer data via the communication connection.

[0060] According to an exemplary implementation of this disclosure, establishing a communication connection between a client process and a server process includes: receiving a request from a client thread in the client process, establishing a communication connection between the client thread and the server process; and the action further includes: in response to receiving another request from another client thread in the client process, establishing another communication connection between the client thread and the server process.

[0061] According to an exemplary implementation of this disclosure, in response to determining that multiple communication connections exist between the client process and the server process, multiple server threads of the server process are used to manage the multiple communication connections.

[0062] According to one exemplary implementation of this disclosure, multiple server threads are each run by multiple processor cores of a computing device.

[0063] According to an exemplary implementation of this disclosure, the client process and the server process are written in different programming languages, and the allocation of a shared memory block to the communication connection includes: obtaining the address of the shared memory block in the computing device; establishing a mapping between the address and the identifier of the shared memory block; and instructing the client process to access the shared memory block via the identifier.

[0064] According to an exemplary implementation of this disclosure, transmitting data between a client process and a server process using a shared memory block includes at least one of the following: instructing the client process to send data to the server process via the shared memory block; and instructing the client process to receive data from the server process via the shared memory block.

[0065] According to an exemplary implementation of this disclosure, the action further includes: disconnecting the communication connection in response to receiving a request to stop data transmission; and releasing the shared storage block allocated to the communication connection.

[0066] According to one exemplary implementation of this disclosure, the action is performed at the server process.

[0067] According to an exemplary implementation of this disclosure, a computer program product is provided, which is tangibly stored on a non-transient computer-readable medium and includes machine-executable instructions for performing a method according to this disclosure.

[0068] According to an exemplary implementation of this disclosure, a computer-readable medium is provided. The computer-readable medium stores machine-executable instructions that, when executed by at least one processor, cause the at least one processor to implement the method according to this disclosure.

[0069] This disclosure can be a method, apparatus, system, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of this disclosure.

[0070] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.

[0071] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.

[0072] The computer program instructions used to perform the operations of this disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, etc., and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some implementations, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is customized by utilizing the status information of the computer-readable program instructions to execute the computer-readable program instructions, thereby implementing various aspects of this disclosure.

[0073] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.

[0074] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processing unit of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.

[0075] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.

[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0077] Various implementations of this disclosure have been described above. The foregoing description is exemplary and not exhaustive, nor is it limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the implementations disclosed herein.

Claims

1. A method for transferring data among multiple processes, comprising: in response to receiving a request to transfer data between a client process and a server process in a computing device, establishing a communication connection between the client process and the server process; and in response to determining that a block of shared storage is available in the computing device, allocating a block of shared storage to the communication connection, including setting a property of the communication connection to a shared storage mode to indicate that the client process and the server process utilize the block of shared storage to transfer the data; and utilizing the block of shared storage to transfer the data between the client process and the server process; or in response to determining that no block of shared storage is available in the computing device, setting the property of the communication connection to a non-shared storage mode to indicate that the client process and the server process transfer the data via the communication connection without utilizing any block of shared storage, and transferring data between the client process and the server process without utilizing any block of shared storage.

2. The method of claim 1, wherein establishing the communication connection between the client process and the server process comprises: receiving the request from a client thread in the client process, establishing the communication connection between the client thread and the server process; and the method further comprising, in response to receiving another request from another client thread in the client process, establishing another communication connection between the client thread and the server process.

3. The method of claim 2, further comprising: in response to determining that multiple communication connections exist between the client process and the server process, utilizing multiple server threads of the server process to manage the multiple communication connections, respectively.

4. The method of claim 3, wherein the multiple server threads are run by multiple processor cores of the computing device, respectively.

5. The method of claim 1, wherein the client process and the server process are written using different programming languages, and wherein allocating the block of shared storage to the communication connection comprises: obtaining an address of the block of shared storage in the computing device; establishing a mapping relationship between the address and an identifier of the block of shared storage; and indicating the client process to access the block of shared storage via the identifier.

6. The method of claim 1, wherein utilizing the block of shared storage to transfer data between the client process and the server process comprises at least either of: indicating the client process to send data to the server process via the block of shared storage; and indicating the client process to receive data from the server process via the block of shared storage. in response to receiving a request to stop the data transfer, 7. The method of claim 1, further comprising: disconnecting the communication connection; and releasing the block of shared storage allocated to the communication connection.

8. The method of claim 1, wherein the method is performed at the server process.

9. An electronic device, comprising: at least one processor; a volatile memory; and a block of shared storage. ​ ​ a memory coupled with the at least one processor, the memory having instructions stored therein that, when executed by the at least one processor, cause the device to perform acts for transferring data among a plurality of processes, the acts comprising: in response to receiving a request to transfer data between a client process and a server process in a computing device, establishing a communication connection between the client process and the server process; and in response to determining that no shared memory block is available in the computing device, setting a property of the communication connection to a non-shared memory mode to indicate that the client process and the server process transfer the data via the communication connection; transferring the data between the client process and the server process according to the non-shared memory mode; or in response to determining that a shared memory block is available in the computing device, allocating a shared memory block to the communication connection, including setting the property of the communication connection to a shared memory mode to indicate that the client process and the server process transfer the data via the shared memory block, and transferring data between the client process and the server process via the shared memory block.

10. The device of claim 9, wherein establishing the communication connection between the client process and the server process comprises: receiving the request from a client thread in the client process, establishing the communication connection between the client thread and the server process; and the acts further comprising, in response to receiving another request from another client thread in the client process, establishing another communication connection between the client thread and the server process.

11. The apparatus of claim 10, further comprising: in response to determining that a plurality of communication connections exist between the client process and the server process, managing the plurality of communication connections with a plurality of server threads of the server process respectively.

12. The device of claim 11, wherein the plurality of server threads are run by a plurality of processor cores of the computing device respectively, and the acts are performed at the server process.

13. The device of claim 9, wherein the client process and the server process are written in different programming languages, and wherein allocating the shared memory block to the communication connection comprises: obtaining an address of the shared memory block in the computing device; establishing a mapping relationship between the address and an identifier of the shared memory block; and indicating the client process to access the shared memory block via the identifier.

14. The device of claim 9, wherein transferring data between the client process and the server process with the shared memory block comprises at least either of: indicating the client process to send data to the server process via the shared memory block; and indicating the client process to receive data from the server process via the shared memory block. ​ 15. A computer program product tangibly stored on a non-transitory computer readable medium and comprising machine executable instructions for performing a method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Copy-free inter-process communication system and method

    CN112416625A

  • News transfer method based on chained list process

    CN1859325A