Movatterモバイル変換


[0]ホーム

URL:


CN112311811A - Full link tracking method, device, storage medium and server - Google Patents

Full link tracking method, device, storage medium and server
Download PDF

Info

Publication number
CN112311811A
CN112311811ACN202011283184.9ACN202011283184ACN112311811ACN 112311811 ACN112311811 ACN 112311811ACN 202011283184 ACN202011283184 ACN 202011283184ACN 112311811 ACN112311811 ACN 112311811A
Authority
CN
China
Prior art keywords
time
request
calling
call
server
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
Application number
CN202011283184.9A
Other languages
Chinese (zh)
Other versions
CN112311811B (en
Inventor
何良万
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Shenzhen Huantai Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd, Shenzhen Huantai Technology Co LtdfiledCriticalGuangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011283184.9ApriorityCriticalpatent/CN112311811B/en
Publication of CN112311811ApublicationCriticalpatent/CN112311811A/en
Application grantedgrantedCritical
Publication of CN112311811BpublicationCriticalpatent/CN112311811B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种全链路跟踪方法、装置、存储介质以及服务器,涉及通信技术领域。首先记录调用方采用第一调用方法将第一调用请求发送到服务方的第一时间;然后当监测到调用方接收到服务方采用第二调用方法返回的第一回调请求时,调用全链路跟踪服务处理第一时间以得到第二时间;最后将第二时间作为第一调用请求对应的业务逻辑的处理时间。由于调用方和服务方采用不同的调用方法发送以及回调请求,因此当调用方从服务方接收到采用第二调用方法返回的第一回调请求时,可以确定服务方已经完成对业务逻辑的处理过程,此时可以通过调用全链路跟踪服务获取到服务方处理业务逻辑的处理时间,可以有效分辨出服务方处理完业务逻辑的时间点。

Figure 202011283184

The present application discloses a full-link tracking method, device, storage medium and server, and relates to the technical field of communications. First record the first time when the caller uses the first call method to send the first call request to the server; then when monitoring the caller to receive the first callback request returned by the server using the second call method, call the full link The tracking service processes the first time to obtain the second time; finally, the second time is used as the processing time of the business logic corresponding to the first invocation request. Since the caller and the server use different calling methods to send and call back requests, when the caller receives the first callback request returned by the second calling method from the server, it can be determined that the server has completed the processing of the business logic , at this time, the processing time of the server processing the business logic can be obtained by calling the full-link tracking service, and the time point when the server has finished processing the business logic can be effectively identified.

Figure 202011283184

Description

Full link tracking method, device, storage medium and server
Technical Field
The present application relates to the field of communications technologies, and in particular, to a full link tracking method, apparatus, storage medium, and server.
Background
With the development of scientific technology, computer technology and network technology have rapidly progressed, wherein Remote Procedure Call (RPC) is an important part of communication, and therefore development and maintenance of RPC framework become one of the key points of research of those skilled in the art.
In the related art, the RPC framework is mostly Dubbo, which is originally a high-performance RPC framework written in JAVA language from the beginning of 2.7 versions and handed over to Apache community development and maintenance. In the Dubbo, an invoke method of a Filter interface is generally adopted to perform dotting to realize a full link tracking function, but in the asynchronous invocation of the Dubbo, since the service party immediately outputs an invoke return after the invocation of the invoke, and then the service party performs service processing, the time difference between the invoke return and the invoke is directly passed, and the time for the service party to perform service processing cannot be obtained, so that the dotting full link tracking used in the asynchronous invocation of the Dubbo is invalid.
Disclosure of Invention
The application provides a full link tracking method, a full link tracking device, a storage medium and a server, which can solve the technical problems that in the related art, dotting full link tracking used in asynchronous calling of an RPC frame is invalid and the time for a server side to process a service cannot be obtained.
In a first aspect, an embodiment of the present application provides a full link tracking method, where the method includes:
recording the first time when the calling party sends a first calling request to the service party by adopting a first calling method;
when it is monitored that the caller receives a first callback request returned by the server by adopting a second calling method, calling a full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the caller after the server processes a service logic corresponding to the first callback request;
and taking the second time as the processing time of the business logic corresponding to the first calling request.
Optionally, the recording a first time when the caller sends the first invocation request to the server by using the first invocation method includes: recording a first time when the calling party sends a first calling request to the service party by adopting a first calling method through a first thread; and saving the first time to a calling parameter through the first thread.
Optionally, when a request that the caller uses an asynchronous calling model to perform remote calling is monitored; the recording the first time when the caller sends the first call request to the server by adopting the first call method further comprises: and recording a third time when the caller receives a second return request through the first thread, wherein the second return request is a request returned by the caller by adopting the first calling method after the server receives the first calling request.
Optionally, the invoking the full link tracking service to process the first time to obtain a second time includes: calling the full-link tracking service for dotting through a second thread to obtain fourth time when the calling party receives a first callback request returned by the service party by adopting a second calling method; and acquiring the first time from the calling parameter, calling the full link tracking service to calculate a difference value between the fourth time and the first time, and taking the difference value as a second time.
Optionally, the invoking the full link tracking service for dotting by the second thread includes: and calling the full-link tracking service through the second thread to perform normal dotting or abnormal dotting.
Optionally, the caller and the server are based on a Remote Procedure Call (RPC) framework when making a Remote Call, and the RPC framework includes at least a Dubbo framework.
Optionally, when the RPC frame is a Dubbo frame, the first calling method is an invoke method, and the second calling method is an onResponse method.
In a second aspect, an embodiment of the present application provides a full link tracking apparatus, including:
the first calling module is used for recording the first time when the calling party sends a first calling request to the service party by adopting a first calling method;
the second callback module is used for calling the full-link tracking service to process the first time to obtain a second time when monitoring that the calling party receives a first callback request returned by the service party by adopting a second calling method, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request;
and the time processing module is used for taking the second time as the processing time of the business logic corresponding to the first calling request.
In a third aspect, embodiments of the present application provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the above-mentioned method.
In a fourth aspect, embodiments of the present application provide a server, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method described above.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
the application provides a full link tracking method, which comprises the steps of firstly recording the first time when a calling party sends a first calling request to a service party by adopting a first calling method; then, when it is monitored that the calling party receives a first callback request returned by the server by adopting a second calling method, calling the full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request; and finally, taking the second time as the processing time of the business logic corresponding to the first calling request. The calling party and the service party adopt different calling methods to send and call back the request, so that when the calling party receives a first call back request returned by a second calling method from the service party, the service party can be determined to finish the processing process of the service logic, and the processing time for processing the service logic by the service party can be acquired by calling the full-link tracking service.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is an exemplary system architecture diagram of a full link tracking method provided in an embodiment of the present application;
fig. 2 is a system interaction diagram of a full link tracking method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a full link tracking method according to another embodiment of the present application;
FIG. 4 is a schematic structural diagram of a synchronous call model according to another embodiment of the present application;
FIG. 5 is a schematic structural diagram of an asynchronous call model according to another embodiment of the present application;
fig. 6 is a schematic flowchart of a full link tracking method according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a full link tracking apparatus according to another embodiment of the present application;
fig. 8 is a schematic structural diagram of a full link tracking apparatus according to another embodiment of the present application;
fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
In order to make the features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims.
Fig. 1 is an exemplary system architecture diagram of a full link tracking method according to an embodiment of the present application.
As shown in fig. 1, the system architecture may include at least onecaller 110, aserver 120, and aserver 130, wherein thecaller 110 and theserver 120 are disposed in the server, thecaller 110 and theserver 120 may be a program (service) or an entity module, and thecaller 110 and theserver 120 may call or transmit information with each other in theserver 130.
Theserver 130 may be a business server providing various services. Theserver 130 may be hardware or software. When theserver 130 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When theserver 130 is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, and is not limited in particular herein.
It should be understood that the number of callers, servers, and servers in fig. 1 is merely illustrative. There may be any number of callers, servers, and servers, as desired for the implementation. Referring to fig. 2, fig. 2 is a system interaction diagram of a full link tracking method according to an embodiment of the present application, and a system interaction process in the full link tracking method will be described with reference to fig. 1 and fig. 2.
S101, recording the first time when the calling party sends the first calling request to the service party by adopting a first calling method.
Optionally, recording a first time when the caller sends the first invocation request to the server by using the first invocation method, including: recording a first time when a calling party sends a first calling request to a service party by adopting a first calling method through a first thread; saving the first time to the calling parameter through the first thread.
Optionally, when it is monitored that the caller uses the asynchronous call model to make a remote call request, recording a first time that the caller sends the first call request to the server by using the first call method, further comprising: and recording the third time when the caller receives the second return request through the first thread, wherein the second return request is the request of the caller returned by the service after receiving the first call request by adopting the first call method.
S102, after the service side processes the service logic corresponding to the first calling request, the service side returns the first calling request to the calling side.
S103, when it is monitored that the calling party receives a first callback request returned by the service party by adopting a second calling method, calling the full link tracking service to process the first time to obtain a second time.
Optionally, invoking the full link tracking service to process the first time to obtain a second time, comprising: calling the full-link tracking service for dotting through a second thread to obtain fourth time when the calling party receives a first callback request returned by the service party by adopting a second calling method; and acquiring the first time from the calling parameter, calling the full link tracking service to calculate the difference between the fourth time and the first time, and taking the difference as the second time.
The method for dotting by calling the full-link tracking service through the second thread comprises the following steps: and calling the full-link tracking service through the second thread to perform normal dotting or abnormal dotting.
And S104, taking the second time as the processing time of the business logic corresponding to the first calling request.
The method comprises the steps that a caller and a server are based on a Remote Procedure Call (RPC) framework when the caller and the server make Remote calls, and the RPC framework at least comprises a Dubbo framework.
Optionally, when the RPC frame is a Dubbo frame, the first calling method is an invoke method, and the second calling method is an onResponse method.
In the embodiment of the application, first time when a calling party sends a first calling request to a service party by adopting a first calling method is recorded; then, when it is monitored that the calling party receives a first callback request returned by the server by adopting a second calling method, calling the full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request; and finally, taking the second time as the processing time of the business logic corresponding to the first calling request. The calling party and the service party adopt different calling methods to send and call back the request, so that when the calling party receives a first call back request returned by a second calling method from the service party, the service party can be determined to finish the processing process of the service logic, and the processing time for processing the service logic by the service party can be acquired by calling the full-link tracking service.
Referring to fig. 3, fig. 3 is a flowchart illustrating a full link tracking method according to another embodiment of the present application.
As shown in fig. 3, the method includes:
s301, recording the first time when the calling party sends the first calling request to the service party by adopting the first calling method.
It can be understood that, in the embodiment of the present application, when the caller and the server perform the Remote Call, the Remote Call may be based on a Remote Procedure Call (RPC) frame, and the RPC frame at least includes a Dubbo frame, because in the related art, the RPC frame is mostly the Dubbo frame, for convenience of description, the RPC frame is taken as the Dubbo frame in the embodiment of the present application, and an implementation process of the full link tracking method is introduced.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a synchronous call model according to another embodiment of the present application.
As shown in fig. 4, in the related art, when the caller 110 needs to use the synchronous call model to call data from the server 120, the caller 110 may first send a first call request to the server 120 by using a first call method, for example, when the first call method is an invoke method, the caller 110 may first send a first invoke request 410 to the server 120 by using an invoke method, at this time, the caller 110 may suspend executing other operations, wait for the server 120 to return data, when the server 120 receives the first invoke request 410, process the business logic corresponding to the first invoke request 410, and return a first invoke return request 420 to the caller 110 by using an invoke method, so that the caller 110 determines that the server 120 has completed processing the business logic, when the caller 110 receives the first invoke return request 420 from the server 120 by using an invoke method, the point is taken by calling the full link trace service to calculate the processing time of the service party 120 to the service logic, that is, the time difference between the first invoke return request 420 and the first invoke call request 410 is calculated, and the time difference is taken as the processing time of the service party 120 to the service logic.
Specifically, the above process may be implemented by calling a full link tracking service dotting to calculate a processing time of a service party to the service logic, and the dotting may be implemented by using an invoke method of a Filter interface to implement a full link tracking function, where a core code is as follows:
Figure BDA0002780014550000071
referring to fig. 5, fig. 5 is a schematic structural diagram of an asynchronous call model according to another embodiment of the present application.
As shown in fig. 5, in the related art, when thecaller 110 needs to use the asynchronous call model to call data from theserver 120, thecaller 110 may first send a first call request to theserver 120 by using a first call method, for example, when the first call method is a join method, thecaller 110 may first send a first invokerequest 510 to theserver 120 by using a join method, and after theserver 120 receives the first invokerequest 510, theserver 120 immediately returns a first invokereturn request 520 to thecaller 110, and thecaller 110 does not suspend executing other operations, that is, thecaller 110 does not wait for theserver 120 to return a processing result of the business logic, and then theserver 120 processes the business logic corresponding to the first invokerequest 510. At this time, if the time difference between the first invokereturn request 520 and the first invokecall request 510 is calculated continuously and in the above synchronous call model, and the time difference is taken as the processing time of the service logic by theservice side 120, the processing time of the service logic obtained at this time will be wrong, because after theservice side 120 receives the first invokecall request 510, theservice side 120 immediately returns the first invokereturn request 520 to the invokingside 110, then theservice side 120 will continue to process the service logic, and after theservice side 120 finishes processing the service logic, theservice side 120 returns thefirst callback request 530 to the invoking side, so the invokingside 110 receives the first invokereturn request 520, and does not represent that theservice side 120 has finished processing the service logic. Therefore, it is necessary to provide a full-link tracing method to solve the technical problem that when a remote call is made between thecaller 110 and theserver 120, especially when the remote call is made between thecaller 110 and theserver 120 based on an asynchronous call, theserver 120 cannot process the business logic time through the full-link tracing.
In the embodiment of the application, when a terminal or a client performs a certain operation, it may need to interact with a server to obtain some data, for example, when a certain application program in the terminal verifies the identity of a user, the identity data of the user needs to be obtained from the server, so that an operation performed by the server for data information required by the terminal or the client is called as service logic, at this time, the terminal or the client may establish a connection with a caller in the server, the terminal or the client may send a data request to the caller, after the caller receives the data request sent by the terminal or the client, a request execution request for performing remote invocation on behalf of the caller may be sent to a central processing unit in the server to obtain an execution command issued by the central processing unit based on the execution request and allowing the caller to perform remote invocation, the caller makes a remote call based on the execution command, so that as long as the server monitors any one or more parameters in the process, for example, the server monitors the "execution command", the caller is monitored to make a remote call on behalf of the server.
In the embodiment of the application, when the caller performs remote call, the caller may send a first call request to the server by using a first call method, where the first call request carries data information required by a terminal or a client, that is, the server may obtain service logic to be processed by the server according to the first call request. The server may further record a first time when the caller sends the first call request to the server by using the first call method, and after the caller receives the first call request sent by the caller, the service logic corresponding to the first call request may be processed, so that the first time may be considered as an initial time when the server starts to process the service logic.
S302, when it is monitored that the calling party receives a first callback request returned by the service party by adopting a second calling method, calling the full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request.
After receiving the first call request sent by the caller, the server may process the service logic corresponding to the first call request, and after completing the processing of the service logic, the server may return the first callback request to the caller by using a second call method, where the second call method is different from the first call method, for example, when the RPC frame is a Dubbo frame, the first call method is an invoke method, and the second call method may be an onResponse method. Therefore, in the embodiment of the present application, the server may further monitor whether the caller receives the first callback request returned by the server by using the second calling method, and when it is monitored that the caller receives the first callback request returned by the server by using the second calling method, call the full-link tracking service to process the first time to obtain the second time. The full-link tracking service is a service for calculating the processing time of each execution step between a calling party and a service party by performing dotting marking on each execution step between the calling party and the service party, but the full-link tracking service needs to obtain the specific processing time of each execution step based on the correct step dotting position.
Specifically, when it is monitored that the caller receives the first callback request returned by the server using the second calling method, the full link tracking service may be called to obtain a fourth time when the caller receives the first callback request, the fourth time is also the end time after the service logic processing by the server is completed, and a difference between the fourth time and the first time is taken as the second time, so the second time may be considered as the time used by the server to completely process the service logic.
And S303, taking the second time as the processing time of the business logic corresponding to the first calling request.
Since the second time is obtained after the service party completes the service logic processing and calls the full-link tracking service to process the first time, and the first time is the initial time when the service party starts to process the service logic, the second time can be considered as the time used by the service party to completely process the service logic, and then the second time can be used as the processing time of the service logic corresponding to the first call request.
In the embodiment of the application, first time when a calling party sends a first calling request to a service party by adopting a first calling method is recorded; then, when it is monitored that the calling party receives a first callback request returned by the server by adopting a second calling method, calling the full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request; and finally, taking the second time as the processing time of the business logic corresponding to the first calling request. The calling party and the service party adopt different calling methods to send and call back the request, so that when the calling party receives a first call back request returned by a second calling method from the service party, the service party can be determined to finish the processing process of the service logic, and the processing time for processing the service logic by the service party can be acquired by calling the full-link tracking service.
Referring to fig. 6, fig. 6 is a flowchart illustrating a full link tracking method according to another embodiment of the present application.
As shown in fig. 6, the method includes:
s601, recording the first time when the caller sends the first calling request to the server by adopting a first calling method through the first thread.
In this embodiment of the application, the server may first create a first thread, so that the server may record, through the first thread, a first time when the caller sends the first invocation request to the server by using a first invocation method, where please refer to the detailed description in step S301 for recording a detailed description of a first time when the caller sends the first invocation request to the server by using the first invocation method.
S602, saving the first time to a calling parameter through a first thread.
Optionally, the server may further save the first time to the calling parameter through the first thread, so that the subsequent full link tracking service may obtain the first time from the calling parameter at any time.
Optionally, because the synchronous call model or the asynchronous call model may be used for the remote call between the caller and the server, when the server monitors that the caller uses the asynchronous call model to make a remote call request, the server immediately returns a first return request to the caller after receiving a first call request sent by the caller, and the caller may continue to perform other operations without waiting for the server to perform other operations after completing the business logic processing, thereby implementing the asynchronous call between the caller and the server. Therefore, after the server records a first time when the caller sends the first call request to the server by using the first call method, the method further comprises the following steps: and recording the third time when the caller receives the second return request through the first thread, wherein the second return request is the request of the caller returned by the service after receiving the first call request by adopting the first call method. For example, when the first calling method is a join method, the caller may send a first call request, that is, a first invoke request, to the server by using the invoke method, and after the server receives the first invoke request, the server may immediately return the first return request, that is, the first invoke return request, to the caller, and the caller may continue to execute other operations without waiting for the server to return the processing result of the business logic.
Where the purpose of recording the third time at which the caller received the second return request by the first thread is to facilitate the invocation of a subsequent full link tracking service, then the processing time for the other operational steps may be calculated based on the third time.
S603, when it is monitored that the caller receives the first callback request returned by the server by the second calling method, calling the full-link tracking service for dotting through the second thread to obtain fourth time when the caller receives the first callback request returned by the server by the second calling method.
After receiving the first call request sent by the caller, the server may process the service logic corresponding to the first call request, and after completing processing the service logic, the server may return the first callback request to the caller by using a second call method, where the second call method is different from the first call method, for example, when the RPC frame is a Dubbo frame, the first call method is an invoke method, the second call method may be an onResponse method, the first callback request may be a first onResponse callback request, and when receiving the first callback request, the caller already completes the processing process of the service logic.
Optionally, the server may further create a second thread completely independent from the first thread, and call the full-link tracking service for dotting through the second thread when it is monitored that the caller receives the first callback request returned by the server by using the second call method, where dotting by the full-link tracking service is also performed, that is, the time point at which the caller receives the first callback request returned by the server by using the second call method is marked, so as to obtain a fourth time when the caller receives the first callback request returned by the server by using the second call method, and the fourth time is also the end time after the service logic processing is completed by the server.
Since the information transmission or data delivery between the service side and the calling side may fail, the second thread calls the full link tracking service for dotting, including: calling the full-link tracking service through a second thread to perform normal dotting or abnormal dotting, wherein the normal dotting means that dotting marking is performed after the server and the caller correctly perform information transmission or data delivery, and finally the processing time of the service logic is obtained, namely the time required by normal processing of the service logic; the abnormal dotting means that after the service party and the calling party perform information transmission or data delivery is abnormal, dotting marking is performed, and then the processing time of the service logic is finally obtained, namely the time required by abnormal processing of the service logic.
S604, obtaining the first time from the calling parameter, calling the full link tracking service to calculate a difference value between the fourth time and the first time, and taking the difference value as the second time.
Since the first time is the initial time when the service side starts to process the service logic, the fourth time is the end time after the service side finishes processing the service logic, and the difference value between the fourth time and the first time is taken as the second time, the second time can be considered as the time used by the service side to finish completely processing the service logic.
Specifically, the first calling method is an invoke method, and the second calling method may be an onResponse method, so the core code of the full link tracking method in this application is as follows:
Figure BDA0002780014550000121
Figure BDA0002780014550000131
in the embodiment of the application, the remote call between the calling party and the service party is monitored through two completely independent threads, namely a first thread and a second thread, and different execution steps in asynchronous call are marked by adopting two different calling methods to obtain the processing process of the service party on the service logic, so that the processing time of the service party on the service logic can be accurately calculated.
In the embodiment of the application, first time when a calling party sends a first calling request to a service party by adopting a first calling method is recorded; then, when it is monitored that the calling party receives a first callback request returned by the server by adopting a second calling method, calling the full-link tracking service to process the first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request; and finally, taking the second time as the processing time of the business logic corresponding to the first calling request. The calling party and the service party adopt different calling methods to send and call back the request, so that when the calling party receives a first call back request returned by a second calling method from the service party, the service party can be determined to finish the processing process of the service logic, and the processing time for processing the service logic by the service party can be acquired by calling the full-link tracking service.
Referring to fig. 7, fig. 7 is a schematic structural diagram of a full link tracking apparatus according to another embodiment of the present application.
As shown in fig. 7, the fulllink tracking apparatus 700 includes:
thefirst calling module 710 is configured to record a first time when the caller sends the first calling request to the server by using the first calling method.
Thesecond callback module 720 is configured to, when it is monitored that the caller receives a first callback request returned by the server by using the second calling method, invoke the full-link tracking service to process the first time to obtain a second time, where the first callback request is a request returned to the caller after the server processes the service logic corresponding to the first call request.
And thetime processing module 730 is configured to take the second time as a processing time of the service logic corresponding to the first call request.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a full link tracking apparatus according to another embodiment of the present application.
As shown in fig. 8, the fulllink tracking apparatus 800 includes:
the firsttime obtaining module 810 is configured to record, by a first thread, a first time at which a caller sends a first call request to a server by using a first call method.
Thetime saving module 820 is configured to save the first time to the call parameter through the first thread.
Optionally, when it is monitored that the caller uses the asynchronous call model to make a remote call request, recording a first time that the caller sends the first call request to the server by using the first call method, further comprising: and recording the third time when the caller receives the second return request through the first thread, wherein the second return request is the request of the caller returned by the service after receiving the first call request by adopting the first call method.
The fourthtime obtaining module 830 is configured to, when it is monitored that the caller receives the first callback request returned by the server by using the second calling method, call the full-link tracking service through the second thread to perform dotting, so as to obtain fourth time when the caller receives the first callback request returned by the server by using the second calling method.
The secondtime obtaining module 840 is configured to obtain the first time from the calling parameter, call the full-link tracking service to calculate a difference between the fourth time and the first time, and use the difference as the second time.
Optionally, invoking, by the second thread, a full link tracking service for dotting includes: and calling the full-link tracking service through the second thread to perform normal dotting or abnormal dotting. The caller and the server are based on a Remote Procedure Call (RPC) framework when making Remote calls, and the RPC framework includes at least a Dubbo framework. When the RPC frame is a Dubbo frame, the first calling method is an invoke method, and the second calling method is an onResponse method.
In an embodiment of the present application, a full link tracking apparatus includes: the first calling module is used for recording the first time when the calling party sends the first calling request to the service party by adopting a first calling method; the second callback module is used for calling the full-link tracking service to process the first time to obtain a second time when monitoring that the calling party receives a first callback request returned by the service party by adopting a second calling method, wherein the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first calling request; and the time processing module is used for taking the second time as the processing time of the business logic corresponding to the first calling request. The calling party and the service party adopt different calling methods to send and call back the request, so that when the calling party receives a first call back request returned by a second calling method from the service party, the service party can be determined to finish the processing process of the service logic, and the processing time for processing the service logic by the service party can be acquired by calling the full-link tracking service.
Embodiments of the present application also provide a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method according to any of the above embodiments.
Further, please refer to fig. 9, where fig. 9 is a schematic structural diagram of a server according to an embodiment of the present application. As shown in fig. 9, theserver 900 may include: at least onecentral processor 901, at least onenetwork interface 904, auser interface 903, amemory 905, at least onecommunication bus 902.
Wherein acommunication bus 902 is used to enable connective communication between these components.
Theuser interface 903 may include a Display screen (Display), and theoptional user interface 903 may also include a standard wired interface or a wireless interface.
Thenetwork interface 904 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
Thecentral processor 901 may include one or more processing cores. Thecentral processor 901 connects various parts within theentire server 900 using various interfaces and lines, and performs various functions of theserver 900 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in thememory 905, and calling data stored in thememory 905. Optionally, thecentral Processing unit 901 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). TheCPU 901 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is to be understood that the modem may not be integrated into thecentral processor 901, and may be implemented by a single chip.
TheMemory 905 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, thememory 905 includes a non-transitory computer-readable medium. Thememory 905 may be used to store instructions, programs, code, sets of codes, or sets of instructions. Thememory 905 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-described method embodiments, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. Thememory 905 may optionally be at least one storage device located remotely from thecentral processor 901. As shown in fig. 9, thememory 905, which is a type of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a full link tracking program.
In theserver 900 shown in fig. 9, theuser interface 903 is mainly used for providing an input interface for a user to obtain data input by the user; thecentral processor 901 may be configured to call the full link trace program stored in thememory 905, and specifically perform the following operations:
recording the first time when a calling party sends a first calling request to a service party by adopting a first calling method;
when monitoring that a calling party receives a first callback request returned by a server party by adopting a second calling method, calling the full-link tracking service to process a first time to obtain a second time, wherein the first callback request is a request returned to the calling party after the server party processes a service logic corresponding to the first calling request;
and taking the second time as the processing time of the business logic corresponding to the first calling request.
When the first time when the caller sends the first invocation request to the server by using the first invocation method is executed and recorded, thecentral processing unit 901 specifically executes the following steps: recording a first time when a calling party sends a first calling request to a service party by adopting a first calling method through a first thread; saving the first time to the calling parameter through the first thread.
When monitoring that the caller uses the asynchronous call model to make a remote call request, thecentral processing unit 901 further specifically executes the following steps after recording the first time that the caller sends the first call request to the server using the first call method: and recording the third time when the caller receives the second return request through the first thread, wherein the second return request is the request of the caller returned by the service after receiving the first call request by adopting the first call method.
When thecentral processor 901 calls the full link tracking service to process the first time to obtain the second time, the following steps are specifically performed: calling the full-link tracking service for dotting through a second thread to obtain fourth time when the calling party receives a first callback request returned by the service party by adopting a second calling method; and acquiring the first time from the calling parameter, calling the full link tracking service to calculate the difference between the fourth time and the first time, and taking the difference as the second time.
When thecentral processing unit 901 calls the full-link tracking service for dotting through the second thread, the following steps are specifically executed to call the full-link tracking service for normal dotting or abnormal dotting through the second thread.
Optionally, the caller and the server are based on a Remote Procedure Call (RPC) framework when making the Remote Call, and the RPC framework includes at least a Dubbo framework.
Optionally, when the RPC frame is a Dubbo frame, the first calling method is an invoke method, and the second calling method is an onResponse method.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of modules is merely a division of logical functions, and an actual implementation may have another division, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated module, if implemented in the form of a software functional module and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In view of the above description of the full link tracking method, apparatus, storage medium and server provided by the present application, those skilled in the art will appreciate that there are variations in the embodiments and applications of the full link tracking method, apparatus, storage medium and server according to the concepts of the present application.

Claims (10)

Translated fromChinese
1.一种全链路跟踪方法,其特征在于,所述方法包括:1. A full-link tracking method, characterized in that the method comprises:记录所述调用方采用第一调用方法将第一调用请求发送到服务方的第一时间;record the first time when the caller uses the first call method to send the first call request to the server;当监测到所述调用方接收到所述服务方采用第二调用方法返回的第一回调请求时,调用全链路跟踪服务处理所述第一时间以得到第二时间,其中,所述第一回调请求为所述服务方处理完所述第一调用请求对应的业务逻辑之后,向所述调用方返回的请求;When monitoring that the caller receives the first callback request returned by the server using the second calling method, call the full-link tracking service to process the first time to obtain the second time, wherein the first time The callback request is a request returned to the caller by the service party after processing the business logic corresponding to the first call request;将所述第二时间作为所述第一调用请求对应的业务逻辑的处理时间。The second time is used as the processing time of the business logic corresponding to the first invocation request.2.根据权利要求1所述的方法,其特征在于,所述记录所述调用方采用第一调用方法将第一调用请求发送到服务方的第一时间,包括:2. The method according to claim 1, wherein the recording of the first time when the caller uses the first call method to send the first call request to the server comprises:通过第一线程记录所述调用方采用第一调用方法将第一调用请求发送到服务方的第一时间;Recording, by the first thread, the first time when the caller sends the first call request to the server using the first call method;通过所述第一线程保存所述第一时间至调用参数中。The first time is saved in the calling parameter by the first thread.3.根据权利要求2所述的方法,其特征在于,所述方法包括:3. The method of claim 2, wherein the method comprises:当监测到所述调用方采用异步调用模型进行远程调用的请求时,所述记录所述调用方采用第一调用方法将第一调用请求发送到服务方的第一时间之后,还包括:When monitoring the request that the caller uses the asynchronous call model to make a remote call, after recording the first time when the caller uses the first call method to send the first call request to the server, the method further includes:通过所述第一线程记录所述调用方接收到第二返回请求的第三时间,所述第二返回请求为所述服务方在接收到所述第一调用请求后,采用所述第一调用方法返回所述调用方的请求。The third time when the caller receives the second return request is recorded by the first thread, and the second return request is that the service party uses the first call after receiving the first call request The method returns the caller's request.4.根据权利要求2所述的方法,其特征在于,所述调用全链路跟踪服务处理所述第一时间以得到第二时间,包括:4. The method according to claim 2, wherein the invoking a full-link tracking service to process the first time to obtain the second time comprises:通过第二线程调用全链路跟踪服务进行打点,以获取所述调用方接收到所述服务方采用第二调用方法返回的第一回调请求时的第四时间;The full-link tracking service is invoked by the second thread to perform management, to obtain the fourth time when the caller receives the first callback request returned by the service party using the second calling method;从所述调用参数中获取所述第一时间,调用所述全链路跟踪服务计算所述第四时间与所述第一时间之间差值,将所述差值作为第二时间。The first time is acquired from the invocation parameter, the full-link tracking service is invoked to calculate the difference between the fourth time and the first time, and the difference is used as the second time.5.根据权利要求4所述的方法,其特征在于,所述通过第二线程调用全链路跟踪服务进行打点,包括:5. The method according to claim 4, characterized in that, invoking the full-link tracking service through the second thread to perform management, comprising:通过第二线程调用全链路跟踪服务进行正常打点或者异常打点。The full-link tracking service is invoked through the second thread to perform normal or abnormal management.6.根据权利要求1所述的方法,其特征在于,所述调用方和所述服务方进行远程调用时基于远程过程调用(Remote Procedure Call,RPC)框架,且所述RPC框架至少包括Dubbo框架。6. method according to claim 1, is characterized in that, when described calling party and described service party carry out remote calling based on remote procedure call (Remote Procedure Call, RPC) framework, and described RPC framework at least comprises Dubbo framework .7.根据权利要求6所述的方法,其特征在于,当所述RPC框架为Dubbo框架时,所述第一调用方法为invoke方法,所述第二调用方法为onResponse方法。7 . The method according to claim 6 , wherein when the RPC framework is a Dubbo framework, the first calling method is an invoke method, and the second calling method is an onResponse method. 8 .8.一种全链路跟踪装置,其特征在于,所述装置包括:8. A full-link tracking device, wherein the device comprises:第一调用模块,用于记录所述调用方采用第一调用方法将第一调用请求发送到服务方的第一时间;a first calling module, configured to record the first time when the calling party uses the first calling method to send the first calling request to the server;第二回调模块,用于当监测到所述调用方接收到所述服务方采用第二调用方法返回的第一回调请求时,调用全链路跟踪服务处理所述第一时间以得到第二时间,其中,所述第一回调请求为所述服务方处理完所述第一调用请求对应的业务逻辑之后,向所述调用方返回的请求;The second callback module is configured to call the full-link tracking service to process the first time to obtain the second time when monitoring that the caller receives the first callback request returned by the service party using the second calling method , wherein the first callback request is a request returned to the caller by the service party after processing the business logic corresponding to the first call request;时间处理模块,用于将所述第二时间作为所述第一调用请求对应的业务逻辑的处理时间。A time processing module, configured to use the second time as the processing time of the business logic corresponding to the first invocation request.9.一种计算机存储介质,其特征在于,所述计算机存储介质存储有多条指令,所述指令适于由处理器加载并执行如权利要求1~7任意一项的所述方法的步骤。9. A computer storage medium, characterized in that the computer storage medium stores a plurality of instructions, the instructions are suitable for being loaded by a processor and performing the steps of the method according to any one of claims 1-7.10.一种服务器,其特征在于,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1~7任一项所述方法的步骤。10. A server, characterized by comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implementing the program according to any one of claims 1 to 7 when the processor executes the program. steps of the method described.
CN202011283184.9A2020-11-162020-11-16Full link tracking method, device, storage medium and serverActiveCN112311811B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202011283184.9ACN112311811B (en)2020-11-162020-11-16Full link tracking method, device, storage medium and server

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202011283184.9ACN112311811B (en)2020-11-162020-11-16Full link tracking method, device, storage medium and server

Publications (2)

Publication NumberPublication Date
CN112311811Atrue CN112311811A (en)2021-02-02
CN112311811B CN112311811B (en)2022-10-18

Family

ID=74334582

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202011283184.9AActiveCN112311811B (en)2020-11-162020-11-16Full link tracking method, device, storage medium and server

Country Status (1)

CountryLink
CN (1)CN112311811B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109831351A (en)*2018-12-292019-05-31深圳云天励飞技术有限公司Link trace method, apparatus, terminal and storage medium
CN109885449A (en)*2018-12-292019-06-14北京奥鹏远程教育中心有限公司Full link trace method
CN109921927A (en)*2019-02-202019-06-21苏州人之众信息技术有限公司Real-time calling D-chain trace method based on micro services
CN110245035A (en)*2019-05-202019-09-17平安普惠企业管理有限公司A kind of link trace method and device
CN110245043A (en)*2018-03-072019-09-17深圳市小赢信息技术有限责任公司The tracking system of call relation between a kind of distributed system
CN110808877A (en)*2019-10-302020-02-18深圳前海环融联易信息科技服务有限公司Statistical analysis method and device based on interface response duration and computer equipment
CN111277643A (en)*2020-01-182020-06-12深圳市麦谷科技有限公司HTTP link tracking recording method and system
CN111385122A (en)*2018-12-292020-07-07广州市百果园信息技术有限公司Distributed system link tracking method and device, computer equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN110245043A (en)*2018-03-072019-09-17深圳市小赢信息技术有限责任公司The tracking system of call relation between a kind of distributed system
CN109831351A (en)*2018-12-292019-05-31深圳云天励飞技术有限公司Link trace method, apparatus, terminal and storage medium
CN109885449A (en)*2018-12-292019-06-14北京奥鹏远程教育中心有限公司Full link trace method
CN111385122A (en)*2018-12-292020-07-07广州市百果园信息技术有限公司Distributed system link tracking method and device, computer equipment and storage medium
CN109921927A (en)*2019-02-202019-06-21苏州人之众信息技术有限公司Real-time calling D-chain trace method based on micro services
CN110245035A (en)*2019-05-202019-09-17平安普惠企业管理有限公司A kind of link trace method and device
CN110808877A (en)*2019-10-302020-02-18深圳前海环融联易信息科技服务有限公司Statistical analysis method and device based on interface response duration and computer equipment
CN111277643A (en)*2020-01-182020-06-12深圳市麦谷科技有限公司HTTP link tracking recording method and system

Also Published As

Publication numberPublication date
CN112311811B (en)2022-10-18

Similar Documents

PublicationPublication DateTitle
CN113438355B (en) Communication method, device, equipment and storage medium based on cloud mobile phone
JP7339425B2 (en) Method and apparatus for executing smart contracts
CN108055304B (en) Synchronization method, apparatus, server, device and storage medium for remote data
JP2023536365A (en) Video processing method and apparatus
CN113961330A (en)Distributed timing task execution method, device, equipment and computer readable medium
US11863842B2 (en)Method and apparatus for processing audio and video, electronic device and storage medium
CN113010238A (en)Permission determination method, device and system for micro application call interface
CN113893525A (en) Cloud game running method, apparatus, electronic device, and computer-readable medium
US10027722B2 (en)Communication transaction continuity using multiple cross-modal services
CN112311811B (en)Full link tracking method, device, storage medium and server
US10341420B1 (en)Approaches for preparing and delivering bulk data to clients
CN110262912B (en)Calling method and device for procedure call gRPC
CN118449932A (en) Network connection method and related products
CN118277986A (en)Authentication login method and device, storage medium and electronic equipment
CN114579327A (en)Cross-process communication method and device, storage medium and electronic equipment
CN114095758B (en)Cloud image intercepting method and related device
WO2017165253A1 (en)Modular communications
CN117041468B (en)Network communication method, device, equipment and storage medium
CN118550769B (en) Method, device, equipment and medium for realizing dual-machine hot standby based on virtualization scenario
CN113535421B (en) A business message processing method and device
CN117480497A (en) A cross-system testing method and device
CN115475379A (en) Sharing method, device, electronic device and storage medium in cloud game
CN112363817A (en)Big data task execution method and device, storage medium and server
CN113918259A (en)View adaptation processing method and device
CN118214567A (en) Asynchronous account login method, asynchronous account authentication calling method and related equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp