Link tracing method and apparatus
By filtering the path weights of call paths in a distributed system, high-value call chain information is obtained, solving the problems of large data volume and low-value data in the chain tracing process, and realizing efficient anomaly analysis and storage optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-21
- Publication Date
- 2026-03-24
AI Technical Summary
In the process of link tracing in distributed systems, existing technologies record a large amount of call path information data, which includes a lot of low-value data, resulting in wasted storage space and low analysis efficiency.
By obtaining the call path to be traced, it is determined whether it exists in the call path pool. High-value call links are selected based on path weight, and link tracing results are generated to facilitate anomaly analysis and save storage space.
It effectively filters out high-value data that can reflect abnormal call paths, reduces storage requirements, and improves the efficiency of anomaly analysis.
Smart Images

Figure CN114816915B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the network technical field, and particularly relates to a link tracking method and device. BACKGROUND
[0002] In a distributed system (for example, a microservice system), a plurality of modules (for example, microservices) in the system often need to be called to complete the response to an external request. Taking the microservice system as an example, the calling path (path) generated by calling the microservice to respond to the external request is complex, and therefore, the link tracking technology is often used to record the related information of each calling path in the microservice system, so as to timely handle the exception when the calling path has an exception, and improve the stability and reliability of the microservice system.
[0003] At present, in the link tracking process, the calling information in the calling path recorded is usually obtained based on a fixed sampling frequency. In this case, the amount of data to be recorded in the link tracking process is large, and a large amount of storage space is consumed, and there are a large number of low-value data in the link tracking result, which cannot reflect the exception of the calling path. SUMMARY
[0004] The embodiments of the present application provide a link tracking method and device, so as to screen the high-value data capable of reflecting the exception of the calling path, facilitate the exception analysis, and save the storage space.
[0005] In a first aspect, the embodiments of the present application provide a link tracking method, comprising: obtaining a calling path to be tracked, the calling path being formed by aggregating M same calling links; determining a path weight of the calling path according to whether the calling path exists in a calling path pool, the calling path pool comprising historical calling paths formed in a historical link tracking process; screening the M same calling links according to the path weight of the calling path, to obtain N1 calling links in the M same calling links; and generating a link tracking result of the calling path according to the N1 calling links, the link tracking result being used to represent the calling situation of the calling links in the calling path; wherein M≥N1≥1.
[0006] In a second aspect, an embodiment of the present application provides a link tracking device, comprising: an acquisition unit configured to acquire a call path to be tracked, the call path being aggregated by M same call links; a weight determination unit configured to determine a path weight of the call path according to whether the call path exists in a call path pool, the call path pool comprising historical call paths formed in a historical link tracking process; a link screening unit configured to screen the M same call links according to the path weight of the call path, to obtain N1 call links in the M same call links; and a result generation unit configured to generate a link tracking result of the call path according to the N1 call links, the link tracking result being used to represent a call situation of the call links in the call path, wherein M≥N1≥1.
[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer execution instructions; and the at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the method provided in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing computer execution instructions, when a processor executes the computer execution instructions, the method provided in the first aspect is implemented.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, when the computer instructions are executed by a processor, the method provided in the first aspect is implemented.
[0010] In the embodiment of the present application, the link tracking device screens the call links aggregated to form the call path based on whether the call path to be tracked exists in the call path pool, and then generates the link tracking result of the call path based on the screened call links. As a result, there are more high-value data in the link tracking result, which can reflect the abnormality of the call path, so as to facilitate the abnormality analysis of the call path, and the storage space is saved. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 A scene diagram of link tracking provided by the present application;
[0012] Figure 2 A schematic diagram of a link tracking device provided by the embodiment of the present application;
[0013] Figure 3 A flowchart of a link tracking method provided by the embodiment of the present application;
[0014] Figure 4 A flowchart of another link tracking method provided by the embodiment of the present application;
[0015] Figure 5 A schematic block diagram of a link tracking device provided for an embodiment of the present application;
[0016] Figure 6 A structural schematic diagram of an electronic device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0017] Embodiments of the present application are applicable to link tracking of calling paths of any distributed system, and are particularly applicable to link tracking of calling paths of microservice systems. Hereinafter, the present application is exemplarily described by taking link tracking of calling paths of microservice systems as an example.
[0018] Figure 1 A schematic diagram of a scenario of link tracking provided for the present application. It is assumed that there are calling nodes a to f (not including calling node g) in a microservice system as shown in Figure 1 It should be noted that a calling node can be a microservice (Service) or an operation (Operation) in a microservice. For example, in the e-commerce field, microservices can include order service, payment service, address calculation service, inventory service, etc., and operations included in the order service can be creating an order, updating an order, canceling an order, etc. In Figure 1 , calling node a can be a root application, and calling nodes b to f are all operations in microservices, for example, calling node b and calling node c are operations in microservice S1, calling node d is an operation in microservice S2, calling node e is an operation in microservice S3, and calling node f is an operation in microservice S4.
[0019] When the microservice system responds to an external request, multiple calling paths can be generated due to calling, and each calling path describes a path of Service and Operation through which a calling link (trace) passes. For example, there can be calling paths A to D. As shown in Figure 1 , calling path A is a calling path including calling nodes a, b, d and e, calling path B is a calling path including calling nodes a, b, d and f, calling path C is a calling path including calling nodes a, c, d and e, and calling path D is a calling path including calling nodes a, c, d and f.
[0020] It should be noted that a calling path is formed by aggregating calling links (traces) of the same calling generated by multiple calling. The microservice system can respond to one type of external request through the same calling link, and each time an external request is responded to, a calling link is generated, for example, each calling link aggregated to form calling path A is a calling link including calling nodes a, b, d and e.
[0021] The call between each two adjacent call nodes in each call link can be represented by a span, for example, each call of call node a to call node b generates a call span, and each call of call node b to call node d also generates a call span, and so on, when the complete call responding to the external request is completed, these spans constitute a call link. Each span corresponds to span information, which is used to represent the information generated by the two adjacent call nodes in the call process. The span information can include part or all of the identification of the call link, the identification of the span, the service name of the call, the operation name of the call, the call start time and the call end time of the span, the call response, etc. For example, Figure 1 Taking the span of call node a calling call node b as an example, the span information of the span includes: the identification of the span (SpanID) is 1, the identification of the call link (TraceID) is 1000, the service name of the call (ServiceName) is S1, the operation name of the call (OperationName) is O1, the call start time (StarTime) is the time when call node a requests to call call node b, and the call end time (EndTime) is the time when call node a receives the response of call node b to the call request of call node a.
[0022] The same span in multiple call links can be aggregated to obtain the corresponding hop in the call path. The hop describes a node in the path, and corresponds to the set of services and operations and spans in the current path. The same span refers to the span in which the call node and the called node are the same. For example, the span between call node a and call node b is aggregated to obtain Hop1, the span between call node b and call node d is aggregated to obtain Hop2, and the span between call node d and call node e is aggregated to obtain Hop3, and Hop1~3 constitute the call path A. The information of the hop can include the identification of the call path (PathID), the service name of the call (ServiceName), the operation name of the call (OperationName), the number of included spans (Count), the number of included error spans (ErrorCount), and the number of included slow spans (SlowCount). The slow span refers to the span whose response time (RT) exceeds a preset time threshold. The RT of the span is equal to the difference between the call end time and the call start time in the span information of the span.
[0023] Link tracking can be collecting the span information of the spans in each call link to visually display the call situation of the call path through the span information of each span.
[0024] Figure 2 A schematic diagram of a link tracking device provided by an embodiment of the present application. Figure 2 The link tracking device in the micro system can be used to track the call paths, for example, the call paths in the micro system described above. Figure 1 The link tracking device 200 can include some or all of the data collection unit 210, the first stream computing unit 220, the storage unit 230, the second stream computing unit 240, and the console 250.
[0025] The data collection unit 210 can collect span information generated in real time in the micro service system. For example, the data collection unit 210 can collect span information generated by the micro service system in response to external requests through the application probe (Agent) 211. The application probe 211 can be used to collect span information generated by one or more call nodes in the micro service system during the call process, and report the span information according to a preset sampling frequency. Generally, all span information in the micro service system can be collected through multiple application probes 211 deployed. For example, the sampling frequency of the application probe 211 is r%, and when the span counter of the application probe takes r as the remainder, the span information is reported.
[0026] For example, the data collection unit 210 can input the collected span information to the message queue 212, and output the span information to the first stream computing unit 220 through the message queue 212. Optionally, the message queue 212 can be a message queue based on kafka, which is a distributed, high-throughput, and highly scalable message queue system. Of course, the implementation of the message queue is not limited in the present application.
[0027] The first stream computing unit 220 can filter the received span information based on the call path pool to obtain data with high value for analyzing call path exceptions, and then output the filtered span information and the generated call path to the storage unit 230. The filtering process of the span information by the first stream computing unit 220 will be described in detail below.
[0028] The second stream computing unit 240 can obtain the data of the historical link tracking process stored in the storage unit 230, and then update the call path pool according to the data of the historical link tracking process, so that the first stream computing unit 220 can accurately filter high-value data.
[0029] The first stream computing unit 220 and the second stream computing unit 240 can each be implemented as a stream computing cluster, or both can be part of a stream computing cluster. The stream computing cluster can be a functional unit with stream computing capability implemented based on a Flink stream computing framework. The first stream computing unit 220 and the second stream computing unit 240 can be independent of each other or can be integrated, which is not limited in the present application.
[0030] The storage unit 230 can be used to store at least one of the filtered span information, the aggregated call path, and the real-time updated call path pool. The storage unit 230 can include one or more databases. When the storage unit 230 includes multiple databases, different types of data can be stored in different databases to achieve data isolation and facilitate data reading and writing.
[0031] For example, the storage unit 230 includes a first storage unit 231, a second storage unit 232, and a third storage unit 233. The first storage unit 231 can be used to store the generated call path. Since the call path in the link tracking process does not require real-time response, the read-write speed requirement of the first storage unit 231 is relatively low. In this case, the first storage unit 231 can be implemented as a disk-based graph database, such as Neo4j, to increase storage capacity. The second storage unit 232 can be used to store the filtered span information. The second storage unit 232 can be implemented as a log storage system, such as a cloud log storage system SLS. The third storage unit 233 can be used to store the call path pool. Since the call path pool in the link tracking process needs to be responded in real time, the read-write speed requirement of the third storage unit 233 is relatively high. In this case, the third storage unit 233 can be implemented as a memory-based graph database, such as RedisGraph.
[0032] For example, the second storage unit 232 stores span information in the form shown in Table 1 below.
[0033] Table 1
[0034]
[0035] It should be noted that the PathID in Table 1 is generated by the first stream computing unit 220 after the call path is aggregated. Optionally, the PathID can be added to the span information after the PathID is generated.
[0036] For example, the call path pool stored by the third storage unit 233 includes multiple historical call paths, and each historical call path includes multiple Hops. The storage form of a Hop in the third storage unit 233 can be seen from Table 2 below.
[0037] Table 2
[0038]
[0039] Optionally, the third storage unit 233 can also store the RT interval corresponding to each Hop, which can be determined according to the RT of multiple spans contained in the Hop in the call path pool (to be specified below). The storage form of the RT interval corresponding to each Hop in the storage unit 233 can refer to Table 3 as follows.
[0040] Table 3
[0041]
[0042] The console 250 is configured to generate a display interface according to the data stored in the storage unit 230, such as the stored filtered span information, and the display interface displays the link tracking result. Optionally, the display interface can be a human-computer interaction interface, that is, the user can view or perform other control operations on the link tracking result through the human-computer interaction interface generated by the console 250. The console 250 can be implemented as a console.
[0043] It should be noted that the microservice system in the above Figure 1 and the link tracking device in Figure 2 can be implemented as a general server, a server cluster, or a cloud server, a server cluster. The microservice system and the link tracking device can be deployed on the same or different servers, and the present application does not limit this.
[0044] The link tracking method provided by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0045] Figure 3 A flowchart of a link tracking method provided by an embodiment of the present application. The execution subject of the embodiment of the present application can be the link tracking device described above, and in some embodiments, the link tracking device can be integrated into a distributed system, such as the microservice system in Figure 1 . As shown in Figure 3 , the method comprises:
[0046] S310, obtaining a call path to be tracked, the call path being aggregated by M same call links;
[0047] S320, determining a path weight of the call path according to whether the call path exists in a call path pool, the call path pool comprising historical call paths formed in a historical link tracking process;
[0048] S330, filtering the M same call links according to the path weight of the call path to obtain N1 call links in the M same call links;
[0049] S340, generating a link tracking result of the call path according to the N1 call links, the link tracking result being used to represent the call situation of the call links in the call path.
[0050] Wherein, M≥N1≥1.
[0051] It should be noted that the multiple historical call paths included in the call path pool may be, for example, Figure 1 the call paths A to D in the microservice system shown in FIG. 1. The call path in S310 can be one of the call paths in the call path pool, or the call path can be a new call path, not a historical call path in the call path pool, for example, the call path can be the call path E in Figure 1 FIG. 1, and the call path is a call path including call nodes a, b, d, f and g.
[0052] For example, the link tracking device can collect span information of each span in the microservice system through a data collection unit, for example, Figure 2 the data collection unit 210 in FIG. 1, to obtain multiple call links by connecting the span information, and then aggregate the multiple call links to obtain one or more call paths, and the call path in S310 can be one of the call paths.
[0053] It can be understood that the call path can be formed by aggregating M same call links, and each call link in the M same call links is used to complete the response of an external request once through the call nodes a-b-d-f-g.
[0054] The present application does not limit the external request, and it can be applied to any field. When the microservice system is applied to the e-commerce field, the external request may, for example, be an item purchase request, an order query request, an item detail browsing request, etc.
[0055] The aggregation of the M same call links to form the call path can be performed based on any path generation algorithm. For example, the link tracking device can realize the generation of the call path through the following four steps: 1. In the collected span information, the entry application is filtered according to the level attribute in the span information, for example, Figure 1The calling node a in the span information is the entry application. The level of the entry application is 0; 2, according to the ServiceName, OperationName and level information in the span information, the hash value (hash) of the current span information is calculated, for example, hash = HashCode(span.serviceName) + HashCode(span.operationName) + span.level 31, wherein HashCode is a hash value calculation function; 3, recursively the span information of the entry application (the sub-span information represents the subsequent calling relationship after the span information of the entry application) and generates the hash of the sub-span information return and splicing, the hash generated in the span information of the entry application is the PathId; 4, the PathId generated in the span information of the entry application is passed to all sub-span information through recursion.
[0056] Generally speaking, if the calling path to be tracked is a historical calling path that already exists in the calling path pool, it indicates that the calling path has experienced historical link tracking, and the possibility of abnormality is low, so for analyzing the abnormality of the calling path, the calling information of the M same calling links aggregated to form the calling path can be considered as low-value data; if the calling path to be tracked is not a historical calling path that already exists in the calling path pool, it indicates that the calling path is a new calling path, and the possibility of abnormality is high, so for analyzing the abnormality of the calling path, the calling information of the M same calling links aggregated to form the calling path can be considered as high-value data, which needs to be retained, so as to generate a link tracking result based on the retained calling information of the calling link. Optionally, the calling information of the calling link can include the span information of multiple spans on the calling link.
[0057] Therefore, in the above S320, the link tracking device can set a path weight for the calling path based on whether the calling path to be tracked exists in the calling path pool, so as to screen out the calling information of the calling link with higher value.
[0058] In one possible example of the above S320, if the calling path exists in the calling path pool, the link tracking device can determine that the path weight of the calling path is a first path weight; if the calling path does not exist in the calling path pool, the path weight of the calling path is determined to be a second path weight. Generally, the value of the first path weight is less than the value of the second path weight, that is, the link tracking device is more inclined to obtain more data in the calling path that does not exist in the calling path pool.
[0059] The path weight can be a sampling rate, for example, the first path weight can be 20%, and the second path weight can be 50%. For example, the call path exists in the call path pool, and the link tracking device can set the path weight of the call path to 20%, and for another example, the call path does not exist in the call path pool, and the link tracking device can set the path weight of the call path to 50%.
[0060] In the above S330, the link tracking device filters the M same call links based on the path weight of the call path, and can obtain high-value data that can reflect the abnormality of the call path. For example, the call link exists in the call path pool, and the link tracking device sets the path weight of the call path to 20%, so that each of the M same call links has a 20% chance of being retained and an 80% chance of being discarded; for another example, the call link does not exist in the call path pool, and the link tracking device sets the path weight of the call path to 50%, so that each of the M same call links has a 50% chance of being retained and a 50% chance of being discarded.
[0061] In the above example, assuming that the call path exists in the call path pool, the link tracking device determines the path weight of the call path as the first path weight, and then the link tracking device can determine the values of the first path weight corresponding to the M same call links that aggregate to form the call path. Specifically, each call link has a timestamp, and the link tracking device can determine the value of the first path weight corresponding to each call link according to the timestamp of each call link. Optionally, the earlier the call link displayed by the timestamp, the smaller the value of the first path weight corresponding to the call link, and the later the call link displayed by the timestamp, the larger the value of the first path weight corresponding to the call link. For example, the call link 1 day earlier than the current time corresponds to a first path weight of 5%, the call link 0.5 days earlier than the current time corresponds to a first path weight of 10%, and the call link 1 hour earlier than the current time corresponds to a first path weight of 20%. The timestamp can be the time when the call link receives an external request, or the time when the call link starts to execute the call, etc.
[0062] In the above S330, the filtering of the call link by the link tracking device can be embodied as filtering of span information in the call link. When at least one span information in the call link is discarded, the call link is considered to be discarded, and when all span information in the call link is retained, the call link is considered to be retained. The timestamp of the call link can also be carried in the span information of the call link.
[0063] It can be understood that when the value of the path weight is large, the number of the calling links screened by the link tracking device is larger, that is, the value of N1 is larger; when the value of the path weight is small, the number of the calling links screened by the link tracking device is smaller, that is, the value of N1 is smaller.
[0064] In the above S340, the link tracking result generated by the link tracking device according to the N1 calling links should at least include the calling information of the N1 calling links, for example, include the span information of the spans constituting each calling link.
[0065] The link tracking result can also be the fusion of the link tracking results of multiple calling paths. That is, the multiple calling paths can be visually tracked and displayed through the link tracking result.
[0066] In the embodiment of the application, the link tracking device filters the calling links aggregated to form a calling path based on whether the calling path to be tracked exists in the calling path pool, and then generates a link tracking result of the calling path based on the filtered calling links. There are more high-value data in the link tracking result that can reflect the abnormality of the calling path.
[0067] On the basis of the above embodiment, in order to more accurately filter out high-value data, the link tracking device can further filter the N1 calling links to obtain the calling information of N2 calling links with higher value for reflecting the abnormality of the calling path. The following will be described by way of example. Figure 4
[0068] Figure 4 Another flowchart of a link tracking method provided by the embodiment of the application is shown in FIG. 6. As shown in FIG. 6, S310 to S330 in the method have similar implementation manners as the corresponding processes in Figure 4 , and details are not repeated here. The method further includes: Figure 3
[0069] S341, determining the sampling weights corresponding to the N1 calling links respectively;
[0070] S342, filtering the N1 calling links according to the sampling weights corresponding to the N1 calling links respectively, to obtain N2 calling links in the N1 calling links;
[0071] S343, generating a link tracking result of a calling path according to the N2 calling links;
[0072] Wherein, N1≥N2≥1.
[0073] In the above S341, at least the following two possible implementation manners can be included:
[0074] In an implementation, the link tracking apparatus can determine the sampling weight corresponding to each of the N1 calling links based on the RT interval.
[0075] The RT interval can be used to distinguish whether the RT of the calling link belongs to the normal running condition, and therefore, determining the sampling weight of each calling link based on the RT interval helps to filter out high-value data.
[0076] For example, for one of the N1 calling links, the link tracking apparatus obtains at least one span information in the calling link, the span information being used to represent the information generated by two adjacent calling nodes in the calling link in the calling process, and the link tracking apparatus determines at least one span weight of the calling link according to the at least one span information and the RT interval, the RT interval being determined based on the calling information of the historical calling links on the calling path, and then the link tracking apparatus takes the maximum value of the at least one span weight as the sampling weight of the calling link. Of course, the link tracking apparatus can also take the minimum value or the average value of the at least one span weight as the sampling weight of the calling link, which is not limited in the present application.
[0077] In the above implementation, the RT interval can include a first interval. Optionally, the first interval can be a confidence interval obtained by processing the calling information of the historical calling links based on a normal distribution function and a Bayesian function. The first interval can also be referred to as a Bayesian confidence interval, which is an interval estimation algorithm based on a given prior probability distribution, calculating the posterior probability distribution through Bayesian theory, and then obtaining the parameter value interval under a certain probability.
[0078] For example, the link tracking apparatus can obtain each span information of each historical calling link in the calling path pool, and obtain the RT of each span in the historical calling path according to the calling start time and the calling end time in each span information. Then, the link tracking apparatus can divide the RT of each span in the historical calling path into two data sets D1 and D2. The link tracking apparatus calculates the mean μ and the variance of the data set D1, and takes the mean μ and the variance as the input of the following normal function to obtain the prior distribution of the Bayesian function .
[0079]
[0080] Wherein, exp is the exponential function with the natural constant e as the base.
[0081] Further, the link tracking apparatus obtains the posterior distribution based on the following Bayesian formula according to the prior distribution .
[0082]
[0083] Further, the link tracking device determines quantiles from the posterior distribution function as a left endpoint b1 and a right endpoint b2 of the confidence interval. Wherein, b1 is less than the mean of the data set D2, and b2 is greater than the mean of the data set D2. Finally, the confidence interval (i.e., the first interval) [b1, b2] is obtained.
[0084] The first interval can reflect the interval that the RT of the span satisfies under normal operation. That is, when the RT of the span belongs to the first interval, the link tracking device considers that the span is a normal span, and when the RT of the span does not belong to the first interval, the link tracking device considers that the span is an abnormal span, which can include an error span and a slow span, etc.
[0085] When the RT interval includes the first interval, the above-mentioned implementation manner one can be specifically implemented as follows: the link tracking device determines the span weight of at least one span information one by one. The link tracking device determines the RT of the i th span of the calling link according to the i th span information in the at least one span information. If the RT of the i th span is less than the lower limit threshold (such as b1) of the first interval, it indicates that the response time of the span is too low, which can be caused by the function exception of the called calling node, or caused by the function reduction of the called calling node, etc., resulting in that the calling link needs to be concerned. In this case, the i th span weight of the calling link is larger (for example, a first span weight). If the RT of the i th span is in the first interval, the RT of the span is in the normal RT range, and the i th span weight of the calling link is smaller (for example, a second span weight). If the RT of the i th span is greater than the upper limit threshold (such as b2) of the first interval, the RT of the span is too high, which can be caused by the function exception of the called calling node, or caused by the function increase of the called calling node, or caused by network congestion, etc., resulting in that the calling link needs to be concerned. In this case, the i th span weight of the calling link is larger (for example, a third span weight). Wherein, the value of the first span weight and the value of the third span weight are both greater than the value of the second span weight, and the application does not limit the size relationship between the value of the first span weight and the value of the third span weight. For example, the first span weight can be 50%, the second span weight can be 20%, and the third span weight can be 50%.
[0086] In the above example, in the above-mentioned implementation manner one, the RT interval can further include a second interval. Optionally, the second interval is a confidence interval obtained by processing the calling information of the historical calling link based on a confidence interval function. The confidence interval describes the degree that the true value of the parameter has a certain probability to fall around the measurement result.
[0087] For example, the link tracking apparatus can obtain span information of each historical invocation link in the invocation path pool, and obtain the RT of the plurality of spans in the historical invocation path according to the invocation start time and the invocation end time in the span information. Further, the link tracking apparatus can form a dataset D3 with the RTs of the plurality of spans in the historical invocation path whose RTs exceed b2. The link tracking apparatus calculates the mean μ and the standard deviation The mean μ and the standard deviation The following confidence interval function is input to obtain the confidence interval [c1, c2].
[0088]
[0089] wherein, is the standard score, The value of is 0.975 by default.
[0090] Further, the first interval [b1, b2] and the confidence interval [c1, c2] are integrated to obtain the second interval [b2, c2].
[0091] The second interval can reflect the abnormal degree of the RT of the span under abnormal conditions. When the RT interval includes the second interval, the link tracking apparatus determines that the value of the third span weight is the first preset value when the RT of the ith span is in the second interval, and determines that the value of the third span weight is the second preset value when the RT of the ith span is greater than the upper threshold value (such as c2) of the second interval; wherein the first preset value is less than the second preset value. The upper threshold value of the second interval is used to distinguish the high degree of the RT of the span. When the RT is high to exceed the upper threshold value of the second interval, it needs to be paid close attention to. For example, the first preset value can be 50%, and the second preset value can be 100%.
[0092] Implementation manner two: the link tracking apparatus can determine the sampling weight corresponding to each of the N1 invocation links according to whether there is an error span in each of the invocation links.
[0093] For example, for one of the N1 invocation links, the link tracking apparatus can obtain at least one span information in the invocation link, and determine whether there is an error span in the at least one span of the invocation link according to the dispatch response of each span information in the at least one span information. Further, the sampling weight corresponding to each of the N1 invocation links is determined according to whether there is an error span in each of the N1 invocation links.
[0094] For example, the dispatch response can be a response information sent by one invocation node in response to another invocation node. For example, the invocation response can be Figure 1After the calling node A calls the calling node B, the calling node B sends a scheduling response to the calling node A, which can indicate whether the calling node B successfully executes the call of the calling node A. For example, when the calling response includes a value "200", it indicates that the call is successfully executed; when the calling response includes a value other than "200", it indicates that the call is not successfully executed, i.e., the span between the two calling nodes is an error span.
[0095] When it is determined that the calling link has an error span, the span information of the calling link is high-value data for analyzing the exception of the calling path, and therefore, the link tracking device needs to set a higher weight for the calling link. Correspondingly, when it is determined that the calling link does not have an error span, the span information of the calling link is low-value data for analyzing the exception of the calling path, and therefore, the link tracking device needs to set a lower weight for the calling link.
[0096] Regardless of which of the above implementation manner one or implementation manner two, the sampling weight corresponding to each of the N1 calling links can be determined, and then in the above S342 and S343, the N1 calling links are screened according to the determined sampling weight corresponding to each of the N1 calling links, to obtain N2 calling links in the N1 calling links, and then the link tracking result of the path is generated according to the N2 calling links. The screening process of the calling link in the S342 is similar to the S330 in the above Figure 3 , and the generation process of the link tracking result in the S343 is similar to the S340 in the above Figure 3 , which will not be described here.
[0097] Of course, the above implementation manner one and implementation manner two can be combined with each other. For example, the link tracking device can first determine the sampling weight corresponding to each of the N1 calling links based on the RT interval, and then screen the N1 calling links according to the sampling weight corresponding to each of the N1 calling links to obtain N2 calling links, and then determine the sampling weight corresponding to each of the N2 calling links according to whether there is an error span in each calling link, screen the N2 calling links according to the sampling weight corresponding to each of the N2 calling links to obtain N3 calling links in the N2 calling links, and finally generate the link tracking result of the calling path according to the N3 calling links.
[0098] The combination of the first implementation manner and the second implementation manner further includes: the link tracking device determines sampling weights respectively corresponding to the N1 calling links based on whether each calling link in the N1 calling links has an error span, and filters the N1 calling links according to the sampling weights respectively corresponding to the N1 calling links to obtain N2 calling links. Then, the link tracking device determines sampling weights respectively corresponding to the N2 calling links based on the RT interval, filters the N2 calling links according to the sampling weights respectively corresponding to the N2 calling links to obtain N3 calling links in the N2 calling links, and finally generates a link tracking result of the calling path according to the N3 calling links.
[0099] In any of the embodiments including the above Figure 3 or Figure 4 On the basis of any of the embodiments, the link tracking device can update the calling path pool in real time.
[0100] For example, the link tracking device can read span information stored in the storage unit 230 in real time through the second stream computing unit 240 shown in the figure, and update the calling path pool according to the read span information. Figure 2 For example, the link tracking device can read span information stored in the storage unit 230 in real time through the second stream computing unit 240 shown in the figure, and update the calling path pool according to the read span information.
[0101] Figure 5 A schematic block diagram of a link tracking device provided by an embodiment of the present application is shown in the figure. As shown in the figure, the device 400 at least includes an acquisition unit 410, a weight determination unit 420, a link filtering unit 430, and a result generation unit 440. Figure 5
[0102] The acquisition unit 410 can be configured to acquire a calling path to be tracked, the calling path being formed by aggregation of M same calling links; the weight determination unit 420 can be configured to determine a path weight of the calling path according to whether the calling path exists in a calling path pool, the calling path pool including historical calling paths formed in a historical link tracking process; the link filtering unit 430 can be configured to filter the M same calling links according to the path weight of the calling path to obtain N1 calling links in the M same calling links; and the result generation unit 440 can be configured to generate a link tracking result of the calling path according to the N1 calling links, the link tracking result being used to represent calling conditions of the calling links in the calling path; wherein M≥N1≥1.
[0103] In some embodiments, the result generating unit 440 is specifically configured to: determine sampling weights corresponding to the N1 calling links respectively; filter the N1 calling links according to the sampling weights corresponding to the N1 calling links respectively, to obtain N2 calling links in the N1 calling links; and generate the link tracking result of the calling path according to the N2 calling links; wherein N1≥N2≥1.
[0104] In some embodiments, the weight determining unit 420 is specifically configured to: for one calling link in the N1 calling links, obtain at least one span information in the calling link, the span information being used to represent information generated by two adjacent calling nodes in the calling link in a calling process; determine at least one span weight of the calling link according to the at least one span information and a response time interval, the response time interval being determined based on calling information of historical calling links on the calling path; and take a maximum value in the at least one span weight as a sampling weight of the calling link.
[0105] In some embodiments, the response time interval includes a first interval, and the weight determining unit 420 is specifically configured to: determine an RT of an i th span of the calling link according to an i th span information in the at least one span information; if the RT of the i th span is less than a lower threshold of the first interval, a first span weight is taken as the i th span weight of the calling link; if the RT of the i th span is in the first interval, a second span weight is taken as the i th span weight of the calling link; if the RT of the i th span is greater than an upper threshold of the first interval, a third span weight is taken as the i th span weight of the calling link; wherein the value of the first span weight and the value of the third span weight are both greater than the value of the second span weight.
[0106] In some embodiments, the first interval is a confidence interval determined based on a normal distribution function and a Bayesian function.
[0107] In some embodiments, the response time interval further includes a second interval, the lower threshold of the second interval being the same as the upper threshold of the first interval, and the weight determining unit 420 is specifically configured to: if the RT of the i th span is in the second interval, a first preset value is taken as the value of the third span weight; if the RT of the i th span is greater than the upper threshold of the second interval, a second preset value is taken as the value of the third span weight; wherein the first preset value is less than the second preset value.
[0108] In some embodiments, the second interval is an interval determined based on a confidence interval function and the first interval.
[0109] In some embodiments, the result generation unit 440 is specifically configured to: determine whether each of the N2 calling links has an error span; determine sampling weights corresponding to the N2 calling links respectively according to whether each of the N2 calling links has an error span; filter the N2 calling links according to the sampling weights corresponding to the N2 calling links respectively, to obtain N3 calling links from the N2 calling links; and generate the link tracking result of the calling path according to the N3 calling links; where N2≥N3≥1.
[0110] In some embodiments, the result generation unit 440 is specifically configured to: for one of the N2 calling links, obtain at least one span information in the calling link, the span information being used to represent information generated by two adjacent calling nodes in the calling link in a calling process; and determine whether there is an error span in at least one span of the calling link according to scheduling responses of each of the at least one span information.
[0111] In some embodiments, the result generation unit 440 is specifically configured to: determine whether each of the N1 calling links has an error span; and determine sampling weights corresponding to the N1 calling links respectively according to whether each of the N1 calling links has an error span.
[0112] In some embodiments, the weight determination unit 420 is specifically configured to: if the calling path exists in the calling path pool, determine that a path weight of the calling path is a first path weight; and if the calling path does not exist in the calling path pool, determine that the path weight of the calling path is a second path weight; where a value of the first path weight is less than a value of the second path weight.
[0113] In some embodiments, the weight determination unit 420 is further configured to: determine values of first path weights corresponding to each of the M same calling links according to time stamps of each of the M same calling links.
[0114] In some embodiments, the apparatus 400 further includes a path pool updating unit 450 configured to update the calling path pool according to calling information corresponding to the N1 calling links, the calling information including at least one span information of a corresponding calling link, the span information being used to represent information generated by two adjacent calling nodes in the calling link in a calling process.
[0115] It should be understood that the specific processes by which each unit performs the corresponding steps described above have been described in detail in the method embodiments described above, and thus will not be described again here for the sake of brevity.
[0116] It should also be understood that the obtaining unit 410, the weight determination unit 420, and the link filtering unit 430 described above can each be a processor, a central processing unit (CPU), or a combination thereof.Figure 2 The subunit in the first stream computing unit 220 in the apparatus 200 shown; the result generating unit 440 can be Figure 2 The console 250 in the apparatus 200 shown, or a subunit in the console 250; the path pool updating unit 450 can be Figure 2 The second stream computing unit 240 in the apparatus 200 shown, or a subunit in the second stream computing unit 240.
[0117] Figure 6 A structural schematic diagram of an electronic device is provided for an exemplary embodiment of the present application. The electronic device 500 can be an implementation of the link tracking apparatus in the method embodiments above. As Figure 6 shown, the electronic device 500 includes a memory 510 and a processor 520.
[0118] The memory 510 is configured to store computer programs and can be configured to store other various data to support operations on the cloud server. The memory 510 can be an object storage service (OSS).
[0119] The processor 520 is coupled to the memory 510 and is configured to execute the computer programs in the memory 510 to implement the method implemented by the application server or the relay server in the method embodiments above.
[0120] Further, as Figure 6 shown, when the electronic device is implemented as a cloud server, it further includes a firewall 530, a load balancer 540, a communication component 550, a power supply component 560, and other components. Figure 6 Only part of the components are shown schematically, and it does not mean that the server only includes Figure 6 the components shown.
[0121] It should be understood that Figure 6 The electronic device 500 shown can implement each process involving the application server or the relay server in the method embodiments above. The operations and / or functions of each module in the electronic device 500 are respectively to implement the corresponding processes in the method embodiments above. For details, refer to the description in the method embodiments above, and the detailed description is appropriately omitted here.
[0122] The present application also provides a processing apparatus including at least one processor configured to execute a computer program stored in a memory, so that the processing apparatus executes the method executed by the link tracking apparatus in the method embodiments above.
[0123] The embodiment of the present application further provides a processing device, comprising a processor and an input-output interface. The input-output interface is coupled with the processor. The input-output interface is used for inputting and / or outputting information. The information comprises at least one of instructions and data. The processor is used for executing a computer program, so that the processing device executes the method executed by the link tracking device in the method embodiment.
[0124] The embodiment of the present application further provides a processing device, comprising a processor and a memory. The memory is used for storing a computer program, and the processor is used for calling and running the computer program from the memory, so that the processing device executes the method executed by the link tracking device in the method embodiment.
[0125] It should be understood that the processing device described above can be one or more chips. For example, the processing device can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processor unit (CPU), can also be a network processor (NP), can also be a digital signal processor (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chip.
[0126] In the implementation process, each step of the above method can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The steps of the method disclosed in the embodiment of the present application can be directly embodied as hardware processor execution completion, or executed by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory, and combines the hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0127] It should be noted that the processor in the embodiments of the present application can be an integrated circuit chip with a signal processing capability. In the implementation process, the steps of the above method embodiments can be completed by an integrated logic circuit or an instruction in the form of software in the processor. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The disclosed methods, steps and logic block diagrams in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as a hardware code processor for execution, or a combination of hardware and software modules in the code processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, and other mature storage media in the art. The storage medium is located in the storage, and the processor reads the information in the storage, and combines the hardware to complete the steps of the above method.
[0128] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (read-only memory, ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (electrically EPROM, EEPROM) or a flash memory. The volatile memory can be a random access memory (random access memory, RAM) used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM). It should be noted that the memory of the system and method described herein is intended to include but not limited to these and any other suitable types of memory.
[0129] According to the method provided by the embodiment of the application, the application further provides a computer program product, which comprises computer program code, and when the computer program code runs on a computer, the computer is caused to execute the method performed by the link tracking device in the method embodiment.
[0130] According to the method provided by the embodiment of the application, the application further provides a computer readable storage medium, which stores program code, and when the program code runs on a computer, the computer is caused to execute the method performed by the link tracking device in the method embodiment.
[0131] The above is merely specific embodiments of the application, but the protection scope of the application is not limited to this. Any person skilled in the art can easily think of changes or replacements within the technical range disclosed by the application, which should be covered in the protection scope of the application. Therefore, the protection scope of the application should be subject to the protection scope of the claims.
Claims
1. A link tracing method, characterized in that, include: Obtain the call path to be traced, which is formed by the aggregation of M identical call chains; The path weight of the call path is determined based on whether the call path exists in the call path pool. The call path pool includes historical call paths formed during the historical link tracing process. Based on the path weight of the call path, the M identical call links are filtered to obtain N1 call links from the M identical call links; Based on the sampling weights corresponding to the N1 call links, a link tracing result for the call path is generated. The link tracing result is used to represent the call status of the call links in the call path. The sampling weights are determined based on at least one span information and a response time RT interval of the call link. The span information is used to characterize the information generated by two adjacent call nodes in the call link during the call process. The RT interval is determined based on the call information of historical call links on the call path. Where M≥N1≥1.
2. The method according to claim 1, characterized in that, The step of generating the link tracing result of the call path based on the sampling weights corresponding to the N1 call links includes: Determine the sampling weights corresponding to the N1 call chains respectively; Based on the sampling weights corresponding to the N1 call links, the N1 call links are filtered to obtain N2 call links from the N1 call links; Based on the N2 call links, generate the link tracing results of the call path; Where N1≥N2≥1.
3. The method according to claim 2, characterized in that, Determining the sampling weights corresponding to the N1 call chains includes: For one of the N1 call chains, obtain at least one span information in the call chain; Based on the at least one span information and the response time RT interval, at least one span weight of the call chain is determined respectively; The maximum value among the at least one span weight is used as the sampling weight of the call chain.
4. The method according to claim 3, characterized in that, The RT interval includes a first interval, and determining at least one span weight of the call link based on the at least one span information and the RT interval includes: Based on the i-th span information in the at least one span information, determine the RT of the i-th span of the call link; If the RT of the i-th span is less than the lower limit threshold of the first interval, then the weight of the i-th span of the call link is the weight of the first span; If the RT of the i-th span is in the first interval, then the weight of the i-th span of the call link is the weight of the second span; If the RT of the i-th span is greater than the upper limit threshold of the first interval, then the weight of the i-th span of the call link is the weight of the third span; The values of the first span weight and the third span weight are both greater than the value of the second span weight.
5. The method according to claim 4, characterized in that, The first interval is a reliable interval determined based on the normal distribution function and the Bayesian function.
6. The method according to claim 4 or 5, characterized in that, The RT interval also includes a second interval, the lower threshold of which is the same as the upper threshold of the first interval. If the RT of the i-th span is greater than the upper threshold of the first interval, then the weight of the i-th span of the call chain is a third span weight, including: If the RT of the i-th span is in the second interval, then the value of the third span weight is the first preset value; If the RT of the i-th span is greater than the upper limit threshold of the second interval, then the value of the weight of the third span is the second preset value; Wherein, the first preset value is less than the second preset value.
7. The method according to claim 6, characterized in that, The second interval is determined based on the confidence interval function and the first interval.
8. The method according to any one of claims 2 to 5, characterized in that, The step of generating the link tracing result of the call path based on the N2 call links includes: Determine whether there is an error span in each of the N2 call chains; Based on whether there is an error span in each of the N2 call links, the sampling weights corresponding to the N2 call links are determined respectively; Based on the sampling weights corresponding to the N2 call links respectively, the N2 call links are filtered to obtain N3 call links from the N2 call links; Based on the N3 call links, generate the link tracing results of the call paths; Where N2≥N3≥1.
9. The method according to claim 8, characterized in that, Determining whether each of the N2 call chains has an error span includes: For one of the N2 call chains, at least one span information in the call chain is obtained. The span information is used to characterize the information generated by two adjacent call nodes in the call chain during the call process. Based on the scheduling response of each span information in the at least one span information, determine whether there is an erroneous span in at least one span of the call link.
10. The method according to claim 2, characterized in that, Determining the sampling weights corresponding to the N1 call chains includes: Determine whether there is an error span in each of the N1 call chains; Based on whether there is an error span in each of the N1 call links, the sampling weights corresponding to the N1 call links are determined.
11. The method according to any one of claims 1 to 5, characterized in that, The step of determining the path weight of a call path based on whether the call path exists in the call path pool includes: If the call path exists in the call path pool, the path weight of the call path is determined as the first path weight; If the call path does not exist in the call path pool, the path weight of the call path is determined as the second path weight; The value of the first path weight is less than the value of the second path weight.
12. The method according to claim 11, characterized in that, The method further includes: Based on the timestamps of each of the M identical call chains, determine the values of the first path weights corresponding to the M identical call chains respectively.
13. The method according to any one of claims 1 to 5, characterized in that, The method further includes: The call path pool is updated based on the call information corresponding to the N1 call links respectively. The call information includes at least one span information of the corresponding call link. The span information is used to characterize the information generated by two adjacent call nodes in the call link during the call process.
14. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-13.
16. A computer program product, characterized in that, The computer program product stores computer instructions, which, when executed by a processor, implement the method as described in any one of claims 1-13.
Citation Information
Patent Citations
Micro-service monitoring method and device and computer storage medium
CN111459760A
Call link abnormity detection method, computer equipment and readable storage medium
CN113516174A