Call relationship tracking method, device, equipment and computer-readable storage medium
By using middleware in the distributed system to obtain and store call relationship logs, the problem of existing technology being unable to track cross-application, cross-microservice and cross-data center call relationships is solved, and efficient call relationships are achieved without modifying the upper-layer code. Tracking and storage.
Patent Information
- Application Number
- CN201910557465.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2039-06-25
AI Technical Summary
The existing distributed tracking system cannot effectively track call relationships across applications, cross-microservices, and cross-data centers, and requires modifications to the upper-layer application code, which increases the burden on developers.
By presetting middleware buried points in each application, the calling relationship log is obtained, and the log identifier is set according to the naming rules, and forwarded to the data server for storage, thereby achieving the acquisition of the calling relationship of multiple applications in the distributed system without modifying the upper layer. code.
It realizes the tracking and storage of multi-application call relationships in distributed systems, reduces the burden on developers, and improves the efficiency of call relationship tracking and system availability.
Smart Images

Figure CN112131070B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a call relationship tracking method, device, equipment and computer-readable storage medium. Background Art
[0002] Distributed tracing systems are generally used to track the complex calling relationships between modules of distributed systems. They can help developers better sort out the calling and dependency relationships between modules, better locate system bottlenecks, and optimize the system in a targeted manner. They can also help developers locate problems more accurately and perform root cause analysis.
[0003] Existing distributed tracing systems generally build call relationships into tracing trees and store the collected tracing trees in distributed storage systems so that subsequent users can obtain the tracing trees from the distributed storage systems to query the running status of the distributed systems. In order to increase the availability of the system, these systems embed some commonly used libraries at the lower level to achieve transparency to the upper-level applications.
[0004] However, when applications based on microservice architecture, such as large-scale Internet e-commerce services, become more and more complex, the corresponding operation and maintenance tools, especially the call relationship tracking system, have become unable to meet the needs. Specifically, when the number of microservices involved in the application increases dramatically, the call relationships between services are complex and diverse. In addition to caring about the call relationships between traditional services, applications also care about the call relationships between cross-applications, cross-microservices, and cross-data centers based on business. However, the above-mentioned distributed tracking system cannot realize the collection of call relationships across applications, cross-microservices, and cross-data centers; in addition, when the above-mentioned distributed tracking system is used to track the call relationships, the upper-level application code needs to be changed, such as inserting specific code, which increases the burden on application developers. Summary of the invention
[0005] The present invention provides a call relationship tracking method, device, equipment and computer-readable storage medium, which are used to solve the technical problem that the existing call relationship tracking method cannot realize the tracking of call relationships across applications.
[0006] A first aspect of the present invention is to provide a call relationship tracking method, comprising:
[0007] Receive a call relationship tracking request;
[0008] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0009] According to a preset naming rule, a call relationship log identifier is set for the call relationship log;
[0010] The call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
[0011] Another aspect of the present invention is to provide a call relationship tracking device, comprising:
[0012] A receiving module, used for receiving a call relationship tracking request;
[0013] An acquisition module is used to acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0014] An identification module, used for setting a call relationship log identification for the call relationship log according to a preset naming rule;
[0015] The sending module is used to forward the call relationship log and the call relationship log identifier to a preset data server for storage.
[0016] Another aspect of the present invention is to provide a call relationship tracking device, comprising: a memory, a processor;
[0017] Memory; Memory for storing instructions executable by the processor;
[0018] The processor is configured to execute the above-mentioned call relationship tracking method.
[0019] Another aspect of the present invention is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the call relationship tracking method as described above.
[0020] The call relationship tracking method, device, equipment and computer-readable storage medium provided by the present invention receive a call relationship tracking request; obtain the call relationship log of each application through the middleware embedded point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice whose usage frequency exceeds a preset frequency threshold in each application; set a call relationship log identifier for the call relationship log according to a preset naming rule; forward the call relationship log and the call relationship log identifier to a preset data server for storage. Thus, the acquisition of the call relationship of multiple applications in a distributed system can be realized, and in addition, there is no need to modify the upper layer code. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention, and a person skilled in the art can also obtain other drawings based on these drawings.
[0022] Figure 1 A schematic diagram of the network architecture based on which the present invention is based;
[0023] Figure 2 A schematic diagram of a flow chart of a call relationship tracking method provided in Embodiment 1 of the present invention;
[0024] Figure 3 This is a diagram of call relationship tracking in actual applications;
[0025] Figure 4 A schematic diagram of a flow chart of a call relationship tracking method provided in Embodiment 2 of the present invention;
[0026] Figure 5 A flowchart of a method for tracking call relationships provided in Embodiment 3 of the present invention;
[0027] Figure 6 A flowchart of a call relationship tracking method provided in Embodiment 4 of the present invention;
[0028] Figure 7 A flowchart of a call relationship tracking method provided in Embodiment 5 of the present invention;
[0029] Figure 8 A schematic diagram of the structure of a call relationship tracking device provided in Embodiment 6 of the present invention;
[0030] Fig. 9 This is a schematic diagram of the structure of a call relationship tracking device provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained based on the embodiments in the present invention belong to the scope of protection of the present invention.
[0032] Existing distributed tracing systems generally build call relationships into tracing trees, and store the collected tracing trees in distributed storage systems, so that subsequent users can obtain the tracing trees from the distributed storage systems to query the running status of the distributed system. In order to increase the availability of the system, these systems bury some commonly used libraries at the lower level to achieve transparency to the upper-level application. However, when applications based on microservice architecture, such as large-scale Internet e-commerce services, become more and more complex, the corresponding operation and maintenance tools, especially the call relationship tracking system, have become unable to meet the needs. Specifically, when the number of microservices involved in the application increases dramatically, the call relationships between services are complex and diverse. In addition to caring about the call relationships between traditional services, the application also cares about the call relationships between cross-applications, cross-microservices, and cross-data centers based on business. However, the above-mentioned distributed tracing system cannot realize the collection of call relationships across applications, cross-microservices, and cross-data centers; in addition, when the above-mentioned distributed tracing system is used to track the call relationship, the upper-level application code needs to be changed, such as inserting specific code, which increases the burden on application developers. In order to solve the above-mentioned technical problems, the present invention provides a call relationship tracking method, device, equipment, and computer-readable storage medium.
[0033] It should be noted that the call relationship tracking method, apparatus, device and computer-readable storage medium provided in the present application can be applied to any tracking of call relationships between applications.
[0034] Figure 1 This is a schematic diagram of the network architecture based on the present invention, such as Figure 1 As shown, the network architecture based on the present invention at least includes: a call relationship tracking device 1, a distributed system 2 and a data server 3. The call relationship tracking device 1 is respectively connected to the distributed system 2 and the data server 3 in communication, so as to be able to exchange information with the distributed system 2 and the data server 3. The call relationship tracking device 1 can be written in languages such as C / C++, Java, Shell or Python; the data server 3 can be a cloud server or a server cluster, which stores a large amount of data.
[0035] Figure 2 A schematic diagram of a flow chart of a call relationship tracking method provided in Embodiment 1 of the present invention; Figure 3 This is a diagram of call relationship tracking in actual applications, such as Figure 1 As shown, the method includes:
[0036] Step 101: receiving a call relationship tracking request;
[0037] Step 102: Acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0038] Step 103: Setting a call relationship log identifier for the call relationship log according to a preset naming rule;
[0039] Step 104: forward the call relationship log and the call relationship log identifier to a preset data server for storage.
[0040] The execution subject of this embodiment is a call relationship tracking device. Call relationship tracking refers to the tracking of call relationships between cross-applications and cross-microservices based on business. For example, in an e-commerce system, the complete process of generating and processing a customer order includes the interactive relationships between several applications and services. This customer browses the goods, operates the shopping cart, submits the order, pays through the connected financial account, and prepares, ships and sends the goods through the logistics system to finally complete the processing of the order. Therefore, the acquisition of call relationships in the distributed system can be achieved by burying points. Specifically, since each application in the distributed system has multiple microservices, it is possible to bury points in each microservice in advance to achieve the tracking of the call relationship of each business. Furthermore, since there are many microservices in the application, burying points for each microservice often causes a large amount of data. Therefore, in order to reduce the amount of data on the basis of achieving the acquisition of the call relationship of the distributed system, the use frequency of each microservice can be determined, and the microservices whose use frequency exceeds the preset frequency threshold can be used as middleware, and buried points can be performed in the middleware to achieve the acquisition of the call relationship in the distributed system. For example, middleware whose usage frequency exceeds the preset frequency threshold includes but is not limited to message queue microservices, data cache microservices, and settlement service microservices. In actual applications, the core package including the code can be used to implement tracking points and to summarize and record the acquired data. Specifically, a call relationship tracking request can be received, and according to the call relationship tracking request, the call relationship log of each application can be obtained through the middleware tracking points preset in each application, wherein the middleware is a microservice whose usage frequency exceeds the preset frequency threshold in each application. Further, since the call relationship log obtained through the middleware tracking points in each application is a log of the call relationship between multiple applications, in order to identify each call relationship log, a call relationship log identifier can be set for the call relationship log according to the preset naming rules. The call relationship log and the corresponding call relationship log identifier are associated and stored in a preset data server for storage, so that the call relationship log can be obtained from the data server for viewing and analysis later.
[0041] It should be noted that, unlike the existing call relationship tracking system that tracks call points in the code base, the present invention tracks call points in the existing microservices in each application, thereby avoiding the waste of manpower and material resources caused by modifying the upper-level code and improving the efficiency of call relationship tracking.
[0042] Taking practical applications as an example, Figure 3 As shown, Figure 3 The example includes a front-end application, back-end application 1, back-end application 2, and a data server. The front-end application starts link tracking by sending a call relationship tracking request to back-end application 1. After receiving the response from back-end application 1, the front-end application sends a second request to back-end application 2, triggering two storage data accesses of back-end application 2. Finally, the front-end application responds to the user after receiving the result, and the system automatically ends the link tracking. The dotted part is the call relationship log obtained by the middleware.
[0043] The call relationship tracking method provided in this embodiment receives a call relationship tracking request; obtains the call relationship log of each application through the middleware embedded point preset in each application according to the call relationship tracking request, and the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold; sets a call relationship log identifier for the call relationship log according to a preset naming rule; and forwards the call relationship log and the call relationship log identifier to a preset data server for storage. This enables the acquisition of the call relationship of multiple applications in a distributed system, and in addition, there is no need to modify the upper-level code.
[0044] Further, based on any of the above embodiments, the method includes:
[0045] Receive a call relationship tracking request;
[0046] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0047] According to a preset naming rule, a single-byte globally unique identifier is set for the call relationship log;
[0048] The call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
[0049] In this embodiment, in order to support the rapidly increasing number of large-scale microservice systems, a single-byte globally unique identifier can be set for the call relationship log according to the preset clear rules, and the single-byte globally unique identifier is used as the call relationship log identifier. It can be understood that, unlike the traditional four-byte unique identifier, the use of a single-byte unique identifier can effectively shorten the bandwidth occupied by the unique identifier, thereby increasing the amount of information transmitted per unit bandwidth.
[0050] The call relationship tracking method provided in this embodiment can effectively shorten the bandwidth occupied by the unique identifier on the basis of obtaining the call relationships of multiple applications in a distributed system by setting a single-byte globally unique identifier for the call relationship log according to a preset naming rule, thereby increasing the amount of information transmitted per unit bandwidth.
[0051] Further, based on any of the above embodiments, the application has an application identifier, and the microservice has a microservice identifier; accordingly, the method includes:
[0052] Receive a call relationship tracking request;
[0053] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0054] According to the application identifier, the microservice identifier and the calling sequence of each microservice, a call relationship log identifier is set for the call relationship log;
[0055] The call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
[0056] In this embodiment, each application has an application identifier, and correspondingly, each microservice also has a microservice identifier. Therefore, in order to better characterize the call relationship of the call relationship log, a call relationship log identifier can be set for the call relationship log according to the application identifier, the microservice identifier and the calling order of each microservice.
[0057] The call relationship tracking method provided in this embodiment can better characterize the call relationship of the call relationship log by setting a call relationship log identifier for the call relationship log according to the application identifier, the microservice identifier and the calling sequence of each microservice.
[0058] Figure 4 A flowchart of a call relationship tracking method provided in Embodiment 2 of the present invention is provided. Based on any of the above embodiments, the method includes:
[0059] Step 201: receiving a call relationship tracking request;
[0060] Step 202: Acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0061] Step 203: Setting a call relationship log identifier for the call relationship log according to a preset naming rule;
[0062] Step 204: caching the call relationship log and the call relationship log identifier through a ring cache structure;
[0063] Step 205: forward the call relationship log and the call relationship log identifier to a preset data server for storage.
[0064] In this embodiment, in order to support the rapidly increasing number of large-scale microservice systems, before forwarding the call relationship log to the data server, the call relationship log and the call relationship log identifier can be cached through a circular cache structure. The advantage of the circular cache structure is that the memory consumption is small, and the collection and forwarding of messages are all processed in memory without falling to the disk, and the message processing speed is fast, thereby improving the efficiency of obtaining the call relationship log. It should be noted that in the process of caching the call relationship log using the circular cache structure, when the circular queue overflows, the system will randomly discard the normal call relationship log to ensure the throughput. This is allowed in the system, because usually the link will be called thousands of times, and random discarding is equivalent to the random sampling strategy adopted by the traditional tracking system.
[0065] The call relationship tracking method provided in this embodiment caches the call relationship log and the call relationship log identifier through a ring cache structure, thereby improving the acquisition efficiency of the call relationship log.
[0066] Further, based on any of the above embodiments, the method includes:
[0067] Receive a call relationship tracking request;
[0068] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0069] According to a preset naming rule, a call relationship log identifier is set for the call relationship log;
[0070] Performing a compression operation on the call relationship log and the call relationship log identifier;
[0071] The compressed call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
[0072] In this embodiment, in order to support the rapidly increasing number of large-scale microservice systems, before forwarding the call relationship log to the data server, the call relationship log can be compressed, and the compressed call relationship log and the call relationship log identifier are sent to the preset data server for storage. It can be understood that the call relationship log can be compressed before transmission, which can effectively reduce the bandwidth occupied by the call relationship log, thereby increasing the amount of information transmitted per unit bandwidth.
[0073] The call relationship tracking method provided in this embodiment can increase the amount of information transmitted in a unit bandwidth and improve the transmission speed of the call relationship log by compressing the call relationship log and the call relationship log identifier; and forwarding the compressed call relationship log and the call relationship log identifier to a preset data server for storage.
[0074] Further, based on any of the above embodiments, the method includes:
[0075] Receive a call relationship tracking request;
[0076] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0077] According to a preset naming rule, a call relationship log identifier is set for the call relationship log;
[0078] Performing a compression operation on the call relationship log and the call relationship log identifier;
[0079] Dynamically sampling the call relationship log and the call relationship log identifier;
[0080] The sampled call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
[0081] In this embodiment, in order to support the rapidly increasing number of large-scale microservice systems, before forwarding the call relationship log to the data server, the call relationship log can be dynamically sampled, and the sampled call relationship log and the call relationship log identifier are forwarded to the preset data server for storage. It can be understood that after the call relationship log is dynamically sampled, the bandwidth occupied by the call relationship log can be effectively reduced, thereby increasing the amount of information transmitted in the unit bandwidth.
[0082] The call relationship tracking method provided in this embodiment dynamically samples the call relationship log and the call relationship log identifier; and forwards the sampled call relationship log and the call relationship log identifier to a preset data server for storage, thereby increasing the amount of information transmitted in a unit bandwidth and improving the transmission speed of the call relationship log.
[0083] As an implementable method, data can be collected through a single Transmission Control Protocol (TCP) long link, thereby saving the extra overhead required to establish TCP and further improving bandwidth utilization. In addition, large-scale call relationship log tracking can be supported through multi-instance clusters.
[0084] Figure 5 The flowchart of the call relationship tracking method provided in the third embodiment of the present invention is based on any of the above embodiments. Figure 5 As shown, the method includes:
[0085] Step 301: receiving a call relationship tracking request;
[0086] Step 302: Acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0087] Step 303: Setting a call relationship log identifier for the call relationship log according to a preset naming rule;
[0088] Step 304: forwarding the call relationship log whose collection time does not exceed the preset first time threshold and the call relationship log identifier to a preset real-time data server for storage;
[0089] Step 305: forward the call relationship log whose collection time exceeds the preset first time threshold and the call relationship log identifier to a preset offline data server for storage.
[0090] In this embodiment, after the call relationship log is obtained, the call relationship log can be forwarded to a data server for storage. Specifically, the data server can be divided into a real-time data server and an offline data server, wherein the real-time data server is used to store the call relationship log whose collection time does not exceed the preset first time threshold, and the offline data server is used to store the call relationship log whose collection time exceeds the preset first time threshold. For example, in practical applications, the first time threshold can be one hour. In addition, the first time threshold can be adjusted according to actual needs, and the present invention does not limit this. Therefore, after the call relationship log is obtained, the call relationship log whose collection time does not exceed the preset first time threshold can be sent to the real-time data server for storage, so that the user can view the call relationship log within the first time threshold. The call relationship log whose collection time exceeds the preset first time threshold is sent to the offline data server for storage.
[0091] The call relationship tracking method provided in this embodiment forwards the call relationship log whose collection time does not exceed the preset first time threshold and the call relationship log identifier to a preset real-time data server for storage, and forwards the call relationship log whose collection time exceeds the preset first time threshold and the call relationship log identifier to a preset offline data server for storage, thereby enabling users to view the collected call relationship logs in a timely manner on the basis of realizing call relationship tracking of the distributed system.
[0092] Figure 6 A flowchart of a call relationship tracking method provided in Embodiment 4 of the present invention is provided. Based on any of the above embodiments, Figure 6 As shown, the method includes:
[0093] Step 401: receiving a call relationship tracking request;
[0094] Step 402: Acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0095] Step 403: Setting a call relationship log identifier for the call relationship log according to a preset naming rule;
[0096] Step 404: forwarding the call relationship log and the call relationship log identifier to a preset data server for storage;
[0097] Step 405: receiving a log analysis instruction;
[0098] Step 406: Obtain the call relationship log from the preset data server according to the log analysis instruction;
[0099] Step 407: Analyze the call relationship log to determine whether a distributed database failure occurs.
[0100] In this embodiment, after the call relationship log is tracked and obtained, the call relationship log can also be analyzed to determine whether the distributed database is currently faulty. Specifically, a log analysis instruction can be received, and the call relationship log can be obtained from a preset data server according to the log analysis instruction, and the call relationship log can be analyzed. The log analysis instruction can include a call relationship log identifier, call relationship log acquisition time information, etc., to achieve accurate acquisition of the call relationship log.
[0101] The call relationship tracking method provided in this embodiment receives a log analysis instruction, obtains a call relationship log from the preset data server according to the log analysis instruction, analyzes the call relationship log, and determines whether a distributed database fails. Thus, it is possible to determine whether a distributed system fails based on the call relationship tracking of the distributed system.
[0102] Further, based on any of the above embodiments, the method includes:
[0103] Receive a call relationship tracking request;
[0104] According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, where the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0105] According to a preset naming rule, a call relationship log identifier is set for the call relationship log;
[0106] Forwarding the call relationship log and the call relationship log identifier to a preset data server for storage;
[0107] Receive log analysis instructions;
[0108] Obtaining a call relationship log from the preset data server according to the log analysis instruction;
[0109] Determine whether there is a link in the call relationship log whose call time exceeds a preset second time threshold; and / or,
[0110] Calculating the number of times each application and / or microservice in the call relationship log is called, and determining the importance of each application and / or microservice according to the number of times each application and / or microservice is called; and / or,
[0111] Calculating the time consumption information of each link in the call relationship log; and / or,
[0112] Calculating the time consumption information of each link in the call relationship log, and comparing the time consumption information with preset standard time consumption information; and / or,
[0113] Collecting statistics on the call relationships of each application and / or microservice in the call relationship log; and / or,
[0114] Collecting statistics on the call relationships of each application and / or microservice in the call relationship log, and performing bottleneck analysis on the call relationship log according to the call relationship;
[0115] Determine whether a distributed database failure occurs.
[0116] In this embodiment, the analysis of the call relationship log can be realized in a variety of ways. Specifically, it can be determined whether there is a link in the call relationship log whose call time exceeds the preset second time threshold. If so, it can be determined that the link has a fault, wherein the second time threshold can be the call time when the link is running normally. It is also possible to calculate the number of times each application and / or microservice is called, so that the importance of each application and / or microservice can be determined according to the number of times each application and / or microservice is called. It is understandable that if a microservice is called more times, the importance of the microservice is high, and when the microservice fails, it may cause a big problem. Therefore, it is also possible to perform bottleneck analysis based on the number of times each application and / or microservice is called, so that the distributed system can be quickly repaired when the distributed system fails. It is also possible to calculate the time-consuming information of each link in the call relationship log. It is understandable that the time-consuming information of each link can intuitively display whether the current system has a fault. If the time-consuming information exceeds the preset standard time-consuming information, it can be determined that the current system has a fault. Otherwise, it can be determined that the system is running normally. In addition, the call relationship of each application and / or microservice in the call relationship log can be counted, so that bottleneck analysis can be performed based on the call relationship of each application and / or microservice, so that the distributed system can be quickly repaired when a failure occurs in the distributed system. It should be noted that the analysis of the above call relationship log can be implemented separately or in combination, and the present invention is not limited here.
[0117] The call relationship tracking method provided in the present embodiment determines whether there is a link in the call relationship log whose call time exceeds a preset second time threshold; and / or calculates the number of times each application and / or microservice is called in the call relationship log, and determines the importance of each application and / or microservice according to the number of times each application and / or microservice is called; and / or calculates the time consumption information of each link in the call relationship log; and / or calculates the time consumption information of each link in the call relationship log, and compares the time consumption information with preset standard time consumption information; and / or counts the call relationships of each application and / or microservice in the call relationship log; and / or counts the call relationships of each application and / or microservice in the call relationship log, and performs bottleneck analysis on the call relationship log according to the call relationship, so as to accurately determine whether a distributed system fails on the basis of implementing call relationship tracking.
[0118] Figure 7 A flowchart of a call relationship tracking method provided in Embodiment 5 of the present invention is provided. Based on any of the above embodiments, Figure 7 As shown, the method also includes:
[0119] Step 501: receiving a call relationship tracking request;
[0120] Step 502: Acquire the call relationship log of each application through the middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0121] Step 503: Setting a call relationship log identifier for the call relationship log according to a preset naming rule;
[0122] Step 504: forwarding the call relationship log and the call relationship log identifier to a preset data server for storage;
[0123] Step 505: Create a call relationship view according to the call relationship log, wherein the call relationship view includes views of all currently acquired call relationship logs.
[0124] In this embodiment, in order to enable the user to have a more intuitive understanding of the call relationship between each application, after tracking and obtaining the call relationship log, a call relationship view can be established according to the call relationship log, wherein the call relationship view includes a view of all the currently obtained call relationship logs. Through the call relationship view, the call relationship between each application can be quickly and intuitively viewed, and the information such as the application and microservice that are called the most can also be intuitively determined.
[0125] The call relationship tracking method provided in this embodiment establishes a call relationship view according to the call relationship log, wherein the call relationship view includes views of all currently acquired call relationship logs, thereby enabling users to have a more intuitive understanding of the call relationship between applications on the basis of implementing call relationship tracking.
[0126] Further, based on any of the above embodiments, the method further includes:
[0127] receiving a viewing instruction from a user, wherein the viewing instruction is sent by the user through an interactive interface, and the viewing instruction includes a call relationship log identifier;
[0128] Acquire the corresponding call relationship log according to the call relationship log identifier;
[0129] The view corresponding to the call relationship log is displayed to the user.
[0130] In this embodiment, the user can perform human-computer interaction with the display interface of the call relationship view. Specifically, the user can click on the view corresponding to the call relationship log that the user wants to view on the interactive interface, so that after receiving the user's viewing instruction, the call relationship log corresponding to the viewing instruction can be obtained according to the viewing instruction. Specifically, the viewing instruction may include a call relationship log identifier, so that the corresponding call relationship log can be obtained according to the call relationship log identifier, and the view corresponding to the call relationship log is displayed to the user, so that the user can view it.
[0131] The call relationship tracking method provided in this embodiment receives a viewing instruction from a user, wherein the viewing instruction is sent by the user through an interactive interface, and the viewing instruction includes a call relationship log identifier; obtains a corresponding call relationship log according to the call relationship log identifier; and displays a view corresponding to the call relationship log to the user, thereby increasing the function of human-computer interaction on the basis of realizing call relationship tracking, allowing the user to more intuitively view the call relationship between applications and improve the user experience.
[0132] Furthermore, based on any of the above embodiments, the method further includes:
[0133] receiving an adjustment instruction from a user, wherein the adjustment instruction is sent by the user through an interactive interface, and the adjustment instruction includes call relationship view size adjustment information;
[0134] The size of the calling relationship view is adjusted according to the adjustment instruction.
[0135] In this embodiment, the user can perform human-computer interaction with the display interface of the call relationship view. Specifically, the user can adjust the size of the call relationship view through the interactive interface. The user's adjustment instruction can be received, wherein the adjustment instruction is sent by the user through the interactive interface, and the adjustment instruction includes the call relationship view size adjustment information. The size of the call relationship view is adjusted according to the call relationship view size adjustment information, so that the adjusted size is more suitable for the user to view.
[0136] The call relationship tracking method provided in this embodiment receives an adjustment instruction from a user, wherein the adjustment instruction is sent by the user through an interactive interface, and the adjustment instruction includes call relationship view size adjustment information; the size of the call relationship view is adjusted according to the adjustment instruction, thereby increasing the function of human-computer interaction on the basis of realizing call relationship tracking, allowing the user to view the call relationship between each application more intuitively, thereby improving the user experience.
[0137] Figure 8 A schematic diagram of the structure of a call relationship tracking device provided in Embodiment 6 of the present invention is shown in FIG. Figure 8 As shown, the call relationship tracking device includes:
[0138] A receiving module 61, used for receiving a call relationship tracking request;
[0139] An acquisition module 62 is used to acquire the call relationship log of each application through a middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold;
[0140] An identification module 63, used to set a call relationship log identification for the call relationship log according to a preset naming rule;
[0141] The sending module 64 is used to forward the call relationship log and the call relationship log identifier to a preset data server for storage.
[0142] The call relationship tracking device provided in this embodiment receives a call relationship tracking request; obtains the call relationship log of each application through the middleware embedded point preset in each application according to the call relationship tracking request, and the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold; sets a call relationship log identifier for the call relationship log according to a preset naming rule; and forwards the call relationship log and the call relationship log identifier to a preset data server for storage. Thus, the acquisition of the call relationship of multiple applications in a distributed system can be realized, and in addition, there is no need to modify the upper-level code.
[0143] Further, based on any of the above embodiments, the identification module includes:
[0144] The first setting unit is used to set a single-byte globally unique identifier for the call relationship log according to a preset naming rule.
[0145] Further, based on any of the above embodiments, the application has an application identifier, and the microservice has a microservice identifier;
[0146] Accordingly, the identification module includes:
[0147] The second setting unit is used to set a call relationship log identifier for the call relationship log according to the application identifier, the microservice identifier and the calling sequence of each microservice.
[0148] Further, based on any of the above embodiments, the device further includes:
[0149] The cache module is used to cache the call relationship log and the call relationship log identifier through a ring cache structure.
[0150] Further, based on any of the above embodiments, the device further includes:
[0151] A compression module, used for compressing the call relationship log and the call relationship log identifier;
[0152] The sending module comprises:
[0153] The first forwarding unit is used to forward the compressed call relationship log and the call relationship log identifier to a preset data server for storage.
[0154] Further, based on any of the above embodiments, the device further includes:
[0155] A sampling module, used for dynamically sampling the call relationship log and the call relationship log identifier;
[0156] The sending module comprises:
[0157] The second forwarding unit is used to forward the sampled call relationship log and the call relationship log identifier to a preset data server for storage.
[0158] Further, based on any of the above embodiments, the sending module includes:
[0159] A first sending unit, configured to forward the call relationship log whose collection time does not exceed a preset first time threshold and the call relationship log identifier to a preset real-time data server for storage;
[0160] The second sending unit is used to forward the call relationship log whose collection time exceeds the preset first time threshold and the call relationship log identifier to a preset offline data server for storage.
[0161] Further, based on any of the above embodiments, the device further includes:
[0162] An instruction receiving module, used for receiving log analysis instructions;
[0163] A log acquisition module, used to acquire the call relationship log from the preset data server according to the log analysis instruction;
[0164] The analysis module is used to analyze the call relationship log to determine whether a failure occurs in the distributed database.
[0165] Further, based on any of the above embodiments, the analysis module includes:
[0166] The first analyzing unit is configured to determine whether there is a link in the call relationship log whose call time exceeds a preset second time threshold; and / or,
[0167] a second analysis unit, configured to calculate the number of times each application and / or microservice in the call relationship log is called, and determine the importance of each application and / or microservice according to the number of times each application and / or microservice is called; and / or,
[0168] A third analysis unit is used to calculate the time consumption information of each link in the call relationship log; and / or,
[0169] a fourth analysis unit, configured to calculate the time consumption information of each link in the call relationship log, and compare the time consumption information with preset standard time consumption information; and / or,
[0170] a fifth analysis unit, configured to collect statistics on the call relationships of each application and / or microservice in the call relationship log; and / or,
[0171] The sixth analysis unit is used to collect statistics on the call relationships of each application and / or microservice in the call relationship log, and perform bottleneck analysis on the call relationship log according to the call relationship.
[0172] Further, based on any of the above embodiments, the device further includes:
[0173] The view establishing module is used to establish a call relationship view according to the call relationship log, wherein the call relationship view includes views of all currently acquired call relationship logs.
[0174] Further, based on any of the above embodiments, the device further includes:
[0175] A viewing instruction receiving module, used for receiving a viewing instruction from a user, wherein the viewing instruction is sent by the user through an interactive interface, and the viewing instruction includes a call relationship log identifier;
[0176] A call relationship log acquisition module, used to acquire the corresponding call relationship log according to the call relationship log identifier;
[0177] A display module is used to display the view corresponding to the call relationship log to the user.
[0178] Further, based on any of the above embodiments, the device further includes:
[0179] An adjustment instruction receiving module, used to receive an adjustment instruction from a user, wherein the adjustment instruction is sent by the user through an interactive interface, and the adjustment instruction includes call relationship view size adjustment information;
[0180] An adjustment module is used to adjust the size of the calling relationship view according to the adjustment instruction.
[0181] Fig. 9 A schematic diagram of the structure of a call relationship tracking device provided in Embodiment 7 of the present invention, such as Fig. 9 As shown, the call relationship tracking device includes: a memory 71, a processor 72;
[0182] Memory 71; Memory 71 for storing instructions executable by the processor 72;
[0183] The processor 72 is configured to execute the call relationship tracking method as described in any of the above embodiments.
[0184] Yet another embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the call relationship tracking method as described in any of the above embodiments.
[0185] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0186] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0187] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A call relationship tracking method, It is characterized in that include: Receive a call relationship tracking request; According to the call relationship tracking request, the call relationship log of each application is obtained through the middleware tracking point preset in each application, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold, the application has an application identifier, and the microservice has a microservice identifier; According to a preset naming rule, a call relationship log identifier is set for the call relationship log, wherein the preset naming rule is the application identifier, the microservice identifier, and the calling order of each microservice; The call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
2. The method according to claim 1, It is characterized in that The step of setting a call relationship log identifier for the call relationship log according to a preset naming rule includes: According to a preset naming rule, a single-byte globally unique identifier is set for the call relationship log.
3. The method according to claim 1 or 2, It is characterized in that Before forwarding the call relationship log and the call relationship log identifier to a preset data server for storage, the method further includes: The call relationship log and the call relationship log identifier are cached through a ring cache structure.
4. The method according to claim 1 or 2, It is characterized in that Before forwarding the call relationship log and the call relationship log identifier to a preset data server for storage, the method further includes: Performing a compression operation on the call relationship log and the call relationship log identifier; The forwarding the call relationship log and the call relationship log identifier to a preset data server for storage includes: The compressed call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
5. The method according to claim 1 or 2, It is characterized in that Before forwarding the call relationship log and the call relationship log identifier to a preset data server for storage, the method further includes: Dynamically sampling the call relationship log and the call relationship log identifier; The forwarding the call relationship log and the call relationship log identifier to a preset data server for storage includes: The sampled call relationship log and the call relationship log identifier are forwarded to a preset data server for storage.
6. The method according to claim 1 or 2, It is characterized in that The forwarding the call relationship log and the call relationship log identifier to a preset data server for storage includes: Forwarding the call relationship log whose collection time does not exceed the preset first time threshold and the call relationship log identifier to a preset real-time data server for storage; The call relationship log whose collection time exceeds the preset first time threshold and the call relationship log identifier are forwarded to a preset offline data server for storage.
7. The method according to claim 1 or 2, It is characterized in that After forwarding the call relationship log and the call relationship log identifier to a preset data server for storage, the method further includes: Receive log analysis instructions; Obtaining a call relationship log from the preset data server according to the log analysis instruction; The call relationship log is analyzed to determine whether a failure occurs in the distributed database.
8. The method according to claim 7, It is characterized in that The analyzing the call relationship log includes: Determine whether there is a link in the call relationship log whose call time exceeds a preset second time threshold; and / or, Calculating the number of times each application and / or microservice in the call relationship log is called, and determining the importance of each application and / or microservice according to the number of times each application and / or microservice is called; and / or, Calculating the time consumption information of each link in the call relationship log; and / or, Calculating the time consumption information of each link in the call relationship log, and comparing the time consumption information with preset standard time consumption information; and / or, Collecting statistics on the call relationships of each application and / or microservice in the call relationship log; and / or, The call relationship of each application and / or microservice in the call relationship log is counted, and a bottleneck analysis is performed on the call relationship log according to the call relationship.
9. The method according to any one of claims 1 to 2 and 8, It is characterized in that After forwarding the call relationship log and the call relationship log identifier to a preset data server for storage, the method further includes: A call relationship view is established according to the call relationship log, wherein the call relationship view includes views of all currently acquired call relationship logs.
10. The method according to claim 9, It is characterized in that The method further comprises: receiving a viewing instruction from a user, wherein the viewing instruction is sent by the user through an interactive interface, and the viewing instruction includes a call relationship log identifier; Acquire the corresponding call relationship log according to the call relationship log identifier; The view corresponding to the call relationship log is displayed to the user.
11. The method according to claim 9, It is characterized in that The method further comprises: receiving an adjustment instruction from a user, wherein the adjustment instruction is sent by the user through an interactive interface, and the adjustment instruction includes call relationship view size adjustment information; The size of the calling relationship view is adjusted according to the adjustment instruction.
12. A call relationship tracking device, It is characterized in that include: A receiving module, used for receiving a call relationship tracking request; An acquisition module is used to acquire the call relationship log of each application through a middleware tracking point preset in each application according to the call relationship tracking request, wherein the middleware is a microservice in each application whose usage frequency exceeds a preset frequency threshold, the application has an application identifier, and the microservice has a microservice identifier; An identification module, used to set a call relationship log identification for the call relationship log according to a preset naming rule, wherein the preset naming rule is the application identification, the microservice identification, and the calling order of each microservice; The sending module is used to forward the call relationship log and the call relationship log identifier to a preset data server for storage.
13. A call relationship tracking device, It is characterized in that include: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is configured to execute the call relationship tracking method as described in any one of claims 1-11.
14. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the call relationship tracking method according to any one of claims 1 to 11.
