CN109710426A - A kind of inter-process communication methods and relevant device - Google Patents
A kind of inter-process communication methods and relevant device Download PDFInfo
- Publication number
- CN109710426A CN109710426A CN201811584275.9A CN201811584275A CN109710426A CN 109710426 A CN109710426 A CN 109710426A CN 201811584275 A CN201811584275 A CN 201811584275A CN 109710426 A CN109710426 A CN 109710426A
- Authority
- CN
- China
- Prior art keywords
- function
- parameter
- server
- name
- value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 96
- 238000004891 communication Methods 0.000 title claims abstract description 43
- 230000006870 function Effects 0.000 claims abstract description 406
- 230000005540 biological transmission Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 12
- 241000208340 Araliaceae Species 0.000 description 8
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 8
- 235000003140 Panax quinquefolius Nutrition 0.000 description 8
- 235000008434 ginseng Nutrition 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 2
- 238000007667 floating Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 238000004883 computer application Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 210000003733 optic disk Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of inter-process communication methods and relevant devices, comprising: server-side initially sets up function call library;Then the function call request that client is sent is received, the function call request includes function name, the first parameter name and the corresponding parameter value of the first parameter name;Then the corresponding object invocation function of function name is searched from function call library;Finally according to the first parameter name, parameter value is substituted into progress operation in object invocation function and obtains function return value, and send function return value to client, the function return value is used to indicate the executable program where client executing object invocation function.Using the embodiment of the present invention, the communication efficiency between process can be improved, and server-side can according to need the calling function of registration multiple functions, to improve the versatility of inter-process communication methods disclosed by the invention.
Description
Technical field
The present invention relates to computer application technology more particularly to a kind of inter-process communication methods and relevant device.
Background technique
Interprocess communication (InterProcess Communication, IPC), which refers to, propagates or is handed between different processes
Change information.Currently, relatively common interprocess communication mode, which has, sends message, event notice, shared drive, pipeline etc., these
Method is generally existing to be had a single function, using complexity and the defect for needing to expend a large amount of learning costs, and the communication between process is caused
Efficiency is unable to get raising.
Summary of the invention
The present invention provides a kind of inter-process communication methods and relevant devices.It can be between the communication efficiency between process and process
The versatility of communication means.
First aspect of the embodiment of the present invention provides a kind of inter-process communication methods, comprising:
Server-side establishes function call library, and the function call library includes multiple calling functions of registration;
The server-side receives the function call request that client is sent, the function call request include function name,
First parameter name and the corresponding parameter value of the first parameter name;
The server-side searches the corresponding object invocation function of the function name from the function call library;
The parameter value is substituted into the object invocation function and is carried out according to first parameter name by the server-side
Operation obtains function return value;
The server-side sends the function return value to the client, and the function return value is used to indicate the visitor
Family end executes the executable program where the object invocation function.
Wherein, described according to first parameter name, the parameter value is substituted into the object invocation function and is carried out
Operation obtains function return value
The server-side determines the second parameter name of the formal parameter of the object invocation function;
The server-side is by second parameter name formal parameter assignment identical with first parameter name
For the corresponding parameter value of first parameter name;
The server-side executes the object invocation function and obtains the function and return according to the formal parameter after assignment
Return value.
Wherein, described to be assigned a value of second parameter name formal parameter identical with first parameter name
Before the corresponding parameter value of first parameter name, further includes:
The server-side determines the first data type of the corresponding parameter value of first parameter name and determines
Second data type of second parameter name formal parameter identical with first parameter name;
The server-side when first data type is identical as second data type, join described second by execution
It is several that identical with first parameter name formal parameter is claimed to be assigned a value of the corresponding ginseng of first parameter name
The operation of numerical value.
Wherein, the method also includes:
The server-side is not when first data type and second data type be identical, Xiang Suoshu client hair
The first prompt information is sent, first prompt information is used to prompt the parameter of object invocation function described in the client to transmit mistake
It loses.
Wherein, the parameter value is substituted into the object invocation function according to first parameter name by the server-side
Middle progress operation obtains before function return value, further includes:
The server-side determines first of at least one first parameter name included by the function call request
Total quantity and the second total quantity for determining at least one formal parameter included by the object invocation function;
The server-side is executed when first total quantity is identical as second total quantity according to first parameter
The parameter value is substituted into progress operation in the object invocation function and obtains the operation of function return value by title.
Wherein, the method also includes:
For the server-side when first total quantity and second total quantity be not identical, Xiang Suoshu client sends the
Two prompt informations, second prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
Second aspect of the embodiment of the present invention provides another inter-process communication methods, comprising:
Client to server-side send function call request, the function call request include function name, parameter name,
And the corresponding parameter value of the parameter name, the function call request are used to indicate the server-side and execute the function name
Claim corresponding object invocation function;
The client receives the function return value for the object invocation function that the server-side is sent.
Wherein, the method also includes:
Client timing since when sending the function call request to the server-side;
When the timing duration reaches preset threshold, if the client does not receive the function return value, to
The server-side retransmits the function call request.
Wherein, the method also includes:
The client receives the prompt information that the server-side is sent;
The client retransmits the function call request according to the prompt information, Xiang Suoshu server-side.
Correspondingly, the third aspect of the embodiment of the present invention provides a kind of server-side, comprising:
Creation module, for establishing function call library, the function call library includes multiple calling functions of registration;
Receiving module, for receiving the function call request of client transmission, the function call request includes function name
Title, the first parameter name and the corresponding parameter value of the first parameter name;
Execution module, for searching the corresponding object invocation function of the function name from the function call library;
The execution module, is also used to according to first parameter name, and the parameter value is substituted into the object invocation
Operation is carried out in function obtains function return value;
Sending module, for sending the function return value to the client, the function return value is used to indicate institute
State the executable program where object invocation function described in client executing.
Wherein, the execution module is also used to:
Determine the second parameter name of the formal parameter of the object invocation function;
Second parameter name formal parameter identical with first parameter name is assigned a value of described first
The corresponding parameter value of parameter name;
According to the formal parameter after assignment, executes the object invocation function and obtain the function return value.
Wherein, the execution module is also used to:
It determines the first data type of the corresponding parameter value of first parameter name and determines second ginseng
Several the second data types for claiming the formal parameter identical with first parameter name;
When first data type is identical as second data type, execute second parameter name and institute
State the operation that the identical formal parameter of the first parameter name is assigned a value of the corresponding parameter value of first parameter name.
Wherein, the sending module is also used to:
When first data type and second data type be not identical, Xiang Suoshu client sends the first prompt
Information, first prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
Wherein, the execution module is also used to:
Determine the first total quantity of at least one first parameter name included by the function call request and
Determine the second total quantity of at least one formal parameter included by the object invocation function;
When first total quantity is identical as second total quantity, execute according to first parameter name, by institute
State parameter value substitute into the object invocation function carry out operation obtain the operation of function return value.
Wherein, the sending module is also used to:
When first total quantity and second total quantity be not identical, Xiang Suoshu client sends the second prompt letter
Breath, second prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
Correspondingly, fourth aspect of the embodiment of the present invention provides a kind of client, comprising:
Sending module, for sending function call request to server-side, the function call request includes function name, ginseng
Several titles and the corresponding parameter value of the parameter name, the function call request are used to indicate the server-side and execute institute
State the corresponding object invocation function of function name;
Receiving module, for receiving the function return value for the object invocation function that the server-side is sent.
Wherein, the sending module is also used to:
The timing since when sending the function call request to the server-side;
When the timing duration reaches preset threshold, if not receiving the function return value, to the server-side
Retransmit the function call request.
Wherein, the receiving module is also used to:
Receive the prompt information that the server-side is sent;
The sending module is also used to:
According to the prompt information, Xiang Suoshu server-side retransmits the function call request.
Correspondingly, the embodiment of the invention provides a kind of storage mediums, wherein the storage medium applies journey for storing
Sequence, the application program for executing a kind of inter-process communication methods disclosed in first aspect of the embodiment of the present invention at runtime.
Correspondingly, the embodiment of the invention provides a kind of storage mediums, wherein the storage medium applies journey for storing
Sequence, the application program for execute the embodiment of the present invention the at runtime and aspect disclosed in a kind of inter-process communication methods.
Correspondingly, the embodiment of the invention provides a kind of application programs, wherein the application program for holding at runtime
A kind of inter-process communication methods disclosed in row first aspect of the embodiment of the present invention.
Correspondingly, the embodiment of the invention provides a kind of application programs, wherein the application program for holding at runtime
A kind of inter-process communication methods disclosed in row second aspect of the embodiment of the present invention.
Implement the embodiment of the present invention, server-side initially sets up function call library, then receives the function tune that client is sent
With request, the function call request includes function name, the first parameter name and the corresponding parameter of the first parameter name
Value;Then the corresponding object invocation function of the function name is searched from the function call library;Finally according to described first
The parameter value is substituted into the object invocation function and carries out operation and obtain function return value by parameter name, and to client
Function return value is sent, the function return value can serve to indicate that the executable journey where client executing object invocation function
Sequence.The communication efficiency between process can be improved, and server-side can according to need the calling function of registration multiple functions, thus
The versatility of method in the embodiment of the present invention of raising.
Detailed description of the invention
In order to illustrate the technical solution of the embodiments of the present invention more clearly, required use in being described below to embodiment
Attached drawing be briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for this field
For those of ordinary skill, without creative efforts, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of inter-process communication methods provided in an embodiment of the present invention;
Fig. 2 is the flow diagram of another inter-process communication methods provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of the structure of server-side provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of client provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram of the structure of another server-side provided in an embodiment of the present invention;
Fig. 6 is the structural schematic diagram of another client provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is a kind of flow diagram of inter-process communication methods provided in an embodiment of the present invention.Such as figure
Shown, the method in the embodiment of the present invention includes:
S101, server-side establish function call library.
In the specific implementation, server-side can be the process for providing for other processes and calling function.Server-side can be registered more
A calling function, and multiple calling functions are put into function call library.Wherein, function is called to refer to and can call for principal function
Function, wherein principal function be executable program entrance function.Calling function includes function name, function body, formal parameter
(abbreviation parameter) needs to state the data type of function return value and the data type of parameter when function is called in registration,
In, function body includes the arithmetic logic of entire function.
By taking C language as an example, as follows be a callings function, wherein the function name of the calling function be create,
The data type of parameter P1 and P2 are respectively that the data type of int (integer) and float (floating type) and function return value is
Double (double-precision floating point type).
double create(int P1,float P2)
{ function body }
S102, server-side receive client send function call request, the function call request include function name,
First parameter name and the corresponding parameter value of the first parameter name.
In the specific implementation, server-side can be, but not limited to establish pipeline with client and connect so that both sides communicate.Letter
It include a function name and at least one first parameter name in number call request, and each first parameter name corresponds to one
A parameter value.Parameter name can be, but not limited to can be, but not limited to for letter, character string and parameter value as character, character
String and number.Wherein, the function call request that server-side receives can be but be not limited to JSON string as follows,
In, Function and " function name " are a pair of of key-value pair, Param and { " the first parameter name -1 ": " parameter value -1 ", " first
Parameter name -2 ": " parameter value 2 " ... it is a pair of of key-value pair and " the first parameter name-n " and " parameter value-n " is a pair
Key-value pair, n=1,2,3 ....
S103, server-side search the corresponding object invocation function of the function name from the function call library.
In the specific implementation, server-side can call the function name and function of each calling function in function call library
Function name in request is matched.When in the function name and function call request of the calling function in function call library
When function name is identical, which is determined as object invocation function.
Optionally, when not including the identical calling function of function name in and function call request in function call library
When, server-side can send prompt information to client, and to inform client, in server-side, there is no corresponding with the function name
Call function.
The parameter value is substituted into the object invocation function and carried out by S104, server-side according to first parameter name
Operation obtains function return value.
In the specific implementation, server-side can determine the second parameter name of the formal parameter of object invocation function first,
In, object invocation function includes at least one formal parameter;Then by the second parameter name shape identical with the first parameter name
Formula parameter assignment is the corresponding parameter value of the first parameter name, this process is the process of parameter transmitting, wherein first ginseng
It is several that corresponding parameter value is claimed to be equivalent to the corresponding actual parameter of formal parameter (abbreviation argument).Then, according to the shape after assignment
Formula parameter performance objective calls function.
Such as: function call request is
Object invocation function sum is
It then can be convenient according to the key-value pair in function call request and parse parameter name therein and each parameter name
Claim corresponding parameter value, and the parameter name is matched with the parameter x and y in sum, is assigned so that x in sum is assigned a value of 1, y
Value is 2.8, finally executes sum and obtains the function return value 3.8 of sum.
S105, server-side send the function return value to the client.
In specific implementation, function return value can serve to indicate that the executable journey where client executing object invocation function
Sequence.
In embodiments of the present invention, server-side initially sets up function call library, then receives the function tune that client is sent
With request, the function call request includes function name, the first parameter name and the corresponding parameter of the first parameter name
Value;Then the corresponding object invocation function of the function name is searched from the function call library;Finally according to described first
The parameter value is substituted into the object invocation function and carries out operation and obtain function return value by parameter name, and to client
Function return value is sent, the function return value can serve to indicate that the executable journey where client executing object invocation function
Sequence.The communication efficiency between process can be improved, and server-side can according to need the calling function of registration multiple functions, thus
The versatility of method in the embodiment of the present invention of raising.
Referring to FIG. 2, Fig. 2 is the flow diagram of another inter-process communication methods provided in an embodiment of the present invention.Such as
Shown in figure, the method in the embodiment of the present invention includes:
S201, server-side establish function call library.This step is identical as the S101 of a upper embodiment, this step is no longer superfluous
It states.
S202, client send function call request to server-side, and the function call request includes function name, first
Parameter name and the corresponding parameter value of the first parameter name.
In the specific implementation, client can be the process of an execution executable program, wherein executing the executable journey
Need to call external calling function during sequence, and client can be, but not limited to connect by pipeline and server-side into
Row communication.Function name included by function call request is function name, the first parameter name for the calling function for needing to call
The formal parameter and the corresponding parameter value of the first parameter name for the calling function for referred to as needing to call are that formal parameter is corresponding
Actual parameter.
For example, being as follows executable program performed by client, wherein main is principal function, sum be need from
The calling function of external call, wherein the parameter of sum includes x and y.
Client executes the instruction in the executable program one by one since first of main instruction, when going to " R=
sum(a,b);" when client to server-side send function call request.
S203, server-side search the corresponding object invocation function of function name from function call library.This step and upper one
S103 in embodiment is identical, this step repeats no more.
Parameter value is substituted into progress operation in object invocation function and obtains letter by S204, server-side according to the first parameter name
Number return value.
Optionally, the second parameter name formal parameter identical with the first parameter name is being assigned a value of first parameter name
Before claiming corresponding parameter value, it can also determine that the first data type of the formal parameter and first parameter name are corresponding
Parameter value the second data type, then the first data type is matched with the second data type.If the first data class
Type is identical as the second data type, then by the second parameter name formal parameter identical with the first parameter name be assigned a value of this first
The corresponding parameter value of parameter name.
Optionally, if the first data type and the second data type be not identical, it is equivalent to the form ginseng of object invocation function
Several and actual parameter data type mismatches, then server-side can send prompt information, first prompt information to client
For prompting client objectives to call the parameter transmitting failure of function.
Optionally, the first total of at least one the first parameter name included by function call request can also be determined first
Second total quantity of at least one formal parameter of quantity and object invocation function;Then, if the first total quantity is total with second
Quantity is identical, then executes parameter value substituting into the operation that object invocation function carries out operation.
Optionally, if the first quantity and the second quantity is not identical, the formal parameter and reality of object invocation function are equivalent to
The quantity of parameter mismatches, then server-side can send prompt information to client, and first prompt information is for prompting client
The parameter of object invocation function is held to transmit failure.
Function return value is sent to client by S205, server-side.
In the specific implementation, function return value, which is used to indicate client, can continue to execute executable program.
Optionally, client can also the timing since sending function call request, when timing duration reaches preset threshold
When (such as 10 seconds), if client does not receive the function return value of server-side transmission yet, client can be to server-side again
Send function call request.
The prompt information that optional client can also be sent according to the server-side received is checking function name, ginseng
After the data type of several titles and parameter value, function call request is retransmitted to server-side.
In embodiments of the present invention, it includes multiple function call libraries for calling function that server-side, which is established, first;Work as client
When having the demand of function call, function call request is sent to server-side;Then server-side includes according in function call request
Function name object invocation function is searched from function call library, and according to the parameter name for including in function call request
And parameter value, performance objective call function to obtain function return value;Function return value is sent to client by last server-side, with
Just client continues to execute executable program according to function return value.It can effectively improve the communication efficiency between process, and take
Business end can according to need the calling function of registration multiple functions, so that the method in the embodiment of the present invention improved is general
Property.
Referring to FIG. 3, Fig. 3 is a kind of server-side structural schematic diagram provided in an embodiment of the present invention.As shown, of the invention
Server-side in embodiment includes:
Creation module 301, for establishing function call library.
In the specific implementation, multiple calling functions can be registered, and multiple calling functions are put into function call library.Its
In, call function to refer to the function that can be called for principal function, wherein principal function is the entrance function of executable program.It calls
Function includes function name, function body, formal parameter (abbreviation parameter), needs to state function return value when function is called in registration
Data type and parameter data type, wherein function body includes the arithmetic logic of entire function.
Receiving module 302, for receiving the function call request of client transmission, the function call request includes function
Title, the first parameter name and the corresponding parameter value of the first parameter name.
In the specific implementation, server-side can be, but not limited to establish pipeline with client and connect so that both sides communicate.Letter
It include a function name and at least one first parameter name in number call request, and each first parameter name corresponds to one
A parameter value.Parameter name can be, but not limited to can be, but not limited to for letter, character string and parameter value as character, character
String and number.
Execution module 303, for searching the corresponding object invocation function of the function name from the function call library.
In the specific implementation, can will be in the function name and function call request of each calling function in function call library
Function name matched.Function name in the function name and function call request of the calling function in function call library
When claiming identical, which is determined as object invocation function.
Execution module 303, is also used to according to first parameter name, and the parameter value is substituted into the object invocation letter
Number carries out operation and obtains function return value.
Specifically, the second parameter name of the formal parameter of object invocation function can be determined first, wherein object invocation
Function includes at least one formal parameter;Then the second parameter name formal parameter identical with the first parameter name is assigned a value of
The corresponding parameter value of first parameter name, this process are the process of parameter transmitting, wherein first parameter name is corresponding
Parameter value is equivalent to the corresponding actual parameter of formal parameter (abbreviation argument).Then, mesh is executed according to the formal parameter after assignment
Mark calls function.
Sending module 304, for sending the function return value to the client.
Optionally, sending module 304 is also used in function call library not include the function name in and function call request
When claiming identical calling function, prompt information is sent to client, to inform that client is not present and the function name in server-side
Corresponding calling function.
Optionally, execution module 303 is also used to by the second parameter name formal parameter identical with the first parameter name
Be assigned a value of before the corresponding parameter value of the first parameter name, can also determine the formal parameter the first data type and
Then second data type of the corresponding parameter value of the first parameter name carries out the first data type and the second data type
Matching.If the first data type is identical as the second data type, by the second parameter name shape identical with the first parameter name
Formula parameter assignment is the corresponding parameter value of the first parameter name.
Optionally, sending module 304 is also used to be equivalent to mesh when the first data type and the second data type be not identical
When mark calls the formal parameter of function and the data type of actual parameter to mismatch, prompt information is sent to client, this first
The parameter transmitting failure that prompt information is used to that client objectives to be prompted to call function.
Optionally, execution module 303 is also used to determine at least one first parameter name included by function call request
The first total quantity and object invocation function at least one formal parameter the second total quantity;Then, if the first total quantity
It is identical as the second total quantity, then it executes and parameter value is substituted into the operation that object invocation function carries out operation.
Optionally, sending module 304 is also used to be equivalent to object invocation letter when the first quantity and the second quantity is not identical
When the quantity of several formal parameters and actual parameter mismatches, prompt information is sent to client, which is used for
The parameter for prompting client objectives to call function transmits failure.
In embodiments of the present invention, server-side initially sets up function call library, then receives the function tune that client is sent
With request, the function call request includes function name, the first parameter name and the corresponding parameter of the first parameter name
Value;Then the corresponding object invocation function of the function name is searched from the function call library;Finally according to described first
The parameter value is substituted into the object invocation function and carries out operation and obtain function return value by parameter name, and to client
Function return value is sent, the function return value can serve to indicate that the executable journey where client executing object invocation function
Sequence.The communication efficiency between process can be improved, and server-side can according to need the calling function of registration multiple functions, thus
The versatility of method in the embodiment of the present invention of raising.
Referring to FIG. 4, Fig. 4 is a kind of structural schematic diagram of client provided in an embodiment of the present invention.As shown, this hair
Client in bright embodiment includes:
Sending module 401, for sending function call request to server-side, the function call request includes function name
Title, the first parameter name and the corresponding parameter value of the first parameter name.
Function call request is sent in the specific implementation, can be, but not limited to be connected by pipeline to server-side.Function call
The included function name of request is the function name for the calling function that needs call, the first parameter name is the tune for needing to call
It is the corresponding actual parameter of formal parameter with the formal parameter of function and the corresponding parameter value of the first parameter name.
Receiving module 402, the function return value sent for receiving the server-side.
Wherein, the client in the embodiment of the present invention further includes that execution module is used to complete can be performed according to function return value
The execution of program.
Optionally, sending module 401 is also used to the timing since when sending function call request to server-side, when timing
When length reaches preset threshold, if not receiving the function return value of server-side transmission also, the function is retransmitted to server-side
Call request.
Optionally, receiving module 402 is also used to receive the prompt information of server-side transmission, and sending module 403 is also used to root
According to the prompt information, to clothes after the data type for checking function name, parameter name and the corresponding parameter value of parameter name
Business end retransmits the function call request.
In embodiments of the present invention, client is when executing executable program, when needing the calling function outside calling,
Function call request can be sent to indicate that server-side executes the calling function to server-side first, which includes
Title, the parameter name of the formal parameter of the function of calling and the corresponding practical ginseng of formal parameter for the function for needing to call
Number;Then the function return value that server-side is sent is received;Then executable program is continued to execute according to the function return value.It can be with
Effectively improve the communication efficiency between process.
Referring to FIG. 5, Fig. 5 is the structural schematic diagram of another server-side provided in an embodiment of the present invention.As shown, should
Server-side may include: at least one processor 501, such as CPU, at least one communication interface 502, at least one processor
503, at least one bus 504.Wherein, bus 504 is for realizing the connection communication between these components.Wherein, the present invention is real
The communication interface 502 for applying server-side in example is wired sending port, or wireless device is used for example including antenna assembly
In the communication for carrying out signaling or data with other node devices.Memory 503 can be high speed RAM memory, be also possible to non-
Unstable memory (non-volatile memory), for example, at least a magnetic disk storage.Memory 503 is optionally gone back
It can be at least one storage device for being located remotely from aforementioned processor 501.Batch processing code is stored in memory 503, and
Processor 501 is for calling the program code stored in memory, for performing the following operations:
Function call library is established, the function call library includes multiple calling functions of registration;
The function call request that client is sent is received, the function call request includes function name, the first parameter name
Title and the corresponding parameter value of the first parameter name;
The corresponding object invocation function of the function name is searched from the function call library;
According to first parameter name, the parameter value is substituted into progress operation in the object invocation function and obtains letter
Number return value;
The function return value is sent to the client, the function return value is used to indicate the client executing institute
State the executable program where object invocation function.
Wherein, processor 501 is also used to perform the following operations step:
Determine the second parameter name of the formal parameter of the object invocation function;
Second parameter name formal parameter identical with first parameter name is assigned a value of described first
The corresponding parameter value of parameter name;
According to the formal parameter after assignment, executes the object invocation function and obtain the function return value.
Wherein, processor 501 is also used to perform the following operations step:
It determines the first data type of the corresponding parameter value of first parameter name and determines second ginseng
Several the second data types for claiming the formal parameter identical with first parameter name;
When first data type is identical as second data type, execute second parameter name and institute
State the operation that the identical formal parameter of the first parameter name is assigned a value of the corresponding parameter value of first parameter name.
Wherein, processor 501 is also used to perform the following operations step:
When first data type and second data type be not identical, Xiang Suoshu client sends the first prompt
Information, first prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
Wherein, processor 501 is also used to perform the following operations step:
Determine the first total quantity of at least one first parameter name included by the function call request and
Determine the second total quantity of at least one formal parameter included by the object invocation function;
When first total quantity is identical as second total quantity, execute according to first parameter name, by institute
State parameter value substitute into the object invocation function carry out operation obtain the operation of function return value.
Wherein, processor 501 is also used to perform the following operations step:
When first total quantity and second total quantity be not identical, Xiang Suoshu client sends the second prompt letter
Breath, second prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
It should be noted that the embodiment of the present invention also provides a kind of storage medium simultaneously, the storage medium is for storing
Application program, the application program are held for executing server-side in Fig. 1 and a kind of inter-process communication methods shown in Fig. 2 at runtime
Capable operation.
It should be noted that the embodiment of the present invention also provides a kind of application program simultaneously, the application program is for transporting
The operation that server-side executes in Fig. 1 and a kind of inter-process communication methods shown in Fig. 2 is executed when row.
Referring to FIG. 6, Fig. 6 is the structural schematic diagram of another client provided in an embodiment of the present invention.As shown, should
Client may include: at least one processor 601, such as CPU, at least one communication interface 602, at least one processor
603, at least one bus 604.Wherein, bus 604 is for realizing the connection communication between these components.Wherein, the present invention is real
The communication interface 602 for applying client in example is wired sending port, or wireless device is used for example including antenna assembly
In the communication for carrying out signaling or data with other node devices.Memory 603 can be high speed RAM memory, be also possible to non-
Unstable memory (non-volatile memory), for example, at least a magnetic disk storage.Memory 603 is optionally gone back
It can be at least one storage device for being located remotely from aforementioned processor 601.Batch processing code is stored in memory 603, and
Processor 601 is for calling the program code stored in memory, for performing the following operations:
Function call request is sent to server-side, the function call request includes function name, parameter name, Yi Jisuo
The corresponding parameter value of parameter name is stated, it is corresponding that the function call request is used to indicate the server-side execution function name
Object invocation function;
Receive the function return value for the object invocation function that the server-side is sent.
Wherein, processor 601 is also used to perform the following operations step:
The timing since when sending the function call request to the server-side;
When the timing duration reaches preset threshold, if not receiving the function return value, to the server-side
Retransmit the function call request.
Wherein, processor 601 is also used to perform the following operations step:
Receive the prompt information that the server-side is sent;
According to the prompt information, Xiang Suoshu server-side retransmits the function call request.
It should be noted that the embodiment of the present invention also provides a kind of storage medium simultaneously, the storage medium is for storing
Application program, the application program are held for executing client in Fig. 1 and a kind of inter-process communication methods shown in Fig. 2 at runtime
Capable operation.
It should be noted that the embodiment of the present invention also provides a kind of application program simultaneously, the application program is for transporting
The operation of client executing in Fig. 1 and a kind of inter-process communication methods shown in Fig. 2 is executed when row.
It should be noted that for simple description, therefore, it is stated as a systems for each embodiment of the method above-mentioned
The combination of actions of column, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described, because
For according to the present invention, certain some step can be performed in other orders or simultaneously.Secondly, those skilled in the art also should
Know, the embodiments described in the specification are all preferred embodiments, related actions and modules not necessarily this hair
Necessary to bright.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in some embodiment
Part, reference can be made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can
It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage
Medium may include: flash disk, read-only memory (English: Read-Only Memory, abbreviation: ROM), random access device (English
Text: Random Access Memory, referred to as: RAM), disk or CD etc..
It is provided for the embodiments of the invention content download method above and relevant device, system are described in detail,
Used herein a specific example illustrates the principle and implementation of the invention, and the explanation of above embodiments is only used
In facilitating the understanding of the method and its core concept of the invention;At the same time, for those skilled in the art, according to the present invention
Thought, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not be construed as
Limitation of the present invention.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office
It can be combined in any suitable manner in one or more embodiment or examples.In addition, without conflicting with each other, the skill of this field
Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples
It closes and combines.
In addition, term " first ", " second " are used for descriptive purposes only and cannot be understood as indicating or suggesting relative importance
Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or
Implicitly include at least one this feature.In the description of the present invention, the meaning of " plurality " is at least two, such as two, three
It is a etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable
Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction
The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings
Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable
Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned
In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries
It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium
In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module
It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above
The embodiment of the present invention is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as to limit of the invention
System, those skilled in the art can be changed above-described embodiment, modify, replace and become within the scope of the invention
Type.
Claims (10)
1. a kind of inter-process communication methods, which is characterized in that the described method includes:
Server-side establishes function call library, and the function call library includes multiple calling functions of registration;
The server-side receives the function call request that client is sent, and the function call request includes function name, first
Parameter name and the corresponding parameter value of the first parameter name;
The server-side searches the corresponding object invocation function of the function name from the function call library;
The parameter value is substituted into the object invocation function according to first parameter name and carries out operation by the server-side
Obtain function return value;
The server-side sends the function return value to the client, and the function return value is used to indicate the client
Execute the executable program where the object invocation function.
2. the method as described in claim 1, which is characterized in that it is described according to first parameter name, by the parameter value
It substitutes into the object invocation function and carries out operation and obtain function return value and include:
The server-side determines the second parameter name of the formal parameter of the object invocation function;
Second parameter name formal parameter identical with first parameter name is assigned a value of institute by the server-side
State the corresponding parameter value of the first parameter name;
The server-side executes the object invocation function and obtains the function return according to the formal parameter after assignment
Value.
3. method according to claim 2, which is characterized in that described by second parameter name and first parameter name
The identical formal parameter is claimed to be assigned a value of before the corresponding parameter value of first parameter name, further includes:
The server-side determines described in the first data type and determination of the corresponding parameter value of first parameter name
Second data type of the second parameter name formal parameter identical with first parameter name;
The server-side is executed when first data type is identical as second data type by second parameter name
Identical with first parameter name formal parameter is claimed to be assigned a value of the corresponding parameter value of first parameter name
Operation.
4. method as claimed in claim 3, which is characterized in that the method also includes:
For the server-side when first data type and second data type be not identical, Xiang Suoshu client sends the
One prompt information, first prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
5. the method as described in claim 1, which is characterized in that the server-side, will be described according to first parameter name
Parameter value, which substitutes into the object invocation function, to carry out before operation obtains function return value, further includes:
The server-side determines the first sum of at least one first parameter name included by the function call request
Amount and the second total quantity for determining at least one formal parameter included by the object invocation function;
The server-side is executed when first total quantity is identical as second total quantity according to first parameter name
Claim, the parameter value is substituted into progress operation in the object invocation function and obtains the operation of function return value.
6. method as claimed in claim 5, which is characterized in that the method also includes:
When first total quantity and second total quantity be not identical, Xiang Suoshu client sends second and mentions the server-side
Show that information, second prompt information are used to prompt the parameter of object invocation function described in the client to transmit failure.
7. the communication means between a kind of process, which is characterized in that the described method includes:
Client to server-side send function call request, the function call request include function name, parameter name and
The corresponding parameter value of the parameter name, the function call request are used to indicate the server-side and execute the function name pair
The object invocation function answered;
The client receives the function return value for the object invocation function that the server-side is sent.
8. the method for claim 7, which is characterized in that the method also includes:
Client timing since when sending the function call request to the server-side;
When the timing duration reaches preset threshold, if the client does not receive the function return value, Xiang Suoshu
Server-side retransmits the function call request.
9. method as claimed in claim 7 or 8, which is characterized in that the method also includes:
The client receives the prompt information that the server-side is sent;
The client retransmits the function call request according to the prompt information, Xiang Suoshu server-side.
10. a kind of server-side, which is characterized in that the server-side includes:
Creation module, for establishing function call library, the function call library includes multiple calling functions of registration;
Receiving module, for receiving the function call request of client transmission, the function call request includes function name, the
One parameter name and the corresponding parameter value of the first parameter name;
Execution module, for searching the corresponding object invocation function of the function name from the function call library;
The execution module, is also used to according to first parameter name, and the parameter value is substituted into the object invocation function
Middle progress operation obtains function return value;
Sending module, for sending the function return value to the client, the function return value is used to indicate the visitor
Family end executes the executable program where the object invocation function.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811584275.9A CN109710426A (en) | 2018-12-24 | 2018-12-24 | A kind of inter-process communication methods and relevant device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811584275.9A CN109710426A (en) | 2018-12-24 | 2018-12-24 | A kind of inter-process communication methods and relevant device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109710426A true CN109710426A (en) | 2019-05-03 |
Family
ID=66256137
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811584275.9A Pending CN109710426A (en) | 2018-12-24 | 2018-12-24 | A kind of inter-process communication methods and relevant device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109710426A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111651146A (en) * | 2020-04-29 | 2020-09-11 | 宁波吉利汽车研究开发有限公司 | A function generation method, apparatus, device and medium |
CN114297230A (en) * | 2021-12-29 | 2022-04-08 | 北京人大金仓信息技术股份有限公司 | Data processing method, apparatus, equipment and medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102087613A (en) * | 2009-12-08 | 2011-06-08 | 北京大学 | Caching method and device for function execution |
US20130054669A1 (en) * | 2011-08-24 | 2013-02-28 | Microsoft Corporation | Calling Functions Within A Deterministic Calling Convention |
CN103853532A (en) * | 2012-11-29 | 2014-06-11 | 国际商业机器公司 | Method and device for calling function |
CN104866383A (en) * | 2015-05-29 | 2015-08-26 | 北京金山安全软件有限公司 | Interface calling method and device and terminal |
CN105721512A (en) * | 2016-05-06 | 2016-06-29 | 深圳前海大数点科技有限公司 | Remote process calling system and method thereof |
CN107291480A (en) * | 2017-08-15 | 2017-10-24 | 中国农业银行股份有限公司 | A kind of function calling method and device |
-
2018
- 2018-12-24 CN CN201811584275.9A patent/CN109710426A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102087613A (en) * | 2009-12-08 | 2011-06-08 | 北京大学 | Caching method and device for function execution |
US20130054669A1 (en) * | 2011-08-24 | 2013-02-28 | Microsoft Corporation | Calling Functions Within A Deterministic Calling Convention |
CN103853532A (en) * | 2012-11-29 | 2014-06-11 | 国际商业机器公司 | Method and device for calling function |
CN104866383A (en) * | 2015-05-29 | 2015-08-26 | 北京金山安全软件有限公司 | Interface calling method and device and terminal |
CN105721512A (en) * | 2016-05-06 | 2016-06-29 | 深圳前海大数点科技有限公司 | Remote process calling system and method thereof |
CN107291480A (en) * | 2017-08-15 | 2017-10-24 | 中国农业银行股份有限公司 | A kind of function calling method and device |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111651146A (en) * | 2020-04-29 | 2020-09-11 | 宁波吉利汽车研究开发有限公司 | A function generation method, apparatus, device and medium |
CN111651146B (en) * | 2020-04-29 | 2024-04-16 | 宁波吉利汽车研究开发有限公司 | Function generation method, device, equipment and medium |
CN114297230A (en) * | 2021-12-29 | 2022-04-08 | 北京人大金仓信息技术股份有限公司 | Data processing method, apparatus, equipment and medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106648945B (en) | Interface data testing method and device and electronic equipment | |
CN109951547B (en) | Transaction request parallel processing method, device, equipment and medium | |
CN109858019B (en) | Dialogue state tracking method and device, storage medium and semantic recognition system | |
CN110944048B (en) | Service logic configuration method and device | |
CN110297766A (en) | Method for testing software and software testing system based on distributed test node cluster | |
CN106843828A (en) | interface display, loading method and device | |
CN111260474B (en) | Asset transaction method, device, equipment, system and storage medium of cross-blockchain | |
CN107526645A (en) | A kind of communication optimization method and system | |
CN109754072A (en) | Processing method, artificial intelligence process device and the Related product of internet off-line model | |
CN109710426A (en) | A kind of inter-process communication methods and relevant device | |
CN106598530A (en) | Display panel configuration method and device | |
CN116185425A (en) | Event flow arrangement method, device, equipment and medium based on node combination | |
CN113051178A (en) | Test data construction method, device, equipment and medium | |
CN109710252A (en) | Page generation method, device, equipment and storage medium | |
Abdulla et al. | Verification of directed acyclic ad hoc networks | |
CN112464497A (en) | Fault drilling method, device, equipment and medium based on distributed system | |
CN109635266A (en) | Three-dimensional visualization edit methods, device and three-dimension visible sysem | |
CN110908644B (en) | Configuration method and device of state node, computer equipment and storage medium | |
CN105068791B (en) | A kind of method and device for realizing bottom library | |
CN113691403B (en) | Topology node configuration method, related device and computer program product | |
CN110471767A (en) | A kind of dispatching method of equipment | |
CN109710908A (en) | Page editing method, system and device | |
CN110362294A (en) | Development task executes method, apparatus, electronic equipment and storage medium | |
CN104199642B (en) | A kind of implementation method and device in target platform operation original platform code | |
Fernandes et al. | Determining hop-constrained spanning trees with repetitive heuristics |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190503 |
|
RJ01 | Rejection of invention patent application after publication |