CN107181675A - Service calling method and device - Google Patents
Service calling method and device Download PDFInfo
- Publication number
- CN107181675A CN107181675A CN201710469894.2A CN201710469894A CN107181675A CN 107181675 A CN107181675 A CN 107181675A CN 201710469894 A CN201710469894 A CN 201710469894A CN 107181675 A CN107181675 A CN 107181675A
- Authority
- CN
- China
- Prior art keywords
- service
- call
- mark
- request
- gateway
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/146—Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention provides a kind of service calling method and device, gateway receives service invocation request and the service invocation request is sent into corresponding service providing end;And, the response results that service providing end is returned are returned into service call end by gateway.Wherein, the mark of calling of link is currently called in service invocation request comprising unique sign, and this calls mark to be transmitted between each service providing end in entirely calling link.Each service invocation request and call result are required for forwarding by gateway, and therefore, gateway can obtain the corresponding recalls information of all service calls.Therefore, this is searched from the recalls information and calls the service call link corresponding to identifying.This method only needs to set to bury on gateway to be sampled, it is not necessary to all sets and is buried a little in client and service end, therefore, greatly reduces exploitation, the lower deployment cost of the client and service end of service.
Description
Technical field
The invention belongs to computer realm, more particularly to a kind of service calling method and device.
Background technology
At present, the system of Internet firm is generally used the framework group of micro services by the subsystem for largely providing difference in functionality
Into.Micro services refer to the service developed multiple individual smalls but have complete business function, each service have the processing of oneself and
Communication mechanism, can be deployed on single or multiple servers.
There are substantial amounts of micro services in micro services framework, moreover, there is complicated call relation between micro services, therefore,
Developer is hard to know the call relation between each micro services that whole system is included, moreover, when whole call chain goes out
During existing performance bottleneck, it is difficult to position the serviced component gone wrong.
In view of the above-mentioned problems, traditional solution is:Buried respectively in the client and service end of each micro services
Point sampling, finally integrates the service call link that all sampled data analyses draw system, but such mode can be to each
The client and service end of micro services bring exploitation and deployment pressure, and different micro services providers is difficult to coordinate unified
Bury point sampling scheme.
The content of the invention
In view of this, it is an object of the invention to provide a kind of service calling method and device, to solve traditional solution party
The exploitation of client and service end and deployment for the micro services that case is present are difficult, and, different service providers is difficult to uniformly bury a little
The technical problem of sampling.Technical scheme is as follows:
In a first aspect, the application provides a kind of service calling method, applied in gateway, this method includes:
Service invocation request is received, the service invocation request includes service call end mark, service name and calls mark
Know, it is described to call mark to be used to uniquely indicate the service call link corresponding to the service invocation request;
The service invocation request is sent to by corresponding service providing end according to the service name;
The call result that the service providing end is returned is received, and the call result is sent to service call end;
The corresponding recalls information of the service invocation request is obtained, so as to call analysis end to analyze in the recalls information
Service call end mark, service providing end mark and described call mark to obtain to call the corresponding service call chain of mark with described
Road.
Alternatively, the recalls information also includes allocating time information, and the allocating time information is time-consuming including calling;Obtain
Time-consuming process is called to include described in taking:
Record receives the very first time stamp of the service invocation request, and, record receives the call request pair
Second timestamp of the call result answered;
The time difference that second timestamp is stabbed with the very first time is calculated, calling for each service is obtained time-consuming.
Alternatively, the reception service invocation request includes:
Receive the service invocation request that client is sent;
Or,
Receive first service and the service invocation request for calling second service to provide end that end is sent is provided.
Second aspect, the application also provides another service calling method, and applied to service providing end, this method includes:
First service provides the first call request that termination conquers business gateway forwards, and first call request includes first
Service call end mark, first service title and mark is called, it is described to call mark to be used to uniquely indicating the service call and ask
Seek corresponding service call link;
The first service, which provides end and parses first call request, obtains what is called needed for first call request
Second service title, and described call mark;
The first service provides end and generates the second call request according to the second service title, and described second call please
Ask and call end mark, second service title including second service and described call mark;
The first service provides end and second call request is sent into the gateway, so that the service network
Close and second call request is transmitted to second service offer end, the second service provides end and provides the second service name
Claim corresponding service;And, the gateway is obtained recalls information, and by calling analysis end to be obtained according to the recalls information
Call the corresponding service call link of mark with described.
Alternatively, methods described also includes:
The first service provides end and receives the second tune that the second service provides end return by the gateway
With result, second call result provides end response second call request by the second service and obtained;
The first service provides end and responds first call request according to second call result, and generation first is adjusted
With result, and first call result is transmitted to the first clothes for initiating first call request by the gateway
End is called in business.
The third aspect, the application provides a kind of service call device, and applied in gateway, described device includes:
First receiving unit, for receiving service invocation request, the service invocation request include service call end mark,
Service name and call mark, the service call chain for calling mark for uniquely indicating corresponding to the service invocation request
Road;
First transmitting element, is carried for the service invocation request to be sent into corresponding service according to the service name
For end;
Second receiving unit, for receiving the call result that the service providing end is returned;
Second transmitting element, for the call result to be sent into service call end;
Acquiring unit, for obtaining the corresponding recalls information of the service invocation request, so as to call analysis end analysis institute
State in recalls information service call end mark, service providing end mark and it is described call mark obtain with it is described call mark pair
The service call link answered.
Alternatively, the recalls information also includes allocating time information, and the allocating time information includes calling time-consuming, institute
Stating acquiring unit includes:
First record subelement, the very first time stamp of the service invocation request is received for recording;
Second record subelement, the second timestamp of the corresponding call result of the call request is received for recording;
Computation subunit, for calculating the time difference that second timestamp is stabbed with the very first time, obtains each clothes
Business it is corresponding call it is time-consuming.
Alternatively, first receiving unit specifically for:
Receive the service invocation request that client is sent;
Or,
Receive first service and the service invocation request for calling second service to provide end that end is sent is provided.
Fourth aspect, the application provides a kind of service call device, and applied to service providing end, the device includes:
First receiving unit, it is described for making first service provide the first call request that termination conquers business gateway forwards
First call request calls end mark, first service title including first service and calls mark, described to call mark to be used for only
Service call link corresponding to the one sign service invocation request;
First resolution unit, described first is obtained for making the first service provide end parsing first call request
The second service title called needed for call request, and described call mark;
Generation unit is asked, is called for making the first service provide end according to second service title generation second
Request, second call request includes second service and calls end to identify, second service title and described calls mark;
First transmitting element, the service is sent to for making the first service provide end by second call request
Gateway, so that second call request is transmitted to second service by the gateway provides end, the second service is provided
End provides the second service title corresponding service;And, the gateway is obtained recalls information, and by calling analysis
End obtains according to the recalls information and calls the corresponding service call link of mark with described.
Alternatively, described device also includes:
Second receiving unit, the gateway reception second service is passed through for making the first service provide end
The second call result that end is returned is provided, second call result provides end response described second by the second service and called
Request is obtained;
Response unit, is called for making the first service provide end according to second call result response described first
Request, generates the first call result, and first call result is transmitted into initiation described first by the gateway
The first service of call request calls end.
The service calling method that the present embodiment is provided, gateway receives service invocation request, and gateway is according to service
The service invocation request is sent in corresponding service providing end, service invocation request and currently called comprising unique sign by title
Link calls mark, and this calls mark to be transmitted between each service providing end in entirely calling link;Each service is adjusted
It is required for being forwarded by gateway with request and call result, therefore, gateway can obtain all service call correspondences
Recalls information.Recalls information includes service call end mark, service providing end mark, calls mark and allocating time information,
Therefore, this is searched from the recalls information calls service call end mark and service providing end mark corresponding to mark to obtain
Must this call the corresponding service call link of mark.This method only needs to set to bury on gateway to be sampled,
It need not all set and be buried a little in client and service end, therefore, greatly reduce the client of each service and opening for service end
Hair, lower deployment cost.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 shows a kind of schematic diagram of typical micro services framework;
Fig. 2 shows a kind of schematic diagram of service calling system of the embodiment of the present invention;
Fig. 3 shows a kind of flow chart of service calling method of the embodiment of the present invention;
Fig. 4 shows the flow chart of another service calling method of the embodiment of the present invention;
Fig. 5 shows a kind of block diagram of service call device of the embodiment of the present application;
Fig. 6 shows a kind of block diagram of acquiring unit of the embodiment of the present application;
Fig. 7 shows the block diagram of another service call device of the embodiment of the present application.
Embodiment
Before technical scheme is discussed in detail, lower micro services framework is introduced first:
Micro services refer to the service developed multiple individual smalls but have complete business function, and each service has the place of oneself
Reason and communication mechanism, can be deployed on single or multiple servers.The thoughts and ideas of micro services framework are as follows:Solutions of Systems
Coupling Cheng Geng little unit;Each unit has the responsibility of oneself;Each unit passes through application programming interface
(Application Programming Interface, API) exposure, the external world need not be concerned about implementing for it;All
Unit be all it is independent, can be independent develop, dispose, extend and monitor;Can be by long-range between unit
Invocation of procedure agreement (Remote Procedure Call Protocol, RPC), which is asked for instructions, to be interacted.
Client needs service gateway device to interact with service end in micro services framework, and gateway is used as system
Entrance, it can be responsible for service request route, combination and protocol conversion etc..In addition, in addition it is also necessary to which the identity docked into client is recognized
Card, replay protection and anti-data tampering, the service authentication of funcall, the desensitization of response data, flow and con current control, very
To metering or charging based on API Calls.
As shown in figure 1, showing a kind of typical micro services framework, the micro services system includes six micro services difference
It is:A, B, C, D, E and F.For example, including 3 micro services routes in the micro services system:New user's registration is by micro services A, B, C
Realized with E, wherein, the call relation between micro services is that A calls B, B to call C, C to call E;Place an order by micro services A, B, C and
D is realized;Pay and realized by micro services A, B, C, D and F.
The call relation of complexity is there is in micro services framework, between micro services, the developer for causing system is difficult
Make the call relation between micro services in whole micro services system clear, when entirely calling link performance bottleneck occur, it is difficult to
Which node positioning goes wrong on.The service calling method that the application is provided, sets in gateway and buries point sampling, take
Business gateway is responsible for service request route, and service call is required for by gateway each time, and therefore, gateway can sample
To the recalls information of each service call, for example, call relation, call it is time-consuming etc..Then, the tune that Analysis Service gateway is collected
Use information.
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 2 is referred to, a kind of schematic diagram of service calling system of the embodiment of the present invention is shown, as shown in Fig. 2 the system
Including service call end 1, gateway 2, service providing end 3, log concentrator 4 and call analysis end 5.
Service call end 1, for sending service invocation request to gateway, and is all wrapped in service invocation request every time
Containing for uniquely indicate it is current call link call mark.
Gateway 2, for service call to be routed into correct service providing end, and record that this calls call letter
Breath, wherein, recalls information includes calling mark, service call end mark, service providing end mark.
Service providing end 3, for receiving and handling first service call request, if service providing end needs to initiate again
Service call, then produce in second service call request, and the second service call request and carry in first service call request
Comprising call mark, call mark hand on successively, last service providing end called until this.
Log concentrator 4, is called for collecting the recalls information that gateway sampling is obtained, and recalls information being sent to
Analyze end 5.
In a kind of possible implementation of the present invention, log concentrator 4 can be deployed in setting where gateway
In standby;
In the alternatively possible implementation of the present invention, log concentrator 4 can be deployed in addition to gateway
Equipment in, in such a application scenarios, log concentrator 4 needs to know the address of gateway, and is obtained from gateway
Recalls information.
Analysis end 5, the recalls information that analysis log concentrator is collected into are called, it is determined that calling all of mark comprising same
Call request belongs to same and calls link, according to the services topology of each different call chain rood to the service system.And,
Obtain each call request correspondence call it is time-consuming, according to calling the time-consuming performance bottleneck for determining service system.Wherein, call time-consuming
Refer to from service call is initiated to the time needed for the response for obtaining the service.
Fig. 3 is referred to, a kind of flow chart of service calling method of the embodiment of the present invention is shown, this method is applied to service
In gateway, as shown in figure 3, this method can include:
S110, gateway receives service invocation request.
Gateway receives the service invocation request that service call end is sent, and the service invocation request includes service call end
Mark, service name and mark is called, this calls mark to be used to call link corresponding to unique sign service invocation request.
Service call end is the side for initiating the service invocation request, and service call end mark can be being capable of unique mark
The identification information at the service call end, for example, media access control (Medium Access Control, MAC) address.
In a kind of possible implementation of the present invention, service call end can be client, i.e. client is to service network
Close the application scenarios for initiating service invocation request;
In the alternatively possible implementation of the present invention, service call end can be service providing end, i.e. the service is carried
Realized for end during some service, it is necessary to other services be called, accordingly, it would be desirable to send service call to other service providing ends
Request.
The example of micro services framework shown in Fig. 1 is adopted, when client initiates the request of new user's registration, from client to clothes
Business gateway is sent under the service invocation request of " new user's registration ", such a application scenarios, and service caller (that is, sends service to adjust
With a side of request) it is exactly client;For example, new user's registration service realizes that micro services A is adjusted by tetra- micro services of A-B-C-E
During with micro services B, service call end is exactly micro services A ISP.
Mark is called to be used to uniquely indicate the mark for currently calling link, this calls the visitor identified by initiating the service call
Family end is produced, and is handed on incessantly in the service call link for realize the service.
Service invocation request is sent to corresponding service providing end by S120, gateway according to service name.
Gateway finds according to the service name included in service invocation request and provides the service name corresponding with service
Service providing end, and the service invocation request is sent to the service providing end.
S130, gateway receives the call result that service providing end is returned, and call result is sent into service call
End.
Service providing end is received after service invocation request, if other services need not be recalled, responds the service
Call request generates call result, and call result is returned into gateway, and gateway is again by the call result received
Return to service call end.
S140, gateway obtains the corresponding recalls information of the service invocation request, so as to call analysis end according to institute
State recalls information and obtain and call the corresponding service call link of mark with described, the recalls information includes the service call end
Mark, service providing end mark, described call identify and allocating time information.
Set to bury in gateway and a little whole service invocation procedure is sampled, obtain recalls information, the recalls information
Including service call end mark, service providing end mark, call mark and allocating time information.
The recalls information for calling analysis end Analysis Service gateway to obtain obtains calling mark is corresponding to call data with this, and
Finally give the whole service call link of this service call.
Alternatively, it is time-consuming that the allocating time information included according to recalls information results in calling of currently calling, and obtains
Time-consuming process is called to include described in taking:
Gateway record receives the very first time stamp of call request, and, record receives call request correspondence
Call result the second timestamp, calculate the time difference that the second timestamp and the very first time stab, obtain each service and adjust
Call time-consuming.
According to currently call each in link call it is corresponding call time-consuming, calculating obtains entirely calling calling for link
It is time-consuming, it can analyze the performance bottleneck for obtaining service system according to calling to take.
The service tracks method that the present embodiment is provided, gateway receives service invocation request, and gateway is according to service
The service invocation request is sent in corresponding service providing end, service invocation request and currently called comprising unique sign by title
Link calls mark, and this calls mark to be transmitted between each service providing end in entirely calling link;Each service is adjusted
It is required for being forwarded by gateway with request and call result, therefore, gateway can obtain all service call correspondences
Recalls information.Recalls information includes service call end mark, service providing end mark, calls mark and allocating time information,
Therefore, this is searched from the recalls information calls service call end mark and service providing end mark corresponding to mark to obtain
Must this call the corresponding service call link of mark.As shown in the above, this method calls letter by gateway sampling acquisition
Breath, final realize calls link tracing, so, it is only necessary to sets to bury on gateway and is sampled, it is not necessary to
Client and service end, which are all set, buries a little, therefore, greatly reduces the exploitation of the client and service end of each service, is deployed to
This.
Fig. 4 is referred to, the flow chart of another service calling method of the embodiment of the present invention is shown, this method is applied to figure
In system shown in 2, as shown in figure 4, this method comprises the following steps:
S210, client sends first service call request to gateway.
Client identification, first service name information are included in the first service call request, mark is called, wherein, adjust
It is used to uniquely indicate with mark and currently calls link.
S220, gateway determines that corresponding first service provides end according to service name information, and by the first service
Call request is transmitted to first service and provides end, and, record first service call request calls relevant information.
It is described to call relevant information to include in one embodiment of the application:Service call end mark, service are carried
For end mark, mark and allocating time information are called, for example, when call request receives time and the reception of corresponding call result
Between.
S230, first service provides end and receives first service call request, and determines the need for calling other services;Such as
Fruit is then to perform S240~S280;If it is not, then performing S290.
First service provides termination and received after first service call request, parses the first service call request, and determine
Respond whether the first service call request needs to recall other services.
If other services need not be called, directly in response to the first service call request;Call if desired other
Service, then continue to call other services.
S240, first service provides end generation second service call request and is sent to gateway.
What second service call request carrying first service call request was included calls mark, and, including first
The information and second service name information of service providing end.
If generating and calling, it is necessary to call other services when first service provides end response first service call request
The second service call request of other services, during generation second service call request, first service call request is wrapped
What is contained calls in mark write-in second service call request.That is, mark is called to be handed on always in service call link.
S250, gateway receives second service call request, and determines corresponding with second service name information the
Two service providing ends, and second service call request is sent to second service offer end, and record second service is called and asked
That asks calls relevant information.
S260, second service provides end response second service call request, obtains the second call result, and second is called
As a result it is sent to gateway.
Second call result is returned to first service and provides end by S270, gateway, and records the second call result
Call relevant information.
S280, first service provides end and obtains the first call result according to the second call result, and by the first call result
It is sent to gateway.
Perform after S240~S280, S2100~S2120 is performed successively.
S290, first service provides end response first service call request, generates the first call result and is sent to service
Gateway.
Perform after S290, S2100~S2120 is performed successively;
First call result is returned to client by S2100, gateway, and record the first call result call correlation
Information.
S2110, log concentrator collected from gateway record call relevant information.
S2120, calls the data in analysis end analysis log concentrator, obtains service call chain corresponding with calling mark
Road.
The data in analysis end processing log concentrator are called, obtain calling mark call request, and root comprising same
Call relation is determined according to service call end mark and service providing end mark, so that obtaining this calls the corresponding service call of mark
Link.Each different service call link can be obtained using this method, so that the service for obtaining whole micro services structure is opened up
Flutter structure.
While call relation is obtained, the allocating time information for calling analysis end to be collected into according to log concentrator, really
Calling between each fixed service is time-consuming, i.e., gateway receives the time of certain call request with receiving corresponding to the call request
Call result time between difference.
Using calling time-consuming between services topology structure and each service, the property in whole micro services framework can be analyzed
Can bottleneck.
Call analysis end to be realized based on text retrieval system, link is called by input that screening conditions to be checked
Details, for example, with input time section can be screened the period for calling generation to be checked, from the daily record number of log concentrator
The relevant information of the service call in all periods is retrieved in, for example, service call end mark, service providing end mark
Know and call delay etc..
The present embodiment provide service calling method, in gateway set bury a little in micro services framework each time
Call and all carry out sample record, wherein, comprising the mark of calling for currently calling link in service invocation request, and this calls mark
Transmitted always in link is entirely called.What log concentrator can collect that gateway gathered calls relevant information and provides
To call analysis end, as call analysis end analyze these call relevant information search this call mark corresponding to service call end
Mark and service providing end mark result in this and call the corresponding service call link of mark.This method is sampled by gateway
Recalls information is obtained, final realize calls link tracing, so, it is only necessary to set to bury on gateway and sampled i.e.
Can, it is not necessary to all set and buried a little in client and service end, therefore, greatly reduce the client and service end of each service
Exploitation, lower deployment cost.
For foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as to a series of combination of actions, but
It is that those skilled in the art should know, the present invention is not limited by described sequence of movement, because according to the present invention, certain
A little steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know, be retouched in specification
The embodiment stated belongs to preferred embodiment, and involved action and the module not necessarily present invention are necessary.
Corresponding to above-mentioned service calling method embodiment, present invention also provides service call device embodiment.
Fig. 5 is referred to, a kind of block diagram of service call device of the embodiment of the present application is shown, the device is applied to service network
The Central Shanxi Plain.The device includes:First receiving unit 110, the first transmitting element 120, the second receiving unit 130, the second transmitting element
140 and acquiring unit 150;
First receiving unit 110, for receiving service invocation request, the service invocation request is marked including service call end
Know, service name and call mark, it is described to call mark to be used to uniquely indicate the service tune corresponding to the service invocation request
Use link.
Service call end is the side for initiating the service invocation request, and service call end mark can be being capable of unique mark
The identification information at the service call end, for example, MAC Address.
In a kind of possible implementation of the present invention, service call end can be client, i.e. client is to service network
Close the application scenarios for initiating service invocation request;
In the alternatively possible implementation of the present invention, service call end can be service providing end, i.e. the service is carried
Realized for end during some service, it is necessary to other services be called, accordingly, it would be desirable to send service call to other service providing ends
Request.
First transmitting element 120, for the service invocation request to be sent into corresponding clothes according to the service name
Business provides end.
Gateway finds according to the service name included in service invocation request and provides the service name corresponding with service
Service providing end, and the service invocation request is sent to the service providing end via the first transmitting element.
Second receiving unit 130, for receiving the call result that the service providing end is returned.
Service providing end is received after service invocation request, if other services need not be recalled, responds the service
Call request generates call result, and call result is returned into gateway, and gateway is received via the second receiving unit
The call result.
Second transmitting element 140, for the call result to be sent into service call end.
Acquiring unit 150, for obtaining the corresponding recalls information of the service invocation request, so as to call the analysis of analysis end
The recalls information is obtained calls the corresponding service call link of mark with described.
Set to bury in gateway and a little whole service invocation procedure is sampled, obtain recalls information, the recalls information
Including service call end mark, service providing end mark, call mark and allocating time information.
The recalls information that Analysis Service gateway is obtained obtains calling mark is corresponding to call data with this, and finally gives this
The whole service call link of secondary service call.
Alternatively, the performance bottleneck for determining service system can also be taken according to calling, wherein, call time-consuming refer to from hair
Service call is played to obtaining the time that the service response is undergone.
As shown in fig. 6, acquiring unit 150 includes the first record subelement 151, second record subelement 152 and calculates son
Unit 153.
First record subelement 151, the very first time stamp of the service invocation request is received for recording.
Second record subelement 152, the second time of the corresponding call result of the call request is received for recording
Stamp.
Computation subunit 153, for calculating the time difference that second timestamp is stabbed with the very first time, obtains each
Service it is corresponding call it is time-consuming.
The service call device that the present embodiment is provided, gateway receives service invocation request, and gateway is according to service
The service invocation request is sent in corresponding service providing end, service invocation request and currently called comprising unique sign by title
Link calls mark, and this calls mark to be transmitted between each service providing end in entirely calling link;Each service is adjusted
It is required for being forwarded by gateway with request and call result, therefore, gateway can obtain all service call correspondences
Recalls information.Recalls information includes service call end mark, service providing end mark, calls mark and allocating time information,
Therefore, this is searched from the recalls information calls service call end mark and service providing end mark corresponding to mark to obtain
Must this call the corresponding service call link of mark.The device only needs to set to bury on gateway to be sampled,
It need not all set and be buried a little in client and service end, therefore, greatly reduce the client of each service and opening for service end
Hair, lower deployment cost.
Fig. 7 is referred to, the block diagram of another service call device of the embodiment of the present application is shown, the device is applied to service
There is provided in end, as shown in fig. 7, the device can include:First receiving unit 210, the first resolution unit 220, request generation are single
First 230, first transmitting element 240, the second receiving unit 250 and response unit 260.
First receiving unit 210, for making first service provide the first call request that termination conquers business gateway forwards.
First call request calls end mark, first service title including first service and calls mark, described to adjust
It is used to uniquely indicate the service call link corresponding to the service invocation request with mark.
First resolution unit 220, obtains described for making the first service provide end parsing first call request
The second service title called needed for first call request, and described call mark.
First service provides termination and received after first service call request, parses the first service call request, and determine
Respond the second service title that the first service call request needs to call.
Generation unit 230 is asked, for making the first service provide end according to second service title generation second
Call request, second call request calls end mark, second service title including second service and described calls mark.
What the second call request that first service calls end to generate was included calls mark and the tune in the first call request
It is identical with identifying.
First transmitting element 240, it is described for making the first service offer end be sent to second call request
Gateway;
Second call request is transmitted to second service and provides end by the gateway, and the second service provides end and provided
The corresponding service of second service title;And, the gateway is obtained recalls information, and by calling analysis end according to described
Recalls information is obtained calls the corresponding service call link of mark with described.
Second receiving unit 250, gateway reception described second is passed through for making the first service provide end
The second call result that service providing end is returned, second call result provides end response described second by the second service
Call request is obtained.
Response unit 260, for making the first service provide end according to second call result response described first
Call request, generates the first call result, and first call result is transmitted to described in initiation by the gateway
The first service of first call request calls end.
The data in analysis end processing log concentrator are called, are obtained comprising the same call request for calling mark, and
Service call end mark and service providing end mark according to being included in every call request determine call relation, so as to be somebody's turn to do
Call the corresponding service call link of mark.Each different service call link can be obtained using this method, so as to obtain
The services topology structure of whole micro services structure.
While call relation is obtained, the allocating time information for calling analysis end to be collected into according to log concentrator, really
Calling between each fixed service is time-consuming, i.e., gateway receives the time of certain call request with receiving corresponding to the call request
Call result time between difference.
Using calling time-consuming between services topology structure and each service, the property in whole micro services framework can be analyzed
Can bottleneck.
Call analysis end to be realized based on text retrieval system, link is called by input that screening conditions to be checked
Details, for example, with input time section can be screened the period for calling generation to be checked, from the daily record number of log concentrator
The relevant information of the service call in all periods is retrieved in, for example, service call end mark, service providing end mark
Know and call delay etc..
The present embodiment provide service call device, in gateway set bury a little in micro services framework each time
Call and all carry out sample record, wherein, comprising the mark of calling for currently calling link in service invocation request, and this calls mark
Transmitted always in link is entirely called.Therefore, this is searched from gateway recalls information and calls the service corresponding to identifying
Call end mark and service providing end mark to result in this and call the corresponding service call link of mark.The device is only needed to
Set to bury on gateway and sampled, it is not necessary to all set and buried a little in client and service end, therefore, substantially reduced
The exploitation of the client and service end of each service, lower deployment cost.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight
Point explanation be all between difference with other embodiment, each embodiment identical similar part mutually referring to.
For device class embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is joined
See the part explanation of embodiment of the method.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that
A little key elements, but also other key elements including being not expressly set out, or also include be this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged
Except also there is other identical element in the process including the key element, method, article or equipment.
The foregoing description of the disclosed embodiments, enables those skilled in the art to realize or using the present invention.To this
A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and generic principles defined herein can
Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited
It is formed on the embodiments shown herein, and is to fit to consistent with features of novelty with principles disclosed herein most wide
Scope.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of service calling method, it is characterised in that applied in gateway, this method includes:
Service invocation request is received, the service invocation request includes service call end mark, service name and calls mark, institute
State and call mark to be used to uniquely indicate the service call link corresponding to the service invocation request;
The service invocation request is sent to by corresponding service providing end according to the service name;
The call result that the service providing end is returned is received, and the call result is sent to service call end;
The corresponding recalls information of the service invocation request is obtained, so as to call analysis end to analyze the service in the recalls information
Call end mark, service providing end mark and described call mark to obtain to call the corresponding service call link of mark with described.
2. according to the method described in claim 1, it is characterised in that the recalls information also includes allocating time information, described
Allocating time information is time-consuming including calling;Time-consuming process is called to include described in obtaining:
Record receives the very first time stamp of the service invocation request, and, it is corresponding that record receives the call request
Second timestamp of call result;
The time difference that second timestamp is stabbed with the very first time is calculated, calling for each service is obtained time-consuming.
3. according to the method described in claim 1, it is characterised in that the reception service invocation request includes:
Receive the service invocation request that client is sent;
Or,
Receive first service and the service invocation request for calling second service to provide end that end is sent is provided.
4. a kind of service calling method, it is characterised in that applied to service providing end, this method includes:
First service provides the first call request that termination conquers business gateway forwards, and first call request includes first service
Call end mark, first service title and call mark, it is described to call mark to be used to uniquely indicate the service invocation request institute
Corresponding service call link;
The first service provides end and parses first call request obtains calling needed for first call request second
Service name, and described call mark;
The first service provides end and generates the second call request, the second call request bag according to the second service title
Second service is included to call end mark, second service title and described call mark;
The first service provides end and second call request is sent into the gateway, so that the gateway will
Second call request is transmitted to second service and provides end, and the second service provides end and provides the second service title pair
The service answered;And, the gateway is obtained recalls information, and by call analysis end according to the recalls information obtain with
It is described to call the corresponding service call link of mark.
5. method according to claim 4, it is characterised in that methods described also includes:
The first service provides end and calls knot by the second of the gateway reception second service offer end return
Really, second call result provides end response second call request by the second service and obtained;
The first service provides end and responds first call request according to second call result, and knot is called in generation first
Really, and by first call result first service tune for initiating first call request is transmitted to by the gateway
With end.
6. a kind of service call device, it is characterised in that applied in gateway, described device includes:
First receiving unit, for receiving service invocation request, the service invocation request includes service call end mark, service
Title and call mark, the service call link for calling mark for uniquely indicating corresponding to the service invocation request;
First transmitting element, is provided for the service invocation request to be sent into corresponding service according to the service name
End;
Second receiving unit, for receiving the call result that the service providing end is returned;
Second transmitting element, for the call result to be sent into service call end;
Acquiring unit, for obtaining the corresponding recalls information of the service invocation request, so as to call the analysis of analysis end is described to adjust
Identified with the service call end in information, service providing end mark and described call mark to obtain with described to call mark corresponding
Service call link.
7. device according to claim 6, it is characterised in that the recalls information also includes allocating time information, described
Allocating time information is time-consuming including calling, and the acquiring unit includes:
First record subelement, the very first time stamp of the service invocation request is received for recording;
Second record subelement, the second timestamp of the corresponding call result of the call request is received for recording;
Computation subunit, for calculating the time difference that second timestamp is stabbed with the very first time, obtains each service pair
Calling for answering is time-consuming.
8. device according to claim 6, it is characterised in that first receiving unit specifically for:
Receive the service invocation request that client is sent;
Or,
Receive first service and the service invocation request for calling second service to provide end that end is sent is provided.
9. a kind of service call device, it is characterised in that applied to service providing end, the device includes:
First receiving unit, for making first service provide the first call request that termination conquers business gateway forwards, described first
Call request calls end mark, first service title including first service and calls mark, described to call mark to be used to uniquely mark
Show the service call link corresponding to the service invocation request;
First resolution unit, is called for making the first service offer end parsing first call request obtain described first
The second service title called needed for request, and described call mark;
Generation unit is asked, please for making the first service offer end be called according to second service title generation second
Ask, second call request calls end mark, second service title including second service and described calls mark;
First transmitting element, the service network is sent to for making the first service provide end by second call request
Close, so that second call request is transmitted to second service by the gateway provides end, the second service provides end
There is provided the second service title corresponding service;And, the gateway is obtained recalls information, and by calling analysis end
Obtained according to the recalls information and call the corresponding service call link of mark with described.
10. device according to claim 9, it is characterised in that also include:
Second receiving unit, is provided for making the first service provide end by the gateway reception second service
The second call result returned is held, second call result provides end by the second service and responds second call request
Obtain;
Response unit, please for making the first service offer end be called according to second call result response described first
Ask, generate the first call result, and first call result is transmitted to initiation described first by the gateway and adjust
End is called with the first service of request.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710469894.2A CN107181675B (en) | 2017-06-20 | 2017-06-20 | Service calling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710469894.2A CN107181675B (en) | 2017-06-20 | 2017-06-20 | Service calling method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107181675A true CN107181675A (en) | 2017-09-19 |
CN107181675B CN107181675B (en) | 2020-03-03 |
Family
ID=59844243
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710469894.2A Active CN107181675B (en) | 2017-06-20 | 2017-06-20 | Service calling method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107181675B (en) |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107741885A (en) * | 2017-10-09 | 2018-02-27 | 用友网络科技股份有限公司 | Affairs and business association method, interconnected system based on CS frameworks |
CN107766164A (en) * | 2017-11-17 | 2018-03-06 | 深圳市泉眼网络科技有限公司 | Data calling method and device |
CN107944295A (en) * | 2017-11-28 | 2018-04-20 | 中国农业银行股份有限公司 | The sensitive information desensitization method and system of a kind of transaction message |
CN108199876A (en) * | 2017-12-29 | 2018-06-22 | 北京奇艺世纪科技有限公司 | A kind of daily record data store method, device and distribution service |
CN108600045A (en) * | 2018-04-05 | 2018-09-28 | 厦门快商通信息技术有限公司 | A kind of service link monitoring method and device |
CN108847989A (en) * | 2018-06-29 | 2018-11-20 | 杭州安恒信息技术股份有限公司 | Log processing method, business service system and electronic equipment based on micro services framework |
CN108901022A (en) * | 2018-06-28 | 2018-11-27 | 深圳云之家网络有限公司 | A kind of micro services universal retrieval method and gateway |
CN109412944A (en) * | 2018-10-16 | 2019-03-01 | 深圳壹账通智能科技有限公司 | Request retransmission method, device and server based on micro services |
CN109508431A (en) * | 2018-11-15 | 2019-03-22 | 北京芯盾时代科技有限公司 | Bury point code method for implanting, device, electronic equipment and computer storage medium |
CN109672662A (en) * | 2018-10-11 | 2019-04-23 | 中山大学 | Dependence construction method is serviced in a kind of micro services environment |
WO2019136812A1 (en) * | 2018-01-10 | 2019-07-18 | 平安科技(深圳)有限公司 | Electronic device, data calling log generation and query method, and storage medium |
CN110138741A (en) * | 2019-04-15 | 2019-08-16 | 平安科技(深圳)有限公司 | Micro services management method, device and computer equipment based on management platform |
CN110213240A (en) * | 2019-05-09 | 2019-09-06 | 国电南瑞科技股份有限公司 | A kind of electric power dispatching system and its transregional service calling method of routing self-adaption |
CN110445667A (en) * | 2019-05-29 | 2019-11-12 | 北京大米科技有限公司 | A kind of link delay detection method, device, storage medium and terminal |
CN111163063A (en) * | 2019-12-12 | 2020-05-15 | 万翼科技有限公司 | Edge application management method and related product |
CN111343242A (en) * | 2020-02-13 | 2020-06-26 | 北京奇艺世纪科技有限公司 | Information collection method, device, equipment, storage medium and distributed system |
CN111580896A (en) * | 2020-05-04 | 2020-08-25 | 武汉众邦银行股份有限公司 | Link calling method based on atomization service |
CN111897604A (en) * | 2020-07-30 | 2020-11-06 | 北京百度网讯科技有限公司 | Calling data processing method and device for service calling |
WO2021056739A1 (en) * | 2019-09-25 | 2021-04-01 | 平安科技(深圳)有限公司 | Performance analysis method, device, computer apparatus and storage medium |
CN113169900A (en) * | 2018-11-29 | 2021-07-23 | 华为技术有限公司 | Method and device for tracking service execution process in distributed system |
CN113868345A (en) * | 2021-10-11 | 2021-12-31 | 支付宝(杭州)信息技术有限公司 | Method and device for carrying out main body classification on business data |
CN117194176A (en) * | 2023-11-03 | 2023-12-08 | 中国电子科技集团公司第十五研究所 | Non-invasive operation monitoring method, device, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101252443A (en) * | 2008-03-20 | 2008-08-27 | 华为技术有限公司 | Apparatus and method for detecting message security |
US20130138768A1 (en) * | 2011-11-30 | 2013-05-30 | Vincent Huang | Method and System for Dynamic Service Creation on Sensor Gateways |
CN104348650A (en) * | 2013-08-05 | 2015-02-11 | 腾讯科技(深圳)有限公司 | Website monitoring method, business device and website monitoring system |
CN105577710A (en) * | 2014-10-09 | 2016-05-11 | 阿里巴巴集团控股有限公司 | Service providing method, service acquiring method, devices and system |
CN106790718A (en) * | 2017-03-16 | 2017-05-31 | 北京搜狐新媒体信息技术有限公司 | Service call link analysis method and system |
-
2017
- 2017-06-20 CN CN201710469894.2A patent/CN107181675B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101252443A (en) * | 2008-03-20 | 2008-08-27 | 华为技术有限公司 | Apparatus and method for detecting message security |
US20130138768A1 (en) * | 2011-11-30 | 2013-05-30 | Vincent Huang | Method and System for Dynamic Service Creation on Sensor Gateways |
CN104348650A (en) * | 2013-08-05 | 2015-02-11 | 腾讯科技(深圳)有限公司 | Website monitoring method, business device and website monitoring system |
CN105577710A (en) * | 2014-10-09 | 2016-05-11 | 阿里巴巴集团控股有限公司 | Service providing method, service acquiring method, devices and system |
CN106790718A (en) * | 2017-03-16 | 2017-05-31 | 北京搜狐新媒体信息技术有限公司 | Service call link analysis method and system |
Cited By (32)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107741885A (en) * | 2017-10-09 | 2018-02-27 | 用友网络科技股份有限公司 | Affairs and business association method, interconnected system based on CS frameworks |
CN107766164A (en) * | 2017-11-17 | 2018-03-06 | 深圳市泉眼网络科技有限公司 | Data calling method and device |
CN107944295A (en) * | 2017-11-28 | 2018-04-20 | 中国农业银行股份有限公司 | The sensitive information desensitization method and system of a kind of transaction message |
CN107944295B (en) * | 2017-11-28 | 2020-04-03 | 中国农业银行股份有限公司 | Sensitive information desensitization method and system for transaction message |
CN108199876A (en) * | 2017-12-29 | 2018-06-22 | 北京奇艺世纪科技有限公司 | A kind of daily record data store method, device and distribution service |
WO2019136812A1 (en) * | 2018-01-10 | 2019-07-18 | 平安科技(深圳)有限公司 | Electronic device, data calling log generation and query method, and storage medium |
CN108600045A (en) * | 2018-04-05 | 2018-09-28 | 厦门快商通信息技术有限公司 | A kind of service link monitoring method and device |
CN108901022B (en) * | 2018-06-28 | 2021-08-20 | 深圳云之家网络有限公司 | Micro-service unified authentication method and gateway |
CN108901022A (en) * | 2018-06-28 | 2018-11-27 | 深圳云之家网络有限公司 | A kind of micro services universal retrieval method and gateway |
CN108847989A (en) * | 2018-06-29 | 2018-11-20 | 杭州安恒信息技术股份有限公司 | Log processing method, business service system and electronic equipment based on micro services framework |
CN109672662A (en) * | 2018-10-11 | 2019-04-23 | 中山大学 | Dependence construction method is serviced in a kind of micro services environment |
CN109672662B (en) * | 2018-10-11 | 2021-03-26 | 中山大学 | Method for constructing service dependency relationship in micro-service environment |
CN109412944A (en) * | 2018-10-16 | 2019-03-01 | 深圳壹账通智能科技有限公司 | Request retransmission method, device and server based on micro services |
CN109508431A (en) * | 2018-11-15 | 2019-03-22 | 北京芯盾时代科技有限公司 | Bury point code method for implanting, device, electronic equipment and computer storage medium |
CN113169900A (en) * | 2018-11-29 | 2021-07-23 | 华为技术有限公司 | Method and device for tracking service execution process in distributed system |
CN110138741B (en) * | 2019-04-15 | 2022-06-17 | 平安科技(深圳)有限公司 | Micro-service management method and device based on unified management platform and computer equipment |
CN110138741A (en) * | 2019-04-15 | 2019-08-16 | 平安科技(深圳)有限公司 | Micro services management method, device and computer equipment based on management platform |
CN110213240A (en) * | 2019-05-09 | 2019-09-06 | 国电南瑞科技股份有限公司 | A kind of electric power dispatching system and its transregional service calling method of routing self-adaption |
CN110445667A (en) * | 2019-05-29 | 2019-11-12 | 北京大米科技有限公司 | A kind of link delay detection method, device, storage medium and terminal |
CN110445667B (en) * | 2019-05-29 | 2021-10-26 | 北京大米科技有限公司 | Link delay detection method, device, storage medium and terminal |
WO2021056739A1 (en) * | 2019-09-25 | 2021-04-01 | 平安科技(深圳)有限公司 | Performance analysis method, device, computer apparatus and storage medium |
CN111163063A (en) * | 2019-12-12 | 2020-05-15 | 万翼科技有限公司 | Edge application management method and related product |
CN111163063B (en) * | 2019-12-12 | 2022-07-12 | 万翼科技有限公司 | Edge application management method and related product |
CN111343242A (en) * | 2020-02-13 | 2020-06-26 | 北京奇艺世纪科技有限公司 | Information collection method, device, equipment, storage medium and distributed system |
CN111580896A (en) * | 2020-05-04 | 2020-08-25 | 武汉众邦银行股份有限公司 | Link calling method based on atomization service |
CN111580896B (en) * | 2020-05-04 | 2023-07-07 | 武汉众邦银行股份有限公司 | Link calling method based on atomization service |
CN111897604A (en) * | 2020-07-30 | 2020-11-06 | 北京百度网讯科技有限公司 | Calling data processing method and device for service calling |
CN111897604B (en) * | 2020-07-30 | 2023-08-11 | 北京百度网讯科技有限公司 | Service call data processing method and device |
CN113868345A (en) * | 2021-10-11 | 2021-12-31 | 支付宝(杭州)信息技术有限公司 | Method and device for carrying out main body classification on business data |
CN113868345B (en) * | 2021-10-11 | 2024-05-28 | 支付宝(杭州)信息技术有限公司 | Method and device for classifying business data in main body |
CN117194176A (en) * | 2023-11-03 | 2023-12-08 | 中国电子科技集团公司第十五研究所 | Non-invasive operation monitoring method, device, electronic equipment and storage medium |
CN117194176B (en) * | 2023-11-03 | 2024-06-04 | 中国电子科技集团公司第十五研究所 | Non-invasive operation monitoring method, device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107181675B (en) | 2020-03-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107181675A (en) | Service calling method and device | |
CN100446478C (en) | System and method for distributed diagnostics in a communication system. | |
US20050044213A1 (en) | Network traffic measurement system | |
US9426046B2 (en) | Web page download time analysis | |
US20130191890A1 (en) | Method and system for user identity recognition based on specific information | |
US8284786B2 (en) | Method and system for context aware deep packet inspection in IP based mobile data networks | |
CN106911523A (en) | The method and system that mobile interchange network users are positioned by LTE indulging in the internet | |
CN109039775A (en) | Quality of service monitoring method, apparatus and system | |
CN106375458A (en) | Service call system, method and device | |
CN103067217A (en) | Indicating system and method of communication network service quality | |
CN103685354A (en) | Method and device for testing based on RMI protocol | |
CN102739446B (en) | The method and apparatus for selecting Network Time Protocol server | |
CN103702352A (en) | Business channel-based network capacity opening method and device thereof | |
JP2014523671A (en) | Assessing the overall performance of interactive application services | |
CN110572291A (en) | System and method for realizing automatic framework identification function for distributed system | |
CN106341342A (en) | Communication connection maintaining method and device, terminal and server | |
US7277674B2 (en) | Data monitoring system and method using a single time axis with time information provided by a GPS receiver | |
CN111935316B (en) | Method and device for acquiring front-end equipment catalog | |
CN108429760A (en) | User based on the service of gateway limit asks tracking | |
JP2007035053A (en) | Method for maintaining session between different-terminals | |
US8014397B1 (en) | Correlating packets in a data-communications environment | |
Ptácek | Analysis and detection of Skype network traffic | |
CN105429802B (en) | The determination method, apparatus and server of qualitative data | |
KR101087691B1 (en) | Method and Apparatus for Billing of Packet Data Service | |
CN111212376A (en) | Method, apparatus, device and medium for correlating real-time location and voice quality results |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |