Inter-process communication method, apparatus, storage medium, and chip

CN117014495BActive Publication Date: 2026-10-09BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210480803.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2026-10-09
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

[0004]然而,在请求进程需要同时调用RPC通信方案的接口与IPC通信方案的接口,来调用服务的情况下,需要用户采用不同的操作方式来调用不同的通信方案,导致用户使用请求进程所在客户端的复杂度较高

Benefits of technology

[0046] The inter-process communication method proposed in this disclosure integrates IPC, RPC, and CPC communication schemes to provide a unified interface to the client. Within this interface, different service request instructions are generated according to different application scenarios. Based on the service request instructions, the target communication path and target transmission path adapted to the current application scenario are determined. The target service is invoked through the target communication path and the target service status is adjusted through the target transmission path.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117014495B_ABST
    Figure CN117014495B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an inter-process communication method, device, storage medium and chip, and belongs to the technical field of inter-process communication. The method comprises: a control request process acquiring a service request instruction, the service request instruction being used to instruct a service process to call a target service and instruct a target communication path and a target transmission path between the request process and the service process; the service process being located on a client or a server; the control request process sending the service request instruction to the service process through the target communication path to call the target service; and in the case that the target service is called, the control request process sending a control instruction to the service process through the target transmission path, the control instruction being used to instruct the service process to adjust a working state of the target service. The inter-process communication method provided by the present disclosure can make the client unaware of the interaction details in different communication schemes, thereby reducing the number of operations of the user and bringing convenience to the operation of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of inter-process communication technology, and in particular to an inter-process communication method, apparatus, storage medium and chip. Background Technology

[0002] In the field of software development, inter-process communication is a capability that large-scale software needs to have. Inter-process communication is the transmission or exchange of information between different processes.

[0003] In related technologies, when a requesting process needs to call a service in a service process, if the requesting process and the service process are located on different devices, the requesting process calls the interface of the RPC (remote procedure call) communication scheme to call the service in the service process; if the requesting process and the service process are located on the same device, the requesting process calls the interface of the IPC (inter-process communication) communication scheme to call the service in the service process.

[0004] However, when the requesting process needs to call both the RPC and IPC communication interfaces to invoke a service, users need to use different operation methods to invoke different communication schemes, resulting in higher complexity for users using the client where the requesting process is located. Summary of the Invention

[0005] To overcome the problems existing in related technologies, this disclosure provides an inter-process communication method, apparatus, storage medium, and chip.

[0006] According to a first aspect of the present disclosure, an inter-process communication method is provided, the method being applied to a client, the method comprising:

[0007] The control request process obtains a service request instruction, which is used to instruct the service process to call a target service and to indicate the target communication path and target transmission path between the request process and the service process; the service process is located on the client or server.

[0008] The requesting process is controlled to send the service request instruction to the service process through the target communication path in order to invoke the target service;

[0009] When the target service is invoked, the requesting process is controlled to send a control instruction to the service process through the target transmission path. The control instruction is used to instruct the service process to adjust the working state of the target service.

[0010] Optionally, controlling the requesting process to send the service request instruction to the service process through the target communication path includes:

[0011] The requesting process is controlled to send the service request instruction to the user manager through the target communication path, so that the user manager can forward the service request instruction to the service manager of the service process.

[0012] Optionally, the service request instruction is sent to the user management platform, so that the user manager forwards the service request instruction to the service manager of the service process, including:

[0013] The service request instruction is sent to the user management platform, so that the user manager forwards the service request instruction to the service manager of the service process based on the communication established between the user manager and the service manager.

[0014] Optionally, the communication between the user manager and the service manager includes:

[0015] At least one of wireless communication, wired communication, and cloud communication;

[0016] The cloud communication is used to invoke the target service on the cloud.

[0017] Optionally, the target transmission path is obtained through the following steps;

[0018] Based on the service request instruction, obtain the location of the requesting process and the location of the service process;

[0019] The target transmission path is determined based on the relationship between the location of the requesting process and the location of the service process.

[0020] Optionally, determining the target transmission path based on the relationship between the location of the requesting process and the location of the serving process includes:

[0021] If the requesting process and the service process are located in the same kernel of the client, the first transmission path is used as the target transmission path.

[0022] When the request process and the service process are located in different kernels of the client, the second transmission path is used as the target transmission path;

[0023] When the request process and the service process are located on the client and the server respectively, the third transmission path is used as the target transmission path;

[0024] The first transmission path, the second transmission path, and the third transmission path are different.

[0025] Optionally, the target service is obtained through the following steps:

[0026] Based on the service request instruction, obtain the device identifier and service identifier;

[0027] The target service is determined based on the device identifier and the service identifier.

[0028] According to a second aspect of the present disclosure, an inter-process communication method is provided, the method being applied to a server, the method comprising:

[0029] The control service process receives service request instructions sent by the client's request process. The service request instructions are used to call the target service from the server and to indicate the target transmission path.

[0030] The service process is controlled to invoke the target service from among multiple services registered to the service process according to the service request instruction;

[0031] The service process is controlled to receive control commands sent by the requesting process through the target transmission path;

[0032] The service process is controlled to execute the control instructions to adjust the working state of the target service.

[0033] According to a third aspect of the present disclosure, an inter-process communication apparatus is provided, the apparatus being used on a client, the apparatus comprising:

[0034] The acquisition module is configured to control the request process to acquire service request instructions, wherein the service request instructions are used to instruct the service process to call the target service, and to indicate the target communication path and target transmission path between the request process and the service process; the service process is located on the client or server.

[0035] The request instruction forwarding module is configured to control the requesting process to send the service request instruction to the service process through the target communication path in order to invoke the target service;

[0036] The data sending module is configured to, when the target service is invoked, control the requesting process to send a control instruction to the service process through the target transmission path, wherein the control instruction is used to instruct the service process to adjust the working state of the target service.

[0037] According to a fourth aspect of the present disclosure, an inter-process communication apparatus is provided, the apparatus being used on a server, the apparatus comprising:

[0038] The first receiving module is configured to control the service process to receive a service request instruction sent by the request process of the client. The service request instruction is used to call the target service from the server and to indicate the target transmission path.

[0039] The calling module is configured to control the service process to call the target service from multiple services registered to the service process according to the service request instruction;

[0040] The second receiving module is configured to control the service process to receive control commands sent by the requesting process through the target transmission path.

[0041] The execution module is configured to control the service process to execute the control instructions in order to adjust the working state of the target service.

[0042] According to a fifth aspect of the present disclosure, an inter-process apparatus is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to: implement the steps of the inter-process communication method according to any one of the first aspects, or implement the steps of the inter-process communication method according to the second aspect.

[0043] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided, having stored thereon computer program instructions that, when executed by a processor, implement the steps of the inter-process communication method described in any of the first aspects above, or implement the steps of the inter-process communication method described in the second aspect above.

[0044] According to a seventh aspect of the present disclosure, a chip is provided, including a processor and an interface; the processor is configured to read instructions to execute the steps of the inter-process communication method described in any of the first aspects above, or to implement the steps of the inter-process communication method described in the second aspect above.

[0045] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0046] The inter-process communication method proposed in this disclosure integrates IPC, RPC, and CPC communication schemes to provide a unified interface to the client. Within this interface, different service request instructions are generated according to different application scenarios. Based on the service request instructions, the target communication path and target transmission path adapted to the current application scenario are determined. The target service is invoked through the target communication path and the target service status is adjusted through the target transmission path.

[0047] In this process, the client controls the request process to call a unified interface, which can determine the target communication path and the corresponding communication scheme for the target transmission path that are suitable for the current application scenario, so as to complete the call and adjustment of the target service. This makes the client unaware of the interaction details under each communication scheme, thereby reducing the number of operations for users and bringing convenience to users to remotely call the target service.

[0048] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0049] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0050] Figure 1 This is a flowchart illustrating the steps of an inter-process communication method according to an exemplary embodiment;

[0051] Figure 2 This is a signal flow diagram illustrating how a requesting process sends service request instructions and control instructions through a communication module, according to an exemplary embodiment.

[0052] Figure 3 This is a signal flow diagram illustrating a service process receiving service request instructions and control instructions through a communication module, according to an exemplary embodiment.

[0053] Figure 4 This illustrates an IPC communication scheme and an RPC communication scheme in the related art according to an exemplary embodiment;

[0054] Figure 5 This is a schematic diagram illustrating an IPC communication scheme, an RPC communication scheme, and a CPC communication scheme integrated according to an exemplary embodiment;

[0055] Figure 6 This is a flowchart illustrating the steps of an inter-process communication method according to an exemplary embodiment;

[0056] Figure 7 This is a block diagram illustrating an inter-process communication device according to an exemplary embodiment;

[0057] Figure 8 This is a block diagram illustrating an inter-process communication device according to an exemplary embodiment;

[0058] Figure 9 This is a block diagram (general structure of a mobile terminal) illustrating an apparatus according to an exemplary embodiment;

[0059] Figure 10This is a block diagram (general structure of a server) illustrating an apparatus according to an exemplary embodiment. Detailed Implementation

[0060] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0061] It should be noted that all actions involving the acquisition of signals, information, or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where the application is located, and with the authorization granted by the owner of the relevant device.

[0062] Figure 1 This is a flowchart illustrating an inter-process communication method according to an exemplary embodiment, such as... Figure 1 As shown, the inter-process communication method used in the client includes the following steps.

[0063] In step S11, the control request process obtains a service request instruction, which is used to instruct the service process to call the target service and to indicate the target communication path and target transmission path between the request process and the service process; the service process is located on the client or server.

[0064] In this step, the request process resides on the client, while the service process resides on either the client or the server. If both the request and service processes reside on the client, it indicates that both processes are on the same device; if both processes reside on the client and the service process resides on the server, it indicates that both processes are on different devices.

[0065] The target communication path refers to the path traversed by the service request instruction, providing a communication path for the requesting process to invoke the target service within the service process. The target transmission path refers to the path traversed by the control instructions, providing a data transmission path for the requesting process to send control instructions to the service process to control the state of the target service.

[0066] Taking a computer as the client and a smart TV as the server as an example, when the computer's webcam is damaged and video calls are only possible using the smart TV's webcam, the mobile phone's request process can send a service request command to the smart TV's service process via the target communication path to request access to the smart TV's webcam. Upon successful webcam access, a communication connection is established between the mobile phone's request process and the smart TV's webcam service process. Based on this connection, the mobile phone's request process can then send control commands to the smart TV's webcam service process via the target transmission path to activate the webcam. In this way, the user can remotely control the TV webcam from their computer to conduct video calls.

[0067] The service request instruction changes according to the positional relationship between the requesting process and the service process. Specifically, when the positional information of the requesting process and the service process changes, the target communication path and the target transmission path in the service request instruction also change accordingly.

[0068] For example, when a requesting process within a mobile phone requests a target service from a service process within the same kernel within the same mobile phone, the target communication path specified in the service request instruction is the first communication path, and the target transmission path is the first transmission path; when a requesting process within a mobile phone requests a target service from a service process within another kernel within the same mobile phone, the target communication path specified in the service request instruction is the second communication path, and the target transmission path is the second transmission path; when a requesting process within a mobile phone requests a service process from a smart TV, the target communication path specified in the service request instruction is the third communication path, and the target transmission path is the third transmission path.

[0069] In step S12, the requesting process is controlled to send the service request instruction to the service process through the target communication path to invoke the target service.

[0070] In this step, the service request instruction carries a function call. After the service request instruction is sent to the service process through the target communication path, the service process can parse the function call and the specified target service from the service request instruction, determine the specified target service from the multiple registered services, and use the function call to call the target service.

[0071] In this step, the requesting process can be controlled to send the service request instruction to the user manager through the target communication path, so that the user manager can forward the service request instruction to the service manager of the service process.

[0072] The target communication path includes a first communication path, a second communication path, and a third communication path; the user manager includes a first user manager, a second user manager, and a third user manager; and the service manager includes a first service manager, a second service manager, and a third service manager.

[0073] When the requesting process and the service process are located in the same kernel of the same device, a service request instruction with a specified first communication path can be generated, and the service request instruction can be transmitted to the first service manager of the service process through the first user manager in the first communication path.

[0074] When the requesting process and the service process carried in the service request instruction are located in different kernels of the same device, a service request instruction with a specified second communication path can be generated, and the service request instruction can be transmitted to the second service manager of the service process through the second user manager in the second communication path.

[0075] When the requesting process and the service process carried in the service request instruction are located on different devices (different devices have different kernels), a service request instruction with a specified third communication path can be generated, and the service request instruction can be transmitted to the third service manager of the service process through the third user manager in the third communication path.

[0076] The first communication path refers to the instruction forwarding path under the IPC communication scheme (remote procedure call).

[0077] Specifically, please refer to Figure 2 As shown, the first communication path includes: IPC proxy object (IPC BpBinder, Binder proxy object in the IPC communication scheme), IPC local object (IPC BBinder, Binder local object in the IPC communication scheme), and first user manager (IPC Servicemanager, cross-process service management).

[0078] For example, please see Figure 2 and Figure 3 As shown, Figure 2 The signal flow diagram for the requesting process to invoke the target service. Figure 3 The signal flow diagram for registering the target service for the service process. The service process registers the target service through... Figure 3 The data packaging and transmission between the IPC proxy object and the IPC local object are performed, and multiple services are registered to the first service manager; the request process passes through... Figure 2The IPC proxy object and IPC local object in the system send the service request instruction to the first user manager; the first user manager forwards the service request instruction to the first service manager, the first service manager parses the service request instruction to obtain the target service specified by the service request instruction, and determines the target service from multiple registered services so as to call the target service through the calling function in the service request instruction.

[0079] The second communication path refers to the instruction forwarding path under the CPC (cross-core procedure call) communication scheme.

[0080] Specifically, please refer to Figure 2 As shown, the second communication path includes: CPC proxy object (CPC BpBinder, the Binder proxy object in the CPC communication scheme), CPC local object (CPC BBinder, the Binder local object in the CPC communication scheme), and second user manager (CPC Servicemanager, cross-core service management).

[0081] For example, please see Figure 2 and Figure 3 As shown, the service process passes through Figure 3 The cross-core service management proxy (Cpc SvcMgrproxy, the proxy server), CPC proxy object, CPC local object, and cross-core service management stub (Cpc SvcMgrStub, the service management stub interface) register multiple services to the second service manager; the request process passes through Figure 2 The CPC proxy object, CPC local object, and cross-core service management stub in the system forward the service request instruction to the second user manager; the second user manager forwards the service request instruction to the second service manager, the second service manager parses the service request instruction to obtain the target service specified by the service request instruction, and determines the target service from multiple registered services so as to call the target service through the calling function in the service request instruction.

[0082] The third communication path refers to the instruction forwarding path in the RPC (inter-process communication) scheme.

[0083] Specifically, please refer to Figure 2As shown, the third communication path includes: RPC proxy object (RPC BpBinder, Binder proxy object in the RPC communication scheme), RPC local object (RPC BBinder, Binder local object in the RPC communication scheme), remote cross-device service (RemoteRpcService, remote service under the RPC communication scheme), cross-device service management proxy (Rpc SvcMgr proxy, proxy server), cross-device service management stub (Rpc SvcMgrStub, service management stub interface), and third user manager (RPC Servicemanager, cross-device service management).

[0084] For example, please see Figure 2 and Figure 3 As shown, the service process passes through Figure 3 The RPC local object, RPC proxy object, cross-device service management proxy, RPC proxy object, RPC local object, and cross-device service management stub register multiple services to the third-party service manager; the request process passes through Figure 2 The RPC proxy object, RPC local object, remote cross-device service, cross-device service management proxy, RPC proxy object, RPC local object, and cross-device service management stub register the service request instruction with the third user manager; the third user manager forwards the service request instruction to the third service manager, the third service manager parses the service request instruction to obtain the target service specified by the service request instruction, and determines the target service from the multiple registered services, so as to call the target service through the calling function in the service request instruction.

[0085] Please refer to example 2 and Figure 3 As shown, in the first communication path, the first user manager and the first service manager communicate through a proxy driver (Binder Driver).

[0086] In the second communication path, the second user manager and the second service manager communicate via sockets.

[0087] In the third communication path, the third user manager and the third service manager can communicate through at least one of the following: wireless communication, wired communication, and cloud communication. Wireless communication includes, but is not limited to, the following: BT communication (which can be used in P2P peer-to-peer communication), BLE communication (Bluetooth communication), Wi-Fi (wireless network), NFC (near field wireless communication technology, such as contactless radio frequency identification, used in mobile payment, access control, mobile identity recognition, etc.), and UWB (location system); wired communication includes, but is not limited to, the following: fiber optic cable, coaxial cable, telephone line, network cable, etc.; cloud communication refers to the user manager and service manager calling the target service in the cloud.

[0088] Specifically, the service process registers multiple services registered in the service manager to the cloud; the request process sends the service request instruction in the user manager to the cloud, parses the calling function in the service request instruction in the cloud, and uses the calling function to call the target service.

[0089] When the requesting process and the service process are located on devices in different local area networks (LANs), the requesting process cannot invoke the target service in the service process. Taking a school as an example, multiple devices within a school can communicate with each other through the school's LAN, but these devices cannot communicate with devices outside the school through the same LAN. However, with cloud-based configuration, even if the service process and the requesting process are on different LANs, because multiple services in the service process are registered in the cloud, the requesting process can invoke the target service from the cloud. This enables service calls between two devices across LANs, allowing devices within the school to invoke target services on devices outside the school via the cloud, thus expanding the application of service calls between different devices to more scenarios.

[0090] For related technologies, please refer to Figure 4 As shown, processes A and B, which reside in the same kernel of the client, establish a communication connection through two communication modules. When the two communication modules reside in different processes within the same kernel of the client, a communication connection between processes A and B can be established through an IPC communication scheme. When the two communication modules reside in the client and server respectively, a communication connection between the two processes can be established through an RPC communication scheme.

[0091] In this process, when the requesting process calls the target service in the service process, the client where the requesting process is located needs to select its own scenario and call the interface of one of the communication schemes, either IPC or RPC, in order to complete the service call in the current scenario. Calling different interfaces requires the client to be aware of the interaction details in different communication schemes, requiring the user to perform different operations in different scenarios, which brings inconvenience to the user.

[0092] For example, when a user uses their mobile phone to access a camera powered by the same kernel, the user needs to activate the camera to use its services. When accessing a camera powered by a different kernel, the user needs to perform a series of settings on their phone to access the services of that specific camera. Similarly, when accessing a smart TV's camera, the user needs to perform a series of settings on their phone. Clearly, different settings and operations are required for different application scenarios, causing inconvenience for users.

[0093] This disclosure proposes to determine the current application scenario of the client by the positional relationship between the request process and the service process, determine different target transmission paths based on different application scenarios, and send service request instructions to the service process through different target transmission paths to complete the invocation of target services under different application scenarios.

[0094] For example, a mobile phone provides three services: Camera 1 (mobile phone camera processed by the same kernel), Camera 2 (mobile phone camera processed by a different kernel), and Camera 3 (smart TV camera). When the user selects Camera 3, a service request instruction will be generated based on the user's selection. The third communication path will be selected as the target communication path according to the service request instruction, and the service request instruction will be sent to the service process through the third communication path to complete the call to the target service.

[0095] For the inter-process communication method proposed in this disclosure, please refer to [link / reference]. Figure 5 As shown, the processes communicate with each other through a communication module, and the communication module in each process is equivalent to... Figure 2 and Figure 3 The interaction scheme between the target communication path and the target transmission path.

[0096] In this process, a unified interface is exposed for both the requesting and service processes, and data is transmitted between them using a unified communication scheme. Therefore, the client only needs to control the requesting process to send service request and control commands to the corresponding communication module. It does not need to concern itself with the details of data interaction within the target communication and transmission paths, thus avoiding the frequent operations required by the client to select specific target communication paths and pay attention to the interaction details, thereby simplifying the user experience.

[0097] In step S13, when the target service is invoked, the requesting process is controlled to send a control instruction to the service process through the target transmission path. The control instruction is used to instruct the service process to adjust the working state of the target service.

[0098] In this step, after selecting a target service, the user generates a service request instruction based on the location of the target service's process and the location of the user's current request process. The user then controls the service process to send the service request instruction to a unified interface. The service request instruction specifies the target communication path, the target transmission path, the target service the user needs, and the function to invoke the target service. The request process selects the target communication path based on the service request instruction and sends the function to the target service's process to invoke the target service. The request process also determines the target transmission path based on the service request quality and sends control instructions to the target service's process to control the target service's status.

[0099] The working status of the target service includes whether it is on or off, as well as the specific actions taken by the target service. For example, if the target service is a smart camera, the on / off status and angle of the smart camera can be adjusted.

[0100] After a user selects a target service, the system obtains the device identifier and service identifier of that service. Based on these identifiers, a service request instruction is generated, carrying the device identifier and service identifier within the instruction. The device identifier refers to the identifier of the device hosting the target service; the service identifier refers to the identifier of the service being invoked.

[0101] For example, there are three smart TVs in the room: smart TV A, smart TV B, and smart TV C. Each smart TV has multiple services such as a camera and the ability to watch programs. When a user chooses to remotely access the camera on smart TV A, a service request instruction is generated, which carries the device identifier of smart TV A and the service identifier of the camera. Then, based on the device identifier of smart TV A and the service identifier of the camera on smart TV A, the target service is determined from multiple registered services to be the camera service located on smart TV A.

[0102] In this step, the target transmission path includes a first transmission path, a second transmission path, and a third transmission path. Furthermore, the target transmission path changes as the positional relationship between the requesting process and the serving process changes.

[0103] When the requesting process and the service process are located in the same kernel of the same device, a service request instruction with a specified first transmission path can be generated, and the control instructions of the requesting process can be sent to the service process through the first transmission path.

[0104] Specifically, please refer to Figure 2 and Figure 3 As shown, the first transmission path includes the following under the cross-process service proxy: IPC proxy object and IPC local object. The requesting process can send control commands to the service process sequentially through the IPC proxy object and the IPC local object. The service process then parses the control commands and controls the working state of the target service according to the control commands.

[0105] In the first transmission path, the requesting process directly sends control commands to the IPC local object via the IPC proxy object, and then the IPC local object sends them to the target process. Because the requesting and service processes communicate directly through the Binder object, this avoids the multiple copies of control commands required for cross-process communication, thus preventing the performance overhead of copying data.

[0106] In cases where the requesting process and the service process carried in the service request instruction are located in different kernels of the same device, a service request instruction with a specified second transmission path can be generated, and the service request instruction can be transmitted to the second service manager of the service process through the second user manager in the second transmission path.

[0107] Specifically, please refer to Figure 2 and Figure 3 As shown, the second transmission path includes: CPC proxy object, CPC local object, remote cross-core service (Remote CPC Service, a remote service under the CPC communication scheme), RPM socket (RemoteProcessor Messaging socket, a socket under the CPC communication scheme), and cross-core service access proxy. The requesting process can sequentially pass through... Figure 2 CPC proxy objects, CPC local objects, remote cross-core services, RPM sockets, and Figure 3 The RPM socket, cross-core service access proxy, CPC proxy object, and CPC local object in the process send control instructions to the service process. The service process then parses the control instructions and controls the working state of the target service according to the control instructions.

[0108] Because the requesting process and the service process communicate via RPM sockets in the second transmission path, without crossing a third process, the unnecessary data copying caused by crossing a third process is avoided, thus avoiding the performance loss caused by data copying.

[0109] In cases where the requesting process and the service process carried in the service request instruction are located on different devices (different devices have different kernels), a service request instruction with a specified third transmission path can be generated, and the service request instruction can be transmitted to the third service manager of the service process through the third user manager in the third transmission path.

[0110] The third transmission path is the same as the third communication path, and the requesting process passes through... Figure 2 The RPC proxy object, RPC local object, remote cross-device service, cross-device service management proxy, RPC proxy object, RPC local object, and cross-device service management stub send control commands to the third user manager. After the third user manager forwards the control commands to the third service manager, the third service manager transmits the control commands to the service process through the three cross-device service management stubs, RPC local objects, RPC proxy objects, cross-device service management proxy, cross-device service access proxy, RPC proxy objects, and RPC local objects. The service process then parses the control commands and controls the working state of the target service according to the control commands.

[0111] The inter-process communication method proposed in this disclosure integrates IPC, RPC, and CPC communication schemes to provide a unified interface to the client. Within this interface, different service request instructions are generated according to different application scenarios to determine the target communication path and target transmission path that are suitable for the current application scenario. The target service is invoked through the target communication path and the target service status is adjusted through the target transmission path.

[0112] In this process, the client calls a unified interface to determine the target communication path and the corresponding communication scheme for the current application scenario. This makes the client unaware of the interaction details under each communication scheme, thereby reducing the number of operations required by the user and bringing convenience to the user in remotely calling the target service.

[0113] Specifically, the IPC, RPC, and CPC communication schemes proposed in related technologies provide three different interfaces, and the client will call different interfaces depending on the communication scheme used. However, the inter-process communication method proposed in this disclosure, after integrating the IPC, RPC, and CPC communication schemes, provides a unified interface to the client. The client can control its own request process to call the same externally exposed interface to complete the invocation and control of the target service without calling the other interfaces.

[0114] Furthermore, this disclosure provides a unified interface to adapt to different application environments, which can reduce the number of interfaces, facilitate the maintenance of software development in the later stages, and reduce the complexity and cost of software development.

[0115] Please see Figure 6 As shown, this disclosure proposes an inter-process communication method for use on a server. The method includes the following steps:

[0116] In step S21, the control service process receives a service request instruction sent by the client's request process. The service request instruction is used to call the target service from the server and to indicate the target transmission path.

[0117] In this step, the service manager in the service process can be controlled to receive service request instructions sent by the user manager in the request process. After receiving the service request instructions, the service manager parses the device identifier and service identifier of the calling function and the target service from the service request instructions. Then, based on the device identifier and service identifier, the service manager determines the target service identified by the device identifier and service identifier from the multiple services registered with it. Finally, the target service is called by calling the function.

[0118] Before receiving service request instructions from the requesting process, communication between the user manager and the service manager can be established first. Based on the communication established between the two, data forwarding between the user manager and the service manager can be implemented.

[0119] Specifically, in the IPC communication scheme, the user manager and the service manager establish communication through a proxy driver; in the CPC communication scheme, the user manager and the service manager establish communication through sockets; and in the RPC communication scheme, the user manager and the service manager establish communication through at least one of wireless communication, wired communication, or cloud communication.

[0120] In step S22, the service process is controlled to call the target service from among multiple services registered to the service process according to the service request instruction.

[0121] In this step, before the control request process sends the service request instruction, multiple services can be registered with the service manager so that the target service can be called from among the multiple registered services after the service request instruction is received.

[0122] In step S23, the service process is controlled to receive control commands sent by the requesting process through the target transmission path.

[0123] In this step, the service process can be controlled to receive control commands sent from the requesting process via the target transmission path.

[0124] In step S24, the service process is controlled to execute the control command to adjust the working state of the target service.

[0125] In this step, after receiving the control command, the service process can adjust the working state of the target service according to the control parameters carried in the control command.

[0126] The control parameters include starting the target service, stopping the target service, and changing the working mode of the target service.

[0127] The inter-process communication method proposed in this disclosure integrates IPC, RPC, and CPC communication schemes to provide a unified interface to the client. Within this interface, different service request instructions are generated according to different application scenarios to determine the target communication path and target transmission path that are suitable for the current application scenario. The target service is invoked through the target communication path and the target service status is adjusted through the target transmission path.

[0128] In this process, the client calls a unified interface to determine the target communication path and the corresponding communication scheme for the current application scenario. This makes the client unaware of the interaction details under each communication scheme, thereby reducing the number of operations required by the user and bringing convenience to the user in remotely calling the target service.

[0129] Figure 7 This is a block diagram of an inter-process communication apparatus according to an exemplary embodiment. The apparatus is applied on a client side, see reference... Figure 7 The device includes: an acquisition module 121, a request instruction forwarding module 122, and a data sending module 123.

[0130] The acquisition module 121 is configured to control the request process to acquire service request instructions. The service request instructions are used to instruct the service process to call the target service and to indicate the target communication path and target transmission path between the request process and the service process. The service process is located on the client or server.

[0131] The request instruction forwarding module 122 is configured to control the request process to send the service request instruction to the service process through the target communication path in order to invoke the target service.

[0132] The data sending module 123 is configured to, when the target service is invoked, control the requesting process to send a control instruction to the service process through the target transmission path, wherein the control instruction is used to instruct the service process to adjust the working state of the target service.

[0133] Optionally, the request instruction forwarding module 122 includes:

[0134] The first request instruction forwarding module is configured to control the requesting process to send the service request instruction to the user manager through the target communication path, so that the user manager can forward the service request instruction to the service manager of the service process.

[0135] Optionally, the first request instruction forwarding module includes:

[0136] The second request instruction forwarding module is configured to send the service request instruction to the user management platform, so that the user manager forwards the service request instruction to the service manager of the service process based on the communication established between the user manager and the service manager.

[0137] Optionally, the communication between the user manager and the service manager includes:

[0138] At least one of wireless communication, wired communication, and cloud communication;

[0139] The cloud communication is used to invoke the target service on the cloud.

[0140] Optionally, the inter-process communication device further includes:

[0141] The location acquisition module is configured to acquire the location of the requesting process and the location of the service process according to the service request instruction;

[0142] The target transmission path determination module is configured to determine the target transmission path based on the relationship between the location of the requesting process and the location of the service process.

[0143] Optionally, the target transmission path determination module includes:

[0144] The first transmission path determination module is configured to use the first transmission path as the target transmission path when the requesting process and the service process are located in the same kernel of the client.

[0145] The second transmission path determination module is configured to use the second transmission path as the target transmission path when the request process and the service process are located in different kernels of the client.

[0146] The third transmission path determination module is configured to use the third transmission path as the target transmission path when the request process and the service process are located at the client and the server, respectively.

[0147] The first transmission path, the second transmission path, and the third transmission path are different.

[0148] Optionally, the inter-process communication device further includes:

[0149] The target service identifier determination module is configured to obtain the device identifier and the service identifier according to the service request instruction;

[0150] The target service determination module is configured to determine the target service based on the device identifier and the service identifier.

[0151] Figure 8 This is a block diagram of an inter-process communication apparatus according to an exemplary embodiment. The apparatus is used on a server side, see reference... Figure 8 As shown, the device includes: a first receiving module 221, a calling module 222, a second receiving module 223, and an execution module 224.

[0152] The first receiving module 221 is configured to control the service process to receive a service request instruction sent by the request process of the client. The service request instruction is used to call the target service from the server and to indicate the target transmission path.

[0153] The calling module 222 is configured to control the service process to call the target service from multiple services registered to the service process according to the service request instruction;

[0154] The second receiving module 223 is configured to control the service process to receive control commands sent by the requesting process through the target transmission path.

[0155] The execution module 224 is configured to control the service process to execute the control instructions in order to adjust the working state of the target service.

[0156] This disclosure also provides an inter-process communication device, including: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to: implement the steps of the inter-process communication method proposed in this disclosure.

[0157] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0158] Figure 9 This is a block diagram illustrating an apparatus 800 for inter-process communication according to an exemplary embodiment. For example, apparatus 800 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0159] Reference Figure 9 The device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0160] Processing component 802 typically controls the overall operation of device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of inter-process communication. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0161] Memory 804 is configured to store various types of data to support the operation of device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0162] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device 800.

[0163] Multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0164] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0165] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0166] Sensor assembly 814 includes one or more sensors for providing status assessments of various aspects of device 800. For example, sensor assembly 814 may detect the on / off state of device 800, the relative positioning of components such as the display and keypad of device 800, changes in the position of device 800 or a component of device 800, the presence or absence of user contact with device 800, the orientation or acceleration / deceleration of device 800, and temperature changes of device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, a gyroscope, a magnetometer, a pressure sensor, or a temperature sensor.

[0167] Communication component 816 is configured to facilitate wired or wireless communication between device 800 and other devices. Device 800 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0168] In an exemplary embodiment, the device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the inter-process communication method described above.

[0169] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of the device 800 to complete the inter-process communication method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0170] The aforementioned device can be a standalone electronic device or a part of a standalone electronic device. For example, in one embodiment, the device can be an integrated circuit (IC) or a chip, wherein the integrated circuit can be a single IC or a collection of multiple ICs. The chip can include, but is not limited to, the following types: GPU (Graphics Processing Unit), CPU (Central Processing Unit), FPGA (Field Programmable Gate Array), DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), and SoC (System on Chip). The aforementioned integrated circuit or chip can be used to execute executable instructions (or code) to implement the aforementioned inter-process communication method. The executable instructions can be stored in the integrated circuit or chip or obtained from other devices or equipment. For example, the integrated circuit or chip includes a processor, memory, and an interface for communicating with other devices. The executable instruction can be stored in the processor, and when the executable instruction is executed by the processor, the inter-process communication method described above is implemented; alternatively, the integrated circuit or chip can receive the executable instruction through the interface and transmit it to the processor for execution, so as to implement the inter-process communication method described above.

[0171] In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable device, the computer program having a code portion for performing the inter-process communication method described above when executed by the programmable device.

[0172] Figure 10 This is a block diagram illustrating an apparatus 1900 for inter-process communication according to an exemplary embodiment. For example, apparatus 1900 may be provided as a server. (Refer to...) Figure 10 The device 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by memory 1932 for storing instructions, such as application programs, that can be executed by the processing component 1922. The application programs stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1922 is configured to execute instructions to perform the aforementioned inter-process communication methods.

[0173] Device 1900 may also include a power supply component 1926 configured to perform power management of device 1900, a wired or wireless network interface 1950 configured to connect device 1900 to a network, and an input / output (I / O) interface 1958. Device 1900 can operate on an operating system, such as Windows Server, stored in memory 1932. TM macOS X TM Unix TM Linux TM FreeBSD TM Or similar.

[0174] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of this disclosure. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0175] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. An inter-process communication method, characterized in that, The method is applied to the client, and the method includes: The control request process obtains a service request instruction, which is used to instruct the service process to call a target service and to indicate the target communication path and target transmission path between the request process and the service process; the service process is located on the client or server. The requesting process is controlled to send the service request instruction to the service process through the target communication path in order to invoke the target service; When the target service is invoked, the requesting process is controlled to send a control instruction to the service process through the target transmission path. The control instruction is used to instruct the service process to adjust the working state of the target service. The method of controlling the request process to send the service request instruction to the service process through the target communication path includes: controlling the request process to send the service request instruction to the user manager through the target communication path, so that the user manager can forward the service request instruction to the service manager of the service process; The target transmission path is obtained through the following steps: Based on the service request instruction, the location of the requesting process and the location of the service process are obtained; if the requesting process and the service process are located within the same kernel of the client, a first transmission path is used as the target transmission path; if the requesting process and the service process are located in different kernels of the client, a second transmission path is used as the target transmission path; if the requesting process and the service process are located in the client and the server respectively, a third transmission path is used as the target transmission path; wherein the first transmission path, the second transmission path, and the third transmission path are different.

2. The inter-process communication method according to claim 1, characterized in that, Sending the service request instruction to the user management platform, so that the user manager can forward the service request instruction to the service manager of the service process, includes: The service request instruction is sent to the user management platform, so that the user manager forwards the service request instruction to the service manager of the service process based on the communication established between the user manager and the service manager.

3. The inter-process communication method according to claim 2, characterized in that, The communication between the user manager and the service manager includes: At least one of wireless communication, wired communication, and cloud communication; The cloud communication is used to invoke the target service on the cloud.

4. The inter-process communication method according to claim 1, characterized in that, The target service is obtained through the following steps: Based on the service request instruction, obtain the device identifier and service identifier; The target service is determined based on the device identifier and the service identifier.

5. An inter-process communication method, characterized in that, The method is applied to the server side, and the method includes: The control service process receives service request instructions sent by the client's request process. The service request instructions are used to call the target service from the server and to indicate the target transmission path. The service request instructions are forwarded by the client to the user manager through the target communication path, and then forwarded by the user manager to the service manager of the service process. The service process is controlled to invoke the target service from among multiple services registered to the service process according to the service request instruction; The service process is controlled to receive control commands sent by the requesting process through the target transmission path; Control the service process to execute the control instructions to adjust the working state of the target service; The target transmission path is obtained through the following steps: Based on the service request instruction, the location of the requesting process and the location of the service process are obtained; if the requesting process and the service process are located within the same kernel of the client, a first transmission path is used as the target transmission path; if the requesting process and the service process are located in different kernels of the client, a second transmission path is used as the target transmission path; if the requesting process and the service process are located in the client and the server respectively, a third transmission path is used as the target transmission path; wherein the first transmission path, the second transmission path, and the third transmission path are different.

6. An inter-process communication device, characterized in that, The device is used by a client, and the device includes: The acquisition module is configured to control the request process to acquire service request instructions, wherein the service request instructions are used to instruct the service process to call the target service, and to indicate the target communication path and target transmission path between the request process and the service process; the service process is located on the client or server. The request instruction forwarding module is configured to control the requesting process to send the service request instruction to the service process through the target communication path in order to invoke the target service; The data sending module is configured to, when the target service is invoked, control the requesting process to send a control instruction to the service process through the target transmission path, wherein the control instruction is used to instruct the service process to adjust the working state of the target service; The request instruction forwarding module is further configured to: control the request process to send the service request instruction to the user manager through the target communication path, so that the user manager can forward the service request instruction to the service manager of the service process; The target transmission path is obtained through the following steps: Based on the service request instruction, the location of the requesting process and the location of the service process are obtained; if the requesting process and the service process are located within the same kernel of the client, a first transmission path is used as the target transmission path; if the requesting process and the service process are located in different kernels of the client, a second transmission path is used as the target transmission path; if the requesting process and the service process are located in the client and the server respectively, a third transmission path is used as the target transmission path; wherein the first transmission path, the second transmission path, and the third transmission path are different.

7. An inter-process communication device, characterized in that, The device is used on the server side, and the device includes: The first receiving module is configured to control the service process to receive service request instructions sent by the requesting process of the client. The service request instructions are used to call the target service from the server and to indicate the target transmission path. The service request instructions are forwarded by the client to the user manager through the target communication path, and then forwarded by the user manager to the service manager of the service process. The calling module is configured to control the service process to call the target service from multiple services registered to the service process according to the service request instruction; The second receiving module is configured to control the service process to receive control commands sent by the requesting process through the target transmission path. An execution module is configured to control the service process to execute the control instructions in order to adjust the working state of the target service; The target transmission path is obtained through the following steps: Based on the service request instruction, the location of the requesting process and the location of the service process are obtained; if the requesting process and the service process are located within the same kernel of the client, a first transmission path is used as the target transmission path; if the requesting process and the service process are located in different kernels of the client, a second transmission path is used as the target transmission path; if the requesting process and the service process are located in the client and the server respectively, a third transmission path is used as the target transmission path; wherein the first transmission path, the second transmission path, and the third transmission path are different.

8. An inter-process device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured as follows: The steps of implementing the inter-process communication method according to any one of claims 1-4, or the steps of implementing the inter-process communication method according to claim 5.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the program instructions are executed by the processor, they implement the steps of the inter-process communication method according to any one of claims 1-4, or the steps of the inter-process communication method according to claim 5.

10. A chip, characterized in that, It includes a processor and an interface; the processor is used to read instructions to execute the steps of the inter-process communication method according to any one of claims 1-4, or to execute the steps of the inter-process communication method according to claim 5.

Citation Information

Patent Citations

  • Method for operation system inner core component cross-domain operating

    CN101038545A

  • Inter-process communication method and device, computer device and readable storage medium

    CN109933443A