Inter-process communication method, device, equipment and computer-readable storage medium
By creating shared memory for communication in global shared memory and recording its identity, the problem of blood relationship required for communication based on shared memory is solved, and efficient and flexible inter-process communication is achieved.
Patent Information
- Application Number
- CN202111422039.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2041-11-26
AI Technical Summary
Inter-process communication methods based on shared memory require the blood relationship between multiple processes that communicate, which limits the flexibility of inter-process communication.
By creating shared memory for communication in global shared memory and recording its identity in a global array, client processes and service processes can establish connections for communication without blood relationship.
It improves the efficiency and flexibility of inter-process communication, allows efficient inter-process communication without blood relationships, and avoids the problems of high latency and slow response.
Smart Images

Figure CN114064324B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to an inter-process communication method, apparatus, device, and computer-readable storage medium. Background Art
[0002] With the continuous development of computer technology, the application of inter-process communication technology is becoming more and more extensive.
[0003] Usually, inter-process communication can be achieved through system interfaces. However, this method causes high latency and slow response in inter-process communication. Therefore, to address this problem, it is proposed to achieve inter-process communication through shared memory.
[0004] However, this method of implementing inter-process communication based on shared memory requires that the multiple communicating processes have a blood relationship, for example, the two processes that need to communicate are in a parent-child relationship, which greatly limits the inter-process communication. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an inter-process communication method, apparatus, device and computer-readable storage medium to improve the usage limitations of inter-process communication based on shared memory, thereby improving the flexibility of inter-process communication while ensuring efficient communication.
[0006] In a first aspect, an embodiment of the present disclosure provides an inter-process communication method, including:
[0007] After the service process establishes a connection with the global shared memory, the client process obtains a first identifier of the global shared memory, and establishes a connection with the global shared memory according to the first identifier;
[0008] The client process creates a shared memory for communication, and records a second identifier of the shared memory for communication in a global array of the global shared memory;
[0009] After the service process obtains the second identifier from the global array, the service process establishes a connection with the shared memory for communication according to the second identifier;
[0010] The client process communicates with the service process through the shared memory used for communication.
[0011] In a second aspect, an embodiment of the present disclosure provides an inter-process communication device, including:
[0012] an acquisition module, configured to enable the client process to acquire a first identifier of the global shared memory after the service process establishes a connection with the global shared memory, and to establish a connection with the global shared memory according to the first identifier;
[0013] A creation module, used for the client process to create a shared memory for communication;
[0014] A recording module, used for the client process to record the second identifier of the shared memory used for communication in the global array of the global shared memory;
[0015] a connection establishing module, configured to establish a connection between the service process and the shared memory for communication according to the second identifier after the service process obtains the second identifier from the global array;
[0016] A communication module is used for the client process to communicate with the service process through the shared memory used for communication.
[0017] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:
[0018] Memory;
[0019] Processor; and
[0020] Computer programs;
[0021] The computer program is stored in the memory and is configured to be executed by the processor to implement the method as described in the first aspect.
[0022] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the method described in the first aspect.
[0023] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the inter-process communication method as described above is implemented.
[0024] The inter-process communication method, apparatus, device and computer-readable storage medium provided by the embodiments of the present disclosure create a shared memory for communication based on the global shared memory. The client process and the service process establish a connection with the shared memory for communication through a label, and complete data interaction based on the shared memory for communication, thereby greatly improving the communication efficiency. In addition, the client process and the service process do not need to have a blood relationship to communicate based on the shared memory, thereby improving the usage restrictions of inter-process communication based on the shared memory, thereby improving the flexibility of inter-process communication while ensuring efficient communication. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0026] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0027] Figure 1 A flow chart of an inter-process communication method provided by an embodiment of the present disclosure;
[0028] Figure 2 A schematic diagram of an application scenario provided by an embodiment of the present disclosure;
[0029] Figure 3 A flowchart of an inter-process communication method provided by another embodiment of the present disclosure;
[0030] Figure 4 A signaling diagram of an inter-process communication method provided by another embodiment of the present disclosure;
[0031] Figure 5 A schematic diagram of the structure of an inter-process communication device provided in an embodiment of the present disclosure;
[0032] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features in the embodiments can be combined with each other without conflict.
[0034] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0035] In inter-process communication technology, pipes, message queues, sockets, etc. are required to meet the needs of data interaction. Among them, there are limitations on the use scenarios of pipes. For example, the two communicating processes need to have a blood relationship. Although the use of sockets is relatively stable and widespread, the latency is high. The message queue communication performance based on the system interface is the worst; and the message queue based on the operating system has high latency and slow response. Therefore, a message queue based on shared memory is proposed, but this shared memory-based message queue generally needs to be implemented in multiple blood-related processes, that is, the two communicating processes need to be in a parent-child relationship, which greatly limits the use of shared memory-based message queues. To address this problem, the embodiments of the present disclosure provide an inter-process communication method, which is described below in conjunction with specific embodiments.
[0036] Figure 1 A flow chart of the inter-process communication method provided by the embodiment of the present disclosure. The method can be applied to Figure 2 The application scenario shown includes an electronic device 20, in which at least one client process 21 and at least one service process 22 are running. The electronic device 20 may be a terminal, for example, a smart phone, a PDA, a tablet computer, a wearable device with a display screen, a desktop computer, a laptop computer, an all-in-one machine, a smart home device, etc. It should be noted that the at least one client process 21 and the at least one service process 22 must be in the same electronic device 20. It is understandable that the inter-process communication method provided in the embodiment of the present disclosure may also be applied in other scenarios.
[0037] Combine the following Figure 2 The application scenario shown is Figure 1 The inter-process communication method shown in the figure is introduced, and the specific steps of the method are as follows:
[0038] S101: After the service process establishes a connection with the global shared memory, the client process obtains a first identifier of the global shared memory, and establishes a connection with the global shared memory according to the first identifier.
[0039] The service process 22 establishes a connection with the global shared memory provided by the operating system. The first identifier of the global shared memory is used to indicate its address, storage capacity, etc. The client process 21 obtains the first identifier of the global shared memory by reading the system configuration, and establishes a connection with the global shared memory according to the first identifier, that is, both the client process 21 and the service process 22 establish a connection with the global shared memory.
[0040] S102: The client process creates a shared memory for communication, and records a second identifier of the shared memory for communication in a global array of the global shared memory.
[0041] After the client process 21 is connected to the global shared memory, a shared memory for communication is created based on the global shared memory. The second identifier of the shared memory for communication is used to indicate the address, storage capacity and other information of the shared memory for communication. There is a global array in the above-mentioned global shared memory, and the client process 21 records the second identifier of the shared memory for communication in the global array. It should be noted that the second identifier of the shared memory for communication created by the same client process each time it runs can be the same or different.
[0042] S103: After the service process obtains the second identifier from the global array, the service process establishes a connection with the shared memory used for communication according to the second identifier.
[0043] Since the global array exists in the global shared memory, the client process 21 and the service process 22 can both access the global array after establishing a connection with the global shared memory. The service process 22 accesses the global array, obtains the second identifier recorded by the client process 21 in the global array in S102, and establishes a connection with the corresponding shared memory for communication according to the second identifier.
[0044] S104: The client process communicates with the service process through the shared memory used for communication.
[0045] After both the client process 21 and the service process 22 establish a connection with the shared memory for communication corresponding to the second identifier, data exchange can be performed based on the shared memory for communication.
[0046] The disclosed embodiment is as follows: after the service process establishes a connection with the global shared memory, the client process obtains the first identifier of the global shared memory and establishes a connection with the global shared memory according to the first identifier; the client process creates a shared memory for communication and records the second identifier of the shared memory for communication in the global array of the global shared memory; after the service process obtains the second identifier from the global array, the service process establishes a connection with the shared memory for communication according to the second identifier; the client process communicates with the service process through the shared memory for communication. By creating a shared memory for communication based on the global shared memory, the client process and the service process establish a connection with the shared memory for communication through a label, and complete data interaction based on the shared memory for communication, the communication efficiency is greatly improved, and the client process and the service process can communicate based on the shared memory without having a blood relationship, which improves the use restrictions of inter-process communication based on the shared memory, thereby improving the flexibility of inter-process communication while ensuring efficient communication.
[0047] Figure 3A flow chart of an inter-process communication method provided by another embodiment of the present disclosure is as follows: Figure 3 As shown, the method includes the following steps:
[0048] S301: After the service process establishes a connection with the global shared memory, the service process creates a first queue and a second queue in the global shared memory.
[0049] Among them, the first queue is the sending queue of the client process in the global shared memory, and the first queue is the receiving queue of the service process in the global shared memory; the second queue is the sending queue of the service process in the global shared memory, and the second queue is the receiving queue of the client process in the global shared memory.
[0050] After the service process 22 establishes a connection with the global shared memory, two message queues are created based on the global shared memory for data interaction, namely the first queue and the second queue. Among them, the first queue is the sending queue of the client process 21 in the global shared memory, and it is also the receiving queue of the service process 22 in the global shared memory; the second queue is the sending queue of the service process 22 in the global shared memory, and it is also the receiving queue of the client process 21 in the global shared memory. In other words, the client process 21 sends data to the service process 22 through the first queue, and receives data from the service process 22 through the second queue; the service process 22 receives data from the client process 21 through the first queue, and sends data to the client process 21 through the second queue.
[0051] S302: The client process obtains a first identifier of the global shared memory, and establishes a connection with the global shared memory according to the first identifier.
[0052] Specifically, the implementation process and principle of S302 and S101 are the same, and will not be repeated here.
[0053] S303: The client process creates a shared memory for communication, and the client process creates a third queue and a fourth queue in the shared memory for communication.
[0054] The third queue is a sending queue of the client process in the shared memory for communication, and the third queue is a receiving queue of the service process in the shared memory for communication; the fourth queue is a sending queue of the service process in the shared memory for communication, and the fourth queue is a receiving queue of the client process in the shared memory for communication. The global shared memory includes the shared memory for communication.
[0055] The client process 21 creates a shared memory for communication in the global shared memory corresponding to the first identifier, that is, the global shared memory includes the shared memory for communication. The client process 21 creates two other message queues in the shared memory for communication for data interaction, namely the third queue and the fourth queue. Among them, the third queue is the sending queue of the client process 21 in the shared memory for communication, and it is also the receiving queue of the service process 22 in the shared memory for communication; the fourth queue is the sending queue of the service process 22 in the shared memory for communication, and it is also the receiving queue of the client process 21 in the shared memory for communication. In other words, the client process 21 sends data to the service process 22 through the third queue, and receives data from the service process 22 through the fourth queue; the service process 22 receives data from the client process 21 through the third queue, and sends data to the client process 21 through the fourth queue. It can be understood that if there are multiple client processes, each client process will create a set of third queues and fourth queues on its respective shared memory for communication, that is, each client process corresponds to a set of third queues and fourth queues, and each service process may correspond to one or more sets of third queues and fourth queues; multiple shared memories for communication can exist in a global shared memory.
[0056] S304: The client process records the second identifier of the shared memory used for communication in the global array of the global shared memory.
[0057] Specifically, the implementation process and principle of S304 and S102 are the same, and will not be repeated here.
[0058] S305: The client process sends notification information to the service process through the first queue, where the notification information is used to prompt the service process to traverse the global array.
[0059] After recording the second identifier of the shared memory used for communication in the global array, the client process 21 generates notification information, and further, the client process 21 can put the notification information into the first queue. The service process 22 traverses the receiving queue, and when the notification information is traversed, the service process 22 can read the notification information from the first queue, parse the notification information, and traverse the global array to obtain the second identifier in the global array.
[0060] S306: After the service process obtains the second identifier from the global array, the service process establishes a connection with the shared memory used for communication according to the second identifier.
[0061] Specifically, the implementation process and principle of S306 and S103 are the same, and will not be repeated here.
[0062] S307: The service process sends confirmation information to the client process through the second queue.
[0063] After the service process 22 establishes a connection with the shared memory for communication corresponding to the second identifier, it sends a confirmation message to the client process 21 through the second queue to inform the client process 21 that a connection has been successfully established with the shared memory for communication.
[0064] S308: The client process sends a message to be processed to the service process through the third queue.
[0065] S309: The service process processes the message to be processed to obtain a processing result.
[0066] S310. The service process sends the processing result to the client process through the fourth queue.
[0067] The client process 21 sends a message to be processed to the service process 22 through the third queue, and sends a notification message to the service process 22, notifying the service process 22 to receive the message to be processed; after receiving the notification message, the service process 22 receives the message to be processed through the third queue and processes it. After the processing is completed, the service process 22 sends the processing result to the client process 21 through the fourth queue, and the client process 21 receives the processing result through the fourth queue. It can be understood that S308 to S310 can be executed in a loop until the client process 21 obtains the expected processing result.
[0068] The disclosed embodiment creates a message queue in a global shared memory to establish a communication connection between processes, and notifies through a signal after the connection is successful; another message queue is created in the shared memory used for communication, which is used for communication between processes. The communicating processes do not need to have a blood relationship, but can still communicate based on the shared memory, which not only ensures low latency and high response of communication, but also avoids the limitation of blood relationship between communication processes. At the same time, each client process has its own receiving and sending message queues, which further improves the flexibility of the inter-process communication method.
[0069] Figure 4 A signaling diagram of an inter-process communication method provided by another embodiment of the present disclosure, such as Figure 4 As shown, the method includes the following steps:
[0070] S401, the service process creates a monitoring event and waits for the event.
[0071] When the service process 22 is started, a monitoring event is created internally and waits for an event. The monitoring event is used to monitor the notification information sent by the client process 21 and make corresponding response actions.
[0072] S402: The service process establishes a connection with the global shared memory.
[0073] S403: The service process creates a first queue and a second queue in the global shared memory.
[0074] S404: The client process obtains a first identifier of the global shared memory, and establishes a connection with the global shared memory according to the first identifier.
[0075] S405: The client process creates a shared memory for communication, and creates a third queue and a fourth queue in the shared memory for communication.
[0076] S406: The client process records the second identifier of the shared memory used for communication in the global array of the global shared memory.
[0077] S407: The client process sends notification information to the service process through the first queue, where the notification information is used to prompt the service process to traverse the global array.
[0078] S408: The service process traverses the global array, obtains the second identifier, and then establishes a connection with the shared memory used for communication according to the second identifier.
[0079] S409: The service process sends confirmation information to the client process through the second queue.
[0080] Specifically, the implementation process and principle of S402 to S409 are consistent with those of S301 to S307, and will not be described in detail here.
[0081] S410: The service process waits for an event.
[0082] After both the service process 22 and the client process 21 are connected to the shared memory for communication, the service process 22 waits for notification information sent by the client process 21 .
[0083] S411. The client process sends a message to be processed to the service process through the third queue.
[0084] S412: The service process traverses the third queue, receives messages to be processed, and processes the messages to be processed to obtain processing results.
[0085] S413: The service process sends the processing result to the client process through the fourth queue.
[0086] Specifically, the implementation process and principle of S411 to S413 are consistent with those of S308 to S310, and will not be repeated here.
[0087] The disclosed embodiment creates a monitoring event in the service process and waits for the event. The monitoring event mechanism promptly responds to the received information, thereby ensuring that the service process can process the information in the message queue in a timely manner, further improving the efficiency of inter-process communication and reducing delay time.
[0088] Figure 5 The schematic diagram of the structure of the inter-process communication device provided by the embodiment of the present disclosure. The inter-process communication device provided by the embodiment of the present disclosure can execute the processing flow provided by the embodiment of the inter-process communication method, and is characterized in that the device is set in an electronic device, and at least one client process and at least one service process are running in the electronic device, such as Figure 5 As shown, the inter-process communication device 500 includes: an acquisition module 510, a creation module 520, a recording module 530, a connection establishment module 540, and a communication module 550; wherein the acquisition module 510 is used for the client process to acquire the first identifier of the global shared memory after the service process establishes a connection with the global shared memory, and to establish a connection with the global shared memory according to the first identifier; the creation module 520 is used for the client process to create a shared memory for communication; the recording module 530 is used for the client process to record the second identifier of the shared memory for communication in the global array of the global shared memory; the connection establishment module 540 is used for the service process to establish a connection with the shared memory for communication according to the second identifier after the service process acquires the second identifier from the global array; the communication module 550 is used for the client process to communicate with the service process through the shared memory for communication.
[0089] Optionally, the acquisition module 510 is also used for: after the service process establishes a connection with the global shared memory, the service process creates a first queue and a second queue in the global shared memory. Accordingly, the recording module 530 is also used for the client process to send notification information to the service process through the first queue, and the notification information is used to prompt the service process to traverse the global array; accordingly, the connection establishment module 540 is also used for the service process to send confirmation information to the client process through the second queue. Among them, the first queue is the sending queue of the client process in the global shared memory, and the first queue is the receiving queue of the service process in the global shared memory; the second queue is the sending queue of the service process in the global shared memory, and the second queue is the receiving queue of the client process in the global shared memory.
[0090] Optionally, the creation module 520 is further used for the client process to create a third queue and a fourth queue in the shared memory used for communication;
[0091] Correspondingly, the communication module 550 is also used for the client process to send a message to be processed to the service process through the third queue; the service process processes the message to be processed to obtain a processing result; and the service process sends the processing result to the client process through the fourth queue. The third queue is the sending queue of the client process in the shared memory for communication, and the third queue is the receiving queue of the service process in the shared memory for communication; the fourth queue is the sending queue of the service process in the shared memory for communication, and the fourth queue is the receiving queue of the client process in the shared memory for communication.
[0092] Optionally, the global shared memory includes the shared memory used for communication.
[0093] Figure 5 The inter-process communication device of the illustrated embodiment can be used to execute the technical solution of the above-mentioned method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0094] Figure 6 The electronic device provided by the embodiment of the present disclosure can execute the processing flow provided by the embodiment of the inter-process communication method, such as Figure 6 As shown, the electronic device 60 includes: a memory 61, a processor 62, a computer program and a communication interface 63; wherein the computer program is stored in the memory 61 and is configured so that the processor 62 executes the above-mentioned inter-process communication method.
[0095] In addition, an embodiment of the present disclosure further provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the inter-process communication method described in the above embodiment.
[0096] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the inter-process communication method as described above is implemented.
[0097] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0098] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An inter-process communication method, characterized in that: Applied to an electronic device, wherein at least one client process and at least one service process are running in the electronic device, the method comprises: After the service process establishes a connection with the global shared memory, the client process obtains a first identifier of the global shared memory, and establishes a connection with the global shared memory according to the first identifier; The client process creates a shared memory for communication, and records a second identifier of the shared memory for communication in a global array of the global shared memory; After the service process obtains the second identifier from the global array, the service process establishes a connection with the shared memory for communication according to the second identifier; The client process communicates with the service process through the shared memory for communication; After the service process establishes a connection with the global shared memory, the method further includes: The service process creates a first queue in the global shared memory; Correspondingly, after the client process creates a shared memory for communication and records the second identifier of the shared memory for communication in the global array of the global shared memory, the method further includes: The client process sends notification information to the service process through the first queue, where the notification information is used to prompt the service process to traverse the global array.
2. The method according to claim 1, characterized in that After the service process establishes a connection with the global shared memory, the method further includes: The service process creates a second queue in the global shared memory; Correspondingly, after the service process establishes a connection with the shared memory for communication according to the second identifier, the method further includes: The service process sends confirmation information to the client process through the second queue.
3. The method according to claim 2, characterized in that The first queue is a sending queue of the client process in the global shared memory, and the first queue is a receiving queue of the service process in the global shared memory; The second queue is a sending queue of the service process in the global shared memory, and the second queue is a receiving queue of the client process in the global shared memory.
4. The method according to claim 1, characterized in that: After the client process creates a shared memory for communication, the method further comprises: The client process creates a third queue and a fourth queue in the shared memory for communication; Accordingly, the client process communicates with the service process through the shared memory for communication, including: The client process sends a message to be processed to the service process through the third queue; The service process processes the message to be processed to obtain a processing result; The service process sends the processing result to the client process through the fourth queue.
5. The method according to claim 4, characterized in that The third queue is a sending queue of the client process in the shared memory for communication, and the third queue is a receiving queue of the service process in the shared memory for communication; The fourth queue is a sending queue of the service process in the shared memory for communication, and the fourth queue is a receiving queue of the client process in the shared memory for communication.
6. The method according to claim 1, characterized in that The global shared memory includes the shared memory used for communication.
7. An inter-process communication device, characterized in that: The device is arranged in an electronic device, wherein at least one client process and at least one service process are running in the electronic device, and the device comprises: an acquisition module, configured to enable the client process to acquire a first identifier of the global shared memory after the service process establishes a connection with the global shared memory, and to establish a connection with the global shared memory according to the first identifier; A creation module, used for the client process to create a shared memory for communication; A recording module, used for the client process to record the second identifier of the shared memory used for communication in the global array of the global shared memory; a connection establishing module, configured to establish a connection between the service process and the shared memory for communication according to the second identifier after the service process obtains the second identifier from the global array; A communication module, used for the client process to communicate with the service process through the shared memory for communication; The acquisition module is further used for: after the service process establishes a connection with the global shared memory, the service process creates a first queue in the global shared memory; Correspondingly, the recording module is also used for the client process to send notification information to the service process through the first queue, and the notification information is used to prompt the service process to traverse the global array.
8. The device according to claim 7, characterized in that The acquisition module is further used for: after the service process establishes a connection with the global shared memory, the service process creates a second queue in the global shared memory; Correspondingly, the connection establishment module is also used for the service process to send confirmation information to the client process through the second queue.
9. The device according to claim 8, characterized in that The first queue is a sending queue of the client process in the global shared memory, and the first queue is a receiving queue of the service process in the global shared memory; The second queue is a sending queue of the service process in the global shared memory, and the second queue is a receiving queue of the client process in the global shared memory.
10. The device according to claim 7, characterized in that The creation module is also used for the client process to create a third queue and a fourth queue in the shared memory for communication; Correspondingly, the communication module is also used for the client process to send a message to be processed to the service process through the third queue; The service process processes the message to be processed to obtain a processing result; The service process sends the processing result to the client process through the fourth queue.
11. The device according to claim 10, characterized in that The third queue is a sending queue of the client process in the shared memory for communication, and the third queue is a receiving queue of the service process in the shared memory for communication; The fourth queue is a sending queue of the service process in the shared memory for communication, and the fourth queue is a receiving queue of the client process in the shared memory for communication.
12. The device according to claim 7, characterized in that The global shared memory includes the shared memory used for communication.
13. An electronic device, characterized in that: include: Memory; processor; as well as Computer programs; The computer program is stored in the memory and is configured to be executed by the processor to implement the method according to any one of claims 1 to 6.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Copy-free inter-process communication system and method
CN112416625A