CN112311811B - 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
CN112311811B
CN112311811B CN202011283184.9A CN202011283184A CN112311811B CN 112311811 B CN112311811 B CN 112311811B CN 202011283184 A CN202011283184 A CN 202011283184A CN 112311811 B CN112311811 B CN 112311811B
Authority
CN
China
Prior art keywords
calling
time
request
service
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.)
Active
Application number
CN202011283184.9A
Other languages
Chinese (zh)
Other versions
CN112311811A (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 Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202011283184.9A priority Critical patent/CN112311811B/en
Publication of CN112311811A publication Critical patent/CN112311811A/en
Application granted granted Critical
Publication of CN112311811B publication Critical patent/CN112311811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Abstract

The application discloses a full link tracking method, a full link tracking device, a storage medium and a server, and relates to the technical field of communication. 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 the fact that the calling party receives a first callback request returned by the service party by adopting a second calling method is monitored, the full-link tracking service is called to process the first time to obtain a second time; and finally, taking the second time as the processing time of the business logic corresponding to the first calling request. Because the calling party and the service party adopt different calling methods to send and call back the request, when the calling party receives the first call back request returned by adopting the second calling method from the service party, the service party can be determined to finish the processing process of the service logic, at the moment, the processing time for processing the service logic by the service party can be obtained by calling the full link tracking service, and the time point when the service party finishes processing the service logic can be effectively distinguished.

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 advanced, wherein Remote Procedure Call (RPC) is an important loop in communication, so that development and maintenance of RPC framework become one of the key points of research for 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 a 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 call request to the server by using the first call 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 using 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 call 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 execute 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 embodiments or the prior art descriptions 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 implementations described in the following exemplary examples do not represent all implementations 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 claims that follow.
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 one caller 110, a server 120, and a server 130, wherein the caller 110 and the server 120 are disposed in the server, the caller 110 and the server 120 may be a program (service) or an entity module, and the caller 110 and the server 120 may call each other or transmit information in the server 130.
The server 130 may be a business server providing various services. The server 130 may be hardware or software. When the server 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 the server 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, which is not limited 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, depending on implementation needs. 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 for a calling party to send 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 a request that the caller uses the asynchronous call model to perform remote call is monitored, 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 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 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 call data from the server 120 by using a synchronous call model, 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 which time the caller 110 may suspend performing other operations, wait for the server 120 to return data, when the server 120 receives the first invoke request 410, process the service logic corresponding to the first invoke request 410, and return a first invoke return request 420 to the caller 110 by using the invoke method, so that the caller 110 determines that the server 120 has completed processing the service logic, that is, when the caller 110 receives the first invoke return request 420 by using the invoke method, the service 120 may calculate a processing time difference between the service logic and the service logic by calling a full link tracking service call point, so as to calculate a processing time difference between the service logic 120 and the first invoke request 410, and calculate a processing time difference between the first invoke request 410 and the first invoke time when the service 120 returns the first invoke request 420.
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 the caller 110 needs to use the asynchronous call model to call data from the server 120, the caller 110 may send a first call request to the server 120 by using a first call method, for example, when the first call method is a join method, the caller 110 may send a first invoke request 510 to the server 120 by using an invoke method, and after the server 120 receives the first invoke request 510, the server 120 may immediately return a first invoke return request 520 to the caller 110, and the caller 110 may not suspend performing other operations, that is, the caller 110 may not wait for the server 120 to return a processing result of the business logic, and then the server 120 may process the business logic corresponding to the first invoke request 510. At this time, if the time difference between the first invoke return request 520 and the first invoke call 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 the service side 120, the processing time of the service logic obtained at this time will be wrong, because after the service side 120 receives the first invoke call request 510, the service side 120 immediately returns the first invoke return request 520 to the invoking side 110, then the service side 120 will continue to process the service logic, and after the service side 120 finishes processing the service logic, the service side 120 returns the first callback request 530 to the invoking side, so the invoking side 110 receives the first invoke return request 520, and does not represent that the service 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 the caller 110 and the server 120, especially when a remote call is made between the caller 110 and the server 120 based on an asynchronous call, the service 120 cannot process the business logic time through the full-link tracing.
In the embodiment of the present application, when a terminal or a client performs an operation, it may need to interact with a server to obtain some data, for example, when an application in the terminal verifies the identity of a user, the identity data of the user needs to be obtained from the server, so an operation performed by the server for data information required by the terminal or the client is called as a 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, the caller performs remote invocation based on the execution command, so as long as the server monitors any one or more parameters in the above processes, for example, the server "execution command", the caller then performs remote invocation 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 service side may process the service logic corresponding to the first call request, and after completing processing the service logic, the service side may return the first call 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 then 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 call request. Because the calling party and the service party adopt different calling methods to send and call back the request, when the calling party receives the first call back request returned by adopting the 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 of the service party for processing the service logic can be obtained 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 returned by the caller by adopting a first calling method after the caller receives the first calling request. 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 framework is a Dubbo framework, 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 at this time, and when receiving the first callback request, the caller represents that the server has completed processing 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 party and the calling party may fail, the calling the full link tracking service through the second thread for dotting includes: 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 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, two completely independent threads, namely a first thread and a second thread, are used for monitoring remote calling between a calling party and a service party, and dotting marking is carried out on different execution steps in asynchronous calling by adopting two different calling methods so as 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 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 business 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 call 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 full link tracking apparatus 700 includes:
the first 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.
And the second 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, call 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 callback request.
And the time 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 full link tracking apparatus 800 includes:
the first time 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.
The time 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 fourth time 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.
And a second time obtaining module 840, 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 callback request; and the time processing module is used for taking the second time as the processing time of the service logic corresponding to the first call 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 further 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 one 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, the server 900 may include: at least one central processor 901, at least one network interface 904, a user interface 903, a memory 905, at least one communication bus 902.
Wherein a communication bus 902 is used to enable the connective communication between these components.
The user interface 903 may include a Display screen (Display), and the optional user interface 903 may further include a standard wired interface or a wireless interface.
The network interface 904 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface), among others.
The central processor 901 may include one or more processing cores. The central processor 901 connects various parts within the entire server 900 using various interfaces and lines, and performs various functions of the server 900 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 905, and calling data stored in the memory 905. Optionally, the central 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). The CPU 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 the central processor 901, and may be implemented by a single chip.
The Memory 905 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 905 includes a non-transitory computer-readable medium. The memory 905 may be used to store instructions, programs, code, sets of codes, or sets of instructions. The memory 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. The memory 905 may alternatively be at least one memory device located remotely from the central processor 901. As shown in fig. 9, the memory 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 the server 900 shown in fig. 9, the user interface 903 is mainly used for providing an input interface for a user to obtain data input by the user; the central processor 901 may be configured to call the full link trace program stored in the memory 905, and specifically perform the following operations:
recording a 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 call request.
When the first time at which the caller sends the first invocation request to the server by using the first invocation method is executed and recorded, the central processing unit 901 specifically executes the following steps: recording a first time for a calling party to send a first calling request to a service party by adopting a first calling method through a first thread; and 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, the central processing unit 901 further specifically executes the following steps after recording the first time when the caller sends the first call request to the server by 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 the central 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 a 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.
When the central processor 901 calls the full-link tracking service through the second thread to perform dotting, the following steps are specifically performed to call 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 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 manners. 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 coupling or direct coupling or communication connection between each other may be through some interfaces, indirect coupling or communication connection between 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 this embodiment.
In addition, functional modules in the embodiments of the present application may be integrated into one processing module, or each module 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 various media capable of storing program codes.
It should be noted that for simplicity and convenience of description, the above-described method embodiments are described as a series of combinations of acts, but those skilled in the art will appreciate that the present application is not limited by the order of acts, as some steps may, in accordance with the present application, occur in other orders and/or concurrently. Further, those skilled in the art will appreciate that the embodiments described in this specification are presently considered to be preferred embodiments and that acts and modules are not required in the present application.
In the foregoing 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 the related descriptions of other embodiments.
In the above description of the full link tracking method, apparatus, storage medium and server provided by the present application, for those skilled in the art, there may be variations in the specific implementation and application scope according to the ideas of the embodiments of the present application, and in summary, the contents of the present specification should not be construed as limiting the present application.

Claims (10)

1. A full-link tracing method applied to asynchronous calls between a caller and a server, the method comprising:
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 calling method is different from the second calling method, and the first callback request is a request returned to the caller after the server 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 call request.
2. The method of claim 1, wherein recording a first time at which the caller sends a first invocation request to a server using a first invocation method comprises:
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.
3. The method of claim 2, wherein the method comprises:
when it is monitored that the caller adopts an asynchronous call model to make a remote call request, the method further comprises the following step of recording a first time when the caller adopts a first call method to send a first call request to a server, wherein the first time comprises the following steps:
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.
4. The method of claim 2, wherein invoking the full-link tracking service to process the first time to obtain a second time comprises:
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.
5. The method of claim 4, wherein invoking full-link trace services for dotting by the second thread comprises:
and calling the full-link tracking service through the second thread to perform normal dotting or abnormal dotting.
6. The method of claim 1, wherein the Remote Call between the caller and the server is based on a Remote Procedure Call (RPC) framework, and wherein the RPC framework comprises at least a Dubbo framework.
7. The method of claim 6, wherein 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.
8. A full-link tracing apparatus, applied to asynchronous calls between a caller and a server, the apparatus comprising:
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 it is monitored that the calling party receives a first callback request returned by the service party by adopting a second calling method, wherein the first calling method is different from the second calling method, and the first callback request is a request returned to the calling party after the service party processes the service logic corresponding to the first callback 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.
9. A computer storage medium, characterized in that it stores a plurality of instructions adapted to be loaded by a processor and to perform the steps of the method according to any one of claims 1 to 7.
10. A server comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any one of claims 1 to 7 when the program is executed by the processor.
CN202011283184.9A 2020-11-16 2020-11-16 Full link tracking method, device, storage medium and server Active CN112311811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011283184.9A CN112311811B (en) 2020-11-16 2020-11-16 Full link tracking method, device, storage medium and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011283184.9A CN112311811B (en) 2020-11-16 2020-11-16 Full link tracking method, device, storage medium and server

Publications (2)

Publication Number Publication Date
CN112311811A CN112311811A (en) 2021-02-02
CN112311811B true CN112311811B (en) 2022-10-18

Family

ID=74334582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011283184.9A Active CN112311811B (en) 2020-11-16 2020-11-16 Full link tracking method, device, storage medium and server

Country Status (1)

Country Link
CN (1) CN112311811B (en)

Citations (6)

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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385122B (en) * 2018-12-29 2023-06-16 广州市百果园信息技术有限公司 Distributed system link tracking method, device, computer equipment and storage medium
CN111277643B (en) * 2020-01-18 2023-07-28 深圳市麦谷科技有限公司 Http link tracking recording method and system

Patent Citations (6)

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

Also Published As

Publication number Publication date
CN112311811A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
US9430810B2 (en) Drawing method, apparatus, and terminal
CN113438355B (en) Communication method, device, equipment and storage medium based on cloud mobile phone
EP3547715A1 (en) Method and apparatus for reducing continuous-wakeup delay of bluetooth loudspeaker, and bluetooth loudspeaker
CN108055304B (en) Remote data synchronization method, device, server, equipment and storage medium
JP7339425B2 (en) Method and apparatus for executing smart contracts
US11758087B2 (en) Multimedia conference data processing method and apparatus, and electronic device
US11863842B2 (en) Method and apparatus for processing audio and video, electronic device and storage medium
CN112843676A (en) Data processing method, device, terminal, server and storage medium
JP2023536365A (en) Video processing method and apparatus
CN112311811B (en) Full link tracking method, device, storage medium and server
US20190146645A1 (en) Replaying event-based sessions between a user device and an agent device
CN103975301A (en) Event service for local client applications through local server
CN111966508A (en) Message batch sending method and device, computer equipment and storage medium
US10027722B2 (en) Communication transaction continuity using multiple cross-modal services
CN110277110A (en) A kind of recording of Webpage, playback method, device and terminal
CN115242972A (en) Method and device for calling camera by application, electronic equipment and storage medium
CN110262912B (en) Calling method and device for procedure call gRPC
CN113034291A (en) Method and device for exporting fund transaction processing result
CN111866508A (en) Video processing method, device, medium and electronic equipment
WO2023230797A1 (en) Cross-system test method and apparatus
CN111679930B (en) Single-point rollback method and system for CICS online transaction
CN113824915B (en) Video picture acquisition method, apparatus and computer readable storage medium
CN114816684A (en) Business processing method, device, equipment, readable storage medium and product
CN116132720A (en) Distributed screen projection method and device, computer equipment and storage medium
CN113485728A (en) Server software upgrading method and device, server and storage medium

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