CN111506442B - Local procedure call method, device, equipment and medium - Google Patents

Local procedure call method, device, equipment and medium Download PDF

Info

Publication number
CN111506442B
CN111506442B CN202010299179.0A CN202010299179A CN111506442B CN 111506442 B CN111506442 B CN 111506442B CN 202010299179 A CN202010299179 A CN 202010299179A CN 111506442 B CN111506442 B CN 111506442B
Authority
CN
China
Prior art keywords
function
session object
session
call
calling
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
CN202010299179.0A
Other languages
Chinese (zh)
Other versions
CN111506442A (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.)
Appeon Technology Shenzhen Co ltd
Original Assignee
Appeon Technology Shenzhen 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 Appeon Technology Shenzhen Co ltd filed Critical Appeon Technology Shenzhen Co ltd
Priority to CN202010299179.0A priority Critical patent/CN111506442B/en
Publication of CN111506442A publication Critical patent/CN111506442A/en
Application granted granted Critical
Publication of CN111506442B publication Critical patent/CN111506442B/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
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Abstract

The application discloses a local procedure call method, a device, equipment and a medium, comprising the following steps: creating a process connection object between the first process and the second process; creating a first session object corresponding to the first process; creating a second session object corresponding to the second process; calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; notifying a second session object to call a second process function through the first session object; acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter; and returning the function call result to the first process function through the first session object. The complexity of local procedure call can be reduced, and the program development and maintenance efficiency and the product stability are improved.

Description

Local procedure call method, device, equipment and medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a local procedure call method, apparatus, device, and medium.
Background
Conventional inter-process communication usually performs data exchange through pipes, messages, signals, sockets and the like, but these technologies only provide basic data or information interaction, and cannot meet the requirement of inter-process procedure call.
At present, in order to meet the requirement of inter-process procedure call, open-source remote procedure call frameworks such as gRPC and thread and Microsoft RPC (namely remote procedure call remote procedure call) appear, but the frameworks are based on Client and Server end concepts, are suitable for remote procedure call, have complex concepts, are inconvenient to develop and debug, are troublesome to deploy and have poor expansibility, and are not suitable for local procedure call.
Disclosure of Invention
In view of this, an object of the present application is to provide a local procedure call method, apparatus, device, and medium, which can reduce the complexity of local procedure call, thereby improving the efficiency of program development and maintenance and the stability of products. The specific scheme is as follows:
in a first aspect, the present application discloses a local procedure call method, including:
creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process;
Creating a first session object corresponding to the first process;
creating a second session object corresponding to the second process;
calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process;
notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process;
acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter;
and returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
Optionally, the creating the first session object corresponding to the first process includes:
transmitting a session creation request to the first connection object by using the first process function;
And creating the first session object corresponding to the first process by using the first connection object.
Optionally, the creating a second session object corresponding to the second process includes:
and sending a session creation request to the second connection object by using the first connection object so that the second connection object creates the second session object corresponding to the second process.
Optionally, the notifying, by the first session object, the second session object to make a call of a second process function includes:
and notifying the second session object to call a second process function through the first session object, wherein the first session object notifies the second session object to call the second process function through a synchronous object.
Optionally, the local procedure call method further includes:
the synchronization object is created by the first session object or the second session pair.
Optionally, after the calling the first session object function call interface by using the first process function and the target parameter is transferred to the first session object function call interface, the method further includes:
and packaging the target parameters into corresponding function call data, and placing the function call data in a shared memory by using the first session object so that the second session object reads the function call data from the shared memory after receiving a call notification corresponding to the second process function, and calling the second process function by using the function call data.
Optionally, the local procedure call method further includes:
the shared memory is created by the first session object or the second session object.
In a second aspect, the present application discloses a local procedure call device, including:
the process connection object creation module is used for creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process;
a first session object creation module, configured to create a first session object corresponding to the first process;
a second session object creation module, configured to create a second session object corresponding to the second process;
the session object interface calling module is used for calling a first session object function calling interface by using a first process function and transmitting target parameters to the first session object function calling interface; the first process function is a function corresponding to the first process;
a process function call notification module, configured to notify the second session object to perform a call of a second process function through the first session object; the second process function is a function corresponding to the second process;
The function call result acquisition module is used for acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter;
and the function call result returning module is used for returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
In a third aspect, the present application discloses a local procedure call device comprising a processor and a memory; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the foregoing local procedure call method.
In a fourth aspect, the present application discloses a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the aforementioned local procedure call method.
The method includes the steps that a process connection object between a first process and a second process is created; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process, a first session object corresponding to the first process is created, a second session object corresponding to the second process is created, then a first session object function call interface is called by using a first process function, and a target parameter is transmitted to the first session object function call interface; the first process function is a function corresponding to the first process, and the first session object informs the second session object of calling a second process function; the second process function is a function corresponding to the second process, and then a function calling result returned by the second session object is obtained through the first session object; and finally, returning the function calling result to the first process function through the first session object to complete the process call between the first process and the second process. In this way, the process call between the processes is carried out through the session objects of the two processes and the process function, so that the complexity of the local process call can be reduced, and the efficiency of program development and maintenance and the stability of products are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings may be obtained according to the provided drawings without inventive effort to a person skilled in the art.
FIG. 1 is a flow chart of a local procedure call method disclosed in the present application;
FIG. 2 is a flowchart of a specific local procedure call method disclosed herein;
FIG. 3 is a schematic diagram of a specific local procedure call architecture disclosed herein;
FIG. 4 is a schematic diagram of creating a synchronization object and a shared memory according to the disclosure;
FIG. 5 is a flow chart of the use of a synchronization object and shared memory disclosed in the present application;
FIG. 6 is a schematic diagram of a local procedure call device disclosed in the present application;
FIG. 7 is a block diagram of a local procedure call device disclosed herein;
fig. 8 is a block diagram of an electronic terminal disclosed in the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
At present, in order to meet the requirement of inter-process procedure call, open-source remote procedure call frameworks such as gRPC and thread and Microsoft RPC appear, but the frameworks are based on Client and Server end concepts, are suitable for remote procedure call, have complex concepts, are inconvenient to develop and debug, are troublesome to deploy and have poor expansibility, and are not suitable for local procedure call. Therefore, the application provides a local procedure call scheme which can reduce the complexity of local procedure call, thereby improving the efficiency of program development and maintenance and the stability of products.
Referring to fig. 1, an embodiment of the present application discloses a local procedure call method, including:
step S11: creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process.
Step S12: and creating a first session object corresponding to the first process.
In a specific implementation manner, the present embodiment sends a session creation request to the first connection object by using a first process function; and then creating the first session object corresponding to the first process by using the first connection object.
That is, the first process function requests the first connection object to create the first session object, and the first connection object creates the first session object.
Step S13: and creating a second session object corresponding to the second process.
In a specific embodiment, the embodiment uses the first connection object to send a session creation request to the second connection object, so that the second connection object creates the second session object corresponding to the second process.
That is, the first connection object requests creation of the second session object from the second connection object, and the second connection object creates the second session object.
Step S14: calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process.
That is, when a procedure call between the first process and the second process is performed, the first process function calls the first session object function call interface, and the target parameter is transferred into the first session object function call interface, so that the second process returns a call result corresponding to the target parameter.
In the object-oriented design, the first session object function call interface may be a first session object method call interface.
Step S15: notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process.
In a specific embodiment, the first session object notifies the second session object to call a second process function, wherein the first session object notifies the second session object to call the second process function through a synchronization object.
And, the present embodiment may create the synchronization object through the first session object or the second session pair. In a specific embodiment, after the first session object corresponding to the first process is created in the step S12, the synchronization object may be created through the first session object. In another specific embodiment, after the second session object corresponding to the second process is created in the step S13, if the first session object does not create the synchronization object, the synchronization object may be created through the second session pair.
Step S16: acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter.
That is, in this embodiment, after the first session object notifies the second session object to call the second process function, the second session object calls the second process function, and then returns the function call result to the second session object, and the second session object returns the function call result to the first session object.
Step S17: and returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
It can be appreciated that the present embodiment simplifies the concept of local process procedure call, and improves the efficiency of development and maintenance, and the efficiency of inter-process procedure call is high. In addition, the embodiment simplifies the related range of local procedure call and uses the most basic technology of the system, thereby improving the stability of the product, simultaneously, the understanding is simpler, the use is more convenient, and the user body is improved. And the configuration is convenient, the components are small and easy to integrate with products, and the system has expandability.
And, the present embodiment may be used for 32-bit process and 64-bit inter-process procedure bi-directional calls.
As can be seen, in the embodiment of the present application, a process connection object between a first process and a second process is created; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process, a first session object corresponding to the first process is created, a second session object corresponding to the second process is created, then a first session object function call interface is called by using a first process function, and a target parameter is transmitted to the first session object function call interface; the first process function is a function corresponding to the first process, and the first session object informs the second session object of calling a second process function; the second process function is a function corresponding to the second process, and then a function calling result returned by the second session object is obtained through the first session object; and finally, returning the function calling result to the first process function through the first session object to complete the process call between the first process and the second process. In this way, the process call between the processes is carried out through the session objects of the two processes and the process function, so that the complexity of the local process call can be reduced, and the efficiency of program development and maintenance and the stability of products are improved.
Referring to fig. 2, an embodiment of the present application provides a specific local procedure call method, including:
step S21: creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process.
Step S22: and creating a first session object corresponding to the first process.
Step S23: and creating a second session object corresponding to the second process.
Step S24: calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process.
Step S25: and packaging the target parameters into corresponding function call data, and placing the function call data in a shared memory by using the first session object.
Step S26: notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process.
In a specific embodiment, the first session object notifies the second session object to make a call of a second process function through a synchronization object. And after receiving a call notification corresponding to the second process function, the second session object reads the function call data from the shared memory and calls the second process function by using the function call data.
Moreover, the embodiment may create the shared memory through the first session object or the second session object. In a specific embodiment, after the first session object corresponding to the first process is created in the step S22, the shared memory may be created by using the first session object. In another specific embodiment, after the second session object corresponding to the second process is created in the step S23, if the first session object does not create the shared memory, the shared memory may be created through the second session pair.
It can be understood that the embodiment utilizes the shared memory, improves the performance of reading and writing data, and increases the support for big data.
Step S27: acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter.
In a specific embodiment, the second session object places the returned function call result in the shared memory, and notifies the first session object that there is a function call result in the shared memory through the synchronization object, and the first session object obtains the function call result returned by the second session object from the shared memory.
Step S28: and returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
For example, referring to fig. 3, an embodiment of the present application discloses a specific local procedure call structure schematic. Mainly involving six roles: process a, process B, function, connection object, session object, and shared memory. The first stage: sessions are created, which may be created internally to the function, facilitating stateless processing, and in other embodiments may be created externally to the function. 1. The process A function requests to the connection object to create a process A session object; 2. the process A connection object creates a process A session object, and the process A session object creates a synchronous object and a shared memory (also can be created by a process B session object); 3. the process A connection object requests to create a process B session object from the process B connection object; 4. the process B connection object creates a process B session object, and if the process A session object does not create a synchronous object and a shared memory, the process B session object is responsible for creation; second stage function call (support reverse call, namely, also can process B function call process A function), 5, process A function call process A conversation object function call interface, transfer relevant parameter; 6. the process A session object informs the process B session object to carry out function call; 7. the process B session object calls a process B function; 8. the process B function returns a function calling result to the process B session object; 9. the process B session object returns a function calling result to the process session A object; 10. and the process A session object returns a function calling result to the process A function, and the function calling is finished.
That is, the present application first establishes a basic connection mechanism between processes, then establishes a session (including a shared memory capable of providing high-performance big data and an event, a message, a signal, etc. for synchronization) through the connection mechanism in an inter-process procedure call, and implements the inter-process procedure call through the session. The specific working process is as follows: the method comprises the steps of firstly, creating an inter-process connection object between a process A and a process B; the second step of process A or B creates the session object containing the shared memory capable of providing high-performance big data and event, message or signal for synchronization through the connection object; step three, calling a session object calling interface by a function; step four, the current process session object is subjected to process calling; a fifth step of calling the realization interface by the called session object and returning a related execution result; and sixthly, returning a function calling result by the current process session object, ending the procedure call, and ending the session. Both processes a and B can make bi-directional calls through the second through sixth steps.
Referring to fig. 4, fig. 4 is a schematic diagram of a synchronization object and shared memory creation disclosed in the present application. 1. The process A session object creates a synchronous event object CreateEvent and the like by using a system interface, wherein the synchronous object can be an event object or a lock object or a signal and the like in a system and is used for notifying the other party that the session object shares the data in the memory. 2. The process A session object creates a shared memory CreateFileMapping using a system interface, the shared memory being used to share data. 3. The process B session object opens a synchronous event object OpenEvent and the like by using a system interface; 4. the process B session object opens the shared memory OpenFileMapping.
Referring to fig. 5, fig. 5 is a flowchart of a use of a synchronization object and a shared memory disclosed in the present application. 1. And (3) the session object of the process A receives the notification, and the session object of the process B reads the function call data from the shared memory to perform function call.
Referring to fig. 6, the present application discloses a local procedure call device, including:
a process connection object creation module 11, configured to create a process connection object between a first process and a second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process;
a first session object creation module 12, configured to create a first session object corresponding to the first process;
a second session object creating module 13, configured to create a second session object corresponding to the second process;
a session object interface calling module 14, configured to call a first session object function calling interface by using a first process function, and transfer a target parameter to the first session object function calling interface; the first process function is a function corresponding to the first process;
A process function call notification module 15, configured to notify the second session object to make a call of a second process function through the first session object; the second process function is a function corresponding to the second process;
a function call result obtaining module 16, configured to obtain, by using the first session object, a function call result returned by the second session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter;
and a function call result returning module 17, configured to return the function call result to the first process function through the first session object, so as to complete a procedure call between the first process and the second process.
As can be seen, in the embodiment of the present application, a process connection object between a first process and a second process is created; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process, a first session object corresponding to the first process is created, a second session object corresponding to the second process is created, then a first session object function call interface is called by using a first process function, and a target parameter is transmitted to the first session object function call interface; the first process function is a function corresponding to the first process, and the first session object informs the second session object of calling a second process function; the second process function is a function corresponding to the second process, and then a function calling result returned by the second session object is obtained through the first session object; and finally, returning the function calling result to the first process function through the first session object to complete the process call between the first process and the second process. In this way, the process call between the processes is carried out through the session objects of the two processes and the process function, so that the complexity of the local process call can be reduced, and the efficiency of program development and maintenance and the stability of products are improved.
Wherein, the first session object creating module 12 is specifically configured to send a session creation request to the first connection object by using the first process function; and creating the first session object corresponding to the first process by using the first connection object.
The second session object creation module 13 is specifically configured to send a session creation request to the second connection object by using the first connection object, so that the second connection object creates the second session object corresponding to the second process.
The process function call notification module 15 is specifically configured to notify the second session object to make a call of the second process function through the first session object, where the first session object notifies the second session object to make a call of the second process function through the synchronization object.
And the local procedure call device further comprises a synchronous object creation module for creating the synchronous object through the first session object or the second session pair.
The local procedure call device further comprises a function call data encapsulation module, which is used for encapsulating the target parameters into corresponding function call data.
The local procedure call device further comprises a function call data placement module, which is used for placing the function call data in a shared memory by utilizing the first session object, so that after the second session object receives a call notification corresponding to the second process function, the function call data is read from the shared memory, and the second process function is called by utilizing the function call data.
The local procedure call device further comprises a shared memory creation module, configured to create the shared memory through the first session object or the second session object.
Referring to fig. 7, fig. 7 is a diagram illustrating a local procedure call device according to an embodiment of the present application, including a processor 21 and a memory 22; wherein the memory 22 is used for storing a computer program; the processor 21 is configured to execute the computer program to implement the following steps:
creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process; creating a first session object corresponding to the first process; creating a second session object corresponding to the second process; calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process; notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process; acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter; and returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
As can be seen, in the embodiment of the present application, a process connection object between a first process and a second process is created; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process, a first session object corresponding to the first process is created, a second session object corresponding to the second process is created, then a first session object function call interface is called by using a first process function, and a target parameter is transmitted to the first session object function call interface; the first process function is a function corresponding to the first process, and the first session object informs the second session object of calling a second process function; the second process function is a function corresponding to the second process, and then a function calling result returned by the second session object is obtained through the first session object; and finally, returning the function calling result to the first process function through the first session object to complete the process call between the first process and the second process. In this way, the process call between the processes is carried out through the session objects of the two processes and the process function, so that the complexity of the local process call can be reduced, and the efficiency of program development and maintenance and the stability of products are improved.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: transmitting a session creation request to the first connection object by using the first process function; and creating the first session object corresponding to the first process by using the first connection object.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: and sending a session creation request to the second connection object by using the first connection object so that the second connection object creates the second session object corresponding to the second process.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: and notifying the second session object to call a second process function through the first session object, wherein the first session object notifies the second session object to call the second process function through a synchronous object.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: the synchronization object is created by the first session object or the second session pair.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: and packaging the target parameters into corresponding function call data, and placing the function call data in a shared memory by using the first session object so that the second session object reads the function call data from the shared memory after receiving a call notification corresponding to the second process function, and calling the second process function by using the function call data.
In this embodiment, when the processor 21 executes the computer subroutine stored in the memory 22, the following steps may be specifically implemented: the shared memory is created by the first session object or the second session object.
The memory 22 may be a carrier for storing resources, such as a read-only memory, a random access memory, a magnetic disk or an optical disk, and the storage mode may be transient storage or permanent storage.
Referring to fig. 8, an embodiment of the present application discloses an electronic terminal 20 including a processor 21 and a memory 22 as disclosed in the foregoing embodiments. The steps that the processor 21 may specifically perform may refer to the corresponding contents disclosed in the foregoing embodiments, and will not be described herein.
Further, the electronic terminal 20 in the present embodiment may further specifically include a power supply 23, a communication interface 24, an input/output interface 25, and a communication bus 26; wherein, the power supply 23 is used for providing working voltage for each hardware device on the terminal 20; the communication interface 24 can create a data transmission channel between the terminal 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 25 is used for acquiring external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application requirement, which is not limited herein.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program, wherein the computer program realizes the following steps when being executed by a processor:
creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process; creating a first session object corresponding to the first process; creating a second session object corresponding to the second process; calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process; notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process; acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter; and returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process.
As can be seen, in the embodiment of the present application, a process connection object between a first process and a second process is created; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process, a first session object corresponding to the first process is created, a second session object corresponding to the second process is created, then a first session object function call interface is called by using a first process function, and a target parameter is transmitted to the first session object function call interface; the first process function is a function corresponding to the first process, and the first session object informs the second session object of calling a second process function; the second process function is a function corresponding to the second process, and then a function calling result returned by the second session object is obtained through the first session object; and finally, returning the function calling result to the first process function through the first session object to complete the process call between the first process and the second process. In this way, the process call between the processes is carried out through the session objects of the two processes and the process function, so that the complexity of the local process call can be reduced, and the efficiency of program development and maintenance and the stability of products are improved.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: transmitting a session creation request to the first connection object by using the first process function; and creating the first session object corresponding to the first process by using the first connection object.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: and sending a session creation request to the second connection object by using the first connection object so that the second connection object creates the second session object corresponding to the second process.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: and notifying the second session object to call a second process function through the first session object, wherein the first session object notifies the second session object to call the second process function through a synchronous object.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: the synchronization object is created by the first session object or the second session pair.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: and packaging the target parameters into corresponding function call data, and placing the function call data in a shared memory by using the first session object so that the second session object reads the function call data from the shared memory after receiving a call notification corresponding to the second process function, and calling the second process function by using the function call data.
In this embodiment, when the computer subroutine stored in the computer readable storage medium is executed by the processor, the following steps may be specifically implemented: the shared memory is created by the first session object or the second session object.
In this specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, so that the same or similar parts between the embodiments are referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing has described in detail a local procedure call method, apparatus, device and medium, to which specific examples have been applied to illustrate the principles and embodiments of the present application, the above examples being provided only to assist in understanding the method and core idea of the present application; meanwhile, as those skilled in the art will have modifications in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (8)

1. A local procedure call method, comprising:
creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process;
Creating a first session object corresponding to the first process;
creating a second session object corresponding to the second process;
calling a first session object function call interface by using a first process function, and transmitting target parameters to the first session object function call interface; the first process function is a function corresponding to the first process;
notifying the second session object to call a second process function through the first session object; the second process function is a function corresponding to the second process;
acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter;
returning the function call result to the first process function through the first session object so as to complete the process call between the first process and the second process;
the creating the first session object corresponding to the first process includes: transmitting a session creation request to the first connection object by using the first process function; creating the first session object corresponding to the first process by using the first connection object;
And creating a second session object corresponding to the second process includes: and sending a session creation request to the second connection object by using the first connection object so that the second connection object creates the second session object corresponding to the second process.
2. The local procedure call method according to claim 1, wherein said notifying, by said first session object, said second session object to make a call to a second procedure function comprises:
and notifying the second session object to call a second process function through the first session object, wherein the first session object notifies the second session object to call the second process function through a synchronous object.
3. The local procedure call method of claim 2, further comprising:
the synchronization object is created by the first session object or the second session pair.
4. A local procedure call method as claimed in any one of claims 1 to 3, in which, after said calling a first session object function call interface with a first process function and entering a target parameter into said first session object function call interface, further comprises:
And packaging the target parameters into corresponding function call data, and placing the function call data in a shared memory by using the first session object so that the second session object reads the function call data from the shared memory after receiving a call notification corresponding to the second process function, and calling the second process function by using the function call data.
5. The local procedure call method of claim 4, further comprising:
the shared memory is created by the first session object or the second session object.
6. A local procedure call device, comprising:
the process connection object creation module is used for creating a process connection object between the first process and the second process; the process connection object comprises a first connection object corresponding to the first process and a second connection object corresponding to the second process;
a first session object creation module, configured to create a first session object corresponding to the first process;
a second session object creation module, configured to create a second session object corresponding to the second process;
the session object interface calling module is used for calling a first session object function calling interface by using a first process function and transmitting target parameters to the first session object function calling interface; the first process function is a function corresponding to the first process;
A process function call notification module, configured to notify the second session object to perform a call of a second process function through the first session object; the second process function is a function corresponding to the second process;
the function call result acquisition module is used for acquiring a function call result returned by the second session object through the first session object; the function calling result is a calling result returned to the second session object by the second process function, and the function calling result is a calling result corresponding to the target parameter;
a function call result returning module, configured to return the function call result to the first process function through the first session object, so as to complete a procedure call between the first process and the second process;
the first session object creating module is specifically configured to send a session creation request to the first connection object by using the first process function; creating the first session object corresponding to the first process by using the first connection object;
the second session object creation module is specifically configured to send a session creation request to the second connection object by using the first connection object, so that the second connection object creates the second session object corresponding to the second process.
7. A local procedure call device comprising a processor and a memory; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory is used for storing a computer program;
the processor for executing the computer program to implement the local procedure call method of any one of claims 1 to 5.
8. A computer readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the local procedure call method according to any one of claims 1 to 5.
CN202010299179.0A 2020-04-16 2020-04-16 Local procedure call method, device, equipment and medium Active CN111506442B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010299179.0A CN111506442B (en) 2020-04-16 2020-04-16 Local procedure call method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010299179.0A CN111506442B (en) 2020-04-16 2020-04-16 Local procedure call method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN111506442A CN111506442A (en) 2020-08-07
CN111506442B true CN111506442B (en) 2023-05-09

Family

ID=71869401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010299179.0A Active CN111506442B (en) 2020-04-16 2020-04-16 Local procedure call method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN111506442B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0695993A2 (en) * 1994-07-27 1996-02-07 International Business Machines Corporation System and method for interprocess communication
CN108132872A (en) * 2018-01-10 2018-06-08 成都信息工程大学 Based on the parallel super GRAPES system optimization methods for calculating grid cloud platform
CN110245027A (en) * 2018-09-21 2019-09-17 浙江大华技术股份有限公司 A kind of method and apparatus of interprocess communication
CN110489163A (en) * 2018-05-15 2019-11-22 北京三快在线科技有限公司 Recognition methods, device, equipment and the storage medium of remote procedure call
CN110532106A (en) * 2019-07-16 2019-12-03 华为技术有限公司 The means of communication, device, equipment and storage medium between process

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070106778A1 (en) * 2005-10-27 2007-05-10 Zeldin Paul E Information and status and statistics messaging method and system for inter-process communication
JP4641506B2 (en) * 2006-03-13 2011-03-02 富士通株式会社 Session management program, session management method, and session management apparatus

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0695993A2 (en) * 1994-07-27 1996-02-07 International Business Machines Corporation System and method for interprocess communication
CN108132872A (en) * 2018-01-10 2018-06-08 成都信息工程大学 Based on the parallel super GRAPES system optimization methods for calculating grid cloud platform
CN110489163A (en) * 2018-05-15 2019-11-22 北京三快在线科技有限公司 Recognition methods, device, equipment and the storage medium of remote procedure call
CN110245027A (en) * 2018-09-21 2019-09-17 浙江大华技术股份有限公司 A kind of method and apparatus of interprocess communication
CN110532106A (en) * 2019-07-16 2019-12-03 华为技术有限公司 The means of communication, device, equipment and storage medium between process

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吴涛,张素娟,李伟.Linux进程调度的数据结构.河北理工学院学报.(第02期),全文. *

Also Published As

Publication number Publication date
CN111506442A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
US20240119969A1 (en) Video processing method and apparatus, electronic device and storage medium
CN112835632B (en) Method and equipment for calling end capability and computer storage medium
CN111240858A (en) Event scheduling method and component
US20240104513A1 (en) Schedule sharing method, apparatus, and device
CN106357654B (en) Remote procedure calling method, device and communication system
CN110582998A (en) Group communication method and device, computer storage medium and computer equipment
CN111506442B (en) Local procedure call method, device, equipment and medium
CN110958562B (en) Modulation mode selection method, near field communication device and storage medium
CN108536805A (en) web access method and device
CN112689012A (en) Cross-network proxy communication method and device
CN114697888B (en) 5G message processing method, device and storage medium
CN113542217B (en) Service subscription system
CN111522605B (en) Local procedure calling method, device, equipment and medium
CN108108170A (en) A kind of decoupling method and system of component
CN114595080A (en) Data processing method and device, electronic equipment and computer readable storage medium
US9092779B2 (en) Heuristics processing
CN109669793B (en) Object calling method in middleware process
CN113596328A (en) Camera calling method and device and electronic equipment
WO2023246756A1 (en) Computing power service method and apparatus, terminal, and core network device
CN117201577B (en) Communication method and system of cross-platform API and SPI based on PISA
CN107528769A (en) Terminal, service end and instant communication method and system
CN112104980B (en) Method and device for assisting in positioning terminal
CN101022432A (en) Information display in accordance with inserting family gateway and interactive method
CN113709085A (en) Remote procedure call processing method, device and equipment
CN117835213A (en) Information acquisition method and device, terminal equipment and network side equipment

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