A fault locating method, device, equipment and readable storage medium

CN114579346BActive Publication Date: 2026-03-27BEIJING CHINA POWER INFORMATION TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-16
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

[0002]传统的微服务系统中,由于微服务之间的关系复杂、行为差异大,单个微服务发生故障,可能导致整个微服务系统崩溃,同时也带来了微服务软件系统的运维管理困难,因此,针对微服务系统的维护性和可靠性的需求,亟需一种准确的故障定位方法

Benefits of technology

[0039]由上述技术方案可以看出,本申请实施例提供的故障定位方法、装置、设备及可读存储介质,基于运行信息,对微服务进行聚类得到至少一个微服务群组,运行信息包括第一微服务和第二微服务的调用参数,第一微服务和第二微服务为任意两个微服务,微服务群组包括至少一个目标微服务。基于运行信息,获取目标微服务的至少一个特征的特征值。基于各个目标微服务的特征的特征值,获取微服务群组对应于特征的差异参数。若微服务群组对应于特征的差异参数超出预设的合理差异范围,将满足预设的故障条件的目标微服务作为故障微服务,故障条件包括特征的特征值超出特征对应的特征值范围。可见,本方案通过运行信息将微服务划分微服务群组,每一微服务群组内的微服务属于同一聚类,由于差异参数用于指示各个目标微服务的特征的差异程度,因此,若微服务群组对应于特征的差异参数超出合理差异范围,表示微服务群组中的微服务在该特征维度的运行异常,进一步通过该特征对应的特征值范围定位微服务群组中该特征的特征值异常的微服务,得到的故障定位结果准确性高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579346B_ABST
    Figure CN114579346B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a fault positioning method, device and equipment and readable storage medium, based on running information, at least one micro-service group is obtained by clustering micro-services, and a feature value of at least one feature of a target micro-service is obtained. Based on the feature value of the feature of each target micro-service, the difference parameter corresponding to the feature of the micro-service group is obtained. If the difference parameter corresponding to the feature of the micro-service group exceeds the preset reasonable difference range, the target micro-service meeting the preset fault condition is taken as a fault micro-service, and the fault condition includes that the feature value of the feature exceeds the feature value range corresponding to the feature. Obviously. If the difference parameter corresponding to the feature of the micro-service group exceeds the reasonable difference range, it indicates that the micro-services in the micro-service group are abnormally running in the feature dimension, and the micro-service with the feature value anomaly in the feature in the micro-service group is further positioned through the feature value range corresponding to the feature, and the obtained fault positioning result is high in accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular to a fault positioning method and device, equipment and a readable storage medium. BACKGROUND

[0002] In a traditional micro-service system, due to the complex relationship between micro-services and the large difference in behavior, a single micro-service failure may cause the entire micro-service system to crash, and also brings difficulties in the operation and maintenance management of the micro-service software system. Therefore, in view of the maintenance and reliability requirements of the micro-service system, an accurate fault positioning method is urgently needed. SUMMARY

[0003] The present application provides a fault positioning method, device, equipment and readable storage medium, as follows:

[0004] A fault positioning method comprises:

[0005] Clustering micro-services based on running information to obtain at least one micro-service group, the running information comprising calling parameters of a first micro-service and a second micro-service, the first micro-service and the second micro-service being any two micro-services, and the micro-service group comprising at least one target micro-service;

[0006] Based on the running information, obtaining a feature value of at least one feature of the target micro-service;

[0007] Based on the feature value of the feature of each target micro-service, obtaining a difference parameter corresponding to the feature of the micro-service group, the difference parameter being used to indicate the difference degree of the feature of each target micro-service;

[0008] If the difference parameter corresponding to the feature of the micro-service group exceeds a pre-set reasonable difference range, a target micro-service meeting a pre-set fault condition is taken as a fault micro-service, the fault condition comprising that the feature value of the feature exceeds a feature value range corresponding to the feature.

[0009] Optionally, clustering micro-services based on running information to obtain at least one micro-service group comprises:

[0010] Based on the running information, obtaining a calling relationship and an association degree between the first micro-service and the second micro-service;

[0011] Based on the calling relationship and the association degree of each two micro-services, generating a relationship graph;

[0012] The relationship graph includes microservice nodes and edges, a direction of a target edge indicates a calling relationship of two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with an association degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge.

[0013] The relationship graph is subjected to graph clustering to obtain a graph clustering result, and the graph clustering result includes at least one microservice node cluster.

[0014] Each microservice node cluster is divided into a microservice group.

[0015] Optionally, the relationship graph is subjected to graph clustering to obtain a graph clustering result, and the graph clustering includes:

[0016] The relationship graph is subjected to graph clustering by taking direct reachability and a number of shared neighbor nodes as clustering indexes to obtain the graph clustering result.

[0017] Optionally, based on the running information, a feature value of at least one feature of the target microservice is obtained, and the obtaining includes:

[0018] According to a calling parameter of the target microservice calling other microservices, a feature value of the target microservice corresponding to each calling parameter is obtained.

[0019] Feature values of the target microservice corresponding to a same calling parameter are normalized to obtain the feature value of the feature.

[0020] Optionally, based on the feature value of the feature of each target microservice, a difference parameter of the microservice group corresponding to the feature is obtained, and the obtaining includes:

[0021] A difference value of the feature value of each two target microservices is calculated.

[0022] An average value of the difference value of the feature value of each feature is obtained as the difference parameter of the microservice group corresponding to the feature.

[0023] Optionally, the calling parameter includes an operation name, a start time, an end time, a calling link identifier, a calling process identifier, a reference relationship, a response time, a request volume, a log size, a queue depth, a thread number, a calling frequency, and an access volume.

[0024] Optionally, based on the running information, a calling relationship and an association degree between the first microservice and the second microservice are obtained, and the obtaining includes

[0025] According to a time window length and a time window step of a preset sliding time window, an update time of the sliding time window is obtained.

[0026] in response to reaching the update time, obtaining running information in a target time period, the target time period being a time period before the update time and having a time length equal to the time window length;

[0027] based on the running information in the target time period, obtaining a calling relationship and a correlation degree between the first microservice and the second microservice;

[0028] after the relationship graph is generated based on the calling relationship and the correlation degree between each two microservices, the method further includes:

[0029] displaying the relationship graph in the sliding time window.

[0030] A fault locating apparatus includes:

[0031] a group obtaining unit configured to cluster microservices based on running information to obtain at least one microservice group, the running information including calling parameters of a first microservice and a second microservice, the first microservice and the second microservice being any two microservices, and the microservice group including at least one target microservice;

[0032] a feature obtaining unit configured to obtain a feature value of at least one feature of the target microservice based on the running information;

[0033] a difference obtaining unit configured to obtain a difference parameter corresponding to the feature for the microservice group based on the feature value of the feature of each target microservice, the difference parameter being used to indicate a difference degree of the feature of each target microservice;

[0034] a fault determining unit configured to, if the difference parameter corresponding to the feature for the microservice group exceeds a preset reasonable difference range, take a target microservice satisfying a preset fault condition as a fault microservice, the fault condition including that the feature value of the feature exceeds a feature value range corresponding to the feature.

[0035] A fault locating device includes a memory and a processor.

[0036] The memory is configured to store a program.

[0037] The processor is configured to execute the program to implement each step of a fault locating method.

[0038] A readable storage medium has a computer program stored thereon, the computer program being executed by a processor to implement each step of a fault locating method.

[0039] It can be seen from the technical solution that the fault positioning method, device, equipment and readable storage medium provided by the embodiment of the application are based on running information, at least one microservice group is obtained by clustering microservices, the running information includes the calling parameters of the first microservice and the second microservice, the first microservice and the second microservice are any two microservices, and the microservice group includes at least one target microservice. Based on the running information, the feature value of at least one feature of the target microservice is obtained. Based on the feature value of the feature of each target microservice, the difference parameter corresponding to the feature of the microservice group is obtained. If the difference parameter corresponding to the feature of the microservice group exceeds the preset reasonable difference range, the target microservice that meets the preset fault condition is taken as a fault microservice, and the fault condition includes that the feature value of the feature exceeds the feature value range corresponding to the feature. It can be seen that the microservices are divided into microservice groups by the running information in the present solution, and the microservices in each microservice group belong to the same cluster. Since the difference parameter is used to indicate the difference degree of the feature of each target microservice, if the difference parameter corresponding to the feature of the microservice group exceeds the reasonable difference range, it indicates that the microservices in the microservice group are abnormal in the running of the feature dimension, and the microservice with the abnormal feature value of the feature in the microservice group is further located by the feature value range corresponding to the feature, so that the fault positioning result is accurate. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0041] Figure 1 A flowchart of a specific implementation of a fault positioning method provided by the embodiment of the present application is shown in the figure.

[0042] Figure 2 A structure diagram of a relationship graph provided by the embodiment of the present application is shown in the figure.

[0043] Figure 3 A flowchart of a sliding time window provided by the embodiment of the present application is shown in the figure.

[0044] Figure 4 A flowchart of a fault positioning method provided by the embodiment of the present application is shown in the figure.

[0045] Figure 5 A structure diagram of a fault positioning device provided by the embodiment of the present application is shown in the figure.

[0046] Figure 6 A structure diagram of a fault positioning device provided by the embodiment of the present application is shown in the figure. Detailed Implementation

[0047] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0048] This application provides a fault location method that is applied to, but not limited to, monitoring multiple microservices in a microservice system to locate the faulty microservice. It should be noted that this fault location method is applicable to electronic devices (e.g., smartphones, iPads, or computers), servers, or server clusters.

[0049] Figure 1 The specific implementation flow of the fault location method provided in the embodiments of this application is as follows: Figure 1 As shown, this method includes:

[0050] S101. Based on the preset time window length and time window step size of the sliding time window, obtain the update time of the sliding time window.

[0051] It should be noted that the sliding time window (or simply time window) is a pre-established, highly real-time data model used to dynamically display data mining results. Under certain conditions, the time window can discard historical data, meaning it only uses data from the period most recent to the current time for data mining.

[0052] In this embodiment, the update time of the sliding time window is obtained based on the preset time window length and time window step size. When the update time is reached, the detection time for fault location is determined.

[0053] Figure 2 This is a schematic diagram of a time window mechanism. For example, the preset time window length is w, the time lengths of time windows w1, w2, and w3 are all w, and the time window sliding step size is t. Then, from the initial time, an update time is reached every time interval t, as shown in the figure, the update times are t1, t2, t3, t4, and t5 respectively.

[0054] S102. In response to the arrival of the update time, obtain the running information within the target time period.

[0055] In this embodiment, the target time period is the time period preceding the update time, with a length equal to the time window length. For example... Figure 2The target time period is a time period before the update time t3 and has a time length equal to w, that is, the time range of the time window w1.

[0056] In this embodiment, the pre-configured agent tool is used to monitor the microservices in the microservice system, and real-time running information of the microservices is acquired. The running information in the target time period includes calling parameters of the first microservice and the second microservice in the target time period.

[0057] Specifically, the calling parameters include an operation name, a start time, an end time, a calling link identifier, a calling process identifier, a reference relationship, a response time, a request volume, a log size, a queue depth, a thread number, a calling frequency, and a visit volume. It can be understood that the calling parameters indicate the closeness of the association between the two microservices from different dimensions, that is, the correlation degree of the two microservices.

[0058] Specifically, the operation name is the name of a system page operation. For example, in a user management module, clicking the "query" button is a normal query operation of the user management module, and in addition, there are login operations, query user statistical value operations, and the like.

[0059] The start time and the end time respectively indicate the start time and the end time when the first microservice calls the second microservice.

[0060] The calling link identifier (trace id) is used to indicate a path formed by a microservice request passing through all called microservices. For example, a microservice request passes through three microservices in sequence, that is, microservice A, microservice B, and microservice C. An identifier indicating the path ABC is the calling link identifier of the microservice request.

[0061] The calling process identifier (span id) is used to indicate the order of microservice requests from small to large and is passed to the next microservice call for use.

[0062] The queue depth represents the depth of a calling queue. For example, the calling queue has a first layer A, a second layer B and C, and a third layer D. The queue depth is 3.

[0063] The thread number represents the number of threads occupied by the microservice when the microservice runs in the system.

[0064] The service calling frequency represents the calling frequency of the first microservice to the second microservice.

[0065] The visit volume represents the visit frequency of the second microservice to the first microservice.

[0066] It should be noted that the specific method of monitoring the microservice system and acquiring the calling information in real time can refer to the prior art.

[0067] S103, acquire the calling relationship and the correlation degree between the first microservice and the second microservice based on the running information.

[0068] In this embodiment, the first microservice and the second microservice are any two microservices. Optionally, the calling relationship between the first microservice and the second microservice is acquired according to the calling link identifier.

[0069] The correlation degree between the first microservice and the second microservice is determined according to each calling parameter. For example, the calling times of the first microservice to the second microservice. If the calling times are greater than a first threshold (for example, 3 times), it is considered that the closeness between the two microservices is high, that is, the correlation degree is high.

[0070] S104, generate a relationship graph based on the calling relationship and the correlation degree between each two microservices.

[0071] In this embodiment, the relationship graph includes microservice nodes and edges. The direction of a target edge indicates the calling relationship between the two microservice nodes connected by the target edge. The weight of the target edge is positively correlated with the correlation degree between the two microservices corresponding to the two microservice nodes connected by the target edge. The target edge is any edge.

[0072] As shown in Figure 3 An example of a structural diagram of a relationship graph is shown in Figure 3 As shown, the relationship graph includes microservice nodes 0-12. Taking the edge connecting the microservice node 5 and the microservice node 6 as an example, the direction of the edge is from the microservice node 5 to the microservice node 6 (not shown in the figure), indicating that the calling relationship between the microservice node 5 and the microservice node 6 is that the microservice node 5 (corresponding microservice) calls the microservice node 6 (corresponding microservice). The weight of the edge is determined by the correlation degree when the microservice node (corresponding microservice) calls the microservice node 6. The closer the correlation degree, the greater the weight.

[0073] S105, perform graph clustering on the relationship graph by taking the direct reachability between the microservice nodes and the number of shared neighbor nodes as clustering indicators to obtain a graph clustering result.

[0074] In this embodiment, the direct reachability between the microservice nodes indicates whether the microservice nodes have edges. For example, the microservice node 5 and the microservice node 6 have direct reachability. The shared neighbor node indicates a node that has edges with multiple microservice nodes. For example, the microservice node 0 and the microservice node 5 have 4 shared neighbor nodes, including the microservice node 0, the microservice node 1, the microservice node 4, and the microservice node 5.

[0075] It can be understood that the direct reachability between the microservice nodes and the number of shared neighbor nodes can indicate the closeness between different microservices.

[0076] In this embodiment, the graph clustering result includes at least one microservice node cluster. It should be noted that the specific clustering algorithm can be the SCAN algorithm. For the implementation process of the specific graph clustering algorithm, refer to the prior art.

[0077] It should be noted that when the SCAN algorithm considers the relationship between the microservice nodes within the time window, not only the direct reachability between the microservice nodes within the time window is considered, but also the shared neighbor nodes of the microservice nodes are used as the clustering standard. As long as the microservice nodes within the time window have common neighbors (i.e., shared neighbor nodes), the microservice nodes can be clustered through the common neighbors. Therefore, the more common neighbors between any two microservice nodes, the more likely the two microservice nodes are clustered together, and the more closely the microservice group is.

[0078] It should be noted that the method can also obtain the microservice bridge node and the microservice outlier point by using the SCAN algorithm. The purpose is to narrow down the scope of investigation.

[0079] S106, divide each microservice node cluster into a microservice group.

[0080] In this embodiment, the microservice group includes a plurality of target microservices.

[0081] Since the microservice node cluster is obtained through graph clustering, the relationship between the nodes belonging to the same microservice node cluster is close, that is, the association relationship between the plurality of target microservices included in the microservice group is high in closeness.

[0082] S107, according to the calling parameters of the target microservice calling other microservices, obtain the feature value of the target microservice corresponding to each feature.

[0083] In this embodiment, the feature is the feature indicated by the calling parameter, and the number of features is determined by the number of calling parameters. For example, the features include response time, request volume, log size, queue depth, thread number, calling frequency, and access volume. The feature value of the response time as the feature is determined according to at least one response time in the calling parameters of the target microservice calling other microservices.

[0084] For example, the feature value of the response time of the target microservice is the average value or the maximum value of each response time in the calling parameters of the target microservice. The method executes S108-S111 for the feature value of each feature, that is, determines whether the microservice has a fault according to the feature point.

[0085] S108, normalize the feature value of each target microservice corresponding to the target feature to obtain the normalization result of the target microservice corresponding to the feature.

[0086] In this embodiment, the target feature is any one feature, and the response time of the target feature is taken as an example to normalize the feature values of the response time of each target microservice to obtain the normalized result of the response time of each target microservice. Specifically, the microservice group M includes target microservice 1 to target microservice n, and the feature values of the response time are t1 to tn, respectively. The maximum and minimum normalization algorithm is used to normalize t1 to tn to obtain ψ1 to ψn. 10 .

[0087] It should be noted that the feature values corresponding to one feature of different target microservices are normalized by the maximum and minimum normalization algorithm, so that the data format is standardized and the accuracy of the feature difference value calculation is improved. For specific normalization methods, refer to the prior art.

[0088] S109, calculating the difference value of the normalized result of the target feature of each two target microservices.

[0089] It should be noted that there are various methods for obtaining the difference value between the values. Taking target microservice i and target microservice j in the microservice group M as an example, the normalized results of the target feature ψ of the target microservice i and the target microservice j are ψi and ψj, respectively. i and ψ j An optional difference value calculation method is shown in the following formula (1):

[0090]

[0091] Wherein, E(i,j) represents the difference value of ψ i and ψ j .

[0092] S110, obtaining the average value of a plurality of difference values corresponding to the target feature as the difference parameter of the microservice group corresponding to the target feature.

[0093] In this embodiment, the difference parameter is used to indicate the difference degree of the target feature of each target microservice.

[0094] Continuing the above example, an optional difference parameter calculation method is shown in the following formula (2):

[0095]

[0096] Wherein, S(M, ψ) represents the difference parameter of the microservice group M with respect to the target feature ψ, and i, j ∈ M represents that the target microservice i and the target microservice j belong to the microservice group M.

[0097] S111, if the difference parameter of the microservice group corresponding to the target feature exceeds the preset reasonable difference range, the target microservice satisfying the preset fault condition is taken as a fault microservice.

[0098] In this embodiment, the fault condition includes that the feature value of the target feature exceeds the feature value range corresponding to the target feature.

[0099] Specifically, when the difference parameter corresponding to the target feature exceeds the preset reasonable difference range, the target microservice is sorted according to the target feature (for example, sorted from large to small), and whether the target microservice exceeds the feature value range corresponding to the feature is determined according to the sequence (for example, the sequence is from small to large).

[0100] Taking the response time as an example, the normalized result of the response time of each target microservice belongs to [0, 1], so by presetting the feature value range [0, 0.5] corresponding to the response time, it is determined whether the normalized result of the response time of the target microservice exceeds [0, 0.5], that is, whether it is greater than 0.5, if it is greater than 0.5, the target microservice is regarded as a fault microservice.

[0101] It can be understood that sorting first and then troubleshooting the fault microservice can improve the troubleshooting efficiency, and the specific sorting method is determined according to the feature value range.

[0102] As can be seen from the above technical solution, the present scheme divides the microservices into microservice groups through the running information, and the microservices in each microservice group belong to the same cluster. Since the difference parameter is used to indicate the difference degree of the features of each target microservice, if the difference parameter corresponding to the feature of the microservice group exceeds the reasonable difference range, it indicates that the microservices in the microservice group are running abnormally in the feature dimension. Further, the feature value abnormal microservice in the microservice group is located through the feature value range corresponding to the feature, and the obtained fault location result has high accuracy.

[0103] Further, the calling relationship and the association degree between the microservices are determined through the running information, a relationship graph is constructed, the complex relationship between the microservices is represented using the relationship graph, the troubleshooting efficiency of the fault point is improved, and the accuracy of dividing the microservice groups based on the graph clustering is high.

[0104] In summary, the technical problem to be solved by the present application is that, in view of the maintenance and reliability requirements of the microservice software system, in the traditional microservice software system, the relationship between the microservices is complex, the behavior difference is large, the probability of microservice failure is high, it is not easy to troubleshoot the problem point, and the failure of the microservice component may cause the entire microservice software system to crash, which also brings difficulties in the operation and maintenance management of the microservice software system. By using the present scheme, the fault microservice and the fault feature can be timely troubleshooted, thereby improving the availability, improving the resource use efficiency, and improving the accuracy of fault location.

[0105] Figure 1As an optional specific implementation method of the fault locating method provided in the application, the application further includes other specific implementation methods. For example, the method further includes dynamically displaying a relationship diagram in a time window. Specifically, after each generation of the relationship diagram, the relationship diagram is visualized in the time window, thereby achieving dynamic display of the relationship diagram, and each displayed relationship diagram is based on running data in the time window, and discards running data with a long interval, achieving strong real-time performance and high efficiency of data processing. The time window is slid, so that the microservice data in the time window constantly changes, thereby changing the microservice diagram from static to dynamic.

[0106] For another example, specific algorithms of graph clustering include a plurality of algorithms, in addition to the SCAN algorithm mentioned in the embodiment, other graph clustering algorithms can also be applied, and specific algorithms can be referred to in the prior art. For another example, the number and type of the calling parameters are preset according to actual application, and the calling parameters are parameters indicating the closeness between microservices in different dimensions.

[0107] For another example, the method further includes locating the position of the faulty microservice in the system based on the Span id and the operation name.

[0108] In summary, the fault locating method provided in the application is summarized as Figure 4 As shown in the flowchart, the method includes Figure 4 As shown in the flowchart, the method includes

[0109] S401, based on the running information, clustering the microservices to obtain at least one microservice group.

[0110] In the embodiment, the running information includes calling parameters of the first microservice and the second microservice, the first microservice and the second microservice are any two microservices, and the microservice group includes at least one target microservice. The target microservices belonging to the same microservice group have a calling relationship and a large correlation degree. It should be noted that different calling parameters indicate different dimensions of the correlation degree between microservices. The correlation degree includes the calling relationship and the correlation degree.

[0111] An optional clustering method is described in the above embodiment. It should be noted that in addition to the graph clustering-based clustering method provided in the above embodiment, the microservice group can also be obtained through data clustering, and specific algorithms can be referred to in the prior art, and the embodiment will not be described herein.

[0112] S402, based on the running information, obtaining a feature value of at least one feature of the target microservice.

[0113] In the embodiment, the features include features indicated by the calling parameters and used to indicate the correlation degree between microservices, for example, response time, log quantity, request frequency, and the like.

[0114] S403, obtain a difference parameter corresponding to the feature of the microservice group based on the feature values of the features of the respective target microservices.

[0115] In this embodiment, the difference parameter is used to indicate the difference degree of the features of the respective target microservices.

[0116] S404, if the difference parameter corresponding to the feature of the microservice group exceeds a preset reasonable difference range, a target microservice satisfying a preset fault condition is taken as a fault microservice.

[0117] In this embodiment, the fault condition includes that the feature value of the feature exceeds the feature value range corresponding to the feature.

[0118] As can be seen from the above technical solution, the fault positioning method provided in the embodiments of the present application is based on running information, and at least one microservice group is obtained by clustering microservices. The running information includes the calling parameters of the first microservice and the second microservice, the first microservice and the second microservice are any two microservices, and the microservice group includes at least one target microservice. Based on the running information, the feature values of at least one feature of the target microservice are obtained. Based on the feature values of the features of the respective target microservices, the difference parameter corresponding to the feature of the microservice group is obtained. If the difference parameter corresponding to the feature of the microservice group exceeds a preset reasonable difference range, a target microservice satisfying a preset fault condition is taken as a fault microservice, and the fault condition includes that the feature value of the feature exceeds the feature value range corresponding to the feature. As can be seen, the present scheme divides microservices into microservice groups through running information, and the microservices in each microservice group belong to the same cluster. Since the difference parameter is used to indicate the difference degree of the features of the respective target microservices, if the difference parameter corresponding to the feature of the microservice group exceeds the reasonable difference range, it indicates that the microservices in the microservice group are running abnormally in the feature dimension. Further, the microservice with the abnormal feature value of the feature in the microservice group is located through the feature value range corresponding to the feature, and the fault positioning result obtained has high accuracy.

[0119] Figure 5 A structure schematic diagram of a fault positioning device provided in the embodiments of the present application is shown, as shown in FIG. 5, the device can include: Figure 5

[0120] The group obtaining unit 501 is configured to cluster microservices based on running information to obtain at least one microservice group, the running information includes the calling parameters of the first microservice and the second microservice, the first microservice and the second microservice are any two microservices, and the microservice group includes at least one target microservice.

[0121] The feature obtaining unit 502 is configured to obtain the feature values of at least one feature of the target microservice based on the running information. ​

[0122] The difference obtaining unit 503 is configured to obtain a difference parameter corresponding to the feature of the microservice group based on the feature value of the feature of each target microservice, where the difference parameter is used to indicate a difference degree of the feature of each target microservice.

[0123] The fault determining unit 504 is configured to, if the difference parameter corresponding to the feature of the microservice group exceeds a preset reasonable difference range, regard a target microservice satisfying a preset fault condition as a fault microservice, where the fault condition includes that the feature value of the feature exceeds a feature value range corresponding to the feature.

[0124] Optionally, the group obtaining unit is configured to cluster the microservices based on the running information to obtain at least one microservice group, including that the group obtaining unit is specifically configured to:

[0125] obtain a calling relationship and an association degree between the first microservice and the second microservice based on the running information;

[0126] generate a relationship graph based on the calling relationship and the association degree between each two microservices;

[0127] The relationship graph includes microservice nodes and edges, a direction of a target edge indicates a calling relationship between two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with an association degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge.

[0128] perform graph clustering on the relationship graph to obtain a graph clustering result, where the graph clustering result includes at least one microservice node cluster;

[0129] divide microservices corresponding to each microservice node cluster into a microservice group.

[0130] Optionally, the group obtaining unit is configured to perform graph clustering on the relationship graph to obtain a graph clustering result, including that the group obtaining unit is specifically configured to:

[0131] perform graph clustering on the relationship graph by taking direct reachability between the microservice nodes and a number of shared neighbor nodes as clustering indexes to obtain the graph clustering result.

[0132] Optionally, the feature obtaining unit is configured to obtain a feature value of at least one feature of the target microservice based on the running information, including that the feature obtaining unit is specifically configured to:

[0133] obtain the feature value of the target microservice corresponding to each calling parameter according to a calling parameter of the target microservice calling other microservices;

[0134] normalize the feature values of the targets microservices corresponding to the same call parameter to obtain the feature values of the features.

[0135] Optionally, the difference obtaining unit is configured to obtain the difference parameter of the microservice group corresponding to the feature based on the feature values of the targets microservices, including that the difference obtaining unit is specifically configured to:

[0136] calculate the difference value of the feature values of the features of each two targets microservices;

[0137] obtain the average value of the difference values of the feature values of each feature as the difference parameter of the microservice group corresponding to the feature.

[0138] Optionally, the call parameter includes operation name, start time, end time, call link identifier, call process identifier, reference relationship, response time, request volume, log size, queue depth, thread number, call frequency, access volume.

[0139] Optionally, the group obtaining unit is configured to obtain the call relationship and the correlation degree between the first microservice and the second microservice based on the running information, including that the group obtaining unit is specifically configured to:

[0140] obtain the update time of the sliding time window according to a time window length and a time window step of a preset sliding time window;

[0141] obtain the running information in a target time period in response to reaching the update time, the target time period being a time period before the update time and having a time length equal to the time window length;

[0142] obtain the call relationship and the correlation degree between the first microservice and the second microservice based on the running information in the target time period;

[0143] The device further includes a visualization unit configured to display the relationship graph in the sliding time window after generating the relationship graph based on the call relationship and the correlation degree between each two microservices.

[0144] Figure 6 A structural diagram of the fault locating device is shown, which can include at least one processor 601, at least one communication interface 602, at least one memory 603 and at least one communication bus 604;

[0145] In the embodiments of the present application, the number of the processor 601, the communication interface 602, the memory 603 and the communication bus 604 is at least one, and the processor 601, the communication interface 602 and the memory 603 complete the communication among each other through the communication bus 604;

[0146] The processor 601 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the present application.

[0147] The memory 603 can include a high-speed RAM memory, and can also include a non-volatile memory such as at least one disk memory.

[0148] The memory stores a program, and the processor can execute the program stored in the memory to implement each step of the fault locating method provided by the embodiments of the present application, as follows:

[0149] A fault locating method comprises:

[0150] Based on the running information, the microservices are clustered to obtain at least one microservice group, the running information including calling parameters of a first microservice and a second microservice, the first microservice and the second microservice being any two microservices, and the microservice group including at least one target microservice;

[0151] Based on the running information, a feature value of at least one feature of the target microservice is obtained;

[0152] Based on the feature value of the feature of each target microservice, a difference parameter corresponding to the feature of the microservice group is obtained, the difference parameter being used to indicate a difference degree of the feature of each target microservice;

[0153] If the difference parameter corresponding to the feature of the microservice group is beyond a preset reasonable difference range, a target microservice satisfying a preset fault condition is taken as a fault microservice, the fault condition including that the feature value of the feature is beyond a feature value range corresponding to the feature.

[0154] Optionally, based on the running information, the microservices are clustered to obtain at least one microservice group, comprising:

[0155] Based on the running information, a calling relationship and an association degree between the first microservice and the second microservice are obtained;

[0156] Based on the calling relationship and the association degree of each two microservices, a relationship diagram is generated;

[0157] The relationship graph includes microservice nodes and edges, a direction of a target edge indicates a calling relationship of two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with an association degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge.

[0158] The relationship graph is subjected to graph clustering to obtain a graph clustering result, and the graph clustering result includes at least one microservice node cluster.

[0159] Each microservice corresponding to the microservice node cluster is divided into a microservice group.

[0160] Optionally, the relationship graph is subjected to graph clustering to obtain a graph clustering result, including:

[0161] The relationship graph is subjected to graph clustering by taking direct reachability and a number of shared neighbor nodes as clustering indexes to obtain the graph clustering result.

[0162] Optionally, based on the running information, a feature value of at least one feature of the target microservice is obtained, including:

[0163] According to a calling parameter of the target microservice calling other microservices, a feature value of the target microservice corresponding to each calling parameter is obtained.

[0164] Feature values of the target microservice corresponding to a same calling parameter are normalized to obtain the feature value of the feature.

[0165] Optionally, based on the feature value of the feature of each target microservice, a difference parameter corresponding to the feature of the microservice group is obtained, including:

[0166] A difference value of the feature value of each two target microservices is calculated.

[0167] An average value of the difference value of the feature value of each feature is obtained as the difference parameter corresponding to the feature of the microservice group.

[0168] Optionally, the calling parameter includes an operation name, a start time, an end time, a calling link identifier, a calling process identifier, a reference relationship, a response time, a request volume, a log size, a queue depth, a thread number, a calling frequency, and an access volume.

[0169] Optionally, based on the running information, a calling relationship and an association degree between the first microservice and the second microservice are obtained, including

[0170] According to a time window length and a time window step of a preset sliding time window, an update time of the sliding time window is obtained.

[0171] in response to reaching the update time, obtaining running information in a target time period, the target time period being a time period before the update time and having a time length equal to the time window length;

[0172] obtaining a calling relationship and a correlation degree between the first microservice and the second microservice based on the running information in the target time period;

[0173] After the relationship graph is generated based on the calling relationship and the correlation degree between each two microservices, the method further includes:

[0174] displaying the relationship graph in the sliding time window.

[0175] The application also provides a readable storage medium, which can store a computer program suitable for processor execution, and when the computer program is executed by the processor, each step of a fault locating method provided by the application is implemented, as follows:

[0176] A fault locating method includes:

[0177] based on running information, clustering microservices to obtain at least one microservice group, the running information including calling parameters of a first microservice and a second microservice, the first microservice and the second microservice being any two microservices, and the microservice group including at least one target microservice;

[0178] based on the running information, obtaining a feature value of at least one feature of the target microservice;

[0179] based on the feature value of the feature of each target microservice, obtaining a difference parameter corresponding to the feature of the microservice group, the difference parameter being used to indicate a difference degree of the feature of each target microservice;

[0180] if the difference parameter corresponding to the feature of the microservice group exceeds a preset reasonable difference range, a target microservice meeting a preset fault condition is taken as a fault microservice, the fault condition including that the feature value of the feature exceeds a feature value range corresponding to the feature.

[0181] Optionally, based on running information, clustering microservices to obtain at least one microservice group includes:

[0182] obtaining a calling relationship and a correlation degree between the first microservice and the second microservice based on the running information;

[0183] generating a relationship graph based on the calling relationship and the correlation degree between each two microservices;

[0184] The relationship graph includes microservice nodes and edges, a direction of a target edge indicates a calling relationship of two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with an association degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge.

[0185] The relationship graph is subjected to graph clustering to obtain a graph clustering result, and the graph clustering result includes at least one microservice node cluster.

[0186] Each microservice corresponding to the microservice node cluster is divided into a microservice group.

[0187] Optionally, the relationship graph is subjected to graph clustering to obtain a graph clustering result, including:

[0188] The relationship graph is subjected to graph clustering by taking direct reachability and a number of shared neighbor nodes as clustering indexes to obtain the graph clustering result.

[0189] Optionally, based on the running information, a feature value of at least one feature of the target microservice is obtained, including:

[0190] According to a calling parameter of the target microservice calling other microservices, a feature value of the target microservice corresponding to each calling parameter is obtained.

[0191] Feature values of the target microservice corresponding to a same calling parameter are normalized to obtain the feature value of the feature.

[0192] Optionally, based on the feature value of the feature of each target microservice, a difference parameter corresponding to the feature of the microservice group is obtained, including:

[0193] A difference value of the feature value of the feature of each two target microservices is calculated.

[0194] An average value of the difference value of the feature value of each feature is obtained as the difference parameter corresponding to the feature of the microservice group.

[0195] Optionally, the calling parameter includes an operation name, a start time, an end time, a calling link identifier, a calling process identifier, a reference relationship, a response time, a request volume, a log size, a queue depth, a thread number, a calling frequency, and an access volume.

[0196] Optionally, based on the running information, a calling relationship and an association degree between the first microservice and the second microservice are obtained, including

[0197] According to a time window length and a time window step of a preset sliding time window, an update time of the sliding time window is obtained.

[0198] In response to reaching the update time, running information in a target time period is acquired, the target time period being a time period before the update time and having a time length equal to the time window length;

[0199] Based on the running information in the target time period, a calling relationship and a correlation degree between the first microservice and the second microservice are acquired;

[0200] After the relationship graph is generated based on the calling relationship and the correlation degree between each two microservices, the method further includes:

[0201] The relationship graph is displayed in the sliding time window.

[0202] Finally, it should be noted that in this document, relational terms such as first and second and the like can only be used to distinguish one entity or action from another entity or action, without necessarily requiring or implying any such actual relationship or order between or among the entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.

[0203] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0204] The above description of disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A fault location method characterized by, The method comprises: obtaining a calling relationship and a correlation degree between a first microservice and a second microservice based on running information; generating a relationship graph based on the calling relationship and the correlation degree between each two microservices, wherein the relationship graph comprises microservice nodes and edges, a direction of a target edge indicates a calling relationship of two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with a correlation degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge; performing graph clustering on the relationship graph by taking direct reachability between the microservice nodes and a number of shared neighbor nodes as clustering indicators to obtain a graph clustering result, wherein the graph clustering result comprises at least one microservice node cluster; dividing microservices corresponding to each microservice node cluster into a microservice group; the running information comprises calling parameters of the first microservice and the second microservice, the first microservice and the second microservice are any two microservices, and the microservice group comprises at least one target microservice; obtaining a feature value of at least one feature of the target microservice based on the running information; obtaining a difference parameter corresponding to the feature of the microservice group based on the feature value of the feature of each target microservice, wherein the difference parameter is used to indicate a difference degree of the feature of each target microservice; if the difference parameter corresponding to the feature of the microservice group is out of a preset reasonable difference range, a target microservice satisfying a preset fault condition is taken as a fault microservice, and the fault condition comprises that the feature value of the feature is out of a feature value range corresponding to the feature.

2. The method of claim 1, wherein, The method of obtaining the feature value of the at least one feature of the target microservice based on the running information comprises: obtaining a feature value corresponding to each calling parameter of the target microservice according to a calling parameter of the target microservice calling other microservices; normalizing the feature values corresponding to the same calling parameter of each target microservice to obtain the feature value of the feature.

3. The method of claim 2, wherein, The method of obtaining the difference parameter corresponding to the feature of the microservice group based on the feature value of the feature of each target microservice comprises: calculating a difference value of the feature value of the feature of each two target microservices; obtaining an average value of the difference value of the feature value of each feature as the difference parameter corresponding to the feature of the microservice group.

4. The method of claim 1, wherein, The calling parameter comprises an operation name, a start time, an end time, a calling link identifier, a calling process identifier, a reference relationship, a response time, a request amount, a log size, a queue depth, a thread number, a calling frequency, and an access amount.

5. The method of claim 1, wherein, The method of obtaining the calling relationship and the correlation degree between the first microservice and the second microservice based on the running information comprises obtaining an update time of a preset sliding time window based on a time window length and a time window step of the sliding time window; in response to reaching the update time, obtaining running information in a target time period, wherein the target time period is a time period before the update time and having a time length equal to the time window length; obtain the calling relationship and the correlation degree between the first microservice and the second microservice based on the running information in the target time period; after generating the relationship graph based on the calling relationship and the correlation degree between each two microservices, the method further includes: display the relationship graph in the sliding time window.

6. A fault location device characterized by, The method includes: a group obtaining unit, configured to cluster microservices based on running information to obtain at least one microservice group, the running information including calling parameters of a first microservice and a second microservice, the first microservice and the second microservice being any two microservices, and the microservice group including at least one target microservice; a feature obtaining unit, configured to obtain a feature value of at least one feature of the target microservice based on the running information; a difference obtaining unit, configured to obtain a difference parameter corresponding to the feature of the microservice group based on the feature value of the feature of each target microservice, the difference parameter being used to indicate a difference degree of the feature of each target microservice; a fault determining unit, configured to, if the difference parameter corresponding to the feature of the microservice group is out of a preset reasonable difference range, take a target microservice that meets a preset fault condition as a fault microservice, the fault condition including that the feature value of the feature is out of a feature value range corresponding to the feature. The group obtaining unit is configured to cluster microservices based on running information to obtain at least one microservice group, and specifically includes: obtaining the calling relationship and the correlation degree between a first microservice and a second microservice based on the running information; and generating a relationship graph based on the calling relationship and the correlation degree between each two microservices, wherein the relationship graph includes microservice nodes and edges, a direction of a target edge indicates a calling relationship between two microservice nodes connected by the target edge, a weight of the target edge is positively correlated with a correlation degree between microservices corresponding to the two microservice nodes connected by the target edge, and the target edge is any edge; performing graph clustering on the relationship graph by taking direct reachability between the microservice nodes and a number of shared neighbor nodes as clustering indexes to obtain a graph clustering result, the graph clustering result including at least one microservice node cluster; and dividing microservices corresponding to each microservice node cluster into a microservice group.

7. A fault location device characterized by, The method includes: a memory and a processor; the memory is configured to store a program; the processor is configured to execute the program to implement each step of the fault locating method according to any one of claims 1-5.

8. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements each step of the fault locating method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Fault root cause positioning method and system for micro-service architecture information system

    CN112698975A

  • Fault root cause positioning method and system based on service code level and storage medium

    CN113900844A