Method and device for inter-process communication

By using multiple IPC channel backup mechanisms in inter-process communication, IPC failure caused by single channel failure is solved, ensuring normal operation of services, and improving communication reliability and efficiency.

CN116450370BActive Publication Date: 2025-08-26BEIJING YOUZHUJU NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210013965.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-06
Publication Date
2025-08-26
Estimated Expiration
2042-01-06

AI Technical Summary

Technical Problem

When using a single IPC channel to achieve inter-process communication, a channel failure causes IPC failure, affecting the normal operation of the service.

Method used

Multiple IPC channels are used as backups, the target IPC channel is determined through configuration information or priority, and switch to the backup channel when the channel fails to ensure smooth communication.

Benefits of technology

Even if one IPC channel fails, inter-process communication can be realized through other available channels, ensuring normal operation of services, and improving the reliability and efficiency of communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450370B_ABST
    Figure CN116450370B_ABST
Patent Text Reader

Abstract

The present application discloses a method for inter-process communication. In one example, if a first process needs to send a message to a second process, the first process can determine a target IPC channel from a plurality of IPC channels, and send the message to be sent to the second process through the target IPC channel. The first process is the process of the installation-free application, and the second process is the core process of the installation-free framework; or, the first process and the second process are both processes of the installation-free application. Since the possibility of the multiple IPC channels failing at the same time is extremely small, even if one of the IPC channels fails, the first process can determine a target IPC channel that is not failing from the multiple IPC channels, thereby implementing IPC to ensure normal business operation. It can be seen that by utilizing this solution, IPC failures between the second process and the first process in the installation-free application can be avoided, thereby ensuring normal business operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of inter-process communication, and in particular to a method and apparatus for inter-process communication. Background Art

[0002] In some scenarios, such as installation-free scenarios, some services require inter-process communication (IPC). For example, a process in a game application needs to use an IPC channel to send a request to the main process of the game application. The main process handles the request and returns the result, and the game application performs related logical processing based on the result.

[0003] Currently, IPC is implemented through a single IPC channel. This means that when the channel fails, it will cause IPC failure and thus business failure.

[0004] Therefore, a solution is urgently needed to solve the above problems. Summary of the Invention

[0005] The technical problem to be solved by this application is: when using a single IPC channel to implement IPC, if the channel fails, it will cause IPC failure, and a method and device for inter-process communication are provided.

[0006] In a first aspect, an embodiment of the present application provides a method for inter-process communication, the method comprising:

[0007] The first process determines a target IPC channel from a plurality of inter-process communication IPC channels;

[0008] The first process sends the message to be sent to the second process through the target IPC channel; wherein:

[0009] The first process is a process of the installation-free application, and the second process is a core process of the installation-free framework; or, both the first process and the second process are processes of the installation-free application.

[0010] Optionally, the first process determines a target IPC channel from multiple inter-process communication IPC channels, including:

[0011] The first process determines a target IPC channel from the multiple IPC channels according to the configuration information.

[0012] Optionally, the multiple IPC channels include:

[0013] Content Provider channel and Service channel.

[0014] Optionally, the Content Provider channel and the Service channel serve as backups for each other. When a currently used channel among the Content Provider channel and the Service channel fails, the other channel is switched to.

[0015] Optionally, if the ContentProvider channel is not faulty, the target IPC channel is the ContentProvider channel; if the ContentProvider channel is faulty, the target IPC channel is the Service channel.

[0016] Optionally, if the Service channel does not fail, the target IPC channel is the Service channel; if the Service channel fails, the target IPC channel is the ContentProvider channel.

[0017] Optionally, the target IPC channel is a Service channel, and before sending the message to be sent to the second process, the method further includes:

[0018] The first process is bound to the Service channel.

[0019] Optionally, binding the first process to the Service channel includes:

[0020] The first process sends a request to the Service component to bind the Service channel and performs a locking operation;

[0021] The first process receives a confirmation message for the request returned by the Service component.

[0022] In a second aspect, an embodiment of the present application provides an inter-process communication apparatus, applied to a first process, the apparatus comprising:

[0023] A determination unit, configured to determine a target IPC channel from a plurality of inter-process communication IPC channels;

[0024] A sending unit, configured to send the message to be sent to the second process through the target IPC channel;

[0025] in:

[0026] The first process is a process of the installation-free application, and the second process is a core process of the installation-free framework; or, both the first process and the second process are processes of the installation-free application.

[0027] Optionally, the determining unit is configured to:

[0028] A target IPC channel is determined from the multiple IPC channels according to the configuration information.

[0029] Optionally, the multiple IPC channels include:

[0030] Content Provider channel and Service channel.

[0031] Optionally, the Content Provider channel and the Service channel serve as backups for each other. When a currently used channel among the Content Provider channel and the Service channel fails, the other channel is switched to.

[0032] Optionally, if the ContentProvider channel is not faulty, the target IPC channel is the ContentProvider channel; if the ContentProvider channel is faulty, the target IPC channel is the Service channel.

[0033] Optionally, if the Service channel is not faulty, the target IPC channel is the Service channel; if the Service channel is faulty, the target IPC channel is the ContentProvider channel.

[0034] Optionally, the target IPC channel is a Service channel, and the device further includes:

[0035] The binding unit is used to bind the Service channel before sending the message to be sent to the second process.

[0036] Optionally, the binding unit is used to:

[0037] Before sending the message to be sent to the second process, send a request to bind the Service channel to the Service component and perform a locking operation;

[0038] Receive a confirmation message for the request returned by the Service component.

[0039] In a third aspect, an embodiment of the present application provides a device, comprising a processor and a memory;

[0040] The processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the first aspects above.

[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that it includes instructions, and the instructions instruct a device to execute any method described in the first aspect above.

[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.

[0043] Compared with the prior art, the embodiments of the present application have the following advantages:

[0044] An embodiment of the present application provides a method for inter-process communication. In one example, if a first process needs to send a message to a second process, the first process can determine a target IPC channel from a plurality of IPC channels, and send the message to be sent to the second process through the target IPC channel. The first process is the process of the installation-free application, and the second process is the core process of the installation-free framework; or, the first process and the second process are both processes of the installation-free application. Since the possibility of the multiple IPC channels failing at the same time is extremely small, even if one of the IPC channels fails, the first process can determine a target IPC channel that is not failing from the multiple IPC channels, thereby implementing IPC to ensure normal business operation. It can be seen that by utilizing this solution, IPC failures between the second process and the first process in the installation-free application can be avoided, thereby ensuring normal business operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0046] Figure 1 A flowchart of an inter-process communication method provided in an embodiment of the present application;

[0047] Figure 2 A schematic diagram provided for an embodiment of the present application;

[0048] Figure 3 A schematic diagram of the structure of an inter-process communication device provided in an embodiment of the present application;

[0049] Figure 4 A schematic diagram of the structure of a device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to help those skilled in the art better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0051] Various non-limiting embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0052] Exemplary Methods

[0053] See also Figure 1 , which is a flow chart of a method for inter-process communication provided by an embodiment of the present application. In one example, the method can be used to implement inter-process communication in an installation-free framework.

[0054] Regarding the free installation framework, it should be noted that:

[0055] Installation-free technology provides a complete virtual operating environment. Applications that utilize this technology are also known as "installation-free apps." These apps can achieve the same performance as installed apps without needing to be installed on the operating system. The operating system can run platform applications, which in turn can run the installation-free framework, which is used to implement the installation-free technology.

[0056] Figure 1 The method shown may include, for example, the following steps S101 - S102 .

[0057] S101: A first process determines a target IPC channel from multiple IPC channels.

[0058] S102: The first process sends the message to be sent to the second process through the target IPC channel, wherein: the first process is the process of the installation-free application, and the second process is the core process of the installation-free framework; or, the first process and the second process are both processes of the installation-free application.

[0059] In an embodiment of the present application, multiple IPC channels may be provided for implementing IPC. If a first process needs to send a message to a second process, a target IPC channel may be first determined from the multiple IPC channels, and the message to be sent may be sent to the second process via the target IPC channel.

[0060] The target IPC channel is an available IPC channel among the multiple IPC channels. The available IPC channel mentioned here may refer to an IPC channel that has not experienced any failure.

[0061] The first process may be a process of an installation-free application, such as a process of an installation-free game. The second process may be a core process of an installation-free framework. In another example, the first process and the second process are both processes of the installation-free application, the first process being one of the processes of the installation-free application, and the second process being the main process of the installation-free application. The main process refers to the first process that runs when the installation-free application is started.

[0062] In one implementation of the embodiment of the present application, the first process may determine the target IPC channel from the multiple IPC channels according to the configuration information.

[0063] In one example: the configuration information may indicate one of the multiple IPC channels as the default channel, and indicate that the other IPC channels are used as backup channels. In some embodiments, the multiple IPC channels include a first IPC channel and a second IPC channel, and the configuration information indicates that the first IPC channel is the default channel and the second IPC channel is the backup channel. Then, the first process may determine the first IPC channel as the target IPC channel if the first IPC channel is not faulty, and the first process may determine the second IPC channel as the target IPC channel if the first IPC channel is faulty. The first process may determine that the default channel is faulty if it sends a message to the second process through the default channel but does not receive a response returned by the second process.

[0064] In another example: the configuration information includes the priorities corresponding to the multiple IPC channels, and the first process preferentially determines the IPC channel with a high priority as the target IPC channel. When the IPC with a high priority fails, the target IPC channel is determined from the other IPC channels in descending order of priority. For example, the multiple IPC channels include a first IPC channel, a second IPC channel, and a third IPC channel, and the configuration information indicates that the priority of the first IPC channel is higher than the priority of the second IPC channel, and the priority of the second IPC channel is higher than the priority of the third IPC channel. Then the first process can determine the first IPC channel as the target IPC channel if the first IPC channel does not fail; if the first IPC channel fails and the second IPC channel does not fail, the first process determines the second IPC channel as the target IPC channel; if both the first IPC channel and the second IPC channel fail, the first process determines the third IPC channel as the target IPC channel.

[0065] Regarding the multiple IPC channels, the present application embodiment does not make specific limitations. In one example, if the operating system carrying the free installation framework is an Android system, the multiple IPC channels can be content provider channels and service channels. Figure 2 To understand, Figure 2 A schematic diagram provided for an embodiment of the present application. Figure 2 In the example, a ContentProvider channel and a Service channel are located between the first process 201 and the second process 202. In this case, the ContentProvider channel and the Service channel serve as backups for each other. If one of the two channels fails, the other channel is switched to. Both ContentProvider and Service are components of the Android system and are not described in detail here.

[0066] In one example, considering that the Service is mainly used to process background-related operations, the ContentProvider channel can be determined as the default IPC channel, and the Service channel can be used as a backup channel, or the priority of the ContentProvider channel can be set higher than the priority of the Service channel. That is, the ContentProvider channel is used first to implement IPC, and in the event that the ContentProvider channel fails, the Service channel is used to implement IPC. In this case, if the current channel (i.e., the ContentProvider channel) does not fail, the target IPC channel is the ContentProvider channel; if the current channel (i.e., the ContentProvider channel) fails, it switches to another channel (i.e., the Service channel). In this case, the target IPC channel is the Service channel.

[0067] In another example, since the time consumption of the Service channel is less than that of the ContentProvider channel, the Service channel can be determined as the default IPC channel, and the ContentProvider channel can be used as a backup channel, or the priority of the Service channel can be set higher than the priority of the ContentProvider channel. That is, the Service channel is used first to implement IPC, and in the event of a failure in the Service channel, the ContentProvider channel is used to implement IPC. In this case, if the current channel (i.e., the Service channel) has not failed, the target IPC channel is the Service channel; if the current channel (i.e., the Service channel) fails, it switches to another channel (i.e., the ContentProvider channel). In this case, the target IPC channel is the ContentProvider channel. This solution can reduce the time consumption of inter-process communication and improve communication efficiency.

[0068] In an embodiment of the present application, if the first process and the second process communicate using a Service channel, the communication between the two is asynchronous. In this case, the first process can bind the Service channel before using the Service channel to send data to the second process, thereby realizing synchronous communication. Wherein: when the first process binds the Service channel, for example, it can send a request to bind the Service channel to the Service component. After sending the request, the first process performs a locking operation to wait for a confirmation message from the Service component. After the first process receives the confirmation message returned by the Service component for the request, it is considered that the first process has successfully bound the Service channel. At this time, the first process can use the Service channel to communicate synchronously with the second process. It should be noted that the so-called execution of the locking operation means that the first process no longer interacts with other processes for data.

[0069] As can be seen from the above description, since the possibility of multiple IPC channels failing simultaneously is extremely small, even if one of the IPC channels fails, the first process can still determine the target IPC channel that is not failing from the multiple IPC channels, thereby implementing IPC to ensure normal business operation. It can be seen that the solution provided by the embodiment of the present application can avoid IPC failures between the second process and the first process in the installation-free application, thereby ensuring normal business operation.

[0070] Exemplary devices

[0071] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.

[0072] See also Figure 3 , which is a schematic diagram of the structure of an inter-process communication device provided by an embodiment of the present application. The device 300 may specifically include: a determining unit 301 and a sending unit 302.

[0073] The determining unit 301 is configured to determine a target IPC channel from a plurality of inter-process communication IPC channels;

[0074] The sending unit 302 is used to send the message to be sent to the second process through the target IPC channel; wherein: the first process is the process of the installation-free application, and the second process is the core process of the installation-free framework; or, the first process and the second process are both processes of the installation-free application.

[0075] Optionally, the determining unit 301 is configured to:

[0076] A target IPC channel is determined from the multiple IPC channels according to the configuration information.

[0077] Optionally, the multiple IPC channels include:

[0078] Content Provider channel and Service channel.

[0079] Optionally, the Content Provider channel and the Service channel serve as backups for each other. When a currently used channel among the Content Provider channel and the Service channel fails, the other channel is switched to.

[0080] Optionally, if the ContentProvider channel is not faulty, the target IPC channel is the ContentProvider channel; if the ContentProvider channel is faulty, the target IPC channel is the Service channel.

[0081] Optionally, if the Service channel is not faulty, the target IPC channel is the Service channel; if the Service channel is faulty, the target IPC channel is the ContentProvider channel.

[0082] Optionally, the target IPC channel is a Service channel, and the device further includes:

[0083] The binding unit is used to bind the Service channel before sending the message to be sent to the second process.

[0084] Optionally, the binding unit is used to:

[0085] Before sending the message to be sent to the second process, send a request to bind the Service channel to the Service component and perform a locking operation;

[0086] Receive a confirmation message for the request returned by the Service component.

[0087] Since the device 300 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 300 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 300, please refer to the description part of the above method embodiment, which will not be repeated here.

[0088] An embodiment of the present application further provides a device, the device comprising a processor and a memory;

[0089] The processor is configured to execute instructions stored in the memory, so that the device executes the method described in any one of the above method embodiments.

[0090] Reference below Figure 4 , which shows a schematic structural diagram of an electronic device 400 suitable for implementing an embodiment of the present application. The electronic devices in the embodiments of the present application may include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (portable Android devices), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs (televisions) and desktop computers. Figure 4 The electronic device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.

[0091] like Figure 4As shown, the electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 401, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 402 or a program loaded from a storage device 408 into a random access memory (RAM) 403. Various programs and data required for the operation of the electronic device 400 are also stored in the RAM 403. The processing device 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.

[0092] Typically, the following devices may be connected to the I / O interface 405: an input device 406 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 407 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 408 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 409. The communication device 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 4 The electronic device 400 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.

[0093] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 409, or installed from the storage device 408, or installed from the ROM 402. When the computer program is executed by the processing device 401, the above-mentioned functions defined in the method of the embodiment of the present application are performed.

[0094] The electronic device provided in the embodiment of the present application and the method for inter-process communication provided in the above embodiment belong to the same inventive concept. For technical details not fully described in this embodiment, please refer to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0095] An embodiment of the present application provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method for inter-process communication as described in any of the above embodiments is implemented.

[0096] It should be noted that the computer-readable medium mentioned above in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0097] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0098] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0099] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the above-mentioned inter-process communication method.

[0100] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0101] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0102] The units involved in the embodiments described in this application may be implemented by software or hardware. In some cases, the name of a unit / module does not constitute a limitation of the unit itself. For example, a voice data acquisition module may also be described as a "data acquisition module."

[0103] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0104] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0105] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0106] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

[0107] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for inter-process communication, characterized in that: The method comprises: The first process determines a target IPC channel from a plurality of inter-process communication IPC channels according to configuration information, wherein the plurality of IPC channels include: a content provider ContentProvider channel and a service Service channel, wherein: the configuration information indicates one of the plurality of IPC channels as a default channel and indicates that the other IPC channels are used as backup channels; or, the configuration information includes priorities corresponding to the plurality of IPC channels, and the first process preferentially determines an IPC channel with a high priority as the target IPC channel. When the IPC with a high priority fails, the target IPC channel is determined from the other IPC channels in descending order of priority; The first process sends the message to be sent to the second process through the target IPC channel; wherein: The first process is a process of the free-installation application, and the second process is a core process of the free-installation framework; or, the first process and the second process are both processes of the free-installation application; If the target IPC channel is a Service channel, the communication between the first process and the second process is asynchronous. Before sending the message to be sent to the second process, the method further includes: binding the first process to the Service channel so that the first process and the second process communicate synchronously.

2. The method according to claim 1, characterized in that The Content Provider channel and the Service channel serve as backups for each other. When a currently used channel among the Content Provider channel and the Service channel fails, the other channel is switched to.

3. The method according to claim 1 or 2, characterized in that If the ContentProvider channel is not faulty, the target IPC channel is the ContentProvider channel; if the ContentProvider channel is faulty, the target IPC channel is the Service channel.

4. The method according to claim 1 or 2, characterized in that If the Service channel is not faulty, the target IPC channel is the Service channel; if the Service channel is faulty, the target IPC channel is the ContentProvider channel.

5. The method according to claim 1, characterized in that Binding the first process to the Service channel includes: The first process sends a request to the Service component to bind the Service channel and performs a locking operation; The first process receives a confirmation message for the request returned by the Service component.

6. An inter-process communication device, characterized in that: Applied to the first process, the apparatus includes: a determining unit, configured to determine a target IPC channel from a plurality of inter-process communication (IPC) channels according to configuration information, the plurality of IPC channels including a content provider (ContentProvider) channel and a service (Service) channel, wherein the configuration information indicates one of the plurality of IPC channels as a default channel and indicates that the other IPC channels are used as backup channels; or, the configuration information includes priorities corresponding to the plurality of IPC channels, the first process preferentially determines an IPC channel with a high priority as the target IPC channel, and when the IPC with the high priority fails, determines the target IPC channel from the other IPC channels in descending order of priority; A sending unit, configured to send the message to be sent to the second process through the target IPC channel, wherein: The first process is a process of the free-installation application, and the second process is a core process of the free-installation framework; or, the first process and the second process are both processes of the free-installation application; If the target IPC channel is a Service channel, the communication between the first process and the second process is asynchronous, and the apparatus further includes: The binding unit is configured to bind the Service channel before sending the message to be sent to the second process, so as to enable synchronous communication between the first process and the second process.

7. A device for inter-process communication, characterized in that The device includes a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the device performs the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Shared multi-channel process communication memory structure and method

    CN110532109A