Call method and device between a kind of system
Technical field
The application is related to field of computer technology, call method and device between more particularly, to a kind of system.
Background technology
Big in information technology (InformationTechnology, the IT) system of large enterprise or the Internet
In type system architecture, based on the demand of set expandability, stability, generally require to be deployed to large scale system
Distributed multisystem framework.
In distributed multisystem framework, based on the demand of service logic, between different application systems, need base
To realize interface data in remote procedure call protocol (Remote Procedure Call Protocol, RPC)
Communication.When a service request needs multiple application system cooperations to complete, every one-level application system can basis
The demand of oneself to transmission method parameter object process, and will process after method parameter object transmission
Continue with to next stage application system.It can be seen that, afterbody application system receive method parameter to as if
Data after multistep treatment, if data go wrong (such as certain attribute lack or be not inconsistent qualified
Formula is arranged), when needing to carry out positioning problems, can only successively every one-level application system be entered from bottom to top
Row traces positioning, and location efficiency is relatively low.
In order to avoid carrying out tracing positioning to application system level one-level, there is scheme to propose, by third party be
System such as messaging bus, provides transfer service, when calling next stage application system every time, by call method and biography
The method parameter object passed is sent to messaging bus, and messaging bus are obtained based on call method and record transmission
The corresponding contextual information of method parameter object, next stage application system can obtain biography by messaging bus
The corresponding contextual information of method parameter object passed, but this mode needs to additionally introduce messaging bus, increases
Add system cost and implemented complexity, existing system has been transformed too big.
Content of the invention
The embodiment of the present application provides call method between a kind of system, in order to realize not introducing messaging bus etc. the
On the premise of three method, systems, improve the positioning problems efficiency under distributed multisystem framework.
The embodiment of the present application provides call method between a kind of system, including:
First application system when determination needs to call the second application system, based on remote procedure call protocol
RPC framework is that this first application system method parameter waiting for transmission object configures contextual information;
Described first application system context letter to methods described parameter object and configuration based on RPC framework
After breath carries out serializing process, it is transferred to the second application system.
Alternatively, the first application system is based on RPC framework is that this first application system method waiting for transmission is joined
Number object configuration contextual information, including:
Described first application system has context methods described parameter object is detected by RPC framework
After information configuration sign, it is methods described parameter object configuration contextual information.
Alternatively, described first application system based on RPC framework to methods described parameter object and configuration
Contextual information carries out serializing process, including:
Create the composite object of the contextual information comprising methods described parameter object and configuration, establishment is answered
Close object and carry out serializing process;Or,
Respectively serializing process is carried out to the contextual information of methods described parameter object and configuration.
Alternatively, described contextual information includes one or more of following information:
The title of the first application system, the server ip address of the first application system, the class name calling, side
Religious name.
Another embodiment of the application provides call method between a kind of system, including:
The sequence that second application system is transmitted to the first application system based on remote procedure call protocol RPC framework
Method parameter object after rowization and contextual information carry out unserializing process;
Described second application system is based on RPC framework, to the method parameter object side of carrying out after unserializing
Method is called, and preserves the contextual information after unserializing.
Alternatively, after the serializing that the second application system is transmitted to the first application system based on RPC framework
Method parameter object and contextual information carry out unserializing process, including:
To serializing after comprise method parameter object and the composite object of contextual information carries out unserializing
Process;Or,
Respectively unserializing is carried out to the method parameter object after serializing and the contextual information after serializing
Process.
Alternatively, described second application system is based on RPC framework, to the method parameter pair after unserializing
As carrying out method call, and after preserving the contextual information after unserializing, also include:
When determination needs to call three application systems, carried out for this second application system based on RPC framework
The method parameter object configuration contextual information waiting for transmission obtaining after method call;
Based on RPC framework, to this second application system method parameter waiting for transmission object, to be transmitted for this
Method parameter object configuration contextual information and described first application system send contextual information
After carrying out serializing process, it is transferred to described 3rd application system.
Alternatively, described second application system is based on RPC framework, to the method parameter pair after unserializing
As carrying out method call, and after preserving the contextual information after unserializing, also include:
After receiving the inquiry request for described contextual information, extract and feed back the described upper and lower of preservation
Civilian information.
The embodiment of the present application provides calling device between a kind of system, including:
Configuration module, for when determination needs to call the second application system, based on remote procedure call protocol
RPC framework is that this first application system method parameter waiting for transmission object configures contextual information;
Transport module, for the contextual information to methods described parameter object and configuration based on RPC framework
After carrying out serializing process, it is transferred to the second application system.
Another embodiment of the application provides calling device between a kind of system, including:
Processing module, for transmitted to the first application system based on remote procedure call protocol RPC framework
Method parameter object after serializing and contextual information carry out unserializing process;
Performing module, for based on RPC framework, carrying out method to the method parameter object after unserializing
Call, and preserve the contextual information after unserializing.
In the embodiment of the present application, when the RPC framework by the first application system calls the second application system,
Method parameter object for transmission configures contextual information, and the method by the contextual information of configuration and transmission
Parameter object is transferred to the second application system after carrying out serializing process together.So, every one-level application system
Oneself transmission can be increased when the serializing being carried out method parameter object based on RPC framework is processed
The corresponding contextual information of method parameter object;So, afterbody application system, namely bottom application system
In the contextual information that blanket insurance is deposited, the method parameter object describing final output corresponding entirely calls link
Information, such that it is able on the premise of not introducing the Third party system such as messaging bus, improve distributed polyphyly
Positioning problems efficiency under system framework.
Brief description
Call method flow chart between the system that Fig. 1 provides for the embodiment of the present application one;
Call method flow chart between the system that Fig. 2 provides for the embodiment of the present application two;
Call method flow chart between the system that Fig. 3 provides for the embodiment of the present application three;
Fig. 4 is the schematic diagram carrying out calling between system;
Calling device structural representation between the system that Fig. 5 provides for the embodiment of the present application four;
Calling device structural representation between the system that Fig. 6 provides for the embodiment of the present application five.
Specific embodiment
The basic thought of the embodiment of the present application is:The RPC framework carrying out calling between system is extended,
Carrying out increasing contextual information when serializing is processed.Specifically, in the RPC by the first application system
When framework calls the second application system, the method parameter object for transmission configures contextual information, and will configure
Contextual information with transmission method parameter object together with carry out serializing process after be transferred to the second application
System.So, every one-level application system can be in the sequence carrying out method parameter object based on RPC framework
When rowization are processed, increase the corresponding contextual information of method parameter object of oneself transmission;So, last
In level application system, namely the contextual information that preserves of bottom application system, the method that describes final output
The corresponding information entirely calling link of parameter object, such that it is able to not introduce the third parties such as messaging bus system
On the premise of system, improve the positioning problems efficiency under distributed multisystem framework.
With reference to Figure of description, the embodiment of the present application is described in further detail.
Embodiment one
As shown in figure 1, call method flow chart between the system providing for the embodiment of the present application one, including following
Step:
S101:First application system when determination needs to call the second application system, based on remote procedure call
Agreement RPC framework is that this first application system method parameter waiting for transmission object configures contextual information.
In being related to the Business Processing that multisystem is called, the first application system after finishing service logical process,
The method parameter object obtaining after needing to process passes to the second application system and proceeds to process, Ye Jitong
Cross the RPC framework of the first application system, initiate to call the second application to the RPC framework of the second application system
The request of system, proceeds business logic processing with the operational approach calling the second application system.
Here, contextual information can include one or more of following information:
The title of the first application system, the server ip address of the first application system, the class name calling, side
Religious name.
By the contextual information of the first application system configuration, the whole tune in method parameter object can be followed the trail of
With the method call process being responsible for by the first application system in link.
S102:First application system context to methods described parameter object and configuration based on RPC framework
After information carries out serializing process, it is transferred to the second application system.
In this step, the RPC framework of the first application system will need contextual information and the method ginseng of transmission
Number object is transferred to next stage application system after carrying out serializing process together.In fact, here with
The serializing treatment mechanism that RPC calls, completes the interpolation of contextual information in serializing processing procedure.
S103:Second application system is passed to the first application system based on remote procedure call protocol RPC framework
Method parameter object after defeated serializing and contextual information carry out unserializing process.
Here, the RPC framework of the second application system is to the method parameter object and upper after the serializing receiving
Context information carries out unserializing process, obtains original method parameter object and contextual information.
S104:Second application system carries out method call based on the method parameter object after unserializing, and protects
Deposit the contextual information after unserializing.
Here, the second application system, based on the method parameter object after unserializing, is called operational approach, is entered
The process of row own service logic;Contextual information after unserializing is saved, the context of preservation
Information can be used for continuing to the transmission of next stage application system, or is used for inquiring about.
Embodiment two
As shown in Fig. 2 call method flow chart between the system providing for the embodiment of the present application two, including following
Step:
S201:First application system, when needing to call the second application system, is treated by the detection of RPC framework
Whether the method parameter object of transmission has contextual information configuration sign, if so, then enters S203,
Otherwise, enter S202.
In being embodied as, can pre-set which class, method or attribute etc. needs to configure contextual information,
And needing to configure the setting positions such as the title of class/method/attribute of contextual information interpolation contextual information
Configuration sign, such as@HoldContext;Obtain relevant process parameters pair carrying out business logic processing
As rear, generally search the corresponding class/method/attribute of the method parameter object setting position whether have on
Context information configures sign to determine the need for configuring the method parameter object corresponding context letter
Breath.
S202:First application system is based on RPC framework, carries out sequence to method parameter object waiting for transmission
Change is transferred to the second application system after processing.
Here, if method parameter object waiting for transmission need not carry out contextual information configuration, can first should
Can directly carry out being transferred to second after serializing process to changing method parameter object with the RPC framework of system
Application system.
S203:First application system is based on RPC framework, is methods described parameter object configuration context letter
Breath, and create the composite object of the contextual information comprising methods described parameter object and configuration, to create
Composite object is transferred to the second application system after carrying out serializing process;Or, respectively to methods described parameter
The contextual information of object and configuration is transferred to the second application system after carrying out serializing process.
Here, the RPC framework of the first application system can be by the context letter of method parameter object and configuration
Breath carries out serializing as a composite object and processes it is also possible to carry out at serializing to both objects respectively
Reason.
S204:Second application system be based on RPC framework, to serializing after comprise method parameter object and
The composite object of contextual information carries out unserializing process;Or, respectively to the method parameter after serializing
Contextual information after object and serializing carries out unserializing process.
Corresponding with S203, the RPC framework of the second application system when carrying out unserializing and processing, Ke Yishi
The composite object of method parameter object and contextual information is carried out with unserializing process or right respectively
Method parameter object and contextual information both objects carry out unserializing process.
S205:Second application system is based on RPC framework, and the method parameter object after unserializing is carried out
Method call, and preserve the contextual information after unserializing.
Here, the RPC framework of the second application system, based on the method parameter object after unserializing, calls
Operational approach, the second application system carries out the process of own service logic;The RPC frame of the second application system
Contextual information after unserializing is saved by frame, and the contextual information of preservation can be used for continuing downwards
One-level application system is transmitted, or is used for inquiring about.Specifically, if the second application system is not current business
The application system of the bottom, then the second application system be based on RPC framework, will obtain after carrying out service logic
Method parameter object contextual information corresponding with the method parameter object, and the context receiving before
Information is transmitted to next stage application system after carrying out serializing process.If the second application system is current business
The application system of the bottom, can preserve this contextual information, use for subsequent query.This thought will be in reality
Apply in example three and be described further.
Embodiment three
As shown in figure 3, for the embodiment of the present application three provide system between call method flow chart, Fig. 4 be with
Corresponding system between call schematic diagram, this embodiment three comprises the following steps:
S301:First application system, when determination needs to call the second application system, based on RPC framework is
This first application system method parameter waiting for transmission object configures contextual information.
As shown in figure 4, first, developer can be to need to protect by the development interface of the first application system
The setting position holding the class/attribute/method of context etc. adds contextual information configuration sign, such as
@HoldContext.
The RPC framework of the first application system after receiving the instruction calling the second application system, treat by detection
Whether the corresponding setting position of method parameter object of transmission has corresponding contextual information configuration instruction
Mark, if having, configures contextual information for this method parameter object waiting for transmission.
S302:First application system context to methods described parameter object and configuration based on RPC framework
After information carries out serializing process, it is transferred to the second application system.
As shown in figure 4, the RPC framework of the first application system is by method parameter object waiting for transmission and configuration
Contextual information carry out serializing process after, by serializing after method parameter object and configuration context
Information transfer gives the RPC framework of the second application system, namely the second application system proceeds to process.
S303:Side after the serializing that second application system is transmitted to the first application system based on RPC framework
Method parameter object and contextual information carry out unserializing process;Based on the method parameter object after unserializing
Carry out method call, and preserve the contextual information after unserializing.
As shown in figure 4, the RPC framework of the second application system is to the method parameter object after the rowization receiving
Carry out unserializing process with contextual information;After the RPC framework of the second application system is based on unserializing
Method parameter object carry out operational approach and call, the second application system, based on the operational approach called, is carried out
Own service logical process.
S304:Second application system, when determination needs to call three application systems, based on RPC framework is
The method parameter object configuration context letter waiting for transmission that this second application system obtains after carrying out method call
Breath.
S305:Second application system is based on RPC framework, and this second application system method waiting for transmission is joined
Number object, the contextual information for this method parameter object configuration waiting for transmission and described first application system
After the contextual information that system sends carries out serializing process, it is transferred to the 3rd application system.
As shown in figure 4, the RPC framework of the second application system is receiving the finger calling the 3rd application system
After order, for carrying out the method parameter object configuration contextual information waiting for transmission obtaining after operational approach is called,
And the method parameter object, configuration contextual information and contextual information before are carried out sequence together
Change is transferred to the 3rd application system after processing.
S306:Side after the serializing that 3rd application system is transmitted to the second application system based on RPC framework
Method parameter object and contextual information carry out unserializing process;Based on the method parameter object after unserializing
Carry out method call, and preserve the contextual information after unserializing.
As shown in figure 4, the RPC framework of the 3rd application system carries out inverted sequence to the information of the serializing receiving
Rowization are processed, and preserve all contextual informations after unserializing;Using the method parameter pair after unserializing
Call as carrying out operational approach, the 3rd application system, based on the operational approach called, carries out own service logic
Process (such as risk identification business logic processing).
The RPC framework of the 3rd application system provides contextual information services interface, is receiving for arbitrary
After the contextual information inquiry request of method parameter object, the method parameter object is inquired about based on RPC framework
Corresponding call link, and extract this and call each the corresponding context of method parameter object on link to believe
Breath.
Based on same inventive concept, in the embodiment of the present application, additionally provide the corresponding system of call method between system
Calling device between system, due to call method phase between principle and the embodiment of the present application system of this device solve problem
Seemingly, the enforcement of therefore this device may refer to the enforcement of method, repeats no more in place of repetition.
Example IV
As shown in figure 5, calling device structural representation between the system providing for the embodiment of the present application four, including:
Configuration module 51, for when determination needs to call the second application system, based on remote procedure call association
View RPC framework is that this first application system method parameter waiting for transmission object configures contextual information;
Transport module 52, for the context letter to methods described parameter object and configuration based on RPC framework
After breath carries out serializing process, it is transferred to the second application system.
Alternatively, described configuration module 51 specifically for:
Methods described parameter object is detected by RPC framework, there is contextual information configuration sign
Afterwards, it is methods described parameter object configuration contextual information.
Optionally, described transport module 52 specifically for:
Create the composite object of the contextual information comprising methods described parameter object and configuration, establishment is answered
Close object and carry out serializing process;Or,
Respectively serializing process is carried out to the contextual information of methods described parameter object and configuration.
Alternatively, described contextual information includes one or more of following information:
The title of the first application system, the server ip address of the first application system, the class name calling, side
Religious name.
Embodiment five
As shown in fig. 6, calling device structural representation between the system providing for the embodiment of the present application five, including:
Processing module 61, for being transmitted to the first application system based on remote procedure call protocol RPC framework
Serializing after method parameter object and contextual information carry out unserializing process;
Performing module 62, for based on RPC framework, to the method parameter object side of carrying out after unserializing
Method is called, and preserves the contextual information after unserializing.
Alternatively, described processing module 61 specifically for:
To serializing after comprise method parameter object and the composite object of contextual information carries out unserializing
Process;Or,
Respectively unserializing is carried out to the method parameter object after serializing and the contextual information after serializing
Process.
Alternatively, described performing module 62 is additionally operable to:
When determination needs to call three application systems, carried out for this second application system based on RPC framework
The method parameter object configuration contextual information waiting for transmission obtaining after method call;Based on RPC framework,
To this second application system method parameter waiting for transmission object, for this method parameter object waiting for transmission configuration
After the contextual information of contextual information and described first application system transmission carries out serializing process, pass
It is defeated by described 3rd application system.
Alternatively, described performing module 62 is additionally operable to:
After receiving the inquiry request for described contextual information, extract and feed back the described upper and lower of preservation
Civilian information.
Those skilled in the art are it should be appreciated that embodiments herein can be provided as method, system or meter
Calculation machine program product.Therefore, the application can be using complete hardware embodiment, complete software embodiment or knot
Close the form of the embodiment of software and hardware aspect.And, the application can adopt and wherein wrap one or more
Computer-usable storage medium containing computer usable program code (including but not limited to disk memory,
CD-ROM, optical memory etc.) the upper computer program implemented form.
The application is to produce with reference to according to the method for the embodiment of the present application, device (system) and computer program
The flow chart of product and/or block diagram are describing.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or the flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embed
The processor of formula datatron or other programmable data processing device is to produce a machine so that passing through to calculate
The instruction of the computing device of machine or other programmable data processing device produces for realizing in flow chart one
The device of the function of specifying in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or other programmable datas can be guided to process and set
So that being stored in this computer-readable memory in the standby computer-readable memory working in a specific way
Instruction produce and include the manufacture of command device, the realization of this command device is in one flow process or multiple of flow chart
The function of specifying in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other programmable data processing device, makes
Obtain and series of operation steps is executed on computer or other programmable devices to produce computer implemented place
Reason, thus the instruction of execution is provided for realizing in flow chart one on computer or other programmable devices
The step of the function of specifying in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
Although having been described for the preferred embodiment of the application, those skilled in the art once know base
This creative concept, then can make other change and modification to these embodiments.So, appended right will
Ask and be intended to be construed to including preferred embodiment and fall into being had altered and changing of the application scope.
Obviously, those skilled in the art can carry out various changes and modification without deviating from this Shen to the application
Spirit and scope please.So, if the application these modification and modification belong to the application claim and
Within the scope of its equivalent technologies, then the application is also intended to comprise these changes and modification.