CN100458702C - A method of function call between different running platforms - Google Patents

A method of function call between different running platforms Download PDF

Info

Publication number
CN100458702C
CN100458702C CNB2005100929625A CN200510092962A CN100458702C CN 100458702 C CN100458702 C CN 100458702C CN B2005100929625 A CNB2005100929625 A CN B2005100929625A CN 200510092962 A CN200510092962 A CN 200510092962A CN 100458702 C CN100458702 C CN 100458702C
Authority
CN
China
Prior art keywords
parameter
platform
function
pointer
receiving platform
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.)
Expired - Fee Related
Application number
CNB2005100929625A
Other languages
Chinese (zh)
Other versions
CN1731360A (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.)
Vimicro Corp
Original Assignee
Vimicro Corp
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 Vimicro Corp filed Critical Vimicro Corp
Priority to CNB2005100929625A priority Critical patent/CN100458702C/en
Publication of CN1731360A publication Critical patent/CN1731360A/en
Application granted granted Critical
Publication of CN100458702C publication Critical patent/CN100458702C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a function calling method of different running platform, wherein the receiving platform possesses a plurality of task functions used to carry out different tasks, which comprises the following steps: (1) Distributing a message number to each task function of the receiving platform; (2) calling and sealing the task function of the receiving platform into an interface function at least comprising the message number on sending platform; (3) sending the interface function to the receiving platform; (4) carrying out the received interface function to achieve the calling course of the task function on the receiving platform; (5) returning to the result of the interface function to the sending platform after carrying out the received interface function.

Description

The method of the function call between a kind of different operation platforms
Technical field
The present invention relates to a kind of means of communication of function call, the method for the function call between particularly a kind of different operation platforms.
Technical background
Known, can handle some tasks on the operation platform, the process of its Processing tasks is finished by the function of executing the task, and calling of its mission function then is that control system by this operation platform realizes.Yet, if want to realize the function call between the different operation platforms, reach the purpose of multifunctional communication, because the situation difference of each function call, whether whether need after parameter, the function call return results or the like during as function name difference, function call, therefore, send platform and these information all must be sent to receiving platform, could be on receiving platform correct realization function call so just causes between the operation platform volume of transmitted data of communication big.And, in the method for communication, all is generally between the present different operation platforms for different tasks or function, adopt different communication interfaces, therefore along with different task increases, communication interface also will increase the load of system along with increase.Restriction for above-mentioned reasons, the communication between the present different operation platforms generally all only only limits to calling of several mission functions commonly used, and cross-platform attainable function singleness is unfavorable for the development of technology.
Summary of the invention
The objective of the invention is:, provide a kind of unified interface function that adopts to realize the method for a platform the function call between the different operation platforms of multiple-task function call on another platform at the deficiencies in the prior art.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is: the method for the function call between a kind of different operation platforms, wherein receiving platform has some mission functions that are used to carry out different task, comprises the steps:
(1) each mission function respectively distributes a message number on the receipts platform, makes their corresponding one by one;
(2) mission function that need carry out on receiving platform on the transmission platform calls to be packaged into and comprises the interface function of being with message number at least;
(3) send platform and send described interface function to receiving platform;
(4) receiving platform is carried out the interface function that receives, the mission function invoked procedure on the receipts that the achieve a butt joint platform;
(5) receiving platform returns the interface function execution result to described transmission platform after interface function is complete.
Described interface function only is with message number, in the step (4), when described receiving platform is carried out described interface function, can search mission function corresponding on the receiving platform according to message number, carries out this mission function then.
When function call has correlation parameter, in the step (2), send platform and can store correlation parameter, and the correlation parameter information of function call is encapsulated in the described interface function.
The correlation parameter information of described function call can comprise the shared storage size value of parameter, and in the described step (4), receiving platform will be opened up a memory headroom according to sizes values that described parameter takes up space when the executive's interface function.
The correlation parameter information of described function call can also comprise that the transmission platform need send the instruction of parameter, according to this instruction, in the step (3), sends platform and also the correlation parameter of being stored is sent to receiving platform; In the described step (4), receiving platform receives described interface function, and after having opened up memory headroom, receive again from the correlation parameter that sends platform, and this parameter is stored in the described memory headroom, thereby search corresponding mission function according to message number, and parameter is used for the execution of mission function.
The correlation parameter information of described function call can also comprise that sending platform need obtain the mission function execution result, and event memory is in the instruction of designated memory space, according to this instruction, the memory headroom that receiving platform is opened up in the described step (4) is used for store tasks function execution result, and receiving platform also turns back to the transmission platform with this execution result, described transmission platform stores it in the storage space of appointment into after receiving described mission function execution result.
Can comprise pointer parameter in the correlation parameter of described transmission platform storage, also comprise the positional information of pointer parameter in the correlation parameter information of described function call, and the pointer parameter shared storage size value of parameter entity pointed; In the described step (4), receiving platform also according to the shared storage size value of described pointer parameter parameter entity pointed, is opened up sub-memory headroom.
The correlation parameter information of described function call can also comprise that the transmission platform need send the instruction of pointer parameter parameter entity pointed, according to this instruction, in the step (3), sends platform parameter entity also that described pointer parameter is pointed and sends to receiving platform; In the described step (4), receiving platform receives described interface function, and after having opened up memory headroom and sub-memory headroom, receive again from the pointer parameter parameter entity pointed that sends platform, and this parameter entity is stored in the described sub-memory headroom, thereby search corresponding mission function according to message number, and parameter entity is used for the execution of mission function.
In the described step (4), receiving platform can also be according to the positional information of described pointer parameter, and new pointer parameter is filled in the relevant position in described memory headroom, makes it point to described sub-memory headroom.
The correlation parameter information of described function call can also comprise that sending platform need obtain the mission function execution result, and store this result in the specified storage space of certain pointer parameter instruction, according to this instruction, in the step (3), send platform and also described pointer parameter is sent to receiving platform, in the described step (4), receiving platform also receives this pointer parameter, and stores the value of this pointer parameter earlier; Secondly according to the positional information of pointer parameter, new pointer parameter is filled in the relevant position in described memory headroom, makes it point to described sub-memory headroom; Then after executing mission function, the value of the execution result of mission function and received pointer parameter is returned to the transmission platform, described transmission platform stores this execution result in the described pointer parameter storage space pointed into.
The advantage of the relative prior art of the present invention is: the present invention is owing to be packaged into an interface function with the function call unification on the different operation platforms, thereby reduced communication interface, and especially interface is single for sending platform, and the interface function packaged type is fixed.And the present invention also by making the different task function on the operation platform corresponding one by one with message number, helps system extension, increases application flexibility.
Description of drawings
Accompanying drawing 1 is the overview flow chart of the method for the function call between different operation platforms of the present invention;
Accompanying drawing 2 is for sending the workflow diagram of platform among the present invention;
Accompanying drawing 3 is the workflow diagram of receiving platform among the present invention;
Accompanying drawing 4 is the memory headroom storage synoptic diagram of example 2.
Embodiment
Below in conjunction with Figure of description and specific embodiment the present invention is described in further detail.
With reference to the accompanying drawings 1, the method for the function call between a kind of different operation platforms that present embodiment provided specifically comprises the steps:
(1) each mission function on the receiving platform is respectively distributed a message number, make them corresponding one by one;
(2) mission function that need carry out on receiving platform on the transmission platform calls to be packaged into and comprises the interface function of being with message number at least;
(3) send platform and send described interface function to receiving platform;
(4) receiving platform is carried out the interface function that receives, the mission function invoked procedure on the receipts that the achieve a butt joint platform;
(5) receiving platform returns the interface function execution result to described transmission platform after interface function is complete.
Have some mission functions that are used to carry out different task in the above-mentioned receiving platform, and a task can have a plurality of mission functions.
Above-mentioned transmission platform and receiving platform can be the different platform of different system, also can expand to the different platform of same system, even can expand to the different piece under the same platform.
Above-mentioned transmission platform and receiving platform when actual motion, translation function mutually, promptly sending platform becomes receiving platform, receiving platform becomes the transmission platform.
Above-mentioned message number can adopt numeral.
In the present embodiment, described interface function can adopt sendcommand (message number, the correlation parameter information of function call).Wherein sendcommand is a function name.
For the concrete grammar of clearer description present embodiment, will be divided into the workflow that sends platform and the workflow of receiving platform below and describe.
With reference to figure 2, the workflow that sends platform is specially:
Step 001 sends platform and at first according to the mission function that need call message number is set.
During concrete enforcement, can adopt msg to represent message number.
Step 002, discriminant function call whether have correlation parameter.
The parameter that described function call had comprises: mission function is carried out the parameters needed value; The memory location of mission function execution result.
Judged result is if then execution in step 003; Otherwise jump to step 016.
Step 003 is opened up a memory headroom on the transmission platform, be used for all parameters that storage function calls.
During concrete enforcement, can adopt a pointer parameter * param to point to this memory headroom.
For those skilled in the art, obviously know concrete enforcement the time, can all parameters be stored in the memory headroom yet, and only need send the memory address that platform can be known each parameter, and read parameter value smoothly in this address and get final product.
Step 004, shared storage size value and parameter character get parms.
The purpose of the shared storage size value that gets parms is that the notice receiving platform is opened up the memory headroom of corresponding size, with stored parameter entity or mission function execution result.
During concrete enforcement, can adopt paramsize to represent the sizes values of the memory headroom that pointer parameter * param points to.Like this, interface function can be expressed as: and sendcommand (msg, * param, paramsize).
In the present embodiment, represent to send platform with parameter character and whether need to send the parameter that mission function is carried out, and send the result whether platform needs to receive the mission function execution.As:
It is the IN type that parameter character is set, and then expression sends platform does not need to send the parameter that mission function is carried out, but needs to receive the result that mission function is carried out;
It is the OUT type that parameter character is set, and then expression sends platform and need send the parameter that mission function is carried out, but does not need to receive the result that mission function is carried out;
It is the INOUT type that parameter character is set, and then expression sends platform and need send the parameter that mission function is carried out, and needs to receive the result that mission function is carried out.
During concrete enforcement, represent parameter character, paramtype=IN is then arranged with paramtype; Paramtype=OUT; Paramtype=INOUT.
Step 005 judges whether the parameter in the described memory headroom has pointer, promptly whether has pointer parameter, if execution in step 006 then, otherwise jump to step 007.
Step 006 is obtained positional information, the pointer parameter shared storage size value of parameter entity pointed of pointer parameter and the parameter character of pointer parameter.Jump procedure 008 after finishing.
The positional information of described pointer parameter is meant this pointer parameter address stored in memory headroom.When memory headroom adopted pointer * param to point to, this positional information was the side-play amount of pointer parameter memory address apart from its parent pointer * param.The side-play amount of representing described pointer parameter in the present embodiment with ptrparamoffset.
The parameter character of described pointer parameter is used to represent to send platform and whether needs to send the parameter entity that this pointer parameter points to, and the mission function execution result whether the transmission platform needs to receive is stored in the storage space that this pointer parameter points to.
During concrete enforcement, the method for its setting can be identical with the method to set up of aforesaid parameter character.The parameter character of also representing pointer parameter in the present embodiment with ptrparamtype is represented the shared storage size value of described pointer parameter parameter entity pointed with prtparamsize.
In addition, can also include pointer in the pointer parameter parameter entity pointed, therefore, each parameter is represented the relevant information of each pointer parameter with the form that increases suffix " _ n ".
Step 007 as the relevant information of function call, is encapsulated into interface function with message number with the shared storage size value of parameter and parameter character.Jump to step 009 after finishing.
During concrete enforcement, the interface function after the encapsulation is expressed as:
sendcommand(msg,paramtype,paramsize,0)。
Wherein be that interface function expression form during with parameter band pointer is consistent, with the side-play amount of 0 expression parameter.
Step 008, with the shared storage size value of parameter, parameter character, the positional information of pointer parameter, the pointer parameter shared storage size value of parameter entity pointed, and the parameter character of pointer parameter is encapsulated into described interface function as the relevant information of function call with message number.
In the present embodiment, the interface function after the encapsulation is expressed as:
sendcommand(msg,paramtype,paramsize,0,
ptrparamtype_1,ptrparamsize_1,ptrparamoffset_1,……
ptrparamtype_n,ptrparamsize_n,ptrparamoffset_n)
Step 009 sends the packaged interface function of platform forwarding step 007 or step 008 to receiving platform.
In the relevant information that step 010, discriminant function are called, whether the parameter character of parameter character or pointer parameter is the IN type, and promptly whether sending platform does not need to send the parameter that mission function is carried out, but needs to receive the result that mission function is carried out; Perhaps whether sending platform does not need to send the parameter entity that pointer parameter points to, but the mission function execution result that receives need be stored in the storage space that this pointer parameter points to.If then execution in step 013, otherwise execution in step 011.
In the relevant information that step 011, discriminant function are called, whether the parameter character of parameter character and/or pointer parameter is the OUT type, promptly whether sends platform and need send the parameter that mission function is carried out, but do not need to receive the result that mission function is carried out; And/or whether send the parameter entity that platform need send the pointer parameter sensing, but the mission function execution result that does not need to receive is stored in the storage space that this pointer parameter points to.If then execution in step 015, otherwise execution in step 012.
Step 012, in the relevant information of function call, the parameter character of parameter character and/or pointer parameter is the INOUT type, promptly sends platform and need send the parameter that mission function is carried out, and need to receive the result that mission function is carried out; And/or send the parameter entity that platform need send the pointer parameter sensing, and the mission function execution result that receives need be stored in the storage space that this pointer parameter points to.Therefore send the parameter in the memory headroom, and/or pointer parameter corresponding parameters entity is to receiving platform.Jump to step 014 again.
Step 013 sends platform and waits for reception mission function execution result, and this result is stored in designated memory space.Jump to step 018 after finishing.
As parameter character is the IN type, then the result is stored in the memory headroom that sends stored parameter on the platform.Parameter character as pointer parameter is the IN type, then this result is stored in to send on the platform in the pointer parameter corresponding memory space.
In the present embodiment, when having pointer in the parameter,, ptrparamtype then is set also is the IN type if paramtype is the IN type.
Step 014 sends platform and waits for reception mission function execution result, and this result is stored in designated memory space.Jump to step 018 after finishing.
When parameter character is the INOUT type, and the parameter character of pointer parameter is when being the OUT type, and the storage space of described appointment is the memory headroom at parameter place.
When parameter character is the INOUT type, and when existing the parameter character of one or more pointer parameters to be the IN type in the pointer parameter, the storage space of described appointment is the pointer parameter of an IN type storage space pointed.
Step 015 send the parameter in the platform transmission memory headroom, and/or pointer parameter corresponding parameters entity is to receiving platform.Jump to step 018 after finishing.
In the present embodiment, when having pointer in the parameter character, if parameter character is the OUT type, the parameter character that pointer parameter then is set also is the OUT type.
Step 016 is encapsulated into interface function with message number.
In the present embodiment, the interface function after the encapsulation is expressed as: sendcommand msg.
Step 017 sends platform transmission interface function to receiving platform.
Step 018 sends the execution result that platform is waited for the receiving interface function.
In the above-mentioned steps, the execution result of described interface function comprises: interface function runs succeeded, error number.After described error number is meant that interface function is carried out failure, the error reason that it leads to the failure, as fail to find corresponding mission function or the like.The execution result of described mission function is the functional value after mission function is carried out etc.
The one of ordinary skilled in the art should learn that the order of each step of above-mentioned transmission platform can be made corresponding adjustment, as after can having judged parameter character or pointer parameter character, and transmission interface function again; Or can send the parameter entity that needs transmission, transmission interface function more earlier.Therefore, above-mentioned step only is a preferable embodiment of the present invention.
With reference to the accompanying drawings 3, the workflow of receiving platform is specially:
Step 101, receiving platform receives from the interface function that sends platform.
Step 102, receiving platform executive's interface function.
Step 103 obtains message number in interface function.
Is step 104 packaged with the correlation parameter information that mission function calls in the query interface function? have then to jump to step 108, otherwise execution in step 105.
Step 105 is searched mission function corresponding on the receiving platform according to message number.
Does step 106 find corresponding mission function? be execution in step 107 then, otherwise jump to step 127.
Step 107, the function of executing the task jumps to step 127.
Step 108 obtains the parameter sizes values paramsize that takes up space, and opens up a memory headroom according to this value.
Whether step 109 is packaged with the shared storage size value of the parameter entity ptrparamsize that pointer parameter points in the query interface function, have then to obtain this value, and execution in step 110, otherwise jump procedure 111.
Described ptrparamsize comprises the situation that also contains pointer in the pointer parameter.
Step 110 is opened up sub-memory headroom according to ptrparamsize value correspondence on receiving platform.
If also contain pointer in the pointer parameter, then correspondingly open up a plurality of sub-memory headrooms.
Step 111, judge the parameter character paramtype that encapsulates in the interface function, or whether the parameter character ptrparamtype of pointer parameter be the IN type, and promptly whether sending platform does not need to send the parameter that mission function is carried out, but need to receive the result that mission function is carried out; Perhaps whether sending platform does not need to send the parameter entity that pointer parameter points to, but the mission function execution result that receives need be stored in the storage space that this pointer parameter points to.If then execution in step 112, otherwise jump to step 117.
Step 112 is searched corresponding mission function according to message number.
Does step 113 find corresponding mission function? be execution in step 114 then, otherwise jump to step 127.
Step 114, the function of executing the task.
Step 115 is stored in the mission function execution result in corresponding memory headroom or the sub-memory headroom.
Step 116 sends the mission function execution result to sending platform, this result can be stored in the memory headroom or sub-memory headroom of appointment so that send platform.Jump to step 127 after finishing.
Step 117, judge the parameter character paramtype that encapsulates in the interface function, or whether the parameter character ptrparamtype of pointer parameter be the OUT type, promptly whether sends platform and need send the parameter that mission function is carried out, but do not need to receive the result that mission function is carried out; Perhaps whether send platform and need send the parameter entity that pointer parameter points to, but the mission function execution result that does not need to receive is stored in the storage space that this pointer parameter points to.If then execution in step 118, otherwise jump to step 122.
Step 118, receiving platform receives from the parameter that sends platform, and is stored in the memory headroom; Or receive, and be stored in the corresponding sub-memory headroom from the pointer parameter parameter entity pointed that sends platform.
In the present embodiment, this step is embodied as:
When not containing pointer parameter in the parameter, receiving platform receives from the parameter that sends platform, and is stored in the memory headroom of opening up according to paramsize.
When also containing pointer parameter in the parameter:
At first receiving platform receives from the parameter that sends platform, and is stored in the memory headroom of opening up according to paramsize;
Secondly, according to the positional information of pointer parameter, the value of the ptrparamoffset in the present embodiment finds corresponding pointer parameter in memory headroom, and revise the value of this pointer parameter, make it point to the sub-memory headroom that receiving platform is opened up according to the ptrparamsize correspondence;
At last, receive from the pointer parameter parameter entity pointed that sends platform, and be stored in the corresponding sub-memory headroom.
When also having pointer in the pointer parameter parameter entity pointed, repeat back two steps in the aforementioned operation, until the sub-memory headroom of all correct its correspondence of sensing of all pointers, thereby finish the conversion of address space on the receiving platform, and correctly store each pointer parameter entity pointed.
Step 119 is searched corresponding mission function according to message number.
Does step 120 find corresponding mission function? be execution in step 121 then, otherwise jump to step 127.
Step 121, with the parameter that obtains in the step 118, and/or parameter entity is used to the function of executing the task.After finishing, jump to step 127.
Step 122 when paramtype and/or ptrparamtype are the INOUT type, promptly send platform and need send the parameter that mission function is carried out, and needs to receive the result that mission function is carried out; And/or send the parameter entity that platform need send the pointer parameter sensing, and the mission function execution result that receives need be stored in the storage space that this pointer parameter points to.Therefore receive from the parameter that sends platform, and be stored in the memory headroom; Or receive parameter entity from the pointed that sends platform, and corresponding stored is in sub-memory headroom.
Step 123 is searched corresponding mission function according to message number.
Does step 124 find corresponding mission function? be execution in step 125 then, otherwise jump to step 127.
Step 125, with the parameter that obtains in the step 122, and/or parameter entity is used to the function of executing the task.
Step 126 sends the mission function execution result to sending platform.
Step 127, interface function is finished, and produces the interface function execution result, and returns this result to sending platform.
In the present embodiment, the specific implementation process of step 122~126 can for:
When not containing pointer in the parameter, receiving platform receives from the parameter that sends platform, and is stored in the memory headroom of opening up according to paramsize.After mission function was complete, receiving platform at first stored the mission function execution result into this memory headroom, and the data with this memory headroom return to the transmission platform then.
When also containing pointer parameter in the parameter:
If parameter character is the INOUT type, and the parameter character of pointer parameter is the OUT type, and receiving platform at first receives from the parameter that sends platform, and is stored in the memory headroom of opening up according to paramsize.Then according to the positional information of pointer parameter, the value of ptrparamoffset in the present embodiment, in memory headroom, find corresponding pointer parameter, and revise the value of this pointer parameter, make it point to the sub-memory headroom that receiving platform is opened up according to the ptrparamsize correspondence; Receive at last from the pointer parameter parameter entity pointed that sends platform, and be stored in the sub-memory headroom of opening up according to ptrparamsize.When also having pointer in the pointer parameter parameter entity pointed, repeat aforementioned operation, until the sub-memory headroom of all correct its correspondence of sensing of all pointers, thereby finish the conversion of address space on the receiving platform, and correctly store each pointer parameter entity pointed.
After mission function was complete, receiving platform at first was stored in the mission function execution result memory location of non-pointer parameter in the memory headroom, and the data with this memory headroom return to the transmission platform then.
If parameter character is the INOUT type, and when existing the parameter character of one or more pointer parameters to be the IN type in the pointer parameter, receiving platform equally at first receives from the parameter that sends platform, and is stored in the memory headroom of opening up according to paramsize.Next is according to the positional information of pointer parameter, the value of ptrparamoffset in the present embodiment, in memory headroom, find corresponding pointer parameter, preserve and revise the value of this pointer parameter, make it point to the sub-memory headroom that receiving platform is opened up according to the ptrparamsize correspondence; When also having pointer in the pointer parameter parameter entity pointed, repeat aforementioned operation, until the sub-memory headroom of all correct its correspondence of sensing of all pointers, thereby finish the conversion of address space on the receiving platform.Once more, the parameter type of the pointer parameter whether receiving platform inquiry is all be the IN type, if also there is the pointer parameter of OUT or INOUT type, then needs to receive this pointer parameter corresponding parameters entity, and is stored in the sub-memory headroom of correspondence.At last, with the parameter of non-IN type pointer parameter memory location in the memory headroom, and the pointer parameter parameter entity pointed of OUT or INOUT type, be used for the execution of mission function.
After mission function is complete, receiving platform at first is stored in the mission function execution result IN type pointer parameter memory headroom pointed, recover amended pointer parameter value with the former pointer parameter of preserving then, and the mission function execution result in former pointer parameter and the sub-memory headroom returned to the transmission platform, can the mission function execution result be saved in its memory location pointed accurately according to pointer parameter so that send platform.
The one of ordinary skilled in the art should learn that the order of each step of above-mentioned receiving platform can adjust multiple specific embodiments, and this is adjusted only needs and consistent the getting final product of step that sends platform.Therefore, above-mentioned step only is a preferable embodiment of the present invention.
To provide several application examples of the present invention below.
Example 1
Target: the camera that sends on the platform startup receiving platform is made a video recording.
The course of work: send platform transmission interface function: sendcommand 1.Wherein 1 is msg.Receiving platform receives this interface function, and carries out.Find corresponding mission function OPENCAMERA ().This mission function calls and need not parameter.Directly carry out, complete after, return the interface function information that runs succeeded and give and send platform.
Example 2
Target: (Width, Height), it is the image of 300 bytes that the camera of order receiving platform is caught a secondary size to the mission function CAMERACAPTURE on the transmission platform invoke receiving platform, and requires to obtain this view data.
The course of work: send platform and at first determine message number msg=2.The memory headroom of opening up pointer * param sensing then is used to store the needed width value Width of this mission function, height value Height, and storing image data address stored pointer * ptrparam.Data in the memory headroom as shown in Figure 4.Each parameter wherein accounts for 4 bytes respectively, and the side-play amount of * ptrparam is 8, and * ptrparam storage space A pointed accounts for 300 bytes.
Therefore send at first transmission interface function of platform:
sendcommand(2,INOUT,12,0,IN,300,8);
Send the data of all 12 bytes in this memory headroom then.
Receiving platform at first receives this interface function.Open up the memory headroom that a size is 12 bytes then, be used for receive from the data storage of 12 bytes that send platform in this memory headroom, open up the sub-memory headroom that a size is 300 bytes again, and elder generation preserves the value of last 4 bytes in the memory headroom, be the value of pointer * ptrparam, revise making it point to sub-memory headroom then.(Width, Height), as parameter Width, the data of middle 4 bytes are as Parameter H eight with the data of 4 bytes in the memory headroom, the function of executing the task then to find corresponding mission function CAMERACAPTURE according to message number 2.Thereby camera starts the image of catching a secondary specified altitude assignment and width, and this image data storage is gone in the sub-memory headroom.At last, receiving platform need be with the value of last 4 bytes in the value substitute memory space of the * ptrparam that preserves, and parameter entity in the memory headroom and * ptrparam view data pointed are sent to the transmission platform in the lump.Make send platform can be according to * ptrparam, with image data storage in A between the memory block of its sensing.
The description intention that should be noted that the front only is illustrative, rather than in order to limit the present invention.Those of ordinary skill in the art can carry out many variations to here form and the details of disclosed embodiment, and does not break away from spirit of the present invention and essence.Scope of the present invention is limited by additional claim.

Claims (10)

1, the method for the function call between a kind of different operation platforms, wherein receiving platform has some mission functions that are used to carry out different task, comprises the steps:
(1) each mission function respectively distributes a message number on the receiving platform, makes them corresponding one by one;
(2) mission function that need carry out on receiving platform on the transmission platform calls and is packaged into the interface function that comprises message number at least;
(3) send platform and send described interface function to receiving platform;
(4) receiving platform is carried out the interface function that receives, the mission function invoked procedure on the receipts that the achieve a butt joint platform;
(5) receiving platform returns the interface function execution result to described transmission platform after interface function is complete.
2, the described method of claim 1, it is characterized in that: described interface function only is with message number, in the step (4), when described receiving platform is carried out described interface function, searches mission function corresponding on the receiving platform according to message number, carries out this mission function then.
3, method according to claim 1 is characterized in that: when function call has correlation parameter, in the step (2), send platform storage correlation parameter, and the correlation parameter information of function call is encapsulated in the described interface function.
4, as method as described in the claim 3, it is characterized in that: the correlation parameter information of described function call comprises the shared storage size value of parameter, in the described step (4), receiving platform will be opened up a memory headroom according to sizes values that described parameter takes up space when the executive's interface function.
5, as method as described in the claim 4, it is characterized in that: the correlation parameter information of described function call also comprises and sends the instruction that platform need send parameter, according to this instruction, in the step (3), sends platform and also the correlation parameter of being stored is sent to receiving platform; In the described step (4), receiving platform receives described interface function, and after having opened up memory headroom, receive again from the correlation parameter that sends platform, and this parameter is stored in the described memory headroom, thereby search corresponding mission function according to message number, and parameter is used for the execution of mission function.
6, as method as described in the claim 4, it is characterized in that: the correlation parameter information of described function call comprises that also sending platform need obtain the mission function execution result, and event memory is in the instruction of designated memory space, according to this instruction, the memory headroom that receiving platform is opened up in the described step (4) is used for store tasks function execution result, and receiving platform also turns back to the transmission platform with this execution result, described transmission platform stores it in the storage space of appointment into after receiving described mission function execution result.
7, as method as described in one of in the claim 4,5,6, it is characterized in that: comprise pointer parameter in the correlation parameter of described transmission platform storage, the positional information that also comprises pointer parameter in the correlation parameter information of described function call, and the pointer parameter shared storage size value of parameter entity pointed; In the described step (4), receiving platform also according to the shared storage size value of described pointer parameter parameter entity pointed, is opened up sub-memory headroom.
8, as method as described in the claim 7, it is characterized in that: the correlation parameter information of described function call comprises that also the transmission platform need send the instruction of pointer parameter parameter entity pointed, according to this instruction, in the step (3), send platform parameter entity also that described pointer parameter is pointed and send to receiving platform; In the described step (4), receiving platform receives described interface function, and after having opened up memory headroom and sub-memory headroom, receive again from the pointer parameter parameter entity pointed that sends platform, and this parameter entity is stored in the described sub-memory headroom, thereby search corresponding mission function according to message number, and parameter entity is used for the execution of mission function.
9, as method as described in the claim 8, it is characterized in that: in the described step (4), also according to the positional information of described pointer parameter, new pointer parameter is filled in the relevant position in described memory headroom to receiving platform, makes it point to described sub-memory headroom.
10, as method as described in the claim 7, it is characterized in that: the correlation parameter information of described function call comprises that also sending platform need obtain the mission function execution result, and store this result in the specified storage space of certain pointer parameter instruction, according to this instruction, in the step (3), send platform and also described pointer parameter is sent to receiving platform, in the described step (4), receiving platform also receives this pointer parameter, and stores the value of this pointer parameter earlier; Secondly according to the positional information of pointer parameter, new pointer parameter is filled in the relevant position in described memory headroom, makes it point to described sub-memory headroom; Then after executing mission function, the value of the execution result of mission function and received pointer parameter is returned to the transmission platform, and described transmission platform stores this execution result in described pointer parameter that receiving platform the returns storage space pointed into.
CNB2005100929625A 2005-08-26 2005-08-26 A method of function call between different running platforms Expired - Fee Related CN100458702C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2005100929625A CN100458702C (en) 2005-08-26 2005-08-26 A method of function call between different running platforms

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2005100929625A CN100458702C (en) 2005-08-26 2005-08-26 A method of function call between different running platforms

Publications (2)

Publication Number Publication Date
CN1731360A CN1731360A (en) 2006-02-08
CN100458702C true CN100458702C (en) 2009-02-04

Family

ID=35963721

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2005100929625A Expired - Fee Related CN100458702C (en) 2005-08-26 2005-08-26 A method of function call between different running platforms

Country Status (1)

Country Link
CN (1) CN100458702C (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101950260B (en) * 2010-09-10 2014-04-30 中兴通讯股份有限公司 Processor program dispatching method and device
CN108132816B (en) * 2016-12-01 2020-12-18 腾讯科技(深圳)有限公司 Method and device for realizing local framework layer calling in application

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5657447A (en) * 1995-08-31 1997-08-12 International Business Machines Corp. Platform-transparent registration and build of stored procedures and user-defined functions
US5778228A (en) * 1994-08-16 1998-07-07 International Business Machines Corporation Method and system for transferring remote procedure calls and responses over a network
US6314445B1 (en) * 1998-08-03 2001-11-06 International Business Machines Coproration Native function calling
JP2004038313A (en) * 2002-06-28 2004-02-05 Canon Inc Log acquisition method, program, and storage medium
CN1512340A (en) * 2002-12-31 2004-07-14 北京科泰世纪科技有限公司 Packaging method for intelligent pointer of calling structure object function
CN1632747A (en) * 2003-12-22 2005-06-29 联想(北京)有限公司 Software interface testing method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778228A (en) * 1994-08-16 1998-07-07 International Business Machines Corporation Method and system for transferring remote procedure calls and responses over a network
US5657447A (en) * 1995-08-31 1997-08-12 International Business Machines Corp. Platform-transparent registration and build of stored procedures and user-defined functions
US6314445B1 (en) * 1998-08-03 2001-11-06 International Business Machines Coproration Native function calling
JP2004038313A (en) * 2002-06-28 2004-02-05 Canon Inc Log acquisition method, program, and storage medium
CN1512340A (en) * 2002-12-31 2004-07-14 北京科泰世纪科技有限公司 Packaging method for intelligent pointer of calling structure object function
CN1632747A (en) * 2003-12-22 2005-06-29 联想(北京)有限公司 Software interface testing method

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
利用MSMQ实现消息处理引擎. 王天培.网络通信. 2005
利用MSMQ实现消息处理引擎. 王天培.网络通信. 2005 *

Also Published As

Publication number Publication date
CN1731360A (en) 2006-02-08

Similar Documents

Publication Publication Date Title
CN100458703C (en) A cross-platform function call system
EP3636390B1 (en) Robot cluster scheduling system
US20050267953A1 (en) Distributed control system and information system
WO2005109299A1 (en) Robot control software framework in open distributed process architecture
CN100429624C (en) Server implementing method and server system
CN101819539B (en) Interrupt nesting method for transplanting muCOS-II to ARM7
CN105204848B (en) Function solidification is carried out using binary program and the method and system of service are provided
CN100458702C (en) A method of function call between different running platforms
CN100361082C (en) Method for calling function containing pointer parameter between different operation platforms
CN114968616A (en) Multi-process zero-copy communication method and device for sensor data
CN102227717A (en) Method and apparatus for data storage and access
US20130030568A1 (en) Robot system control method and a device therefor
Bruzzone et al. Standard Linux for embedded real-time robotics and manufacturing control systems
CN101719069B (en) Method and device of Web servitization of Java system
US20080141263A1 (en) Embedded agent framework and method of providing ubiquitous services using the same
CN112596787A (en) System and method for adaptively releasing application program in different environments
CN110162381B (en) Agent execution method in container
CN116680209A (en) WASM-based multi-intelligent contract instance management method
CN116819992A (en) STM32 EtherCAT-based embedded numerical control system
CN106658688B (en) System and method for realizing GSM module control in single chip microcomputer
CN101246421A (en) Universal frame work based on workflow engine
Santos et al. A real-time distributed software infrastructure for cooperating mobile autonomous robots
US20050033820A1 (en) Method for accessing data of an automation apparatus and corresponding automation apparatus
CN102694774A (en) A design method of an IPv6 micro protocol stack
CN101582040A (en) Application program loading system and loading method based on ARM system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20090204

Termination date: 20120826