CN103116520B - Method based on the remote procedure call of TCP/ UDP - Google Patents

Method based on the remote procedure call of TCP/ UDP Download PDF

Info

Publication number
CN103116520B
CN103116520B CN201210432628.XA CN201210432628A CN103116520B CN 103116520 B CN103116520 B CN 103116520B CN 201210432628 A CN201210432628 A CN 201210432628A CN 103116520 B CN103116520 B CN 103116520B
Authority
CN
China
Prior art keywords
client
server end
packet
udp
worker thread
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210432628.XA
Other languages
Chinese (zh)
Other versions
CN103116520A (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.)
Jilin Asia Link Technology Development Co.,Ltd.
Original Assignee
SHENZHEN KEYBRIDGE COMMUNICATIONS CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN KEYBRIDGE COMMUNICATIONS CO Ltd filed Critical SHENZHEN KEYBRIDGE COMMUNICATIONS CO Ltd
Priority to CN201210432628.XA priority Critical patent/CN103116520B/en
Publication of CN103116520A publication Critical patent/CN103116520A/en
Application granted granted Critical
Publication of CN103116520B publication Critical patent/CN103116520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)

Abstract

Based on the method for the remote procedure call of transmission control protocol TCP/UDP UDP, for including the network system of server end and client;Described client establishes the link with server end by the socket Socket based on TCP/ UDP.The present invention achieves remote method invocation (RMI) by underlay approach, it is possible to be applied to remote data access, it is achieved the logic business middleware of data base.The remote method that the present invention relates to accesses unrelated with concrete application, as long as the development language of the application based on TCP/UDP can be developed, developing instrument can both realize calling of remote method, and server end can use different developing instruments and language to realize respectively from client.The present invention greatly simplify deployment and the realization of system, one client Client/ server end Server model application of framework is served to the effect of basic framework.

Description

Method based on the remote procedure call of TCP/ UDP
Technical field
The present invention relates to network procedure calling (PRC) method, particularly relate to the remote procedure call RemoteProcedureCall method based on transmission control protocol TCP/UDP UDP.
Background technology
The more representational remote procedure call realization mechanism of prior art includes The Component Object Model ComponentObjectModel+ technology, i.e. COM+ technology, Common Object Request Broker Architecture CommonObjectRequestBrokerArchitecture technology, i.e. CORBA technology, and enterprise software component model EnterpriseJavaBeans technology, i.e. EJB technology.Described COM+ technology is only suitable for the system subordinate under windows platform environment, and exploitation limitation is big;Although described CORBA technology can cross-platform, but development difficulty is big, exploitation personnel requirement is high;Described EJB technology only supports that Java language is developed, and disposes and needs Java Virtual Machine JavaVirtualMachine, i.e. the support of JVM, disposes and exploitation all exists certain difficulty.And above-mentioned prior art all can not well realize following demand:
1. it is capable of data access and the remote method invocation (RMI) mechanism of spanning operation system platform;
2. the asynchronous data Communication processing being capable of in system between disparate modules;
3. system can farthest utilize the parallel processing capability of multi-core processor, it is achieved the concurrent access of remote method or data;
4. system architecture can provide manageability, dynamically grasps the duty of system and the change of disposal ability;
5. can support dissimilar developing instrument, for instance VC, C++Builder, Java, C# etc.;
6. supporting the resilient infrastructure of system, the exploitation from lightweight to platform class can realize under a kind of architecture mode.
It is thus desirable to a kind of network system, the encapsulation that by the realization of application server pattern, dissimilar equipment can be operated, client has only to the equipment operation of remote call service end encapsulation, can realize the access to equipment, without communications protocol and the details of understanding underlying device;Pattern by equipment operation encapsulation, it is achieved the encapsulation to plurality of devices management agreement, thus realizing the long-range management of dissimilar equipment.
Summary of the invention
A kind of method that the technical problem to be solved in the present invention is in that to avoid the deficiencies in the prior art part and proposes to give remote procedure call, it is possible to realize local or based on intranet INTRANET or based on the remote procedure call of the Internet INTERNET;The present invention achieves remote method invocation (RMI) by underlay approach, it is possible to be applied to remote data access, it is achieved the logic business middleware of data base.
The method of the remote procedure call that the present invention proposes, grasping on the basis of bottom layer realization basic principle, realized the suction parameter of remote method and the data interaction of outlet parameter by the mode of TCP/UDP, realized the concurrent access mechanism of process by Thread Pool Technology.The remote method that the present invention relates to accesses unrelated with concrete application, as long as the development language of the application based on TCP/UDP can be developed, namely the basic data type that all development languages are all supported is merely related to, developing instrument can both realize calling of remote method, and server end can use different developing instruments and language to realize respectively from client.System can be deployed under the operating system of any support TCP/UDP communication modes, supports that the remote method of portable operating system accesses.Greatly simplify the deployment of system and realization, one client Client/ server end Server model application of framework is served to the effect of basic framework.
This invention address that described technical problem can by realizing by the following technical solutions:
A kind of method proposing remote procedure call based on transmission control protocol TCP/UDP UDP, for including the network system of server end and client;Described client establishes the link with server end by the socket Socket based on transmission control protocol TransmissionControlProtocol/ UDP UserDatagramProtocol.Described method comprises the steps:
System object pond and system thread pool is set up at server end;Preserving the system interface object called for complete process in described system object pond, described system interface object is assigned with unique object identity code IDentity and unique interface identifier code IDentity;Thus system interface object can be determined uniquely according to object identity code ID and interface identifier code ID;Described system thread pool includes at least two can the worker thread of simultaneously concurrent working;Thus making server end and client can complete remote procedure call RemoteProcedureCall according to following steps,
A. the procedure call data calling main body input is encapsulated as and calls packet by client, and this calls packet and includes object identity code ID, interface identifier code ID and arrange parameter for what complete process called needs;
B. client described in step A is set up and the linking of server end by socket Socket;
C. client sends calling packet described in step A to server end;
D. server end finds corresponding system interface object and interface object to perform method according to the object identity code ID called in packet received and interface identifier code ID in system object pond;
E. server end finds the worker thread of free time in object pool, the system interface object, interface object execution method and the described parameter that arranges called in packet that are found by step D input to worker thread, start worker thread and perform the processing procedure of system interface object;
F. worker thread is performed the result of system interface object and sends to client with the form of return parameters bag by server end;
G. client performs corresponding operating according to the return parameters bag received for calling main body.
Specifically, described in step A, call the time-out time of the data to be returned such as packet also includes, return the pointer of depositing of data, and spread out of parameter for what show byte quantity that this invocation of procedure obtains.
In order to ensure the integrity establishing the link process, step B also includes as follows step by step,
B1. client is initiated and the linking of server end according to socket Socket,
If B2. client and server establishes the link successfully, carry out step C;
If B3. client and server establishes the link failure, terminate this invocation of procedure.
In order to prevent far call process time-out, described in step A, call the time-out time of the data to be returned such as packet also includes, then step C includes as follows step by step,
C1. client sends calling packet described in step A to server end;
C2. client terminal start-up returns data waiting-timeout timing;
Meanwhile, step G includes as follows step by step,
G1. comparing the return data waiting-timeout timing time of C2 step by step and the data timeout time to be returned such as call described in packet, if returning data waiting-timeout timing time the data timeout time to be returned such as to be not more than, performing G2 step by step;If return data waiting-timeout timing time more than etc. data timeout time to be returned, terminate this invocation of procedure;
G2. client performs corresponding operating according to the return parameters bag received for calling main body.
Specifically, G2 includes as follows step by step step by step,
G21. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G22. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G23. the connection with server end is closed.
Received server-side to a kind of concrete processing scheme after calling packet is, described step D include following step by step,
Whether the object identity ID called in packet and interface identifier code ID that D11. server end judgement receives be legal;D12 step by step is carried out if it is determined that legal;If it is determined that illegal, unsuccessful for invocation of procedure result is sent to client with the form of return parameters bag, perform step G;
D12. server end finds corresponding system interface object and interface object to perform method according to the step C object identity code ID called in packet received and interface identifier code ID in system object pond.
Received server-side to the concrete processing scheme after calling packet is, also includes connecting worker thread in the described thread pool of server end, then described step D include following step by step,
D21. start and connect worker thread;
D22. will receive and call data packet sequencing, and successively each packet that calls be performed D23 step by step, D24 step by step, and step E, step F;
Whether the object identity ID called in packet and interface identifier code ID that D23. judgement receives be legal;D24 step by step is carried out if it is determined that legal;If it is determined that illegal, unsuccessful for invocation of procedure result is sent to client with the form of return parameters bag, perform step G;
D24. server end finds corresponding system interface object and interface object to perform method according to the step C object identity code ID called in packet received and interface identifier code ID in system object pond;
And then described step E include following step by step,
E1. whether available free in server-side search object pool worker thread, if available free worker thread, perform E2 step by step;Without idle worker thread, it is maintained at calling packet in the sequencing queue connecting worker thread, returns D22 step by step;
E2. server end finds the worker thread of free time in object pool, the system interface object found by step D24, the interface object needing execution perform method and the described parameter that arranges called in packet inputs to worker thread, start worker thread and perform the processing procedure of system interface object.
Client receives the concrete processing method of the return parameters bag that server end is sent, and step G includes as follows step by step,
G31. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G32. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G33. the connection with server end is closed.
Compared with the existing technology relatively, the having the technical effect that of the present invention " method of remote procedure call based on TCP/UDP "
1. exploitation is simple, realizes unrelated with concrete application with the invocation of procedure under unified shader;Under the remote procedure call framework that the present invention provides, system bottom code realizes simple, reproducibility is strong, developer need not grasp bottom code and realize, system is to concurrent access, the encapsulation of message packet is realized by unified interface function, and developer has only to pay close attention to business characteristic, and exploitation business realizing code can realize the exploitation of application server and client;
2. the present invention borrows and rents physical layer interface link, system platform is not specially required, it is possible in different platform, realizes remote procedure call under different development environments;The present invention does not limit to concrete development language, if the scheme provided according to the present invention, it is possible to achieve cross-platform, across the remote procedure call support of development environment;In system message, the data type of transmission is common to different development languages and development platform, possesses good transplanting characteristic;
3. the present invention makes thread parallel perform, and utilizes the parallel processing capability of multi-core processor, it is achieved the concurrent access of remote method or data;
4. system expandable ability is strong;Owing to adopting bottom layer realization mechanism, the present invention can be extended according to concrete service application, and including security feature, the extension of concurrent characteristic realizes;Such as in the exploitation of network management platform, in order to realize the polling operation to equipment, it is only necessary to the functional extension of adding portion code and feasible system in main business thread.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the present invention " method of remote procedure call based on TCP/UDP " preferred embodiment.
Detailed description of the invention
It is described in further detail below in conjunction with preferred embodiment shown in accompanying drawing.
The present invention proposes a kind of method of remote procedure call based on transmission control protocol TCP/UDP UDP, for including the network system of server end and client.Described server end is made up of the hardware being used for realizing server capability.Described client is made up of the terminal hardware being used for realizing client functionality.Described client establishes the link with server end by the socket Socket based on transmission control protocol TCP/UDP UDP.Described method comprises the steps:
System object pond and system thread pool is set up at server end.Preserving the system interface object called for complete process in described system object pond, described system interface object is assigned with unique object identity code ID and unique interface identifier code ID.Thus system interface object can be determined uniquely according to object identity code ID and interface identifier code ID.System object pond preserves system interface object by the mode of container.So-called system interface object, namely can provide the instantiation of the interface class of remote method invocation (RMI), and total interface prototype all defines at interface apoplexy due to endogenous wind, by instantiation mode by far call.Server end start after, instantiation total interface class, and load all systems support interface object in object pool.Just can determine that, with interface identifier code ID, the execution method that this interface object is corresponding by the object identity code ID of this interface object, namely interface object performs method.Service end start after, instantiation total interface class, and load all systems support interface object in object pool.
Described system thread pool includes at least two can the worker thread of simultaneously concurrent working.As it is shown in figure 1, when server end initializes, all of thread broadly falls into idle condition.Worker thread can be parallel the method for execution interface object, the parallel processing capability of system is decided by worker thread quantity, quantity generally according to each 2 concurrent thread of core CPU support is set, and in thread pool, worker thread quantity can input when system initialization or load from configuration file.
The preferred embodiment of the present invention, as it is shown in figure 1, the remote procedure call that completes of described method needs to carry out between client 100 and server end 200, the present invention makes server end and client can complete remote procedure call according to following steps,
A. as shown in Figure 1, after enabling remote procedure call 101, performing 102, the procedure call data calling main body input is encapsulated as and calls packet by client, and this calls packet and includes object identity code ID, interface identifier code ID and arrange parameter for what complete process called needs;Described main body of calling can be that terminal use inputs, or from feedback information;
B. client described in step A is set up and the linking of server end by socket Socket;
C. as shown in Figure 1 104, client sends calling packet described in step A to server end;
D. as shown in Figure 1 201, after server end completes to initialize, server end finds corresponding system interface object and interface object execution method according to the object identity code ID called in packet received and interface identifier code ID in system object pond;
E. server end finds the worker thread of free time, the system interface object found by step D and the described parameter that arranges called in packet to input to worker thread in object pool, starts worker thread and performs the processing procedure of system interface object;Described worker thread performs interface object execution method according to arranging parameter;
F. as shown in Figure 1 206, worker thread is performed the result of system interface object and sends to client with the form of return parameters bag by server end;It is exactly that worker thread is according to arranging the method return value obtained after parameter performs interface object execution method that worker thread performs the result of system interface object, the method return value is encapsulated as return parameters bag, this return parameters bag is presented as data message, namely returns data message;The socket SOCKET connection that described return data message is set up by client and server returns to client from server end;
G. client performs corresponding operating according to the return parameters bag received for calling main body.
Specifically, described in step A, call the time-out time of the data to be returned such as packet also includes, return the pointer of depositing of data, and spread out of parameter for what show byte quantity that this invocation of procedure obtains.
The preferred embodiment of the present invention, when packet is called in system encapsulation, developer have employed the mode of template class and achieves the encapsulation calling packet, is referred to following message encapsulation function false code prototype,
template<classSTR_T>intsendDataStream(intmethod_id,STR_T*str_method,inttime_out,_UC**recv_buff,int&recv_size,intobj_id)
This function can generate the data stream of class members's method, and passes to remote server by socket SOCKET, calls remote object method, and return data is spread out of.System adopts the mode of template class to realize the fusion of different types of data structure, adopts unified mode to realize the generation of outgoi8ng data.The implementation adopting template class is because incoming structure and not can determine that at present, and the moment that can only by the time run just knows the type of incoming method structure
Being defined as follows of above-mentioned parameter,
Intmethod_id calls the method ID of remote object, macrodefinition determine;
STR_T*str_method template class, it is necessary to pass to the argument structure of remote object;
The time-out time of the data to be returned such as inttime_out, the unit second;
_ UC**recv_buff returns the pointer that data are deposited, and states and apply for internal memory in the function call this function, deletes releasing memory (single byte integer) in the function call this function;
Int&recv_size spreads out of parameter, it was shown that the byte quantity that this far call obtains;
Intobj_id calls the object ID of remote object;
The return value of above-mentioned encapsulation be return SOCKET function return value, time-out or be successfully transmitted.
In order to prevent far call process time-out, call the time-out time of the data to be returned such as packet also includes described in step A, as shown in Figure 1, then step C includes as follows step by step,
C1. as shown in Figure 1 104, client sends calling packet described in step A to server end;
C2. client terminal start-up returns data waiting-timeout timing;
Meanwhile, step G includes as follows step by step,
G1. as shown in Figure 1 105, relatively step by step the return data waiting-timeout timing time of C2 with the data timeout time to be returned such as call described in packet, if returning data waiting-timeout timing time the data timeout time to be returned such as to be not more than, perform G2 step by step;If return data waiting-timeout timing time more than etc. data timeout time to be returned, perform shown in Fig. 1 107, terminate this invocation of procedure;
G2. client performs corresponding operating according to the return parameters bag received for calling main body.
Specifically, step by step G2 include following step by step, as shown in Figure 1 106,
G21. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G22. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G23. the connection with server end is closed.
In order to ensure the integrity establishing the link process, step B also includes as follows step by step,
B1. client is initiated and the linking of server end according to socket Socket,
B2. as shown in Figure 1 103 to 104, if client and server establishes the link successfully, carry out step C;
B3. as shown in Figure 1 103 to 107, if client and server establishes the link failure, terminate this invocation of procedure.
Received server-side to a kind of concrete processing scheme after calling packet is, as it is shown in figure 1, described step D include following step by step,
D11. as shown in Figure 1 202, server end judges that whether the object identity ID called in packet that receives and interface identifier code ID is legal;D12 step by step is carried out if it is determined that legal;If it is determined that illegal, as shown in Figure 1 205, unsuccessful for invocation of procedure result is sent to client with the form of return parameters bag, performs step G;
D12. server end finds corresponding system interface object and interface object to perform method according to the step C object identity code ID called in packet received and interface identifier code ID in system object pond.
Received server-side to the another kind of concrete processing scheme after calling packet is, as it is shown in figure 1, also include in the described thread pool of server end connecting worker thread, then described step D include following step by step,
D21. start and connect worker thread;
D22. will receive and call data packet sequencing, and successively each packet that calls be performed D23 step by step, D24 step by step, and step E, step F;
D23. as shown in Figure 1 202, it is judged that whether the object identity ID called in packet and the interface identifier code ID that receive be legal;D24 step by step is carried out if it is determined that legal;If it is determined that illegal, as shown in Figure 1 205, unsuccessful for invocation of procedure result is sent to client with the form of return parameters bag, performs step G;
D24. server end finds corresponding system interface object and interface object to perform method according to the step C object identity code ID called in packet received and interface identifier code ID in system object pond;
And then described step E include following step by step,
E1. as shown in Figure 1 203, worker thread whether available free in server-side search object pool, if available free worker thread, perform E2 step by step;Without idle worker thread, it is maintained at calling packet in the sequencing queue connecting worker thread, returns D22 step by step;
E2. as shown in Figure 1 204, server end finds the worker thread of free time in object pool, the system interface object found by step D24, the interface object needing execution perform method and the described parameter that arranges called in packet inputs to worker thread, start worker thread and perform the processing procedure of system interface object.
Client receives the concrete processing method of the return parameters bag that server end is sent, as shown in Figure 1 106, step G include following step by step,
G31. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G32. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G33. the connection with server end is closed.
Above steps can adopt Implementation of pseudocode as shown in the table at this preferred embodiment:
Code analysis
TypedefstructPARA_STRUCT is the parameter of set form
Describing, its definition is as follows:
_ULdevice_id;Object ID
_ULmethod_id;Interface method ID
_ULdata_struct_size;Interface parameters size
void*para_data;Interface parameters structured fingers
}PARA_STRUCT;
// perform object method core code
voidExecute_Object_Method(PARA_STRUCT&
_ para, TClientConnThread*client) function prototype, client is SOCKET output lead
{ journey is used for returning the transmission of result message
TDevice*device=getDevice(_para.device_id);
Device is interface object, from input parameter
If (device==NULL) { obtains object ID, and finds interface object
If interface object (can not find connecing of correspondence for empty
// ... mouth object)
return;Carrying out fault processing, code is slightly
And return, do not continue executing with subsequent operation
TprocessThread*_idle_thread=_threadpool->
_getIdleThread();_ threadpool is thread pool object, at thread pool
If (_ idle_thread==NULL) in find idle thread
//……
Without idle thread
return;Message packet is saved in queue, follow-up free
Idle thread continues with, code is slightly
device->setPARA(_para);Return, do not continue executing with subsequent operation
_idle_thread->setDevice(device);Set the parameter that object to perform, describe and to hold
_idle_thread->setClient(client);The method of row
_idle_thread->Resume();Set the object that idle thread performs
Set the SOCKET passage returning result message
// thread performs body core code thread to start to independently execute object method (parallel)
voidTprocessThread::Execute()
After thread RESUME, the work shape of thread
while(!Terminated) { state becomes BUSY, and performs following code
device->execute_method();
RESULT_STRUCTresult=performs the method for object, and object method performs result
device->getRESULT();It is saved in the result structure of object,
generatePackage(result);Obtain the result set that interface object performs to return
If (result.result_data) { carries out the encapsulation operation of returned packet
deleteresult.result_data;If returning valid data (pointer is not empty)
result.result_data=NULL;Delete the internal memory that release has been applied for
Pointer is set to sky
sendResult();Send returned packet
Delete [] _ data._data_stream deletes the internal memory of returned packet application
Suspend();Thread suspension (state becomes IDLE)
}
}
// object execution method core code
voidTDevice::execute_method()
{
// ... object execution method prototype, before execution, perform need
The parameter wanted is before already by thread
intresult_value;Device-> setPARA (_ para) method sets
Switch (para_struct.method_id), before performing concrete method, does the school of parameter
{ testing work, code is slightly
CaseGET_SYS_DESCRIPTION_METHOD_ID: the method for returning returns value statement
result_value=Get_sys_description();Method ID according to parameter, carries out performing method choice
break;
//……
Perform selected method, and result is saved in
Result_value, for follow-up return result message
Follow-up code is slightly.
The present invention can as the exploitation basis of data access middleware.The access of heterogeneous database be service application have in the face of and solve problem, by the problem that the mode of data access middleware can well solve this type.Data access middleware is by the encapsulation to database access, it is achieved the access to distinct type data-base.On the remote method basis that the present invention provides, in conjunction with XML(extensible markup language: ExtensibleMarkupLanguage) the technology realization encapsulation to data set, return the data set returned packet as remote method, client aspect increases the parsing to XML can realize the middleware of business independence, client need not directly set up the connection with database server, replace different types of database server, have only to change different database-driven, without client is done any kind of change.
The present invention can be additionally used in the exploitation of application service middleware.For concrete service application, can by business logically independent out, method provided by the invention is adopted to realize the encapsulation of service logic, client represents layer as business, do not realize concrete service logic, by the remote method invocation (RMI) that the present invention designs, it is achieved the access to service logic, make the system application of three-tier architecture.

Claims (6)

1. based on a method for the remote procedure call of transmission control protocol TCP/UDP UDP, for including the network system of server end and client;Described client establishes the link with server end by the socket Socket based on transmission control protocol TCP/UDP UDP;It is characterized in that described method comprises the steps:
System object pond and system thread pool is set up at server end;Preserving the system interface object called for complete process in described system object pond, described system interface object is assigned with unique object identity code ID and unique interface identifier code ID;Thus system interface object can be determined uniquely according to object identity code ID and interface identifier code ID;Described system thread pool includes at least two can the worker thread of simultaneously concurrent working;Thus making server end and client can complete remote procedure call according to following steps,
A. the procedure call data calling main body input is encapsulated as and calls packet by client, and this calls packet and includes object identity code ID, interface identifier code ID and arrange parameter for what complete process called needs;
B. client described in step A is set up and the linking of server end by socket Socket;
C. client sends calling packet described in step A to server end;
D. server end finds corresponding system interface object and interface object to perform method according to the object identity code ID called in packet received and interface identifier code ID in system object pond;
E. server end finds the worker thread of free time in object pool, the system interface object, interface object execution method and the described parameter that arranges called in packet that are found by step D input to worker thread, start worker thread and perform the processing procedure of system interface object;
F. worker thread is performed the result of system interface object and sends to client with the form of return parameters bag by server end;
G. client performs corresponding operating according to the return parameters bag received for calling main body;
The described thread pool of server end also includes connect worker thread, then described step D includes as follows step by step,
D21. start and connect worker thread;
D22. will receive and call data packet sequencing, and successively each packet that calls be performed D23 step by step, D24 step by step, and step E, step F;
Whether the object identity ID called in packet and interface identifier code ID that D23. judgement receives be legal;D24 step by step is carried out if it is determined that legal;If it is determined that illegal, unsuccessful for invocation of procedure result is sent to client with the form of return parameters bag, perform step G;
D24. server end finds corresponding system interface object and interface object to perform method according to the step C object identity code ID called in packet received and interface identifier code ID in system object pond;
And then described step E include following step by step,
E1. whether available free in server-side search object pool worker thread, if available free worker thread, perform E2 step by step;Without idle worker thread, it is maintained at calling packet in the sequencing queue connecting worker thread, returns D22 step by step;
E2. server end finds the worker thread of free time in object pool, the system interface object found by step D24, the interface object needing execution perform method and the described parameter that arranges called in packet inputs to worker thread, start worker thread and perform the processing procedure of system interface object.
2. the method for the remote procedure call based on transmission control protocol TCP/UDP UDP according to claim 1, it is characterised in that:
Call the time-out time of the data to be returned such as packet also includes described in step A, return the pointer of depositing of data, and spread out of parameter for what show byte quantity that this invocation of procedure obtains.
3. the method for the remote procedure call based on transmission control protocol TCP/UDP UDP according to claim 1, it is characterised in that:
Step B also includes as follows step by step,
B1. client is initiated and the linking of server end according to socket Socket,
If B2. client and server establishes the link successfully, carry out step C;
If B3. client and server establishes the link failure, terminate this invocation of procedure.
4. the method for the remote procedure call based on transmission control protocol TCP/UDP UDP according to claim 1, it is characterised in that:
The time-out time of the data to be returned such as packet also includes is called, then step C includes as follows step by step described in step A,
C1. client sends calling packet described in step A to server end;
C2. client terminal start-up returns data waiting-timeout timing;
Meanwhile, step G includes as follows step by step,
G1. comparing the return data waiting-timeout timing time of C2 step by step and the data timeout time to be returned such as call described in packet, if returning data waiting-timeout timing time the data timeout time to be returned such as to be not more than, performing G2 step by step;If return data waiting-timeout timing time more than etc. data timeout time to be returned, terminate this invocation of procedure;
G2. client performs corresponding operating according to the return parameters bag received for calling main body.
5. the method for the remote procedure call based on transmission control protocol TCP/UDP UDP according to claim 4, it is characterised in that:
G2 includes as follows step by step step by step,
G21. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G22. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G23. close and the linking of server end.
6. the method for the remote procedure call based on transmission control protocol TCP/UDP UDP according to claim 1, it is characterised in that:
Step G includes as follows step by step,
G31. return parameters bag intrinsic parameter is resolved, it is judged that whether the invocation of procedure is successful;
G32. to calling the parameter that main body returns in the return parameters bag of parsing, corresponding operating is performed for calling main body;
G33. the connection with server end is closed.
CN201210432628.XA 2012-11-02 2012-11-02 Method based on the remote procedure call of TCP/ UDP Active CN103116520B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210432628.XA CN103116520B (en) 2012-11-02 2012-11-02 Method based on the remote procedure call of TCP/ UDP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210432628.XA CN103116520B (en) 2012-11-02 2012-11-02 Method based on the remote procedure call of TCP/ UDP

Publications (2)

Publication Number Publication Date
CN103116520A CN103116520A (en) 2013-05-22
CN103116520B true CN103116520B (en) 2016-07-06

Family

ID=48414904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210432628.XA Active CN103116520B (en) 2012-11-02 2012-11-02 Method based on the remote procedure call of TCP/ UDP

Country Status (1)

Country Link
CN (1) CN103116520B (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103347053A (en) * 2013-06-19 2013-10-09 成都市欧冠信息技术有限责任公司 Remote coprocessing procedure call method based on pipeline technology
CN105022622B (en) * 2014-04-29 2018-09-28 鼎捷软件股份有限公司 Overtime control unit and remote procedure call method suitable for remote procedure call
CN104486133B (en) * 2014-12-26 2017-11-17 大唐移动通信设备有限公司 The method and system of network element proxy management
CN104615489B (en) * 2015-01-22 2018-02-23 江苏大烨智能电气股份有限公司 A kind of implementation method of multinode data interaction
CN107179951A (en) * 2016-03-09 2017-09-19 北京京东尚科信息技术有限公司 Remote procedure calling (PRC) method and device
CN105824712B (en) * 2016-03-30 2019-07-30 深圳市金证科技股份有限公司 A kind of execution method and apparatus of service logic
CN105763619B (en) * 2016-03-31 2019-07-05 广州欢聚时代信息科技有限公司 The method and device that client and server-side are communicated
CN107294911B (en) * 2016-03-31 2020-09-08 华为技术有限公司 Data packet monitoring method and device, remote procedure call system and equipment
CN106648940B (en) * 2017-03-13 2020-05-22 北京百悟科技有限公司 Remote procedure calling method and device
CN107301098B (en) * 2017-06-15 2020-09-08 搜易贷(北京)金融信息服务有限公司 Remote procedure calling device, method and system based on Thrift protocol
CN107948215A (en) * 2018-01-17 2018-04-20 广州汇智通信技术有限公司 A kind of remote invocation method and device based on UDP communications
CN110392017B (en) * 2018-04-18 2020-11-06 华为技术有限公司 Method and related device for processing RPC message
CN108829502B (en) * 2018-06-21 2021-11-23 北京奇虎科技有限公司 Method and device for realizing thread operation
CN111913819A (en) * 2020-08-07 2020-11-10 上海格尔安全科技有限公司 RPC-based USBKEY access method
CN113163016B (en) * 2021-05-12 2023-08-04 北京阳光云视科技有限公司 Network long connection service clustering deployment system and control flow
CN117573395B (en) * 2024-01-13 2024-04-02 杭州杰竞科技有限公司 Remote scheduling method and system between micro services

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852209A (en) * 2006-05-31 2006-10-25 北京和利时系统工程股份有限公司 Remote process transfering method and system in distribution type control system
CN101419558A (en) * 2008-11-13 2009-04-29 湖南大学 CUDA graphic subsystem virtualization method
CN101697139A (en) * 2009-11-06 2010-04-21 金蝶软件(中国)有限公司 Method, device and registry for remote procedure call

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7543300B2 (en) * 2004-11-16 2009-06-02 International Business Machines Corporation Interface for application components

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852209A (en) * 2006-05-31 2006-10-25 北京和利时系统工程股份有限公司 Remote process transfering method and system in distribution type control system
CN101419558A (en) * 2008-11-13 2009-04-29 湖南大学 CUDA graphic subsystem virtualization method
CN101697139A (en) * 2009-11-06 2010-04-21 金蝶软件(中国)有限公司 Method, device and registry for remote procedure call

Also Published As

Publication number Publication date
CN103116520A (en) 2013-05-22

Similar Documents

Publication Publication Date Title
CN103116520B (en) Method based on the remote procedure call of TCP/ UDP
CN100353714C (en) Method for realizing Web service automatic test
Schmidt The adaptive communication environment
Schmidt ASX: An Object-Oriented Framework for Developing Distributed Applications.
Schmidt Applying patterns and frameworks to develop object-oriented communication software
Gomaa et al. Design and performance modeling of component interconnection patterns for distributed software architectures
Schmidt A family of design patterns for applications-level gateways
JP2005504455A (en) Adaptive multi-protocol communication system
CN111381983A (en) Lightweight message middleware system and method of virtual test target range verification system
CN106095601A (en) A kind of multi-course concurrency resolves differential server system and its implementation
Schmidt Acceptor and connector
Lacour et al. Deploying CORBA components on a Computational Grid: General principles and early experiments using the Globus Toolkit
Gomaa et al. Performance engineering of component-based distributed software systems
Rine et al. Using adapters to reduce interaction complexity in reusable component-based software development
Gomaa et al. Reusable component interconnection patterns for distributed software architectures
Schmidt et al. Applying patterns to develop a pluggable protocols framework for orb middleware
Pereira et al. Arcademis: a framework for object‐oriented communication middleware development
Schmidt Applying a Pattern Language to Develop Applicationlevel Gateways
Qi et al. LIFL: A Lightweight, Event-driven Serverless Platform for Federated Learning
Aleksy et al. A CORBA-based object group service and a join service providing a transparent solution for parallel programming
Jin et al. A scalable parallel debugging library with pluggable communication protocols
Patchin et al. Adding the Easy Button to the Cloud with SnowFlock and MPI
Prashanth et al. An optimized technique of increasing the performance of network adaptor on EML Layer
Schmidt C++ network programming with patterns, frameworks, and ACE
Hong Coping with Embedded Software Crisis using Real-time Operating Systems and Embedded Middleware “

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
CP03 Change of name, title or address

Address after: 518057, 24th Floor, Yihua Financial Science and Technology Building, 2388 Houhai Avenue, Nanshan High-tech Park, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Asian Union Development Technology Co.,Ltd.

Address before: 518057 Building 6, R3-A, Nanshan High-tech Industrial Village, Shenzhen, Guangdong Province

Patentee before: SHENZHEN KEYBRIDGE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Room 1205, Chuangye Building, Liaoyuan Hi tech Industrial Development Zone, Jilin Province, 136299

Patentee after: Jilin Asia Link Technology Development Co.,Ltd.

Address before: 518057, 24th Floor, Yihua Financial Science and Technology Building, 2388 Houhai Avenue, Nanshan High-tech Park, Shenzhen City, Guangdong Province

Patentee before: Shenzhen Asian Union Development Technology Co.,Ltd.

CP03 Change of name, title or address