CN117435363A - Inter-process communication method, system, device, electronic equipment and medium - Google Patents

Inter-process communication method, system, device, electronic equipment and medium Download PDF

Info

Publication number
CN117435363A
CN117435363A CN202311385918.8A CN202311385918A CN117435363A CN 117435363 A CN117435363 A CN 117435363A CN 202311385918 A CN202311385918 A CN 202311385918A CN 117435363 A CN117435363 A CN 117435363A
Authority
CN
China
Prior art keywords
communication
inter
processes
communication link
network data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311385918.8A
Other languages
Chinese (zh)
Inventor
李彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202311385918.8A priority Critical patent/CN117435363A/en
Publication of CN117435363A publication Critical patent/CN117435363A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Abstract

The application discloses an inter-process communication method, an inter-process communication system, an inter-process communication device, electronic equipment and a medium, and belongs to the technical field of communication. The method comprises the following steps: under the condition that at least two first processes of the first process type have inter-process communication, a first communication link is established, wherein the first communication link is a link for communication between the processes of the first process type; inter-process communication between at least two first processes is performed over a first communication link.

Description

Inter-process communication method, system, device, electronic equipment and medium
Technical Field
The application belongs to the technical field of communication, and particularly relates to an inter-process communication method, system, device, electronic equipment and medium.
Background
At present, information transfer between applications in electronic devices is achieved through inter-process communication. In the existing inter-process communication scheme, all processes need to transmit information one by one through a common system inter-process communication link according to time sequence.
However, when the information to be processed existing on the inter-process communication link is too much, a large number of application programs delay receiving the inter-process information because the information to be processed needs to be queued for processing, which results in low inter-process communication efficiency.
Disclosure of Invention
The embodiment of the application aims to provide an inter-process communication method, an inter-process communication system, an inter-process communication device, electronic equipment and a medium, which can solve the problem of low inter-process communication efficiency.
In a first aspect, an embodiment of the present application provides an inter-process communication method, where the method includes: under the condition that at least two first processes of the first process type have inter-process communication, a first communication link is established, wherein the first communication link is a link for communication between the processes of the first process type; inter-process communication between at least two first processes is performed over a first communication link.
In a second aspect, an embodiment of the present application provides an interprocess communication system, which includes an application layer, a framework layer, and a system kernel space; the system kernel space comprises a first kernel space, wherein the first kernel space is used for establishing a first communication link, and the first communication link is an inter-process communication link of a first process type; the application layer is used for providing services for the running application program; the framework layer is used to determine the flow and interaction between system functions.
In a third aspect, an embodiment of the present application provides an inter-process communication apparatus, where the apparatus includes an establishment module and an execution module; the establishing module is used for establishing a first communication link under the condition that at least two first processes of the first process type have inter-process communication, wherein the first communication link is a link for communication between the processes of the first process type; and the execution module is used for executing inter-process communication between at least two first processes through the first communication link.
In a fourth aspect, embodiments of the present application provide an electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the method as described in the first aspect.
In a fifth aspect, embodiments of the present application provide a readable storage medium having stored thereon a program or instructions which when executed by a processor implement the steps of the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and where the processor is configured to execute a program or instructions to implement a method according to the first aspect.
In a seventh aspect, embodiments of the present application provide a computer program product stored in a storage medium, the program product being executable by at least one processor to implement the method according to the first aspect.
In the embodiment of the present application, a first communication link may be established when at least two first processes of the first process type have inter-process communication, where the first communication link is a link for communication between processes of the first process type; and performing inter-process communication between at least two first processes via the first communication link. By the scheme, the exclusive communication link can be established for the processes of the same type with the inter-process communication so as to be used for executing the inter-process communication among the processes of the same type, so that all the processes can be prevented from being crowded on the inter-process communication link of the system, the time for receiving the inter-process information by the application program can be shortened, and the inter-process communication efficiency is improved.
Drawings
FIG. 1 is one of the flowcharts of the inter-process communication method provided in the embodiments of the present application;
FIG. 2 is a schematic view of a process region of a first process type in a kernel space of a system in an inter-process communication method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a first communication link in an inter-process communication method according to an embodiment of the present application;
FIG. 4 is a second flowchart of an inter-process communication method according to an embodiment of the present application;
FIG. 5 is a third flowchart of an inter-process communication method provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of a third process in the inter-process communication method according to the embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an inter-process communication performed by a third process in the inter-process communication method according to the embodiment of the present application;
FIG. 8 is a fourth flowchart of an inter-process communication method provided by an embodiment of the present application;
FIG. 9 is a schematic diagram of network data communication between a fourth process and a fifth process in the inter-process communication method according to the embodiment of the present application;
FIG. 10 is a fifth flowchart of an inter-process communication method provided by an embodiment of the present application;
FIG. 11 is a schematic diagram of an interprocess communication apparatus provided in an embodiment of the application;
fig. 12 is a schematic diagram of an electronic device provided in an embodiment of the present application;
Fig. 13 is a hardware schematic of an electronic device according to an embodiment of the present application.
Detailed Description
Technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application are within the scope of the protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or otherwise described herein, and that the objects identified by "first," "second," etc. are generally of a type and do not limit the number of objects, for example, the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The term "indication" in this application may be either a direct indication (or an explicit indication) or an indirect indication (or an implicit indication). The direct indication may be understood that the sender explicitly informs the specific information of the receiver, the operation to be executed, the request result, and other contents in the sent indication; the indirect indication may be understood as that the receiving side determines corresponding information according to the indication sent by the sending side, or determines and determines an operation or a request result to be executed according to a determination result.
The terms "at least one," "at least one," and the like in the description and in the claims of the present application mean that they encompass any one, any two, or a combination of two or more of the objects. For example, at least one of a, b, c (item) may represent: "a", "b", "c", "a and b", "a and c", "b and c" and "a, b and c", wherein a, b, c may be single or plural. Similarly, the term "at least two" means two or more, and the meaning of the expression is similar to the term "at least one".
The following describes in detail, by means of specific embodiments and application scenarios thereof, an inter-process communication method, a system, an apparatus, an electronic device and a medium provided in the embodiments of the present application with reference to the accompanying drawings.
Currently, in a system of a mobile terminal, information transfer between application programs is realized through inter-process communication. Inter-process communication is a communication way of sharing messages between one process and another, and is mainly used for message passing between different processes in a computer system. The process is the minimum unit of computer resource allocation, and each process has own virtual address space and is isolated from the virtual address spaces of other processes; that is, one process can only access its own virtual address space, and cannot access the virtual address space of the other process.
In order to enable the different processes to access and coordinate with each other, the operating system of the mobile terminal provides various inter-process communication mechanisms, mainly including broadcasting, message queues, memory sharing, content Provider (i.e., content Provider), and android interface definition language (Android Interface Definition Language, AIDL), etc.
However, the existing inter-process communication mechanisms all depend on unified resources and communication links of the system, and all processes need to transmit information through the common inter-process communication links of the system one by one according to time sequence. This can have the problem that a large number of applications delay receiving cross-process information when there is a shortage of system memory resources, system stuck, or even if there is no shortage of system resources, there is too much information to be processed on the system inter-process communication link. This results in inefficient inter-process communication.
In order to solve the above problems, embodiments of the present application provide an inter-process communication method, system, device, electronic apparatus, and medium. The inter-process communication method provided by the embodiment of the application can be applied to the scene of information transmission among different processes.
In the inter-process communication method provided in the embodiment of the present application, a first communication link may be established when at least two first processes of a first process type have inter-process communication, where the first communication link is a link for communication between processes of the first process type; and performing inter-process communication between at least two first processes via the first communication link. By the scheme, the exclusive communication link can be established for the processes of the same type with the inter-process communication so as to be used for executing the inter-process communication among the processes of the same type, so that all the processes can be prevented from being crowded on the inter-process communication link of the system, the time for receiving the inter-process information by the application program can be shortened, and the inter-process communication efficiency is improved.
It should be noted that, in the inter-process communication method provided in the embodiment of the present application, the execution body may be an inter-process communication device, an electronic device, or a functional module in the electronic device. In some embodiments of the present application, an electronic device executes an inter-process communication method as an example, which illustrates the inter-process communication method provided in the embodiments of the present application.
Fig. 1 shows a flowchart of an inter-process communication method provided in an embodiment of the present application. As shown in fig. 1, the inter-process communication method provided in the embodiment of the present application may include the following steps 101 and 102.
Step 101, the electronic device establishes a first communication link in case there is inter-process communication of at least two first processes of the first process type.
Wherein the first communication link is a link for communication between processes of the first process type.
In this embodiment of the present application, the at least two first processes are running processes.
It should be noted that, one application running in an electronic device generally corresponds to one process, and in a very small number of scenarios, two processes may also be corresponding.
Optionally, in this embodiment of the present application, the first process type may be any process type, such as a music type, a video type, a navigation type, an input method type, or an instant messaging type.
Alternatively, in the embodiment of the present application, the process type of a process may be determined by the electronic device according to the application package name corresponding to the process.
For example, if the application package name corresponding to a process is "XX navigation", the electronic device may determine that the process type of the process is a navigation class according to the application package name.
Optionally, in this embodiment of the present application, there is inter-process communication between the at least two first processes, that is, at least two processes in the at least two first processes are performing inter-process communication.
For example, assuming that the at least two first processes include a process a, a process b, a process c, and a process d, the at least two first processes can be considered to have inter-process communication when the process a and the process b are performing inter-process communication or when the process a and the process b are performing inter-process communication and the process c and the process d are performing inter-process communication.
Alternatively, in the embodiment of the present application, the first communication link may be a dedicated link for communication between processes of the first process type.
Optionally, in this embodiment of the present application, the first communication link is an inter-process communication link, and may specifically be a communication pipe or a message queue.
For example, as shown in fig. 2, in the case where it is detected that there is an inter-process communication between the process 1 and the process 2 of the first process type (i.e., the at least two first processes), the electronic device may first open up a process area 21 of the first process type separately in the system kernel space for establishing the first communication link. Then, as shown in fig. 3, the electronic device can individually establish the first communication link 22 for communication between processes of the first process type based on the process 1 and the process 2 in the process area 21, so that the process 1 and the process 2 can directly perform transmission of communication information through the first communication link 22 without queuing to transmit communication information on the common inter-process communication link 23. In this way, the efficiency of inter-process communication between processes of the same type can be improved.
Alternatively, in the embodiment of the present application, as shown in fig. 4 in conjunction with fig. 1, the above step 101 may be specifically implemented by the following step 101 a.
Step 101a, when at least two first processes of the first process type have inter-process communication, and there is more than or equal to a first amount of information to be processed on the inter-process communication link of the system, the electronic device establishes a first communication link.
In this embodiment of the present application, the inter-process communication link of the system, that is, the default or preset inter-process communication link of the system, each process running in the electronic device may perform inter-process communication through the inter-process communication link of the system.
In this embodiment of the present application, the information to be processed is communication information to be sent or received by a process that performs inter-process communication.
Alternatively, in the embodiment of the present application, the first number may be preset for the system, or may be set according to actual use requirements. It should be noted that, when the first amount of information to be processed exists on the inter-process communication link of the system, it may be considered that more information to be processed exists on the inter-process communication link of the system, and at this time, transmission of the process communication information in queuing may be blocked, thereby causing delay of inter-process communication.
Exemplarily, assume that a music application 1 and a music application 2 are installed in the electronic device, and that there is no resource for song a in the music application 1, resulting in that song a cannot be played; in order not to affect the user experience, the user may cross-process query whether the music application 2 has the resource of song a, and if the music application 2 has the resource of song a, the user may jump to the music application 2 to play song a.
However, in the inter-process communication of the related art, when the system resources are intense and the information to be processed existing on the inter-process communication link of the system is greater than or equal to the first number, the process a corresponding to the music application 1 may not be able to timely communicate with the process B corresponding to the music application 2. In this embodiment of the present application, the electronic device may establish a new communication link (i.e. the first communication link) for the process a and the process B to transmit communication information, so as to determine whether the music application 2 has the resource of the song a, without queuing on the system inter-process communication link, so that the delay of inter-process communication may be reduced.
Optionally, in the embodiment of the present application, when the number of pieces of information to be processed on the inter-process communication link of the system is smaller than the first number, it may be considered that the number of pieces of information to be processed on the inter-process communication link of the system is smaller, and at this time, the electronic device may also need not to establish the first communication link, and still use the inter-process communication link of the system to perform inter-process communication.
In this embodiment of the present application, the electronic device may establish the first communication link only when the first amount of information to be processed exists on the inter-process communication link of the system, so as to alleviate blocking of the inter-process communication link of the system, that is, the electronic device may determine whether to establish the first communication link according to the blocking condition of the inter-process communication link of the system, so that performance and power consumption of inter-process communication may be balanced.
Step 102, the electronic device performs inter-process communication between at least two first processes through the first communication link.
Optionally, in the embodiment of the present application, the electronic device may directly send the cross-process information transmitted between the at least two first processes to the first communication link, so as to perform inter-process communication between the at least two first processes.
Alternatively, in the embodiment of the present application, as shown in fig. 5 in conjunction with fig. 1, the above step 102 may be specifically implemented by the following steps 102a and 102 b.
In step 102a, the electronic device runs a third process on the first communication link in case at least two second processes of the at least two first processes comprise the first dependency library.
Wherein the third process includes only the first dependency library.
In this embodiment of the present application, the at least two second processes may be part or all of the at least two first processes.
It should be noted that, applications of the same type typically have the same implementation of functions, and implementing the same functions typically has the same code resources or dependency libraries, etc. The dependency library is a complete repository created by the tenant that introduces dependencies in the setup page of the project and uses the tenant library. Roles in the repository include cloud repository, code repository, branch management, document upload, view/download, and release software packages, the storage directory structure of the software package repository file repository.
Alternatively, in embodiments of the present application, a process may include at least one dependency library, each for supporting implementation of a function.
Optionally, in an embodiment of the present application, the first dependency library is used to support implementation of a first function.
Optionally, in this embodiment of the present application, the first function may be any function that is commonly owned by all application programs corresponding to the at least two second processes; for example, the function may be any possible function such as a play function or a download function.
Optionally, in this embodiment of the present application, after the electronic device runs the third process on the first communication link, the first dependency library included in each second process of the at least two second processes may be deleted, that is, the electronic device may separately pull the first dependency library from each second process, so as to save a system storage space.
Optionally, in the embodiment of the present application, after the electronic device runs the third process on the first communication link, the first dependency library included in each second process may be further reserved.
Optionally, in an embodiment of the present application, the third process may be configured to share the first dependency library with each of the second processes.
Illustratively, as shown in fig. 6, assuming that the at least two second processes include a process 1 and a process 2, and that the process 1 and the process 2 each include a dependency library a (i.e., the first dependency library described above), the electronic device may run a process a (i.e., the third process) including the dependency library a on the first communication link to share the dependency library a with the process 1 and the process 2, while deleting the dependency library a included in the process 1 and the process 2. Thus, the electronic device can draw a plurality of dependency libraries A in the process into one dependency library A so as to reduce the system memory.
Step 102b, the electronic device performs inter-process communication between at least two second processes through the third process.
Optionally, in the embodiment of the present application, after the electronic device runs the third process, each of the at least two second processes may use the first dependency library in the third process to perform a function call, so that the electronic device may directly perform inter-process communication between the at least two second processes in the third process.
Optionally, in the embodiment of the present application, the electronic device may store the identifier of each second process in the third process, so as to facilitate accurate communication information transfer during the process of executing inter-process communication between the at least two second processes.
Alternatively, in the embodiment of the present application, the identifier of a process may be any possible identifier, such as a package name or a name abbreviation, of an application program corresponding to the process.
For example, as shown in fig. 7, assuming that the at least two second processes include a process 1 and a process 2, and the third process is a process a, the electronic device may store the identifier of the process 1 and the identifier of the process 2 in the process a in advance, so as to accurately determine the transfer object of the communication information in the process of transferring the communication information by the process 1 and the process 2.
Optionally, in the embodiment of the present application, the electronic device may further store a result mapping table of the at least two second processes in the third process, and if one second process of the at least two second processes needs certain result data, the result mapping table may be directly obtained from the result mapping table.
In the embodiment of the present application, in the case where the at least two second processes include the first dependency library, the electronic device may directly perform inter-process communication between the at least two second processes through the third process including only the first dependency library running on the first communication link, so that the process of inter-process communication may be simplified.
Optionally, in an embodiment of the present application, the inter-process communication between the at least two first processes may include: and network data communication between a fourth process and a fifth process in the at least two first processes. Illustratively, in connection with fig. 1, as shown in fig. 8, the above-described step 102 may be implemented specifically by the following steps 102c and 102 d.
Step 102c, the electronic device sends a network data request message corresponding to the fourth process through the first communication link.
The network data request message is used for requesting to acquire the first network data required by the fourth process, and the network data request message includes the identifier of the fifth process.
Alternatively, in the embodiment of the present application, the fourth process and the fifth process may be: any two processes of network data communication exist in the at least two first processes.
In addition, in the process of executing inter-process communication, the electronic device may call a system resource besides a resource inside a process, for example, call a network channel resource to share to perform inter-process communication between multiple processes of the same type. When network data requests are involved between processes of the same type, some of the same network data, e.g., music songs or trade names, etc., are also typically requested.
In this embodiment of the present application, the identifier of the fifth process may be used for the electronic device to determine the fifth process.
Optionally, in an embodiment of the present application, the identifier of the fifth process may be carried in an encapsulation parameter of the network data request message.
Optionally, in the embodiment of the present application, the electronic device may obtain the identifier of the fifth process through invoking a system interface.
Optionally, in the embodiment of the present application, the electronic device may send the network data request message to a server corresponding to the fourth process through the first communication link and the system network model, so as to request to acquire the first network data.
Alternatively, in the embodiment of the present application, the system network model may be a network seven-layer model, where the network seven-layer model refers to an open system interconnection (Open System Interconnect, OSI) reference model, which divides network communications into seven layers, each layer having different functions and protocols, and from top to bottom: an application layer, a network representation layer, a session layer, a transport layer, a network layer, a data link layer, a physical layer.
Step 102d, the electronic device distributes the first network data to the fourth process and the fifth process, respectively, when receiving the first network data.
It should be noted that, since the fourth process and the fifth process have the same process type, the first network data is also the network data required by the fifth process with a high probability; in the related art, network data required by each process needs to send a network data request message to request for acquisition, and after acquiring the network data requested by one network data request message, the electronic device only sends the network data to the corresponding process.
Optionally, in the embodiment of the present application, the electronic device distributes the received first network data to the fourth process and the fifth process, respectively, without sending the received first network data to the fifth process through the fourth process, so as to indirectly implement inter-process communication between the fourth process and the fifth process through network access.
Optionally, in the embodiment of the present application, the electronic device may distribute the first network data to the fourth process and the fifth process through a network representation layer of the network seven-layer model.
Optionally, in this embodiment of the present application, the fourth process may also include an identifier of the fifth process, and when the presentation layer distributes the first network data, the fifth process may be accurately determined according to the identifier of the fifth process, and the first network data may be distributed to the fifth process.
For example, as shown in fig. 9, assuming that the application 1 corresponding to the process 1 (i.e. the fourth process) needs to transfer network result information (i.e. the first network data) to the application 2 corresponding to the process 2 of the same type (i.e. the fifth process), the electronic device may first call the system interface to obtain the identifier of the process 2, and then, when sending the network data request message corresponding to the process 1, may carry the identifier of the process 2 in the network data request message; in this way, when the network result information sent by the server corresponding to the process 1 is received, the network representation layer in the system network model can find the process 2 to transmit according to the identifier of the process 2 in the process 1, so that the transmission efficiency of the inter-process transmission network data can be greatly improved.
In the embodiment of the present application, the electronic device may indirectly implement the inter-process communication between the fourth process and the fifth process through the initiated network data request, so that the process of inter-process communication may be further simplified.
In the inter-process communication method provided by the embodiment of the application, because the exclusive communication link can be established for the process of the same type with the inter-process communication to be used for executing the inter-process communication among the processes of the same type, all the processes can be prevented from being crowded on the inter-process communication link of the system, so that the time for receiving the inter-process information by the application program can be shortened, and the inter-process communication efficiency is improved.
Optionally, in the embodiment of the present application, as shown in fig. 10 in conjunction with fig. 1, after the step 102, the inter-process communication method provided in the embodiment of the present application may further include the following step 103.
Step 103, the electronic device executes the first processing on the first communication link in case that the processes of the first process type are all terminated.
Wherein the first process includes any one of: deletion processing and closing processing.
Optionally, in the embodiment of the present application, the processes of the first process type terminate running, that is, the electronic device system background does not have the process of the first process type.
Optionally, in the embodiment of the present application, the deleting process deletes the first communication link, and a process area of the first process type in a kernel space of the system.
Optionally, in the embodiment of the present application, the closing process closes the first communication link, and a process area of the first process type in a kernel space of the system.
Optionally, in an embodiment of the present application, closing the first communication link may include: the first communication link is placed in an idle state or a dormant state.
In the embodiment of the present application, in the case where the processes of the first process type all terminate running, the electronic device may perform the deletion process or the closing process on the first communication link, so that when communication between the processes of the first process type is not required, resources of the system may be saved.
The foregoing method embodiments, or various possible implementation manners in the method embodiments, may be executed separately, or may be executed in combination with each other on the premise that no contradiction exists, and may be specifically determined according to actual use requirements, which is not limited by the embodiments of the present application.
The embodiment of the application also provides an inter-process communication system, as shown in fig. 2, which comprises an application layer, a framework layer and a system kernel space. The system kernel space may include a first kernel space 21, the first kernel space 21 being configured to establish a first communication link, the first communication link being an inter-process communication link of a first process type; the application layer may be used to provide services for running applications; the framework layer may be used to determine the flow and interaction between system functions.
In one possible implementation, the first communication link is established in the presence of greater than or equal to a first amount of information to be processed on an inter-process communication link established in the kernel space of the system for communication between any of the processes.
In a possible implementation manner, the first communication link is operable to: a third process comprising a first dependency library, and at least two second processes of the first process type. At least two second processes can communicate with each other through the third process, and the second processes comprise the first dependency library.
In a possible implementation manner, the system may further include a network representation layer, where the fourth process and the fifth process of the first process type run on the first communication link. The first communication link may be configured to send a network data request message corresponding to the fourth process, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process; the network representation layer may be configured to distribute the first network data to the fourth process and the fifth process, respectively, upon receipt of the first network data.
In a possible implementation manner, in a case where the processes of the first process type all terminate running, a first process may be performed on the first communication link, where the first process includes any one of the following: deletion processing and closing processing.
For a specific description of the embodiments of the present application and the technical effects achieved by each technical feature, reference may be made to the related description in the foregoing method embodiments, and in order to avoid repetition, a description is omitted herein. According to the inter-process communication method provided by the embodiment of the application, the execution subject can be an inter-process communication device. In the embodiment of the present application, an inter-process communication device executes an inter-process communication method by using an inter-process communication device as an example, and the inter-process communication device provided in the embodiment of the present application is described.
As shown in fig. 11, an embodiment of the present application provides an inter-process communication device 110, where the inter-process communication device 110 may include a setup module 111 and an execution module 112.
The establishing module 111 may be configured to establish a first communication link when at least two first processes of a first process type have inter-process communication, where the first communication link is a link for communication between processes of the first process type. An execution module 112 may be configured to perform inter-process communication between the at least two first processes via the first communication link.
In a possible implementation manner, the establishing module 111 may be specifically configured to establish the first communication link when at least two first processes of the first process type have inter-process communication, and there is greater than or equal to a first amount of information to be processed on a system inter-process communication link.
In a possible implementation manner, the execution module 112 may be specifically configured to execute a third process on the first communication link, where at least two second processes of the at least two first processes include a first dependency library, and the third process includes only the first dependency library; and performing inter-process communication between the at least two second processes through the third process.
In one possible implementation manner, the inter-process communication between the at least two first processes includes: and network data communication between a fourth process and a fifth process in the at least two first processes. The execution module 112 may be specifically configured to send, through the first communication link, a network data request message corresponding to the fourth process, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process; and distributing the first network data to the fourth process and the fifth process, respectively, upon receipt of the first network data.
In a possible implementation manner, the execution module 112 may be further configured to perform a first process on the first communication link when the processes of the first process type terminate running after performing the inter-process communication between the at least two first processes through the first communication link; wherein the first treatment comprises any one of: deletion processing and closing processing.
In the inter-process communication device provided by the embodiment of the application, because the inter-process communication device can establish a dedicated communication link for the processes of the same type with inter-process communication, which are used for executing the inter-process communication between the processes of the same type, all the processes can be prevented from crowding the inter-process communication link of the system, so that the time for receiving the inter-process information by the application program can be shortened, and the inter-process communication efficiency is improved.
The inter-process communication device in the embodiments of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. By way of example, the electronic device may be a mobile phone, tablet computer, notebook computer, palm computer, vehicle-mounted electronic device, mobile internet appliance (Mobile Internet Device, MID), augmented reality (augmented reality, AR)/Virtual Reality (VR) device, robot, wearable device, ultra-mobile personal computer, UMPC, netbook or personal digital assistant (personal digital assistant, PDA), etc., but may also be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and the embodiments of the present application are not limited in particular.
The inter-process communication device in the embodiments of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The inter-process communication device provided in the embodiment of the present application can implement each process implemented by the above method embodiment, so as to achieve the same technical effect, and in order to avoid repetition, a detailed description is omitted here.
As shown in fig. 12, the embodiment of the present application further provides an electronic device 1200, including a processor 1201 and a memory 1202, where the memory 1202 stores a program or an instruction that can be executed on the processor 1201, and the program or the instruction implements the steps of the inter-process communication method embodiment as described above when executed by the processor 1201, and can achieve the same technical effects, so that repetition is avoided, and no redundant description is given here.
It should be noted that, the electronic device in the embodiment of the present application includes a mobile electronic device and a non-mobile electronic device.
Fig. 13 is a schematic hardware structure of an electronic device implementing an embodiment of the present application.
As shown in fig. 13, the electronic device 1000 includes, but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, and processor 1010.
Those skilled in the art will appreciate that the electronic device 1000 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 1010 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 13 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 1010 may be configured to establish a first communication link when at least two first processes of a first process type have inter-process communication, where the first communication link is a link for communication between processes of the first process type; and performing inter-process communication between the at least two first processes over the first communication link.
In a possible implementation manner, the processor 1010 may be specifically configured to establish the first communication link when at least two first processes of the first process type have inter-process communication, and there is greater than or equal to a first amount of information to be processed on the inter-process communication link of the system.
In a possible implementation manner, the processor 1010 may be specifically configured to, in a case where at least two second processes of the at least two first processes include a first dependency library, run a third process on the first communication link, where the third process includes only the first dependency library; and performing inter-process communication between the at least two second processes through the third process.
In one possible implementation manner, the inter-process communication between the at least two first processes includes: and network data communication between a fourth process and a fifth process in the at least two first processes. The processor 1010 may be specifically configured to send, through the first communication link, a network data request message corresponding to the fourth process, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process; and distributing the first network data to the fourth process and the fifth process, respectively, upon receipt of the first network data.
In a possible implementation manner, the processor 1010 may be further configured to perform a first process on the first communication link when the processes of the first process type terminate running after performing the inter-process communication between the at least two first processes through the first communication link; wherein the first treatment comprises any one of: deletion processing and closing processing.
In the electronic device provided by the embodiment of the application, because the electronic device can establish the dedicated communication link for the process of the same type with the inter-process communication to be used for executing the inter-process communication between the processes of the same type, all the processes can be prevented from crowding the inter-process communication link of the system, so that the time for receiving the inter-process information by the application program can be shortened, and the inter-process communication efficiency is improved.
It should be understood that in the embodiment of the present application, the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042, and the graphics processor 10041 processes image data of still pictures or videos obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 can include two portions, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
The memory 1009 may be used to store software programs as well as various data. The memory 1009 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 1009 may include volatile memory or nonvolatile memory, or the memory 1009 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 1009 in embodiments of the present application includes, but is not limited to, these and any other suitable types of memory.
The processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, and the like, and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 1010.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction realizes each process of the above-mentioned inter-process communication method embodiment, and the same technical effect can be achieved, so that repetition is avoided, and no further description is provided herein.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes computer readable storage medium such as computer readable memory ROM, random access memory RAM, magnetic or optical disk, etc.
The embodiment of the application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is configured to run a program or an instruction, implement each process of the above-mentioned inter-process communication method embodiment, and achieve the same technical effect, so as to avoid repetition, and not be repeated here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
The embodiments of the present application provide a computer program product stored in a storage medium, where the program product is executed by at least one processor to implement the respective processes of the above-described inter-process communication method embodiments, and achieve the same technical effects, and are not described herein in detail for avoiding repetition.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solutions of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those of ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are also within the protection of the present application.

Claims (15)

1. An inter-process communication method, the method comprising:
establishing a first communication link under the condition that at least two first processes of a first process type have inter-process communication, wherein the first communication link is a link for communication between the processes of the first process type;
and executing the inter-process communication between the at least two first processes through the first communication link.
2. The method of claim 1, wherein the establishing a first communication link comprises:
the first communication link is established in the presence of greater than or equal to a first amount of information to be processed on an inter-process communication link of the system.
3. The method according to claim 1 or 2, wherein said performing said at least two first inter-process communications over said first communication link comprises:
running a third process on the first communication link, the third process comprising only the first dependent library, in case at least two second processes of the at least two first processes comprise first dependent libraries;
and executing the inter-process communication between the at least two second processes through the third process.
4. The method according to claim 1 or 2, wherein the inter-process communication between the at least two first processes comprises: network data communication between a fourth process and a fifth process in the at least two first processes;
said performing, via said first communication link, inter-process communication between said at least two first processes, comprising:
sending a network data request message corresponding to the fourth process through the first communication link, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process;
and distributing the first network data to the fourth process and the fifth process respectively under the condition that the first network data is received.
5. The method of claim 1, wherein after performing the inter-process communication between the at least two first processes over the first communication link, the method further comprises:
executing a first process on the first communication link in the event that the processes of the first process type all terminate running;
wherein the first process comprises any one of: deletion processing and closing processing.
6. An interprocess communication system, wherein the system comprises an application layer, a framework layer and a system kernel space;
the system kernel space comprises a first kernel space, wherein the first kernel space is used for establishing a first communication link, and the first communication link is an inter-process communication link of a first process type;
the application layer is used for providing services for the running application program;
the framework layer is used to determine the flow and interaction between system functions.
7. The system of claim 6, wherein the first communication link is established in the presence of greater than or equal to a first amount of information to be processed on a system inter-process communication link established in the system kernel space for communication between any of the processes.
8. The system of claim 6 or 7, wherein the first communication link is operable to: a third process comprising a first dependency library, and at least two second processes of said first process type;
at least two second processes can communicate with each other through the third process, and the second processes comprise the first dependency library.
9. The system of claim 6 or 7, further comprising a network representation layer, wherein the first communication link has fourth and fifth processes of the first process type running thereon;
the first communication link is configured to send a network data request message corresponding to the fourth process, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process;
the network representation layer is configured to distribute the first network data to the fourth process and the fifth process, respectively, when the first network data is received.
10. The system of claim 6, wherein, in the event that processes of the first process type each terminate execution, a first process is performed on the first communication link, the first process comprising any one of: deletion processing and closing processing.
11. An inter-process communication apparatus, the apparatus comprising a setup module and an execution module;
the establishing module is used for establishing a first communication link under the condition that at least two first processes of a first process type have inter-process communication, wherein the first communication link is a link for communication between the processes of the first process type;
The execution module is configured to execute inter-process communication between the at least two first processes through the first communication link.
12. The apparatus of claim 11, wherein the device comprises a plurality of sensors,
the execution module is specifically configured to, in a case where at least two second processes of the at least two first processes include a first dependency library, run a third process on the first communication link, where the third process includes only the first dependency library; and executing inter-process communication between the at least two second processes through the third process.
13. The apparatus of claim 11, wherein the inter-process communication between the at least two first processes comprises: network data communication between a fourth process and a fifth process in the at least two first processes;
the execution module is specifically configured to send, through the first communication link, a network data request message corresponding to the fourth process, where the network data request message is used to request to obtain first network data required by the fourth process, and the network data request message includes an identifier of the fifth process; and distributing the first network data to the fourth process and the fifth process respectively under the condition that the first network data is received.
14. An electronic device comprising a processor and a memory storing a program or instructions executable on the processor, which when executed by the processor, implement the steps of the inter-process communication method of any of claims 1-5.
15. A readable storage medium, characterized in that it stores thereon a program or instructions, which when executed by a processor, implement the steps of the inter-process communication method according to any of claims 1-5.
CN202311385918.8A 2023-10-24 2023-10-24 Inter-process communication method, system, device, electronic equipment and medium Pending CN117435363A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311385918.8A CN117435363A (en) 2023-10-24 2023-10-24 Inter-process communication method, system, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311385918.8A CN117435363A (en) 2023-10-24 2023-10-24 Inter-process communication method, system, device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN117435363A true CN117435363A (en) 2024-01-23

Family

ID=89556366

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311385918.8A Pending CN117435363A (en) 2023-10-24 2023-10-24 Inter-process communication method, system, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN117435363A (en)

Similar Documents

Publication Publication Date Title
US10467025B2 (en) Managing delivery of code and dependent data using application containers
US11829787B2 (en) Multi-process model for cross-platform applications
US9794365B2 (en) Re-establishing push notification channels via user identifiers
KR101702698B1 (en) Adaptive process importance
CN110300328B (en) Video playing control method and device and readable storage medium
WO2020052337A1 (en) Information processing method and apparatus, storage medium, and electronic device
US20060253548A1 (en) Method and system for hosting and executing a component application
EP4210053A1 (en) Application program control method and apparatus, electronic device, and storage medium
AU2019256257B2 (en) Processor core scheduling method and apparatus, terminal, and storage medium
WO2023005197A1 (en) Content display method and terminal
WO2023087766A1 (en) Dual-system communication method and apparatus, and electronic device and computer-readable storage medium
EP2304567A2 (en) Method and apparatus for providing a synchronous interface for an asynchronous service
US8938522B2 (en) Tiered XML services in a content management system
CN113127775B (en) Page loading method, device, equipment and storage medium
CN117435363A (en) Inter-process communication method, system, device, electronic equipment and medium
CN115373869A (en) Process processing method and device based on AAR and electronic equipment
CN111770043A (en) Game data communication method, device, storage medium and electronic equipment
WO2023173896A1 (en) Communication method, electronic device and readable storage medium
CN109168079B (en) Bullet screen message distribution method, device, equipment and storage medium
CN116880761A (en) Data read-write method, device and equipment based on cloud storage and interface server
CN117170891A (en) Message processing method, device and equipment
CN117435323A (en) Application function processing method and device, electronic equipment and storage medium
CN115550004A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN117692359A (en) Port monitoring method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination