A fault detection method and apparatus, and a computer-readable storage medium

By analyzing the clustering and causal graph models of microservice system call sequences, combined with adversarial networks and behavioral trajectory models, the problem of dynamic fault detection in microservice systems under various scenarios and scales is solved, achieving efficient and accurate fault detection.

CN116089234BActive Publication Date: 2026-11-17CHINA MOBILE CHENGDU INFORMATION & TELECOMM TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111306681.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-05
Publication Date
2026-11-17
Estimated Expiration
2041-11-05

AI Technical Summary

Technical Problem

Existing technologies are difficult to adapt to the dynamic changes in various scenarios and system scale in microservice systems. This makes it time-consuming and laborious to manually select fault detection models, and static models cannot adapt to the differentiated behavioral characteristics of microservices.

Method used

By acquiring system call sequences, performing clustering and random secondary verification, and combining them with a pre-set causal relationship graph model for training and analysis, it is possible to determine whether a fault has occurred. Furthermore, by utilizing adversarial networks and a pre-set behavioral trajectory model to analyze data flow trajectories, dynamic fault detection can be achieved.

Benefits of technology

It improves the applicability and efficiency of fault detection, reduces the time cost of manually selecting models, adapts to various scenarios and system scale changes, and improves the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116089234B_ABST
    Figure CN116089234B_ABST
Patent Text Reader

Abstract

This invention discloses a fault detection method and apparatus, and a computer-readable storage medium. The method includes: acquiring a system call sequence; clustering the system call sequence to obtain preliminary clustering results; performing random secondary verification on the preliminary clustering results to determine the final clustering result; training and analyzing the clustering results based on a preset causal graph model to obtain analysis data; and determining whether a fault has occurred based on the analysis data. In this solution, clustering the system call sequence to obtain clustering results, and analyzing the clustering results according to a preset causal graph model, determines whether a fault has occurred. This eliminates the need for manual selection of a fault detection model, saving time and effort; furthermore, the fault detection method based on the preset causal graph model is adaptable to various scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault detection, and more particularly to a fault detection method and apparatus, and a computer-readable storage medium. Background Technology

[0002] Microservices are diverse and have complex dependencies. Manually selecting a suitable fault detection model for each component is time-consuming and labor-intensive, and is only suitable for small-scale systems. Current Internet applications need to deal with various types of workloads, and each component will exhibit different behavioral characteristics at different times and in different business scenarios. Static fault detection models cannot adapt to dynamically changing applications. Summary of the Invention

[0003] This invention provides a fault detection method and apparatus, and a computer-readable storage medium, which are applicable to different system sizes and various scenarios when detecting whether a microservice is malfunctioning.

[0004] The technical solution of this invention is implemented as follows:

[0005] This invention provides a fault detection method, the method comprising:

[0006] Obtain the system call sequence;

[0007] Clustering the system call sequence yields preliminary clustering results;

[0008] The preliminary clustering results are randomly validated twice to determine the final clustering result.

[0009] Based on a pre-defined causal relationship graph model, the clustering results are trained and analyzed to obtain analytical data;

[0010] Based on the analyzed data, it is determined whether a fault has occurred.

[0011] In the above scheme, the step of clustering the system call sequence to obtain preliminary clustering results includes:

[0012] The execution sequence is obtained by reconstructing the transformation matrix for the system call sequence;

[0013] Clustering algorithms are used to cluster the execution sequences, thereby clustering the microservices and obtaining the preliminary clustering results.

[0014] In the above scheme, determining whether a fault has occurred based on the analyzed data includes:

[0015] If the analyzed data exceeds a preset threshold, a fault is determined to have occurred.

[0016] If the analyzed data is less than or equal to a preset threshold, it is determined that no fault has occurred.

[0017] In the above scheme, obtaining the system call sequence includes:

[0018] The process-level program monitoring the target;

[0019] The process-level program is dynamically input into the kernel hook function to track the entry and exit points of each system call;

[0020] Based on the entry and exit positions of each system call, obtain the call record;

[0021] Based on the record of the calls, obtain the system call sequence.

[0022] In the above scheme, prior to the process-level procedure of the monitored object, the method further includes:

[0023] The weights of the first monitoring algorithm are initialized; wherein, the first monitoring algorithm is a system process call model;

[0024] The first monitoring algorithm is used to monitor the process of the object, thereby monitoring the process-level program of the object.

[0025] In the above scheme, after obtaining the system call sequence based on the call record, the method further includes:

[0026] The system call sequence is fed back to the first monitoring algorithm to update the weight of the first monitoring algorithm, thus obtaining the updated weight of the first monitoring algorithm.

[0027] This invention provides another fault detection method, the method comprising:

[0028] Obtain the data flow trajectory and save it to the target location;

[0029] Based on the data flow trajectory, an adversarial network is used to predict microservice calls and obtain the data flow trajectory for predicting microservice calls.

[0030] Based on the predicted data flow trajectory of microservice calls, a preset behavior trajectory model is used for training and analysis to determine whether a fault has occurred.

[0031] In the above scheme, before obtaining the data flow trajectory and saving it to the target location, the method further includes:

[0032] The weights of the second monitoring algorithm are initialized; wherein, the second monitoring algorithm is a target trajectory model;

[0033] Pre-embed probe targets at the service access entry point, and use the second monitoring algorithm to monitor the interaction trajectory of the object and obtain the data flow trajectory.

[0034] In the above scheme, after obtaining the data flow trajectory and saving it to the target location, the method further includes:

[0035] The data flow trajectory is fed back to the second monitoring algorithm to update the weights of the second monitoring algorithm, thus obtaining the updated weights of the second monitoring algorithm.

[0036] In the above scheme, the step of using a preset behavioral trajectory model for training and analysis based on the predicted data flow trajectory of microservice calls to determine whether a fault has occurred includes:

[0037] Based on the preset behavior trajectory model, the data flow trajectory of the predicted microservice call is initially classified to obtain the classification result;

[0038] Based on the classification results, it is determined whether a fault has occurred.

[0039] In the above scheme, the preliminary classification of the data flow trajectory of the predicted microservice call based on the preset behavior trajectory model to obtain the classification result includes:

[0040] The data flow trajectory that is accessed normally will be marked as normal.

[0041] Mark the data flow trajectory that is missing or abnormal as an anomaly category;

[0042] The classification result is obtained based on the normal category and the abnormal category.

[0043] In the above scheme, determining whether a fault has occurred based on the analysis results includes:

[0044] Based on the classification results, samples are taken for secondary verification to obtain the verification results;

[0045] If the verification result is incorrect, a fault is determined to have occurred.

[0046] If the verification result is correct, it is determined that no fault has occurred.

[0047] This invention provides a fault detection device, which includes an acquisition unit and a determination unit;

[0048] The acquisition unit is used to acquire historical system call sequences; and to cluster the system call sequences to obtain preliminary clustering results.

[0049] The determining unit is used to perform a random secondary verification on the initial clustering result to determine the clustering result;

[0050] The acquisition unit is used to train and analyze the clustering results based on a preset causal relationship graph model to obtain analysis data;

[0051] The determining unit is used to determine whether a fault has occurred based on the analyzed data.

[0052] This invention provides a fault detection device, characterized in that it includes:

[0053] Memory, used to store executable data instructions;

[0054] A processor is configured to execute executable instructions stored in the memory, and when the executable instructions are executed, the processor executes the fault detection method.

[0055] This invention provides a computer-readable storage medium storing executable instructions, which, when executed by one or more processors, execute the fault detection method.

[0056] This invention provides a fault detection method and apparatus, and a computer-readable storage medium. The method includes: acquiring a system call sequence; clustering the system call sequence to obtain preliminary clustering results; performing random secondary verification on the initial clustering results to determine the final clustering result; training and analyzing the clustering results based on a preset causal graph model to obtain analysis data; and determining whether a fault has occurred based on the analysis data. By using the above implementation scheme, clustering the system call sequence to obtain clustering results, and analyzing the clustering results according to a preset causal graph model, it is possible to determine whether a fault has occurred. This eliminates the need for manual selection of a fault detection model, saving time and effort; furthermore, the fault detection method based on the preset causal graph model is adaptable to various scenarios. Attached Figure Description

[0057] Figure 1 This invention provides an optional flowchart of a fault detection method. Figure 1 ;

[0058] Figure 2 This invention provides an optional flowchart of a fault detection method. Figure 2 ;

[0059] Figure 3 This invention provides an optional flowchart of a fault detection method. Figure 3 ;

[0060] Figure 4 This invention provides an optional flowchart of a fault detection method. Figure 4;

[0061] Figure 5 This invention provides an optional flowchart of a fault detection method. Figure 5 ;

[0062] Figure 6 Schematic diagram of the fault detection device provided in the embodiments of the present invention Figure 1 ;

[0063] Figure 7 Schematic diagram of the fault detection device provided in the embodiments of the present invention Figure 2 . Detailed Implementation

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

[0065] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Figure 1 This is an optional flowchart of a fault detection method provided by an embodiment of the present invention. Figure 1 , will combine Figure 1 The steps shown are explained.

[0066] S101, Obtain the system call sequence.

[0067] In some embodiments of this invention, microservices are a software development technique, a variant of Service-Oriented Architecture (SOA), which advocates dividing a single application into a set of small services that coordinate and cooperate with each other to provide end-value to the user. Each service runs in its own independent process, and services communicate with each other using lightweight communication mechanisms (typically HTTP-based RESTful APIs). Each service is built around a specific business function and can be independently deployed to production environments, pre-production environments, etc. The system call sequence is a record of system calls generated during microservice interaction.

[0068] In some embodiments of the present invention, the terminal can monitor the system call process through a monitoring algorithm to obtain the system call sequence.

[0069] In some embodiments of the present invention, step S101 can be implemented by S1011, S1012, S1013 and S1014, as follows:

[0070] S1011, Process-level program for the monitored object.

[0071] In some embodiments of the present invention, the process-level program is a user-defined bytecode program, and the object refers to the user. The embodiments of the present invention do not impose any restrictions.

[0072] In some embodiments of the present invention, the terminal can monitor the user's system call sequence through a monitoring algorithm.

[0073] S1012. Dynamically input process-level programs into kernel hook functions to track the entry and exit points of each system call.

[0074] In some embodiments of this invention, the hook function is a function in the kernel with its normal access flow. If it is desired to change the original execution flow, such as the read operation on a certain file, then monitoring of the read operation on that file can be dynamically added. By inserting a hook function, the normal execution flow of the program can be interrupted to perform the desired operation. This can serve as a monitoring function or completely suspend the execution of a function.

[0075] In some embodiments of the present invention, the terminal can dynamically input user-defined bytecode programs into the kernel hook function to track the entry and exit points of each system call.

[0076] S1013. Obtain the call record based on the entry and exit positions of each system call.

[0077] In some embodiments of the present invention, the terminal can obtain a record of system calls by knowing the entry and exit points of each system call.

[0078] For example, when the processes p1, p2, p3, ..., pn used by microservice Bi are classified according to the characteristics carried by the processes (p1i, p2i, p3i, ..., pni), the support vector machine algorithm is used for classification [Cmn], and the records of the calls are dynamically injected into the kernel hook function Hp and recorded as R1, R2, R3, ..., Rn.

[0079] S1014. Based on the call record, obtain the system call sequence.

[0080] In some embodiments of the present invention, the terminal can obtain the system call sequence through system call records.

[0081] It should be noted that the system call sequence consists of system call records.

[0082] It is understood that, in some embodiments of the present invention, the terminal can monitor the process-level program of the object; dynamically input the process-level program into the kernel hook function to track the entry and exit positions of each system call; obtain the call record based on the entry and exit positions of each system call; and obtain the system call sequence based on the call record, thus providing an object for microservice fault detection.

[0083] S102. Cluster the system call sequence to obtain preliminary clustering results.

[0084] In some embodiments of the present invention, the terminal can use a clustering algorithm to cluster the system call sequence to obtain preliminary clustering results.

[0085] In some embodiments of the present invention, step S102 can be implemented by S1021 and S1022, as follows:

[0086] S1021. For the system call sequence, obtain the execution sequence by re-establishing the transformation matrix.

[0087] In some embodiments of the present invention, the execution sequence is obtained by performing a matrix transformation on the system call sequence.

[0088] In some embodiments of the present invention, the terminal can perform initial parameterized weight calculations on the system call sequence to re-establish the transformation matrix for the microservice, thereby obtaining the execution sequence.

[0089] S1022. Use a clustering algorithm to cluster the execution sequence, thereby achieving clustering of microservices and obtaining preliminary clustering results.

[0090] In some embodiments of this invention, clustering is a widely used exploratory data analysis technique. People's first instinct regarding data often involves meaningfully grouping it, grouping similar objects into one category and dissimilar objects into different categories. Clustering algorithms are typical unsupervised learning algorithms, primarily used to automatically group similar samples into a single category. In clustering algorithms, samples are classified into different categories based on their similarity. Different similarity calculation methods yield different clustering results; commonly used similarity calculation methods include Euclidean distance. Commonly used clustering algorithms include K-means clustering, hierarchical clustering, SOM clustering, and FCM clustering.

[0091] In some embodiments of the present invention, the clustering algorithm used is the K-means clustering algorithm, and the embodiments of the present invention are not limited thereto.

[0092] In some embodiments of the present invention, the terminal can use the K-means clustering algorithm to cluster the execution sequence, thereby achieving microservice clustering and obtaining preliminary clustering results.

[0093] It is understood that, in some embodiments of the present invention, the terminal can obtain the execution sequence by re-establishing the transformation matrix through the system call sequence; clustering the execution sequence using a clustering algorithm, thereby achieving clustering of microservices, obtaining preliminary clustering results, and analyzing the acquired data, which can improve the efficiency of fault detection.

[0094] S103. Perform random secondary verification on the preliminary clustering results to determine the clustering results.

[0095] In some embodiments of the present invention, verification is performed to protect the accuracy of the clustering results detected.

[0096] In some embodiments of the present invention, the terminal can perform random secondary verification on the preliminary clustering results and determine the final clustering results based on the verification results.

[0097] For example, the call record Rn of the kernel hook function Hp is used as the basis for verification. If the classification is correct, the access record is valid; otherwise, the access record is invalid.

[0098] S104. Based on the preset causal relationship graph model, the clustering results are trained and analyzed to obtain the analysis data.

[0099] In some embodiments of the present invention, the core of the preset causal relationship graph model is to construct a causal relationship pointing graph between two types of running data corresponding to sequence data in a specific time period, so as to form a fault relationship graph of microservice access calls, and determine whether the access is successful or not.

[0100] In some embodiments of the present invention, the terminal can use a preset causal relationship graph model to perform comprehensive analysis on the clustering results and obtain the analyzed data.

[0101] S105. Based on the analyzed data, determine whether a fault has occurred.

[0102] In some embodiments of the present invention, the terminal can determine whether a fault has occurred by analyzing data and comparing it with a preset threshold.

[0103] It is understood that, in some embodiments of the present invention, the terminal can obtain a system call sequence; cluster the system call sequence to obtain a preliminary clustering result; perform random secondary verification on the preliminary clustering result to determine the clustering result; train and analyze the clustering result based on a preset causal relationship graph model to obtain analysis data; and determine whether a fault has occurred based on the analysis data. This can improve the applicability of the fault detection method and improve the efficiency of fault detection.

[0104] In some embodiments of the present invention, step S105 can be implemented by S1051 and S1052, as follows:

[0105] S1051. If the analyzed data is greater than the preset threshold, a fault is determined to have occurred.

[0106] In some embodiments of the present invention, the preset threshold is set in advance, typically 0.5.

[0107] In some embodiments of the present invention, the terminal can compare the analyzed data with a preset threshold, and if the analyzed data is greater than the preset threshold, a fault is determined to have occurred.

[0108] For example, the preset threshold is 0.5, and the analyzed data is 0.55. Since the analyzed data is greater than the preset threshold, it is determined that a fault has occurred.

[0109] S1052. If the analyzed data is less than or equal to the preset threshold, it is determined that no fault has occurred.

[0110] In some embodiments of the present invention, the terminal can compare the analyzed data with a preset threshold. If the analyzed data is less than or equal to the preset threshold, it is determined that no fault has occurred.

[0111] For example, if the preset threshold is 0.5 and the analyzed data is 0.5, then since the analyzed data is equal to the preset threshold, it is determined that no fault has occurred.

[0112] For example, the preset threshold is 0.5, and the analyzed data is 0.45. Since the analyzed data is less than the preset threshold, it is determined that no fault has occurred.

[0113] It is understood that, in some embodiments of the present invention, the terminal can determine whether a fault has occurred by comparing and analyzing data with the size of a preset threshold, thereby improving the accuracy of fault detection.

[0114] In some embodiments of the present invention, S1015 and S1016 are performed before step S1011, as follows:

[0115] S1015. Initialize the weights of the first monitoring algorithm; wherein, the first monitoring algorithm is a system process call model.

[0116] In some embodiments of the present invention, a process is a temporary execution of a program, with a lifespan; it is an independent unit for the system to allocate and schedule resources; multiple processes can be executed alternately on the processor; the system establishes a process control block for each process.

[0117] In some embodiments of the present invention, the terminal may initialize the weights of the algorithm before using the first monitoring algorithm.

[0118] S1016. Use the first monitoring algorithm to monitor the process of the object, thereby monitoring the process-level program of the object.

[0119] In some embodiments of the present invention, the terminal can monitor user processes through a first monitoring algorithm, thereby monitoring the user's process-level programs.

[0120] It is understood that, in some embodiments of the present invention, the terminal can initialize the weights of the first monitoring algorithm to monitor the user's processes, and then monitor the user's process-level programs, providing a basis for fault detection.

[0121] In some embodiments of the present invention, after step S1014, step S1017 is also performed, as follows:

[0122] S1017. Feed back the system call sequence to the first monitoring algorithm, update the weight of the first monitoring algorithm, and obtain the updated weight of the first monitoring algorithm.

[0123] In some embodiments of the present invention, the terminal can feed back the system call sequence to the first monitoring algorithm, use it to update the weight of the first monitoring algorithm, obtain the updated weight of the first monitoring algorithm, and continue monitoring.

[0124] For example, when the microservice Ai is triggered to be invoked, the system updates the algorithm's weights based on the relevant attributes of service A (A1, A2, A3, A4, ..., An) by judging the relevant weights and characteristics of the service through the set of key attributes.

[0125] It is understood that, in some embodiments of the present invention, the terminal can update the weight of the first monitoring algorithm through system call sequence, optimize the first monitoring algorithm, and further improve the accuracy of fault detection.

[0126] In some embodiments of the present invention Figure 2 This is an optional flowchart of a fault detection method provided by an embodiment of the present invention. Figure 2 , will combine Figure 2 The steps shown are explained.

[0127] S201. Obtain the data flow trajectory and save it to the target location.

[0128] In some embodiments of the present invention, the target location is a specific address in memory.

[0129] In some embodiments of the present invention, the terminal can obtain the data flow relationship between microservices through a fault detection algorithm and save it to a specific address in memory.

[0130] S202. Based on the data flow trajectory, use an adversarial network to predict microservice calls and obtain the data flow trajectory for predicting microservice calls.

[0131] In some embodiments of this invention, adversarial networks refer to Generative Adversarial Networks (GANs), a type of deep learning model and one of the most promising unsupervised learning methods on complex distributions in recent years. The model generates reasonably good outputs through the game-like learning between (at least) two modules in its framework: a generative model and a discriminative model. In the original GAN ​​theory, it is not required that both the generative and discriminative models be neural networks; they only need to be able to fit the corresponding generative and discriminative functions. However, in practice, deep neural networks are generally used as both the generative and discriminative models.

[0132] In some embodiments of the present invention, the terminal can use an adversarial network to predict the data flow trajectory of microservice calls by utilizing the data flow trajectory.

[0133] For example, taking microservice call behavior as an example, data is recorded through target access trajectory records, which is the data flow trajectory. Based on this, a trajectory prediction model based on generative adversarial networks is established. The generative model adopts an encoder-decoder structure using a Long Short-Term Memory (LSTM) network. Given a historical access trajectory as input, the decoder generates the access trajectory for the predicted time period. The discriminative model constructs a neural network based on a Multilayer Perceptron (MLP) to perform multiple discriminations between the generated predicted trajectory and the target trajectory. By jointly training the generative and discriminative models, the access trajectory of the microservice in future time periods can be predicted.

[0134] S203. Based on the predicted data flow trajectory of microservice calls, use a preset behavior trajectory model for training and analysis to determine whether a fault has occurred.

[0135] In some embodiments of the present invention, the target trajectory record is the obtained data flow trajectory.

[0136] In some embodiments of the present invention, the terminal can use a preset behavior trajectory model to perform a preliminary classification of the data flow trajectory of the predicted microservice call and obtain a classification result; based on the classification result, it can determine whether a fault has occurred.

[0137] It is understood that, in some embodiments of the present invention, the terminal can obtain the data flow trajectory and save it to the target location; based on the data flow trajectory, use an adversarial network to predict microservice calls and obtain the predicted data flow trajectory of microservice calls; based on the predicted data flow trajectory of microservice calls, use a preset behavior trajectory model for training and analysis to determine whether a fault has occurred, thereby improving the applicability of the fault detection method and improving the efficiency and accuracy of fault detection.

[0138] In some embodiments of the present invention Figure 3 This is an optional flowchart of a fault detection method provided by an embodiment of the present invention. Figure 3 Step S203 can be implemented by S2031-S2032, as follows:

[0139] S2031. Based on the preset behavior trajectory model, perform preliminary classification of the data flow trajectory of the predicted microservice calls to obtain the classification results.

[0140] In some embodiments of the present invention, the terminal can determine whether the predicted data flow trajectory of the microservice call is normal by predicting whether the access is normal, and obtain the classification result of the predicted data flow trajectory of the microservice call.

[0141] In some embodiments of the present invention, step S2031 can be implemented by S20311, S20312 and S20313, as follows:

[0142] S20311. Mark the data flow trajectory that is accessed normally as the normal category.

[0143] In some embodiments of the present invention, the terminal can determine that the predicted data flow trajectory of the microservice call conforms to general access rules, and the predicted data flow trajectory of the microservice call is normal access and is marked as normal.

[0144] S20312. Mark the data flow trajectory with missing or abnormal data as an anomaly category.

[0145] In some embodiments of the present invention, the terminal can determine that the predicted data flow trajectory of the microservice call is incomplete or that there is an access termination phenomenon. In this case, the predicted data flow trajectory of the microservice call is an abnormal access and is marked as an abnormal category.

[0146] S20313. Based on the normal category and the abnormal category, the classification result is obtained.

[0147] In some embodiments of the present invention, the terminal can divide the predicted data flow trajectory of microservice calls into normal and abnormal categories to obtain classification results.

[0148] It is understood that, in some embodiments of the present invention, the terminal can determine whether the predicted data flow trajectory of the microservice call is normal by predicting whether the access is normal, thereby obtaining the classification result of the predicted data flow trajectory of the microservice call, which improves the accuracy of fault detection.

[0149] S2032. Based on the classification results, determine whether a fault has occurred.

[0150] In some embodiments of the present invention, the terminal can classify the predicted data flow trajectory of microservice calls into normal and abnormal categories, thereby determining whether a fault has occurred.

[0151] It is understood that, in some embodiments of the present invention,

[0152] In some embodiments of the present invention, step S2032 can be implemented by S20321, S20322 and S20323, as follows:

[0153] S20321. Based on the classification results, sample and perform secondary verification to obtain the verification results.

[0154] In some embodiments of the present invention, the terminal can obtain a verification result by verifying the classification result, which includes a correct verification result and an incorrect verification result.

[0155] S20322. If the verification result is incorrect, a fault is determined to have occurred.

[0156] In some embodiments of the present invention, the terminal can determine that the microservice has failed by verifying an error in the result.

[0157] S20323. If the verification result is correct, it is determined that no fault has occurred.

[0158] In some embodiments of the present invention, the terminal can determine that the microservice has not failed if the verification result is correct.

[0159] It is understood that, in some embodiments of the present invention, the terminal can perform secondary verification on the classification results to determine whether the microservice has failed, thereby improving the accuracy of fault detection.

[0160] In some embodiments of the present invention Figure 4This is an optional flowchart of a fault detection method provided by an embodiment of the present invention. Figure 4 Before step S201, steps S204 and S205 are also executed to combine... Figure 4 The steps shown are explained.

[0161] S204. Initialize the weights of the second monitoring algorithm; whereby the second monitoring algorithm is the target trajectory model.

[0162] In some embodiments of the present invention, the terminal may initialize the weights of the algorithm before using the second monitoring algorithm.

[0163] S205. Pre-embed probe target points at the service access entry point, and use the second monitoring algorithm to monitor the interaction trajectory of the object and obtain the data flow trajectory.

[0164] In some embodiments of the present invention, the terminal can pre-embed probe target points at the service access entry point, and then monitor the interaction trajectory of the object through a second monitoring algorithm to obtain the data flow trajectory.

[0165] For example, by setting up a watchdog protection mechanism, probes are distributed to hidden entry points of multiple services. When a service is actively requested or passively invoked, it can be identified and recorded, thereby obtaining the data flow trajectory through a second monitoring algorithm.

[0166] It is understood that, in some embodiments of the present invention,

[0167] In some embodiments of the present invention, after step S201, step S206 is also executed, as follows:

[0168] S206. Feed back the data flow trajectory to the second monitoring algorithm, update the weight of the second monitoring algorithm, and obtain the updated weight of the second monitoring algorithm.

[0169] In some embodiments of the present invention, the terminal can feed back the data flow trajectory to the second monitoring algorithm, use it to update the weight of the second monitoring algorithm, obtain the updated weight of the second monitoring algorithm, and continue monitoring.

[0170] It is understood that, in some embodiments of the present invention, the terminal can update the weights of the second monitoring algorithm through data flow trajectory, thereby optimizing the second monitoring algorithm and further improving the accuracy of fault detection. Below, an exemplary application of the embodiments of the present invention in a practical application scenario will be described.

[0171] This invention provides an optional flowchart of a fault detection method. Figure 5 ,like Figure 5 As shown. This fault detection method may include the following steps:

[0172] 1. Algorithm selection for system call path monitoring.

[0173] In some embodiments of the present invention, the terminal can select different monitoring algorithms based on different monitoring paths. These monitoring algorithms include those based on system process call models and those based on target trajectory models. Before using a monitoring algorithm, the algorithm's weights are initialized. The monitored data is then used to update the weights of the monitoring algorithm and optimize it.

[0174] 2. Use monitoring algorithms to monitor the system call process.

[0175] In some embodiments of the present invention, the terminal can monitor the microservice call process through a monitoring algorithm to obtain the system call sequence or data flow trajectory.

[0176] 3. System call data analysis.

[0177] In some embodiments of the present invention, the terminal can re-establish the transformation matrix for the microservice by performing parameterized weight calculations on the system call sequence to obtain the execution sequence; and cluster the execution sequence to obtain the clustering result. The terminal can also predict the microservice call trajectory by using an adversarial network based on the data flow trajectory to obtain the predicted data flow trajectory.

[0178] 4. Fault detection.

[0179] In some embodiments of the present invention, the terminal can analyze the clustering results using a preset causal relationship graph model to determine whether a fault has occurred. The terminal can also analyze the predicted data flow trajectory using a preset behavioral trajectory model to determine whether a fault has occurred.

[0180] It is understood that, in some embodiments of the present invention, the terminal can obtain system call data through monitoring algorithms; obtain analysis results by analyzing the system call data; and analyze the analysis results using a preset causal relationship graph model or a preset behavioral trajectory model to confirm whether a fault has occurred. By adopting the above scheme, the applicability of the fault detection method is improved, and the efficiency and accuracy of fault detection are enhanced.

[0181] Based on the fault detection method described in the above embodiments, this invention also provides a fault detection device, such as... Figure 6 The above, Figure 6 A schematic diagram of a fault detection structure provided in an embodiment of the present invention. Figure 1 The device includes: an acquisition unit 601 and a determination unit 602; wherein,

[0182] The acquisition unit 601 is used to acquire a system call sequence; and to cluster the system call sequence to obtain a preliminary clustering result.

[0183] The determining unit 602 is used to perform random secondary verification on the preliminary clustering results to determine the clustering results;

[0184] The acquisition unit 601 is used to train and analyze the clustering results based on a preset causal relationship graph model to obtain analysis data;

[0185] The determining unit 602 is used to determine whether a fault has occurred based on the analyzed data.

[0186] In some embodiments of the present invention, the acquisition unit 601 is used to obtain an execution sequence by re-establishing a transformation matrix for the system call sequence; and to cluster the execution sequence using a clustering algorithm to achieve clustering of microservices and obtain the preliminary clustering result.

[0187] In some embodiments of the present invention, the fault detection device further includes a determination unit 603; wherein,

[0188] The determination unit 603 is used to determine that a fault has occurred if the analyzed data is greater than a preset threshold, and to determine that no fault has occurred if the analyzed data is less than or equal to the preset threshold.

[0189] In some embodiments of the present invention, the fault detection device further includes a monitoring unit 604 and a tracking unit 605; wherein,

[0190] The monitoring unit 604 is used to monitor the process-level program of the object;

[0191] The tracing unit 605 is used to dynamically input the process-level program into the kernel hook function to trace the entry and exit positions of each system call;

[0192] The acquisition unit 601 is used to obtain a record of the call based on the entry and exit positions of each system call; and to obtain the system call sequence based on the call record.

[0193] In some embodiments of the present invention, the monitoring unit 604 is used to initialize the weight of the first monitoring algorithm; wherein the first monitoring algorithm is a system process call model; the first monitoring algorithm is used to monitor the process of the object, thereby monitoring the process-level program of the object.

[0194] In some embodiments of the present invention, the acquisition unit 601 is used to feed back the system call sequence to the first monitoring algorithm, update the weight of the first monitoring algorithm, and obtain the updated weight of the first monitoring algorithm.

[0195] In some embodiments of the present invention, the acquisition unit 601 is used to acquire the data flow trajectory and save it to the target location; based on the data flow trajectory, an adversarial network is used to predict microservice calls and acquire the predicted data flow trajectory of microservice calls;

[0196] The determining unit 602 is used to determine whether a fault has occurred by training and analyzing a preset behavior trajectory model based on the data flow trajectory of the predicted microservice call.

[0197] In some embodiments of the present invention, the monitoring unit 604 is used to initialize the weights of the second monitoring algorithm; wherein the second monitoring algorithm is a target trajectory model;

[0198] The acquisition unit 601 is used to pre-embed probe target points at the service access entry point, use the second monitoring algorithm to monitor the interaction trajectory of the object, and acquire the data flow trajectory.

[0199] In some embodiments of the present invention, the acquisition unit 601 is used to feed back the data flow trajectory to the second monitoring algorithm, update the weight of the second monitoring algorithm, and obtain the updated weight of the second monitoring algorithm.

[0200] In some embodiments of the present invention, the acquisition unit 601 is used to perform preliminary classification of the data flow trajectory of the predicted microservice call based on the preset behavior trajectory model, and obtain classification results;

[0201] The determining unit 602 is used to determine whether a fault has occurred based on the classification result.

[0202] In some embodiments of the present invention, the fault detection device further includes a labeling unit 606; wherein,

[0203] The labeling unit 606 is used to label the data flow trajectory that is accessed normally as the normal category; and to label the data flow trajectory that is missing data or abnormal data as the abnormal category.

[0204] The determining unit 602 is used to obtain the classification result based on the normal category and the abnormal category.

[0205] In some embodiments of the present invention, the acquisition unit 601 is used to perform secondary verification by sampling based on the classification result to obtain the verification result;

[0206] The determination unit 603 is used to determine that a fault has occurred if the verification result is incorrect, and to determine that a fault has not occurred if the verification result is correct.

[0207] Based on the fault detection method described in the above embodiments, this invention also provides a fault detection device, such as... Figure 7 As shown, Figure 7 A schematic diagram of the structure of a fault detection device provided in an embodiment of the present invention. Figure 2 The device includes a processor 701 and a memory 702; the memory 701 stores one or more programs executable by the processor, and when one or more programs are executed, the processor 702 executes any of the fault detection methods described in the previous embodiments.

[0208] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0209] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0210] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0211] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0212] The above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.

Claims

1. A fault detection method characterized by, include: The microservice call process is monitored using a second monitoring algorithm to obtain the data flow trajectory and save it to the target location; The second monitoring algorithm is used to monitor the interaction trajectory of microservices through pre-embedded probe targets, and the data flow trajectory represents the record of the interaction trajectory; Based on the data flow trajectory, an adversarial network is used to predict microservice calls, obtain the data flow trajectory of the predicted microservice calls, and realize the prediction of the access trajectory of microservices in future time periods. Based on the predicted data flow trajectory of microservice calls, a preset behavior trajectory model is used for training and analysis to determine whether a fault has occurred. Before obtaining the data flow trajectory and saving it to the target location, the method further includes: Pre-embed probe target points at the service access entry point, and use the second monitoring algorithm to monitor the interaction trajectory generated when the microservice is actively requested and passively called, and obtain the data flow trajectory. The step of determining whether a fault has occurred by training and analyzing a preset behavioral trajectory model based on the predicted data flow trajectory of microservice calls includes: Based on the preset behavior trajectory model, the data flow trajectory of the predicted microservice call is initially classified to obtain the classification result; Based on the classification results, it is determined whether a fault has occurred.

2. The method of claim 1, wherein, Before obtaining the data flow trajectory and saving it to the target location, the method further includes: The weights of the second monitoring algorithm are initialized.

3. The method according to claim 1 or 2, characterized in that, After obtaining the data flow trajectory and saving it to the target location, the method further includes: The data flow trajectory is fed back to the second monitoring algorithm to update the weights of the second monitoring algorithm, thus obtaining the updated weights of the second monitoring algorithm.

4. The method of claim 1, wherein, The preliminary classification of the data flow trajectory of the predicted microservice call based on the preset behavior trajectory model yields the following classification results: The data flow trajectory that is accessed normally will be marked as normal. Mark the data flow trajectory that is missing or abnormal as an anomaly category; The classification result is obtained based on the normal category and the abnormal category.

5. The method of claim 1, wherein, The step of determining whether a fault has occurred based on the classification results includes: Based on the classification results, samples are taken for secondary verification to obtain the verification results; If the verification result is incorrect, a fault is determined to have occurred. If the verification result is correct, it is determined that no fault has occurred.

6. A fault detection apparatus characterized by comprising: include: Memory, used to store executable data instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 5.

7. A computer readable storage medium characterized by The storage medium stores executable instructions that, when executed, cause the processor to perform the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Trajectory data sorting method based on generative adversarial network

    CN108564129A

  • A method and a device for generating a malicious software benchmark test set

    CN109241740A

  • System fault diagnosis method and device based on log semantic mining

    CN110288004A

  • Micro-service fault root cause positioning method and device based on causal inference

    CN113391943A