Cloud host fault positioning method and device, equipment, medium and program product
By acquiring and processing the operational anomaly logs and link data of cloud servers, and combining text similarity values and graph analysis, the problem of accurate fault location of cloud servers was solved, and more efficient fault identification and handling were achieved.
Patent Information
- Application Number
- CN202511255979.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2025-10-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing technologies have low accuracy in locating cloud server faults and struggle to effectively utilize the contextual information of cloud servers for accurate matching.
By acquiring the operation anomaly logs of the faulty cloud host, calculating the text similarity value between the anomaly log text information and the preset operation fault knowledge base, and combining the operation anomaly location information for weighted processing, a service call relationship graph is constructed. The depth-first search algorithm is used to locate the anomaly location, and the TF-IDF and TraceSim algorithms are combined to improve the matching accuracy.
It improves the accuracy of cloud server fault location and operational security, enabling more accurate identification of the root cause and location of anomalies.
Smart Images

Figure CN120803792A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a cloud host fault positioning method and device, electronic equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the rapid development of cloud computing, many enterprises go to the cloud to reduce enterprise production costs and operation and maintenance costs, and with more and more business applications going to the cloud, cloud hosts will inevitably fail, so how to realize fault positioning of cloud hosts has become a technical problem to be solved.
[0003] The prior art usually adopts a similar value matching method to position the fault of the cloud host, but it usually collects service request information and uses string edit distance to match fault information, which has low fault matching accuracy, making it difficult to accurately position the fault of the cloud host. SUMMARY
[0004] The present application provides a cloud host fault positioning method, device, equipment, medium and program product to solve the technical problem of low fault positioning accuracy of the prior art for cloud hosts.
[0005] To solve the above technical problems, the first aspect of the present application provides a cloud host fault positioning method, comprising: Obtain the operation exception log of the fault cloud host; wherein the operation exception log comprises exception log text information and operation exception positioning information; Calculate the text similarity value between the exception log text information and each historical fault text in the preset operation fault knowledge base, and use the operation exception positioning information to weight process the text similarity value to obtain the total similarity value between the operation exception log and each historical fault text; wherein the historical fault text is used to record historical operation exception information and the corresponding abnormal root cause information; Determine the target historical fault text from the operation fault knowledge base based on the total similarity value, and obtain the target abnormal root cause information of the fault cloud host from the target historical fault text.
[0006] As a preferred scheme, the method further comprises: Collect the operation link data of the fault cloud host; According to the operation link data, obtain the target operation exception position information of the fault cloud host.
[0007] As a preferred scheme, according to the operation link data, the target operation exception position information of the fault cloud host is obtained, specifically comprising: acquire span information from the operation link data; acquire service component information, service information, calling relationship between service components, calling relationship between service components and services, span state and abnormal log information in each span information; construct a service calling relationship graph of the fault cloud host according to the service component information, the service information, the calling relationship between service components and the calling relationship between service components and services; wherein the nodes in the service calling relationship graph include the service components and the services, the edges between each node are the calling relationship between service components or the calling relationship between service components and services, and the attributes of the nodes include the service component information, the service information, the span state and the abnormal log information; acquire the target operation abnormal position information from the service calling relationship graph by using a depth-first search algorithm.
[0008] As a preferred solution, the text similarity value between the abnormal log information and each historical fault text in the preset operation fault knowledge base is calculated, specifically including: perform word segmentation on the abnormal log information to obtain a plurality of to-be-matched words; based on the total number of words in each historical fault text and the number of historical fault texts, calculate the TF-IDF value of each to-be-matched word corresponding to each historical fault text by using a TF-IDF algorithm; determine the matching value of each to-be-matched word in each historical fault text according to the TF-IDF value and a preset TF-IDF threshold value; sum the matching value of each to-be-matched word in any one historical fault text to determine the text similarity value between the abnormal log information and the any one historical fault text.
[0009] As a preferred solution, the operation abnormal positioning information includes abnormal related components, abnormal related calling relationship and abnormal stack information; the operation fault knowledge base also has historical abnormal stack information corresponding to each historical operation abnormal information; Then, the text similarity value is weighted processed by using the operation abnormal positioning information to obtain the total similarity value between the operation abnormal log and each historical fault text, specifically including: calculate the stack similarity between the abnormal stack information and each historical abnormal stack information by using a TraceSim algorithm, and determine a first weighting value of the operation abnormal log corresponding to each historical operation abnormal information based on the stack similarity; According to the preset weight values corresponding to different service components and different calling relationships, a target weight value corresponding to the abnormal related component and the abnormal related calling relationship is determined, and a second weighting value is determined based on the target weight value; The text similarity value is weighted using the first weighting value and the second weighting value to obtain the total similarity value.
[0010] As a preferred solution, the stack similarity between the abnormal stack information and each historical abnormal stack information is calculated using a TraceSim algorithm, specifically including: The Levenshtein distance between the abnormal stack information and each historical abnormal stack information is obtained. The total weight value of each code snippet in the abnormal stack information and each historical abnormal stack information is calculated respectively; wherein the total weight value is determined based on the local weight and global weight of the code snippet; the local weight is determined based on the stack position of the code snippet, and the global weight is determined based on the IDF value of the code snippet in all historical abnormal stack information. According to the Levenshtein distance and the total weight value, the stack similarity between the abnormal stack information and each historical abnormal stack information is calculated.
[0011] As a preferred solution, the state transition equation of the Levenshtein distance between the abnormal stack information and the historical abnormal stack information is specifically: ; Wherein, represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; i represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; j represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; i represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; j represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; i represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; j represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; i represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; j represents the Levenshtein distance from the first frame code snippet of the abnormal stack information to the first frame code snippet of the historical abnormal stack information; represents the preset weight value of the first frame code snippet of the abnormal stack information; i represents the preset weight value of the first frame code snippet of the abnormal stack information; The historical exception stack information is represented by j Preset weight values for frame code snippets; The exception stack information is represented by i Frame code snippet; The historical exception stack information is represented by j Frame code snippet.
[0012] As a preferred solution, the method specifically calculates the total weight value of the code snippet through the following steps: According to the stack position of the code snippet, the local weight of the code snippet is calculated by the following expression: ; According to the IDF value of the code snippet in all the historical exception stack information, the global weight of the code snippet is calculated by the following expression: ; Determining the total weight value of the code snippet according to the product of the local weight and the global weight; in, The exception stack information or the historical exception stack information is represented by i local weights of frame code snippets; I The exception stack information or the historical exception stack information is represented by i The stack location of the frame code snippet; is the first preset hyperparameter, and >1; The exception stack information or the historical exception stack information is represented by i Global weight of frame code snippets; The exception stack information or the historical exception stack information is represented by i The IDF value of the frame code fragment in all the historical exception stack information; and Represent the preset second and third hyperparameters respectively.
[0013] As a preferred solution, before collecting the operation link data of the faulty cloud host, the method further includes: Tracking key preset operation locations of the faulty cloud host; The operation link data of the faulty cloud host is collected as follows: The operation link data is collected based on the buried point data of each of the preset operation key positions.
[0014] A second aspect of an embodiment of the present invention provides a cloud host fault locating device, including: An operation exception log acquisition module is configured to acquire operation exception logs of the faulty cloud host; wherein the operation exception logs comprise exception log text information and operation exception positioning information; A fault matching module is configured to calculate text similarity values between the exception log text information and each historical fault text in a preset operation fault knowledge base, and perform weighted processing on the text similarity values by using the operation exception positioning information to obtain total similarity values between the operation exception logs and each historical fault text; wherein the historical fault text is used to record historical operation exception information and corresponding exception root cause information; An exception root cause acquisition module is configured to determine a target historical fault text from the operation fault knowledge base based on the total similarity values, and acquire target exception root cause information of the faulty cloud host from the target historical fault text.
[0015] A third aspect of the embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the cloud host fault positioning method of any one of the first aspect when executing the computer program.
[0016] A fourth aspect of the embodiment of the present application provides a computer readable storage medium, comprising a stored computer program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to execute the cloud host fault positioning method of any one of the first aspect when the computer program is running.
[0017] A fifth aspect of the embodiment of the present application provides a computer program product, comprising computer programs / instructions, and the computer programs / instructions implement the steps of the cloud host fault positioning method of any one of the first aspect when executed by a processor.
[0018] Compared with the prior art, the embodiment of the present application has the beneficial effects that the exception root cause matching is performed by using the exception log text information of the faulty cloud host, and the weighted processing is performed on the text similarity values between the exception log text information and each historical fault text in the operation fault knowledge base by using the operation exception positioning information in the operation exception logs, since the exception log text information has context and sequence information, and the operation exception positioning information has a clear use scenario, the context information of the cloud host fault can be fully considered, the accuracy of the exception root cause matching is improved, and thus the fault positioning accuracy of the faulty cloud host is improved. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 is a flowchart of the cloud host fault positioning method in the embodiment of the present application; Figure 2is a system architecture diagram of cloud host fault positioning in the embodiment of the present application; Figure 3 is an operation full-process view of a cloud host subscription scenario in the embodiment of the present application; Figure 4 is a point embedding architecture schematic diagram in the embodiment of the present application; Figure 5 is a structural schematic diagram of a cloud host fault positioning device in the embodiment of the present application; Figure 6 is a structural schematic diagram of an electronic device in the embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0021] Please refer to Figure 1 The first aspect of the embodiment of the present application provides a cloud host fault positioning method, comprising the following steps S1 to S3: Step S1, obtaining operation abnormal log of a fault cloud host; wherein the operation abnormal log comprises abnormal log text information and operation abnormal positioning information; Step S2, calculating a text similarity value between the abnormal log text information and each historical fault text in a preset operation fault knowledge base, and performing weighted processing on the text similarity value by using the operation abnormal positioning information to obtain a total similarity value between the operation abnormal log and each historical fault text; wherein the historical fault text is used to record historical operation abnormal information and abnormal root cause information corresponding thereto; Step S3, determining a target historical fault text from the operation fault knowledge base based on the total similarity value, and obtaining target abnormal root cause information of the fault cloud host from the target historical fault text.
[0022] Specifically, for the fault positioning of a cloud host at present, service request information is usually collected, and a string edit distance is used to perform fault matching with known fault information. However, this method cannot consider the context information of a cloud host fault, and it is difficult to accurately match an abnormal root cause. In order to be able to improve the accuracy of abnormal root cause positioning based on the context information of a service abnormal log of a fault cloud host, the embodiment first obtains operation abnormal log of a fault cloud host, which comprises abnormal log text information with context and sequence information and operation abnormal positioning information capable of clearly indicating a fault occurrence position.
[0023] Furthermore, this embodiment pre-collects historical operational anomaly information of the faulty cloud host and its corresponding abnormal root cause information to form historical fault texts, and uses each historical fault text to construct an operational fault knowledge base. Thus, by text-matching the abnormality log text information with each historical fault text in the operational fault knowledge base, the current target abnormal root cause information of the faulty cloud host can be obtained from the target historical fault text based on the matched target historical fault text, thereby locating the abnormal root cause. In the process of locating the abnormal root cause, since the operational anomaly locating information has a clear usage scenario, using this operational anomaly locating information to assign different weights to text similarity values can further improve the accuracy of abnormal root cause locating.
[0024] In an optional embodiment, the historical fault text also records the exception handling measures corresponding to the historical operation exception information, so that in the process of locating the root cause of the exception, the exception handling measures can be obtained at the same time, which helps to improve the operation and maintenance security of the cloud host.
[0025] Furthermore, after determining the total similarity value between the abnormal log text information and each historical fault text, the historical fault text with the largest total similarity value is the target historical fault text, and the abnormal root cause information recorded in the target historical fault text is the target abnormal root cause information.
[0026] The cloud host fault locating method provided by the embodiment of the present invention uses the abnormal log text information of the faulty cloud host to match the root cause of the abnormality, and uses the operation abnormality locating information in the operation abnormality log to weight the text similarity value between the abnormal log text information and each historical fault text in the operation fault knowledge base. Since the abnormal log text information has context and word order information, and the operation abnormality locating information has a clear usage scenario, it can fully consider the context information of the cloud host failure, improve the accuracy of the abnormal root cause matching, and thereby improve the fault locating accuracy of the faulty cloud host.
[0027] As a preferred solution, the method further comprises: Collecting operation link data of the faulty cloud host; According to the operation link data, target operation abnormality location information of the faulty cloud host is obtained.
[0028] It is worth noting that in order to further accurately locate the current operation abnormal position of the fault cloud host, the positioning of the cloud host operation fault depends on the operation link data of the cloud host product, therefore the embodiment also collects the operation link data of the fault cloud host, the operation link data records the whole operation flow information of the fault cloud host, each span in the operation link data includes the following characteristic index items: operation name, component information, operation method, caller information, calling mode, exception log information, etc., as shown in Table 1 below.
[0029] Table 1 Link span characteristic index items
[0030] Therefore, based on the operation link data, the embodiment can accurately locate the position of each abnormal operation and determine the target operation abnormal position information of the fault cloud host.
[0031] As shown in Figure 2 The embodiment provides a system architecture for cloud host fault positioning, it is worth noting that cloud host products are usually deployed in multiple regions with multiple resource pools, each resource pool contains a console and a cloud computing platform, and the operation link data of the cloud host product needs to be collected by developing a probe respectively; wherein the console is a graphical management tool provided by a cloud computing vendor, which is used to show the configuration and usage of the cloud host. Through the cloud host console, users can perform operations including creating, starting, stopping, deleting, renewing cloud hosts, etc., and also can monitor the running of the cloud host. The cloud computing platform mainly provides infrastructure services, which is divided into public cloud, private cloud and hybrid cloud according to the deployment type. The cloud computing platform mainly uses virtualization technology to create virtual resources based on hardware resources and software resources, including servers, storage devices, networks and operating systems, etc., and provides computing, network and storage capabilities to the outside.
[0032] The traditional link tracking technologies, such as CAT, Pinpoint, Skywalking, Zipkin and the like, can only collect link data of a single protocol, and the technical architectures of cloud host products are quite different, and the link tracking technologies adopted are different, so that a uniform link data collection component cannot be adopted. The Opentelemetry-Collector (open telemetry collector) collection component receives the link data reported by different data collection components, thereby solving the problem that the traditional link tracking data collection component cannot be compatible with different data protocols. After receiving the link data, the Opentelemetry-Collector collection component processes the link data into a uniform format and sends the link data to a Kafka of a data processing component, wherein the Kafka is an Apache Kafka distributed stream processing platform. The traditional link tracking technology stores the link data in a document data, so that the link data cannot be effectively analyzed. A data cleaning component in the data processing component is developed by using a Flink technology, and the data cleaning component consumes the Kafka data in real time and extracts feature index item information contained in each span of the operation link data of the cloud host product, and the feature index item information is uniformly stored in a ClickHouse time series database. Each span in the operation link data is stored as a record in the ClickHouse time series database. A fault matching module in the data processing component introduces an operation topology, determines the calling relationship between the service components and the calling relationship between the service components and the services according to each span data in the ClickHouse time series database, thereby constructing a service calling relationship graph to locate target operation abnormal position information. At the same time, the operation abnormal log of the fault cloud host is used for abnormal root cause matching, and finally the target operation abnormal position information, target abnormal root cause information and abnormal processing measures are sent to a fault display component of a center node for display.
[0033] As a preferred solution, the target operation abnormal position information of the fault cloud host is obtained according to the operation link data, specifically comprising: obtaining span information from the operation link data; obtaining service component information, service information, calling relationship between service components, calling relationship between service components and services, span state and abnormal log information in each span information; According to the service component information, the service information, the calling relationship between the service components, and the calling relationship between the service components and the service, a service calling relationship graph of the fault cloud host is constructed; wherein, nodes in the service calling relationship graph include the service components and the service, edges between the nodes are the calling relationship between the service components or the calling relationship between the service components and the service, and attributes of the nodes include the service component information, the service information, the span state, and the abnormal log information; The target operation abnormal position information is obtained from the service calling relationship graph by using a depth-first search algorithm.
[0034] Specifically, the operation flow of the cloud host involves the cooperative work of multiple service components, including a cloud host console, a mop component, a network console, a nova component, a cinder component, a glance component, a keystone component, and a neutron component, wherein, the mop component is used for service orchestration and scheduling, the nova component is a computing service component, the cinder component is a block storage service component, the glance component is an image service component, the keystone component is an identity authentication and authorization service component, and the neutron component is a network service component. Each service component cooperates to complete key operations such as subscription, cancellation, modification, and continuation of the cloud host. As mentioned above, the operation link data collected contains multiple span information, and each span information contains multiple feature index item information, from which the service component information, the service information, the calling relationship between the service components, the calling relationship between the service components and the service, the span state, and the abnormal log information involved in each operation step can be directly obtained.
[0035] Further, the service components and the service are taken as nodes, and the calling relationship between the service components or the calling relationship between the service components and the service is taken as edges, to construct a service calling relationship graph of the fault cloud host. Taking the subscription cloud host scenario as an example, as shown in Figure 3 , it is the operation full-flow view, i.e., the service calling relationship graph, in Figure 3 , the rpc calling represents a remote procedure call (Remote Procedure Call), the conductor is a conduction module, the scheduler is a scheduling module, and the compute is a computing module. These modules are functional modules included in the nova component.
[0036] Furthermore, since each node contains attributes such as service component information, service information, span status and exception log information, it is possible to locate the root node of the abnormal operation based on the span status and exception log information, and search all abnormal locations of its sub-operations based on the depth-first search algorithm, thereby obtaining the target operation abnormal location information from the service call relationship graph.
[0037] As a preferred solution, the calculating of the text similarity value between the abnormal log information and each historical fault text in a preset operation fault knowledge base specifically includes: Segmenting the abnormal log information to obtain a number of words to be matched; Calculate the TF-IDF value of each of the to-be-matched words corresponding to each of the historical fault texts using the TF-IDF algorithm based on the total number of words in each of the historical fault texts and the number of the historical fault texts; Determining a matching value of each of the to-be-matched words in each of the historical fault texts according to the TF-IDF value and a preset TF-IDF threshold; The matching value of each of the to-be-matched words in any historical fault text is summed up to determine the text similarity value between the abnormal log information and the any historical fault text.
[0038] Specifically, for each matching term obtained through word segmentation of the exception log information, the Term Frequency-Inverse Document Frequency (TF-IDF) algorithm is used to calculate the Term Frequency (TF) value of each matching term in each historical fault text. The TF value represents the frequency of a word in a text, as expressed as follows: ; in, Indicates the t The words to be matched are in d TF value of a historical fault text; Indicates the t The words to be matched are in d The number of occurrences of a historical fault text; Indicates the d The total number of words in the historical fault text.
[0039] Furthermore, the IDF value of each to-be-matched word in all historical fault texts is calculated. It can be understood that the IDF value is a measure of the general importance of a word, and the expression is as follows: ; in, Indicates thet The words to be matched in the operation fault knowledge base D IDF values of all historical fault texts; N Represents the operational fault knowledge base D The total number of historical fault texts in; Represents the operational fault knowledge base D Contains t The number of historical fault texts to be matched with the words.
[0040] Furthermore, through the expression: , calculate the TF-IDF value of each matching word corresponding to each historical fault text, where, Indicates the t The words to be matched correspond to the d TF-IDF value of historical fault text.
[0041] Furthermore, in order to filter out keywords related to abnormal cloud host operations from various to-be-matched words, this embodiment pre-sets a TF-IDF threshold, thereby assigning a matching value to each to-be-matched word in each historical fault text based on the TF-IDF threshold. This embodiment does not specifically limit the matching value under different threshold comparison conditions. Preferably, the matching value is set as follows: ; in, is the TF-IDF threshold, Indicates the t The words to be matched are in d Matching value of historical fault text.
[0042] Furthermore, the matching values of each word to be matched in any historical fault text are summed up to determine the text similarity value between the abnormal log information and the historical fault text. The larger the text similarity value, the more keywords in the abnormal log information the historical fault text contains, that is, the greater the text similarity.
[0043] As a preferred solution, the operation exception location information includes exception-related components, exception-related call relationships and exception stack information; the operation fault knowledge base also has historical exception stack information corresponding to each of the historical operation exception information; Then, the weighted processing of the text similarity value by using the operation abnormality location information to obtain the total similarity value between the operation abnormality log and each of the historical fault texts specifically includes: The TraceSim algorithm is used to calculate stack similarity between the abnormal stack information and each of the historical abnormal stack information, and a first weighting value corresponding to each of the historical operation abnormal information is determined based on the stack similarity of the operation abnormal log; According to the preset weight values corresponding to different service components and different calling relationships, target weight values corresponding to the abnormal related components and the abnormal related calling relationships are determined, and a second weighting value is determined based on the target weight values; The text similarity value is weighted by using the first weighting value and the second weighting value to obtain the total similarity value.
[0044] Specifically, the abnormal stack information is the location information of the abnormal code in the library. In order to further improve the matching accuracy between the operation abnormal log and the operation fault knowledge base, the operation fault knowledge base of the embodiment also has historical abnormal stack information corresponding to each of the historical operation abnormal information, so that the positioning accuracy of abnormal attribution can be improved by matching the abnormal stack information and the historical abnormal stack information and weighting the text similarity value based on the matching result. In order to measure the similarity between two abnormal stack information, the TraceSim algorithm is used to calculate the stack similarity between the abnormal stack information and each of the historical abnormal stack information, and a first weighting value corresponding to each of the historical operation abnormal information is determined. Preferably, the first weighting value is specifically (1+ traceSim ), wherein, traceSim represents the stack similarity between the abnormal stack information and a certain historical abnormal stack information.
[0045] Further, the embodiment sets corresponding weight values for different service components and different calling relationships in advance, so that the target weight values corresponding to the abnormal related components and the abnormal related calling relationships in the operation abnormal log can be directly determined, and a second weighting value is further determined for weighting the text similarity value. Preferably, the second weighting value is specifically (1+ B ), wherein, B represents the target weight value.
[0046] Further, the text similarity value is multiplied by the first weighting value and the second weighting value to complete the weighting processing and obtain the total similarity value. Preferably, the calculation expression of the total similarity value is as follows: ; wherein, represents the total similarity value between the operation abnormal log and the first d historical fault text; represents the text similarity value; represents the stack similarity between the abnormal stack information and the first dThe historical abnormal stack information corresponding to the historical operation abnormal information in the historical failure text.
[0047] As a preferred solution, the stack similarity between the abnormal stack information and each of the historical abnormal stack information is calculated by using the TraceSim algorithm, and specifically includes: Obtaining the Levenshtein distance between the abnormal stack information and each of the historical abnormal stack information. Respectively calculating the total weight value of each code segment in the abnormal stack information and each of the historical abnormal stack information; wherein the total weight value is determined based on the local weight and the global weight of the code segment; the local weight is determined based on the stack position of the code segment, and the global weight is determined based on the IDF value of the code segment in all the historical abnormal stack information. According to the Levenshtein distance and the total weight value, the stack similarity between the abnormal stack information and each of the historical abnormal stack information is calculated.
[0048] Specifically, the stack similarity between the abnormal stack information and the historical abnormal stack information is calculated by the following expression: ; Wherein, ST represents the abnormal stack information, ; represents the historical abnormal stack information corresponding to the historical operation abnormal information in the historical failure text, d ; ; represents the total number of code segments in the abnormal stack information; represents the total number of code segments in the historical abnormal stack information; represents the total weight value of the code segment in the abnormal stack information, i ; represents the total weight value of the code segment in the historical abnormal stack information, j ; represents the Levenshtein distance between the abnormal stack information and the historical abnormal stack information corresponding to the historical operation abnormal information in the historical failure text; d represents the total weight value of the code segment in the abnormal stack information, ; i represents the total weight value of the code segment in the historical abnormal stack information, ; j represents the total weight value of the code segment in the historical abnormal stack information.
[0049] As a preferred solution, the state transition equation of the Levenshtein distance between the abnormal stack information and the historical abnormal stack information is specifically: ; in, Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j Levenshtein distance of frame code snippets; Indicates the front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; The front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j Levenshtein distance of frame code snippets; The exception stack information is represented by i Preset weight values for frame code snippets; The first column of the historical exception stack information j Preset weight values for frame code snippets; The exception stack information is represented by i Frame code snippet; The first column of the historical exception stack information j Frame code snippet.
[0050] Specifically, when calculating the Levenshtein distance between exception stack information and historical exception stack information, this embodiment considers the insertion, deletion, and replacement operations in the traditional Levenshtein distance algorithm, but does not consider the swap operation. The reason is that the order of each frame of code snippets in the stack is practical, and moving two code snippets in a stack is not allowed. For two strings, the traditional Levenshtein distance algorithm is defined as the minimum editing cost, that is, the minimum number of insertions, deletions, and replacements of single characters required to transform one string into another. For two exception stack information, this embodiment also considers the minimum number of insertions, deletions, and replacements of single code snippets required to transform one exception stack information into another. However, this embodiment uses the preset weight values corresponding to the code snippets as the cost of insertion, deletion, and replacement operations. The cost of insertion and deletion operations is the preset weight value corresponding to the corresponding code snippet, and the cost of replacement operation is the sum of the preset weight values of the code snippet before replacement and the new code snippet after replacement.
[0051] Assume that the length of the exception stack information in this embodiment is m, the length of the historical exception stack information is n , then define a dimension as ( m +1)×( n +1) D ,but That is, the Levenshtein distance between the exception stack information and the historical exception stack information.
[0052] The boundary conditions of the Levenshtein distance in this embodiment are: ; ; .
[0053] As a preferred solution, the method specifically calculates the total weight value of the code snippet through the following steps: According to the stack position of the code snippet, the local weight of the code snippet is calculated by the following expression: ; According to the IDF value of the code snippet in all the historical exception stack information, the global weight of the code snippet is calculated by the following expression: ; Determining the total weight value of the code snippet according to the product of the local weight and the global weight; in, The exception stack information or the historical exception stack information is represented by i local weights of frame code snippets; I The exception stack information or the historical exception stack information is represented by i The stack location of the frame code snippet; is the first preset hyperparameter, and >1; The exception stack information or the historical exception stack information is represented by i Global weight of frame code snippets; The exception stack information or the historical exception stack information is represented by i The IDF value of the frame code fragment in all the historical exception stack information; and Represent the preset second and third hyperparameters respectively.
[0054] Specifically, the top code snippet of the exception stack often represents the location information of the exception occurrence. Therefore, in this embodiment, the code snippet near the top is set to have a greater impact than the code snippet at the bottom and has a greater local weight. In the above expression, I Indicates the exception stack information or the historical exception stack information. iThe stack position of the frame code fragment, the closer the code fragment is to the top, I The smaller the value of , the greater the local weight can be.
[0055] Furthermore, the global weights are calculated using Measures the first i The universal importance of the frame code fragment in all historical exception stack traces.
[0056] As a preferred solution, before collecting the operation link data of the faulty cloud host, the method further includes: Tracking key preset operation locations of the faulty cloud host; The operation link data of the faulty cloud host is collected as follows: The operation link data is collected based on the buried point data of each of the preset operation key positions.
[0057] Specifically, this embodiment respectively performs tracking on the console of the faulty cloud host and the preset key operation locations of the cloud computing platform, such as Figure 4 As shown, the console is implemented in Java language. This embodiment uses the Opentelemetry-Sdk tool to track the preset key operation positions of the console in order to collect operation link data. Tracking the preset key operation positions of the console includes: tracking the API interface of the console, tracking the code position of the console's RestTemplate request, tracking the code position of the console's OpenFeign request, tracking the asynchronous thread operation of the console, and tracking the code position of the console's cloud computing platform request. In addition, this embodiment uses the Jaeger-Client (Jaeger client) tool to track the preset key operation positions of the cloud computing platform in order to collect operation link data. Tracking the preset key operation positions of the cloud computing platform includes: tracking the API interface of the cloud computing platform, tracking the code position of the cloud computing platform's RPC request, tracking the code position of the cloud computing platform's Clinet request, and tracking the SQL (Structured Query Language) operation of the cloud computing platform. Figure 4In the prior art, Opentelemetry is an open source tool, Opentelemetry-API defines a set of standard interfaces of the tool, and Opentelemetry-SDK is a specific implementation of the API (Application Programming Interface), which is responsible for processing actual tracking data generation, context management, sampling, processors and exporters and the like. OpenTracing is also an open source tool, OpenTracing-API defines a standard interface of distributed tracking, and OpenTracing-SDK is a specific implementation of the API. The Jaeger client provides an SDK (Software Development Kit) based on the OpenTracing API, which is responsible for converting the tracking logic defined by the API into actual tracking data and sending it to the corresponding backend system.
[0058] See Figure 5 The second aspect of the embodiment of the application provides a cloud host fault positioning device 100, comprising: An operation exception log acquisition module 11 is configured to acquire operation exception logs of a fault cloud host; wherein the operation exception logs comprise exception log text information and operation exception positioning information; A fault matching module 12 is configured to calculate a text similarity value between the exception log text information and each historical fault text in a preset operation fault knowledge base, and perform weighted processing on the text similarity value by using the operation exception positioning information to obtain a total similarity value between the operation exception logs and each historical fault text; wherein the historical fault text is used to record historical operation exception information and corresponding abnormal root cause information; An abnormal root cause acquisition module 13 is configured to determine a target historical fault text from the operation fault knowledge base based on the total similarity value, and acquire target abnormal root cause information of the fault cloud host from the target historical fault text.
[0059] As a preferred solution, the device further comprises an operation exception location positioning module configured to: Collect operation link data of the fault cloud host; According to the operation link data, acquire target operation exception location information of the fault cloud host.
[0060] As a preferred solution, the operation exception location positioning module is configured to acquire target operation exception location information of the fault cloud host according to the operation link data, and specifically comprises: Acquire a plurality of span information from the operation link data; acquire service component information, service information, calling relationship between service components, calling relationship between service components and services, span state and abnormal log information in each span information; construct a service calling relationship graph of the fault cloud host according to the service component information, the service information, the calling relationship between service components and the calling relationship between service components and services; wherein nodes in the service calling relationship graph include the service components and the services, edges between each node are the calling relationship between service components or the calling relationship between service components and services, and attributes of the nodes include the service component information, the service information, the span state and the abnormal log information; acquire the target operation abnormal position information from the service calling relationship graph by using a depth-first search algorithm.
[0061] As a preferred solution, the fault matching module 12 is configured to calculate a text similarity value between the abnormal log information and each historical fault text in a preset operation fault knowledge base, and specifically includes: perform word segmentation on the abnormal log information to obtain a plurality of to-be-matched words; calculate a TF-IDF value of each to-be-matched word corresponding to each historical fault text by using a TF-IDF algorithm based on a total number of words in each historical fault text and a number of historical fault texts; determine a matching value of each to-be-matched word in each historical fault text according to the TF-IDF value and a preset TF-IDF threshold value; sum the matching value of each to-be-matched word in any historical fault text to determine a text similarity value between the abnormal log information and the any historical fault text.
[0062] As a preferred solution, the operation abnormal positioning information includes abnormal related components, abnormal related calling relationship and abnormal stack information; the operation fault knowledge base also has historical abnormal stack information corresponding to each historical operation abnormal information; Then, the fault matching module 12 is configured to perform weighted processing on the text similarity value by using the operation abnormal positioning information to obtain a total similarity value between the operation abnormal log and each historical fault text, and specifically includes: calculate a stack similarity between the abnormal stack information and each historical abnormal stack information by using a TraceSim algorithm, and determine a first weighted value of the operation abnormal log corresponding to each historical operation abnormal information based on the stack similarity; Determining a target weight value corresponding to the abnormality-related component and the abnormality-related call relationship according to preset weight values corresponding to different service components and different call relationships, and determining a second weight value based on the target weight value; The text similarity value is weighted by using the first weighted value and the second weighted value to obtain the total similarity value.
[0063] As a preferred solution, the fault matching module 12 is configured to use a TraceSim algorithm to calculate the stack similarity between the exception stack information and each of the historical exception stack information, specifically including: Obtaining the Levenshtein distance between the exception stack information and each of the historical exception stack information; Calculating the total weight value of each code snippet in the exception stack information and each of the historical exception stack information respectively; wherein the total weight value is determined based on the local weight and global weight of the code snippet; the local weight is determined based on the stack position of the code snippet, and the global weight is determined based on the IDF value of the code snippet in all the historical exception stack information; The stack similarity between the exception stack information and each of the historical exception stack information is calculated according to the Levenshtein distance and the total weight value.
[0064] As a preferred solution, the state transition equation of the Levenshtein distance between the exception stack information and the historical exception stack information is specifically: ; in, Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j Levenshtein distance of frame code snippets; Indicates the front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; The front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j Levenshtein distance of frame code snippets; The exception stack information is represented by i Preset weight values for frame code snippets; a local weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; j a preset weight value of a frame code snippet; a local weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; i a frame code snippet; a local weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; j a frame code snippet.
[0065] As a preferred solution, the fault matching module 12 specifically calculates the total weight value of the code snippet by the following steps: According to the stack position of the code snippet, the local weight of the code snippet is calculated by the following expression: ; According to the IDF value of the code snippet in all the historical abnormal stack information, the global weight of the code snippet is calculated by the following expression: ; According to the product of the local weight and the global weight, the total weight value of the code snippet is determined; wherein, a local weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; i a stack position of a frame code snippet of the abnormal stack information or the historical abnormal stack information; I a stack position of a frame code snippet of the abnormal stack information or the historical abnormal stack information; i is a preset first hyperparameter, and > 1; a global weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; a global weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; i a global weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; a global weight of a frame code snippet of the abnormal stack information or the historical abnormal stack information; i and and respectively represent preset second and third hyperparameters.
[0066] As a preferred solution, the device further comprises a burying point module, configured to: burying points are performed on preset operation critical positions of the fault cloud host; The collecting operation link data of the fault cloud host specifically comprises: collecting the operation link data according to the burying point data of each preset operation critical position.
[0067] The cloud host fault positioning device 100 provided by the embodiment of the present application matches the abnormal root cause by using the abnormal log text information of the fault cloud host, and performs weighted processing on the text similarity value between the abnormal log text information and each historical fault text in the operation fault knowledge base by using the operation abnormal positioning information in the operation abnormal log. Since the abnormal log text information has context and sequence information, and the operation abnormal positioning information has a clear use scenario, the context information of the cloud host fault can be fully considered, the accuracy of the abnormal root cause matching is improved, and thus the fault positioning accuracy of the fault cloud host is improved.
[0068] Please refer to Figure 6 The third aspect of the embodiment of the present application provides an electronic device 200, which comprises a memory 22, a processor 21, and a computer program stored in the memory 22 and executable on the processor 21, and the processor 21 implements the cloud host fault positioning method of any one of the first aspect when executing the computer program.
[0069] For example, the computer program can be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device 200.
[0070] The electronic device 200 can include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art can understand that the schematic diagram is only an example of the electronic device 200, and does not constitute a limitation on the electronic device 200, and can include more or fewer components than the diagram, or combine certain components, or different components, for example, the electronic device 200 can also include an input / output device, a network access device, a bus, etc.
[0071] The processor 21 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic components, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor 21 can also be any conventional processor 21, etc. The processor 21 is a control center of the electronic device 200, and connects all parts of the electronic device 200 through various interfaces and lines.
[0072] The memory 22 can be used to store computer programs and / or modules, and the processor 21 realizes various functions of the electronic device 200 by running or executing the computer programs and / or modules stored in the memory 22, and calling data stored in the memory 22. The memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.), etc.; and the data storage area can store data created according to use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 22 can include a high-speed random access memory, and can also include a nonvolatile memory, for example, a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one disk storage device, a flash memory device, or other volatile solid-state memory devices.
[0073] The fourth aspect of the embodiment of the present application provides a computer readable storage medium, which includes a stored computer program, wherein when the computer program runs, the computer readable storage medium controls a device where the computer readable storage medium is located to execute the cloud host fault positioning method in any one of the embodiments of the first aspect.
[0074] The fifth aspect of the embodiment of the present application provides a computer program product, which includes computer programs / instructions, and when the computer programs / instructions are executed by a processor, the steps of the cloud host fault positioning method in any one of the embodiments of the first aspect are realized.
[0075] The modules / units integrated in the electronic device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0076] The above is the preferred embodiment of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which are also considered within the scope of protection of the present application.
Claims
1. A cloud host fault location method, characterized in that: include: Obtaining an operation abnormality log of the faulty cloud host; wherein the operation abnormality log includes abnormality log text information and operation abnormality location information; Calculating text similarity values between the abnormality log text information and each historical fault text in a preset operation fault knowledge base, and weighting the text similarity values using the operation abnormality location information to obtain a total similarity value between the operation abnormality log and each of the historical fault texts; wherein the historical fault text is used to record historical operation abnormality information and its corresponding abnormality root cause information; A target historical fault text is determined from the operation fault knowledge base based on the total similarity value, and target abnormality root cause information of the faulty cloud host is obtained from the target historical fault text.
2. The cloud host fault locating method according to claim 1, wherein: The method further comprises: Collecting operation link data of the faulty cloud host; According to the operation link data, target operation abnormality location information of the faulty cloud host is obtained.
3. The cloud host fault location method according to claim 2, wherein: The acquiring, based on the operation link data, target operation abnormality location information of the faulty cloud host specifically includes: Acquire a plurality of span information from the operation link data; Obtaining service component information, service information, call relationships between service components, call relationships between service components and services, span status, and exception log information in each of the span information; Constructing a service call relationship graph of the faulty cloud host based on the service component information, the service information, the call relationships between the service components, and the call relationships between the service components and the services; wherein the nodes in the service call relationship graph include the service components and the services, the edges between the nodes are the call relationships between the service components or the call relationships between the service components and the services, and the attributes of the nodes include the service component information, the service information, the span status, and the exception log information; The target operation abnormality location information is obtained from the service call relationship graph using a depth-first search algorithm.
4. The cloud host fault locating method according to claim 1, wherein: The calculating of the text similarity value between the abnormal log information and each historical fault text in the preset operation fault knowledge base specifically includes: Segmenting the abnormal log information to obtain a number of words to be matched; Calculate the TF-IDF value of each of the to-be-matched words corresponding to each of the historical fault texts using the TF-IDF algorithm based on the total number of words in each of the historical fault texts and the number of the historical fault texts; Determining a matching value of each of the to-be-matched words in each of the historical fault texts according to the TF-IDF value and a preset TF-IDF threshold; The matching value of each of the to-be-matched words in any historical fault text is summed up to determine the text similarity value between the abnormal log information and the any historical fault text.
5. The cloud host fault locating method according to claim 1, wherein: The operation exception location information includes exception-related components, exception-related call relationships and exception stack information; the operation fault knowledge base also has historical exception stack information corresponding to each of the historical operation exception information; Then, the weighted processing of the text similarity value by using the operation abnormality location information to obtain the total similarity value between the operation abnormality log and each of the historical fault texts specifically includes: Calculating stack similarities between the exception stack information and each of the historical exception stack information using a TraceSim algorithm, and determining a first weighted value of the operation exception log corresponding to each of the historical operation exception information based on the stack similarities; Determining a target weight value corresponding to the abnormality-related component and the abnormality-related call relationship according to preset weight values corresponding to different service components and different call relationships, and determining a second weight value based on the target weight value; The text similarity value is weighted by using the first weighted value and the second weighted value to obtain the total similarity value.
6. The cloud host fault locating method according to claim 5, characterized in that: The using of the TraceSim algorithm to calculate the stack similarity between the exception stack information and each of the historical exception stack information specifically includes: Obtaining the Levenshtein distance between the exception stack information and each of the historical exception stack information; Calculating the total weight value of each code snippet in the exception stack information and each of the historical exception stack information respectively; wherein the total weight value is determined based on the local weight and global weight of the code snippet; the local weight is determined based on the stack position of the code snippet, and the global weight is determined based on the IDF value of the code snippet in all the historical exception stack information; The stack similarity between the exception stack information and each of the historical exception stack information is calculated according to the Levenshtein distance and the total weight value.
7. The cloud host fault location method according to claim 6, characterized in that: The state transition equation of the Levenshtein distance between the exception stack information and the historical exception stack information is specifically: ; in, Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j Levenshtein distance of frame code snippets; Indicates the front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; Indicates the front of the exception stack information i Frame code snippet to the front of the historical exception stack information j - Levenshtein distance of 1-frame code snippet; The front of the exception stack information i -1 frame code snippet to the beginning of the historical exception stack information j Levenshtein distance of frame code snippets; The exception stack information is represented by i Preset weight values for frame code snippets; The first column of the historical exception stack information j Preset weight values for frame code snippets; The exception stack information is represented by i Frame code snippet; The first column of the historical exception stack information j Frame code snippet.
8. The cloud host fault locating method according to claim 6, wherein: The method specifically calculates the total weight value of the code snippet through the following steps: According to the stack position of the code snippet, the local weight of the code snippet is calculated by the following expression: ; According to the IDF value of the code snippet in all the historical exception stack information, the global weight of the code snippet is calculated by the following expression: ; Determining the total weight value of the code snippet according to the product of the local weight and the global weight; in, The exception stack information or the historical exception stack information is represented by i local weights of frame code snippets; I The exception stack information or the historical exception stack information is represented by i The stack location of the frame code snippet; is the first preset hyperparameter, and >1; The exception stack information or the historical exception stack information is represented by i Global weight of frame code snippets; The exception stack information or the historical exception stack information is represented by i The IDF value of the frame code fragment in all the historical exception stack information; and Represent the preset second and third hyperparameters respectively.
9. The cloud host fault locating method according to claim 2, wherein: Before collecting the operation link data of the faulty cloud host, the method further includes: Tracking key preset operation locations of the faulty cloud host; The operation link data of the faulty cloud host is collected as follows: The operation link data is collected based on the buried point data of each of the preset operation key positions.
10. A cloud host fault location device, characterized in that: include: An operation abnormality log acquisition module is used to obtain the operation abnormality log of the faulty cloud host; wherein the operation abnormality log includes abnormality log text information and operation abnormality location information; a fault matching module, configured to calculate text similarity values between the abnormality log text information and each historical fault text in a preset operation fault knowledge base, and weight the text similarity values using the operation abnormality location information to obtain a total similarity value between the operation abnormality log and each of the historical fault texts; wherein the historical fault texts are used to record historical operation abnormality information and its corresponding abnormality root cause information; The abnormality root cause acquisition module is used to determine a target historical fault text from the operation fault knowledge base based on the total similarity value, and obtain target abnormality root cause information of the faulty cloud host from the target historical fault text.
11. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the cloud host fault locating method according to any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the cloud host fault locating method according to any one of claims 1 to 9.
13. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements the steps of the cloud host fault locating method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Fault positioning method and system and related assembly
CN109885505A
Distributed service calling management system and method thereof
CN117640544A
Application software fault analysis method and device, equipment, storage medium and product
CN118377719A