CN112596931B - Cross-process communication method and device, electronic equipment and storage medium - Google Patents

Cross-process communication method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112596931B
CN112596931B CN202011636882.2A CN202011636882A CN112596931B CN 112596931 B CN112596931 B CN 112596931B CN 202011636882 A CN202011636882 A CN 202011636882A CN 112596931 B CN112596931 B CN 112596931B
Authority
CN
China
Prior art keywords
target
demand
content
manager
cross
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011636882.2A
Other languages
Chinese (zh)
Other versions
CN112596931A (en
Inventor
李志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuba Co Ltd
Original Assignee
Wuba Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuba Co Ltd filed Critical Wuba Co Ltd
Priority to CN202011636882.2A priority Critical patent/CN112596931B/en
Publication of CN112596931A publication Critical patent/CN112596931A/en
Application granted granted Critical
Publication of CN112596931B publication Critical patent/CN112596931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables

Abstract

The embodiment of the invention provides a cross-process communication method, a cross-process communication device, electronic equipment and a storage medium, wherein in the cross-process communication method, a content provider receives a calling request sent by a demand process and sends the method characteristics of a target process to a manager, so that the manager determines a target operation entrance according to the method characteristics of the target process and receives the target operation entrance fed back by the manager, and therefore the method content of the target process can be called through the operation entrance of the target process, and cross-process communication between the demand process and the target process is realized. Therefore, the method and the system can complete the calling of the target process only by needing one IPC between the process and the manager, and the cross-process communication efficiency is higher.

Description

Cross-process communication method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of application development, and in particular, to a cross-process communication method and apparatus, an electronic device, and a storage medium.
Background
Inter-Process Communication (IPC) refers to a technology or a method for transmitting data or signals between at least two processes, in order to improve the performance of an application program, a remote service needs to be called under many circumstances, the remote service and a caller run in different processes respectively, at this time, the calling Process of the caller to the remote service is cross-Process Communication, for example, a plurality of application programs share the same background service (remote service), that is, one remote service performs cross-Process Communication with a plurality of application programs.
In order to implement cross-process communication between a remote service and an application program, an Interface Definition Language (AIDL) needs to be used, and in the process of implementing cross-process communication using the AIDL, a manager needs to be established between a client and a server, usually, the manager also runs in an independent process, the processes of the process and the client and the server are different, and communication between the client and the server needs to be forwarded through the manager, that is, cross-process communication between the client and the server includes communication between the client and the manager and communication between the manager and the server, each communication process is an IPC, and as a result, cross-process communication between the client and the server needs to be performed by the IPC at least twice, and the communication efficiency is low.
Disclosure of Invention
The application provides a cross-process communication method, a cross-process communication device, electronic equipment and a storage medium, so that the efficiency of cross-process communication is improved.
In a first aspect, an embodiment of the present invention provides a cross-process communication method, which is applied to a content provider, and the method includes:
receiving a call request sent by a demand process, wherein the call request comprises method characteristics of a target process to be called by the demand process, the method characteristics are used for identifying method contents of the process, and the method contents refer to logic for realizing corresponding functions of the process;
sending the method characteristics of the target process to a manager so that the manager determines a target operation entry according to the method characteristics of the target process, wherein the manager is used for managing routing information of each process, the routing information comprises the corresponding relation between the method characteristics of the process and the operation entry, and the operation entry is an entry for calling the method content of the process;
receiving the target operation entry fed back by the manager;
and calling the method content of the target process through the operation entrance of the target process so as to realize cross-process communication between the demand process and the target process.
In a possible implementation manner of the first aspect of the embodiment of the present invention, before the receiving a call request sent by a demand process, the method further includes:
receiving content information sent by the demand process, wherein the content information comprises method content of the demand process;
packaging the method content of the demand process to obtain registration information of the demand process, wherein the registration information comprises the method characteristics and the operation interface of the demand process;
and sending registration information of the demand process to the manager so that the manager stores the method characteristics and the operation interface of the demand process.
In a second aspect, an embodiment of the present invention provides a cross-process communication method, which is applied to a manager, where the manager is configured to manage routing information of each process, where the routing information includes a correspondence between a method feature of a process and an operation entry, where the operation entry refers to an entry for invoking a method content of the process, and the method includes:
receiving a call request sent by a content provider, wherein the content provider is used for forwarding data of a required process, the call request comprises method characteristics of a target process to be called by the required process, the method characteristics are used for identifying method contents of the process, and the method contents refer to logic for realizing corresponding functions of the process;
determining a target operation entrance according to the method characteristics of the target process;
and sending the target operation entry to the content provider to enable the content provider to call the method content of the target process through the operation entry of the target process so as to realize cross-process communication between the demand process and the target process.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the determining a target operation entry according to the method feature of the target process includes:
determining a target method characteristic which is the same as the method characteristic of the target process;
and determining a corresponding target operation entrance according to the target method characteristic.
In a possible implementation manner of the second aspect of the embodiment of the present invention, before receiving the invocation request sent by the content provider, the method further includes:
receiving registration information sent by a content provider, wherein the registration information comprises method characteristics and an operation entrance of the requirement process;
storing the method characteristics and the operation entry of the requirement process.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the method for storing the requirement process and the operation entry include:
establishing a corresponding relation between the method characteristics of the demand process and an operation entrance to obtain the routing information of the demand process;
and storing the routing information of the required process to a central routing table, wherein the central routing table is used for storing the routing information of each process.
In a possible implementation manner of the second aspect of the embodiment of the present invention, the method further includes:
and updating the central routing table according to a preset period so as to eliminate invalid routing information in the central routing table.
In a third aspect, an embodiment of the present application provides a cross-process communication apparatus, applied to a content provider, where the apparatus includes:
a call request receiving module, configured to receive a call request sent by a demand process, where the call request includes a method feature of a target process to be called by the demand process, the method feature is used to identify method content of the process, and the method content is logic used to implement a corresponding function of the process;
a method characteristic sending module, configured to send the method characteristic of the target process to a manager, so that the manager determines a target operation entry according to the method characteristic of the target process, where the manager is configured to manage routing information of each process, where the routing information includes a correspondence between the method characteristic of the process and an operation entry, and the operation entry is an entry for invoking a method content of the process;
a target operation entrance receiving module, configured to receive the target operation entrance fed back by the manager;
and the calling module is used for calling the method content of the target process through the operation entrance of the target process so as to realize cross-process communication between the demand process and the target process.
In a possible implementation manner of the third aspect of the embodiment of the present invention, the generating module includes:
a content information receiving module, configured to receive content information sent by the demand process, where the content information includes method content of the demand process;
the packaging module is used for packaging the method content of the demand process to obtain the registration information of the demand process, wherein the registration information comprises the method characteristics and the operation interface of the demand process;
and the registration information sending module is used for sending the registration information of the demand process to the manager so as to enable the manager to store the method characteristics and the operation interface of the demand process.
In a fourth aspect, an embodiment of the present application provides a cross-process communication apparatus, which is applied to a manager, where the manager is configured to manage routing information of each process, where the routing information includes a correspondence relationship between a method feature of a process and an operation entry, where the operation entry refers to an entry for invoking a method content of the process, and the apparatus includes:
a request receiving module, configured to receive a call request sent by a content provider, where the content provider is configured to forward data of a demand process, the call request includes a method feature of a target process to be called by the demand process, the method feature is used to identify method content of the process, and the method content refers to logic for implementing a corresponding function of the process;
the target operation entrance determining module is used for determining a target operation entrance according to the method characteristics of the target process;
and the feedback module is used for sending the target operation entry to the content provider so that the content provider calls the method content of the target process through the operation entry of the target process to realize cross-process communication between the demand process and the target process.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the target operation entry determining module includes:
a target method characteristic determination module for determining a target method characteristic identical to a method characteristic of the target process;
and the determining module is used for determining the corresponding target operation entrance according to the target method characteristics.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the apparatus further includes:
the registration information receiving module is used for receiving registration information sent by a content provider, wherein the registration information comprises the method characteristics and the operation entrance of the requirement process;
and the storage module is used for storing the method characteristics and the operation entrance of the demand process.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the storage module includes:
the establishing module is used for establishing the corresponding relation between the method characteristics of the demand process and the operation entrance to obtain the routing information of the demand process;
and the table storage module is used for storing the routing information of the required process to a central routing table, and the central routing table is used for storing the routing information of each process.
In a possible implementation manner of the fourth aspect of the embodiment of the present invention, the apparatus further includes:
and the updating module is used for updating the central routing table according to a preset period so as to eliminate the invalid routing information in the central routing table.
In a fifth aspect, an embodiment of the present invention provides an electronic device, including:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the cross-process communication method via execution of the executable instructions.
In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the cross-process communication method.
In a seventh aspect, an embodiment of the present invention provides an electronic device, including:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the cross-process communication method via execution of the executable instructions.
In an eighth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the cross-process communication method.
The embodiment of the invention provides a cross-process communication method, a cross-process communication device, electronic equipment and a storage medium, wherein in the cross-process communication method, a content provider receives a calling request sent by a demand process and sends method characteristics of a target process to a manager, so that the manager determines a target operation entrance according to the method characteristics of the target process and receives the target operation entrance fed back by the manager, and therefore the method content of the target process can be called through the operation entrance of the target process, and cross-process communication between the demand process and the target process is realized. Therefore, the embodiment can complete the calling of the target process only by needing one IPC between the process and the manager, and the calling efficiency is higher.
Drawings
In order to more clearly explain the technical solution of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any creative effort.
Fig. 1 is a schematic structural diagram of a cross-process communication system according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a method for registering process information according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a method for processing content information of a process to be registered by a content provider according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a method for generating a central routing table by a manager according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a method for cross-process communication according to an embodiment of the present application;
FIG. 6 is a flowchart of a method for determining a target operation entry according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a cross-process communication apparatus according to a first embodiment of the present application;
fig. 8 is a schematic structural diagram of a second cross-process communication apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a third embodiment of a cross-process communication apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a fourth embodiment of a cross-process communication apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a fifth embodiment of a cross-process communication apparatus according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a sixth embodiment of a cross-process communication apparatus according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a seventh embodiment of a cross-process communication apparatus according to an embodiment of the present application;
fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention;
fig. 15 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 1 is a schematic structural diagram of a cross-process communication system according to an embodiment of the present application, and as shown in fig. 1, the cross-process communication system includes: a demand process 1, a manager 2, a target process 3 and a content provider 4. The demand process 1 refers to a process generating a cross-process communication demand, and accordingly, a process called by the demand process 1 may be referred to as a target process 3. The manager 2 is located in a single process and is used for managing registration information of each process, the processes managed by the manager 2 include a demand process 1 and a target process 3, the process where the manager 2 is located is different from the processes managed thereon, and as shown in fig. 1, the manager 2 stores the registration information of a plurality of processes. Specifically, the manager 2 may manage each module according to the following method, which takes the requirement module as an example for description:
fig. 2 is a schematic flowchart of a method for registering process information according to an embodiment of the present application, where as shown in fig. 2, the method includes:
s101, receiving registration information sent by a content provider, wherein the registration information comprises the method characteristics and the operation entrance of the demand process.
The manager receives registration information sent by a content Provider (Binder Provider) 4, where the content Provider 4 is an intermediate layer and can convert content information sent by a process to be registered into registration information, and the details are as follows:
fig. 3 is a schematic flowchart of a method for processing content information of a process to be registered by a content provider according to an embodiment of the present application, and as shown in fig. 3, the method includes:
s1011, receiving content information sent by the demand process, wherein the content information comprises method content of the demand process;
s1012, packaging the method content of the demand process to obtain registration information of the demand process, wherein the registration information comprises the method characteristics and the operation interface of the demand process;
and S1013, sending the registration information of the requirement process to the manager so that the manager stores the method characteristics and the operation interface of the requirement process.
The process to be registered is a process that needs to be registered in the manager 2, and the process to be registered sends content information to the content provider 4, where the content information is method content of the process to be registered, and execution of the method content usually implements corresponding functions, such as calling a function, accessing data, and the like. The content provider 4 packages the method content of the process to be registered to obtain registration information of the process to be registered, for example, serializes the content information, sends the serialized information to idispatchterimpr, packages the serialized information through the idispatchterimpr to hide a large amount of details in the method content, only provides method features that can represent the method content and an operation interface for calling the method content, and generates the registration information of the process to be registered through the method features and the operation interface of the method content. Thus, the registration information may be sent to the manager 2 through the IDispatcher for storage by the manager 2. It can be seen that the registration information processed by the content provider 4 is more abbreviated, which can provide efficiency of identifying the method content (process) according to the registration information.
S102, storing the method characteristics and the operation entry of the demand process.
After receiving the registration information sent by the content provider 4, the manager 2 may store the registration information, and may generate a central routing table based on the registration information for management. Thus, once the process successfully registered, the operation entry of the process is exposed in the central routing table, and a call entry is provided for the calls of other processes.
Fig. 4 is a schematic flowchart of a method for generating a central routing table by a manager according to an embodiment of the present application, and as shown in fig. 4, the method includes:
s1021, establishing a corresponding relation between the method characteristics of the demand process and an operation entrance, and obtaining routing information of the demand process;
s1022, storing the routing information of the required process to a central routing table, where the central routing table is used to store the routing information of each process.
After the manager 2 receives the registration information, in order to implement accurate correspondence between the registration information and the process, a corresponding correspondence needs to be established, as can be seen from the above, the method feature of the process may be used to identify the process, and the operation entry of the process is used to invoke the method content of the process, so that the correspondence between the method feature and the operation entry may be established to obtain the routing information of the process, and thus, the process may be identified by the method feature, and according to the correspondence, the operation entry corresponding to the process may be found to invoke the method content of the process, thereby completing communication.
The manager 2 performs the above-described processing on the received registration information of each process to obtain the routing information of each process, and generates a central routing table by summarizing the routing information. Further, in order to ensure the validity of the central routing table, that is, to ensure that each process in the central routing table can be invoked to improve the success rate of the invocation of the demand process 1, the manager 2 may remove the routing information that fails in the central routing table according to a preset period to update the central routing table.
The registration process of a process itself has an authentication process, so that a process that is considered to be successfully registered has the ability to invoke other already registered processes in the manager 2. In another implementation, if the demand process 1 is not registered in the manager 2, authentication first needs to be performed to ensure security of cross-process communication if other processes need to be invoked through the manager 2. For example, by the content provider 4 sending authentication information to the manager 2, the requiring process 1 is allowed to proceed with the subsequent calling process only when the manager 2 passes the authentication.
Fig. 5 is a schematic flowchart of a method for cross-process communication according to an embodiment of the present application, where as shown in fig. 5, the method includes:
s100, receiving a calling request sent by a demand process, wherein the calling request comprises method characteristics of a target process to be called by the demand process, the method characteristics are used for identifying method contents of the process, and the method contents refer to logic used for realizing corresponding functions of the process.
S200, sending the method characteristics of the target process to a manager so that the manager determines a target operation entry according to the method characteristics of the target process, wherein the manager is used for managing routing information of each process, the routing information comprises the corresponding relation between the method characteristics of the process and the operation entry, and the operation entry is an entry for calling the method content of the process.
S300, receiving the target operation entry fed back by the manager.
S400, calling the method content of the target process through the operation entrance of the target process so as to realize cross-process communication between the demand process and the target process.
The requiring process 1 sends a call request to the content provider 4 and declares in the call request the method characteristics of the process to be called, as an identification for identifying the target process 3. The content provider 4 sends the method features of the target process to the manager 2, so that the manager 2 can determine the target operation entry, which is as follows:
fig. 6 is a flowchart of a method for determining a target operation entry according to an embodiment of the present application, where as shown in fig. 6, the method includes:
s201, determining target method characteristics which are the same as the method characteristics of the target process;
s202, determining a corresponding target operation entrance according to the target method characteristics.
The manager 2 may look up in the central routing table according to the method characteristics of the process to be invoked to find a matching operation entry, i.e. the target entry. For example, if the method feature of the process to be invoked is a and the central routing table stores method feature a-operation entry a, method feature b-operation entry b, and method feature c-operation entry c, then the target operation entry may be determined to be operation entry a in the central routing table. Thus, the manager 2 can feed back the operation entry a to the content provider 4, and the content provider 4 can call the corresponding method content by operating the entry a. And if the method characteristic a corresponds to the process A, the process A is the target process 3, and the process is completed, namely the cross-process communication between the demand process 1 and the target process 3 is completed.
In another implementation, if manager 2 does not query the central routing table for the target operation entry, indicating that the process corresponding to the method feature is not registered, manager 2 may suspend the invocation request and periodically query the central routing table, and may immediately access the target operation entry once it appears. As can be seen, in the embodiment of the present application, the requirement process 1 may invoke an operation interface (implemented by the content provider 4) of the target process 3 through the manager 2 to complete cross-process communication with the target process 3, and communication between the requirement process 1 and the manager 2 is only IPC once, so that the requirement process 1 may invoke the target process 3 only by IPC once, and efficiency of cross-process communication may be effectively improved.
Fig. 7 is a schematic structural diagram of a cross-process communication apparatus according to a first embodiment of the present application, where the apparatus includes: a call request receiving module 10, configured to receive a call request sent by a demand process, where the call request includes a method feature of a target process to be called by the demand process, where the method feature is used to identify method content of the process, and the method content is logic used to implement a corresponding function of the process; a method feature sending module 20, configured to send the method feature of the target process to a manager, so that the manager determines a target operation entry according to the method feature of the target process, where the manager is configured to manage routing information of each process, where the routing information includes a correspondence between the method feature of the process and the operation entry, and the operation entry is an entry for calling method content of the process; a target operation entry receiving module 30, configured to receive the target operation entry fed back by the manager; and the calling module 40 is configured to call the method content of the target process through the operation entry of the target process, so as to implement cross-process communication between the demand process and the target process.
Fig. 8 is a schematic structural diagram of a second embodiment of a cross-process communication device according to an embodiment of the present application, where the device further includes: a content information receiving module 50, configured to receive content information sent by the demand process, where the content information includes method content of the demand process; an encapsulating module 60, configured to encapsulate the method content of the demand process to obtain registration information of the demand process, where the registration information includes a method feature and an operation interface of the demand process; a registration information sending module 70, configured to send registration information of the requirement process to the manager, so that the manager stores method features and an operation interface of the requirement process.
Fig. 9 is a schematic structural diagram of a third embodiment of a cross-process communication apparatus provided in an embodiment of the present application, and is applied to a manager, where the manager is configured to manage routing information of each process, where the routing information includes a correspondence between a method feature of the process and an operation entry, where the operation entry is an entry for invoking a method content of the process, and the apparatus includes: a request receiving module 11, configured to receive a call request sent by a content provider, where the content provider is configured to forward data of a required process, and the call request includes a method feature of a target process to be called by the required process, where the method feature is used to identify method content of the process, and the method content refers to logic used to implement a corresponding function of the process; a target operation entry determining module 22, configured to determine a target operation entry according to the method characteristic of the target process; a feedback module 33, configured to send the target operation entry to the content provider, so that the content provider invokes the method content of the target process through the operation entry of the target process, so as to implement cross-process communication between the demand process and the target process.
Fig. 10 is a schematic structural diagram of a fourth embodiment of a cross-process communication apparatus according to the present application, where the target operation entry determining module 22 includes: a target method characteristic determining module 221, configured to determine a target method characteristic that is the same as a method characteristic of the target process; and a determining module 222, configured to determine a corresponding target operation entry according to the target method characteristic.
Fig. 11 is a schematic structural diagram of a fifth embodiment of a cross-process communication apparatus according to an embodiment of the present application, where the apparatus further includes: a registration information receiving module 44, configured to receive registration information sent by a content provider, where the registration information includes a method characteristic and an operation entry of the demand process; and the storage module 55 is used for storing the method characteristics and the operation entry of the requirement process.
Fig. 12 is a schematic structural diagram of a sixth embodiment of a cross-process communication apparatus according to an embodiment of the present application, where the storage module 55 includes: an establishing module 551, configured to establish a correspondence between the method characteristic of the demand process and an operation entry, to obtain routing information of the demand process; a table storage module 552, configured to store the routing information of the demand process into a central routing table, where the central routing table is used to store the routing information of each process.
Fig. 13 is a schematic structural diagram of a seventh embodiment of a cross-process communication apparatus according to an embodiment of the present application, where the apparatus further includes: and the updating module 66 is configured to update the central routing table according to a preset period, so as to eliminate the routing information that fails in the central routing table.
Fig. 14 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. The electronic equipment is applied to a content provider and comprises the following components: a memory 101 and a processor 102;
a memory 101 for storing a computer program;
the processor 102 is configured to execute the computer program stored in the memory to implement the cross-process communication method in the above embodiment. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 101 may be separate or integrated with the processor 102.
When the memory 101 is a device independent of the processor 102, the electronic apparatus may further include:
a bus 103 for connecting the memory 101 and the processor 102.
Fig. 15 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. The electronic equipment is applied to a manager and comprises: a memory 201 and a processor 202;
a memory 201 for storing a computer program;
the processor 202 is configured to execute the computer program stored in the memory to implement the cross-process communication method in the above embodiment. Reference may be made in particular to the description relating to the method embodiments described above.
Alternatively, the memory 201 may be separate or integrated with the processor 202.
When the memory 201 is a device independent of the processor 202, the electronic apparatus may further include:
a bus 203 for connecting the memory 201 and the processor 202.
The electronic device provided in the embodiment of the present invention may be configured to execute any one of the cross-process communication methods shown in the foregoing embodiments, and the implementation manner and the technical effect are similar, which are not described herein again.
An embodiment of the present invention further provides a readable storage medium, in which a computer program is stored, and when at least one processor of a message sending apparatus executes the computer program, the message sending apparatus executes a cross-process communication method described in any one of the above embodiments.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical solutions described in the foregoing embodiments may be modified or equivalent replaced by some or all of the technical features, and the modifications or the substitutions may not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (18)

1. A cross-process communication method applied to at least one content provider, the at least one content provider being in communication with a same manager, the method comprising:
receiving a call request sent by a corresponding demand process, wherein the call request comprises method characteristics of a target process to be called by the demand process, the method characteristics are used for identifying method contents of the process, and the method contents refer to logic for realizing corresponding functions of the process;
sending the method characteristics of the target process to the manager so that the manager determines a target operation entry according to the method characteristics of the target process, wherein the manager is positioned in a single process and is used for managing routing information of each process, the routing information comprises the corresponding relation between the method characteristics of the process and the operation entry, and the operation entry is an entry for calling the method content of the process;
receiving the target operation entry fed back by the manager;
and calling the method content of the target process through the operation entrance of the target process so as to realize cross-process communication between the demand process and the target process.
2. The method according to claim 1, further comprising, before the receiving the call request sent by the demanding process:
receiving content information sent by the demand process, wherein the content information comprises method content of the demand process;
packaging the method content of the demand process to obtain registration information of the demand process, wherein the registration information comprises the method characteristics and the operation interface of the demand process;
and sending registration information of the demand process to the manager so that the manager stores the method characteristics and the operation interface of the demand process.
3. A cross-process communication method is applied to a manager, the manager is communicated with at least one content provider and is used for managing routing information of each process, the routing information comprises a corresponding relation between method characteristics of the process and an operation entry, and the operation entry refers to an entry used for calling method contents of the process, and the method comprises the following steps:
receiving a call request sent by the content provider, wherein the content provider is used for forwarding data of a corresponding demand process, the call request comprises method characteristics of a target process to be called by the demand process, the method characteristics are used for identifying method contents of the process, and the method contents refer to logic for realizing corresponding functions of the process;
determining a target operation entrance according to the method characteristics of the target process;
and sending the target operation entry to the content provider to enable the content provider to call the method content of the target process through the operation entry of the target process so as to realize cross-process communication between the demand process and the target process.
4. The method of claim 3, wherein determining a target operation entry according to the method features of the target process comprises:
determining a target process characteristic which is the same as the method characteristic of the target process;
and determining a corresponding target operation entrance according to the target method characteristic.
5. The method of claim 3, wherein the receiving the invocation request sent by the content provider further comprises, before:
receiving registration information sent by a content provider, wherein the registration information comprises method characteristics and an operation entrance of the requirement process;
storing the method characteristics and the operation entry of the requirement process.
6. The method of claim 5, wherein storing the method features and operation entries of the demand process comprises:
establishing a corresponding relation between the method characteristics of the demand process and an operation entrance to obtain the routing information of the demand process;
and storing the routing information of the required process to a central routing table, wherein the central routing table is used for storing the routing information of each process.
7. The method of claim 6, further comprising:
and updating the central routing table according to a preset period so as to eliminate invalid routing information in the central routing table.
8. A cross-process communication apparatus, applied to at least one content provider, the at least one content provider communicating with a same manager, the apparatus comprising:
a call request receiving module, configured to receive a call request sent by a corresponding demand process, where the call request includes a method feature of a target process to be called by the demand process, the method feature is used to identify method content of the process, and the method content is logic used to implement a corresponding function of the process;
a method characteristic sending module, configured to send the method characteristic of the target process to the manager, so that the manager determines a target operation entry according to the method characteristic of the target process, where the manager is located in a single process and is configured to manage routing information of each process, where the routing information includes a correspondence between the method characteristic of the process and an operation entry, and the operation entry is an entry for calling method content of the process;
a target operation entrance receiving module, configured to receive the target operation entrance fed back by the manager;
and the calling module is used for calling the method content of the target process through the operation entrance of the target process so as to realize cross-process communication between the demand process and the target process.
9. The apparatus of claim 8, further comprising:
a content information receiving module, configured to receive content information sent by the demand process, where the content information includes method content of the demand process;
the packaging module is used for packaging the method content of the demand process to obtain the registration information of the demand process, and the registration information comprises the method characteristics and the operation interface of the demand process;
and the registration information sending module is used for sending the registration information of the demand process to the manager so as to enable the manager to store the method characteristics and the operation interface of the demand process.
10. A cross-process communication apparatus applied to a manager, the manager communicating with at least one content provider, for managing routing information of processes, the routing information including correspondence between method features of the processes and operation entries, the operation entries referring to entries for invoking method contents of the processes, the apparatus comprising:
a request receiving module, configured to receive a call request sent by the content provider, where the content provider is configured to forward data of a corresponding demand process, the call request includes a method feature of a target process to be called by the demand process, the method feature is used to identify method content of the process, and the method content refers to logic for implementing a corresponding function of the process;
the target operation entrance determining module is used for determining a target operation entrance according to the method characteristics of the target process;
and the feedback module is used for sending the target operation entry to the content provider so that the content provider calls the method content of the target process through the operation entry of the target process to realize cross-process communication between the demand process and the target process.
11. The apparatus of claim 10, wherein the target operation entry determination module comprises:
a target method characteristic determination module for determining a target method characteristic identical to a method characteristic of the target process;
and the determining module is used for determining a corresponding target operation entrance according to the target method characteristic.
12. The apparatus of claim 10, further comprising:
the registration information receiving module is used for receiving registration information sent by a content provider, wherein the registration information comprises the method characteristics and the operation entrance of the requirement process;
and the storage module is used for storing the method characteristics and the operation entrance of the demand process.
13. The apparatus of claim 12, wherein the storage module comprises:
the establishing module is used for establishing the corresponding relation between the method characteristics of the demand process and the operation entrance to obtain the routing information of the demand process;
and the table storage module is used for storing the routing information of the required process to a central routing table, and the central routing table is used for storing the routing information of each process.
14. The apparatus of claim 13, further comprising:
and the updating module is used for updating the central routing table according to a preset period so as to eliminate the invalid routing information in the central routing table.
15. An electronic device, characterized in that the electronic device comprises:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the cross-process communication method of any of claims 1-2 via execution of the executable instructions.
16. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the cross-process communication method according to any one of claims 1-2.
17. An electronic device, characterized in that the electronic device comprises:
a processor, and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the cross-process communication method of any of claims 3-7 via execution of the executable instructions.
18. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the cross-process communication method according to any one of claims 3 to 7.
CN202011636882.2A 2020-12-31 2020-12-31 Cross-process communication method and device, electronic equipment and storage medium Active CN112596931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011636882.2A CN112596931B (en) 2020-12-31 2020-12-31 Cross-process communication method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011636882.2A CN112596931B (en) 2020-12-31 2020-12-31 Cross-process communication method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112596931A CN112596931A (en) 2021-04-02
CN112596931B true CN112596931B (en) 2023-04-07

Family

ID=75206709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011636882.2A Active CN112596931B (en) 2020-12-31 2020-12-31 Cross-process communication method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112596931B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988907B (en) * 2021-04-28 2022-01-21 北京卡普拉科技有限公司 Information adjusting method, system, electronic equipment and storage medium
CN113821357A (en) * 2021-09-23 2021-12-21 瑞芯微电子股份有限公司 Socket-based cross-process communication method, medium and electronic device
CN116048744B (en) * 2022-08-19 2023-09-12 荣耀终端有限公司 Image acquisition method and related electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101087314A (en) * 2007-05-15 2007-12-12 华为技术有限公司 A system and method for application to use socket interface across processes
CN110309006A (en) * 2019-06-28 2019-10-08 百度在线网络技术(北京)有限公司 A kind of funcall method, apparatus, terminal device and storage medium
CN110377438A (en) * 2019-07-22 2019-10-25 广州小鹏汽车科技有限公司 The method for routing of striding course communication interface, device and system
CN111936967A (en) * 2018-04-10 2020-11-13 微软技术许可有限责任公司 Cross-process interface for non-compatible frameworks

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101087314A (en) * 2007-05-15 2007-12-12 华为技术有限公司 A system and method for application to use socket interface across processes
CN111936967A (en) * 2018-04-10 2020-11-13 微软技术许可有限责任公司 Cross-process interface for non-compatible frameworks
CN110309006A (en) * 2019-06-28 2019-10-08 百度在线网络技术(北京)有限公司 A kind of funcall method, apparatus, terminal device and storage medium
CN110377438A (en) * 2019-07-22 2019-10-25 广州小鹏汽车科技有限公司 The method for routing of striding course communication interface, device and system

Also Published As

Publication number Publication date
CN112596931A (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN112596931B (en) Cross-process communication method and device, electronic equipment and storage medium
US11336465B2 (en) Sending cross-chain authenticatable messages
CN111163129B (en) Resource processing method and device based on cross-link network
US20200177572A1 (en) Sending cross-chain authenticatable messages
CN109815025B (en) Service model calling method, device and storage medium
CN108881111B (en) Method and device for realizing multi-tenant system
US20180011749A1 (en) System and method for extending a web service environment to support scalable asynchronous clients
CN112114979A (en) Remote procedure call method and device
CN111045833A (en) Interface calling method and device
CN110753129A (en) Message transmission method, system, device, equipment and computer readable storage medium
CN109343975B (en) Method and apparatus for inter-page asynchronous communication
US5815708A (en) Method and apparatus for dynamically loading method call exception code in response to a software method exception generated in a client/server computer system
CN115186260A (en) Applet risk detection method and device
CN113448655B (en) C standard dynamic library calling method and device
CN113806104A (en) Interface access request processing method, API gateway, server and system
US10846156B2 (en) Methods, devices and computer program products for managing software function
US20040243693A1 (en) Inbound connector
CN112579212A (en) Cross-language calling method, calling party device and called party device
CN112738181B (en) Method, device and server for cluster external IP access
CN112905273A (en) Service calling method and device
CN113742235A (en) Method and device for checking codes
CN112860398A (en) Data processing method, device, equipment and medium based on rule engine
CN113760487A (en) Service processing method and device
CN109376023B (en) Method and equipment for generating calling information and issuing return code group
CN112702270B (en) Node calling method, system and storage medium based on event distribution mechanism

Legal Events

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