Fault location method and device, computer system and readable storage medium
Through Bayesian network processing node attribute data of microservice architecture, the problem of locating the source of faults in microservice architecture fault diagnosis and prediction is solved, and fast and accurate fault location and prediction is achieved, reducing labor costs and improving operation and maintenance is improved. efficiency.
Patent Information
- Application Number
- CN201911126084.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-11-15
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2039-11-15
AI Technical Summary
The existing microservice architecture fault diagnosis and prediction methods are difficult to quickly locate the source of the fault. They rely on manual troubleshooting and the diagnosis results are unstable when the data set is small or the quality is poor, so they cannot effectively predict the fault.
Bayesian network is used to process node attribute data of microservice architecture, and by building topological structures and conditional probability distributions, failing nodes are located and potential failures are predicted to adapt to data missing situations.
It reduces labor costs, improves operation and maintenance efficiency, and can accurately locate fault nodes that have occurred or are about to occur, improving the accuracy of fault diagnosis and prediction.
Smart Images

Figure CN112817786B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of Internet technology, and more specifically, to a fault location method, a fault location device, a computer system, and a computer-readable storage medium. Background Art
[0002] Microservice architecture is a new type of service architecture that is now widely used in large-scale enterprise-level applications. Different from the traditional monolithic application architecture and SOA (Service-Oriented Architecture) architecture, the microservice architecture relies on emerging cloud technology and container technology and does not require a service bus. The core concept is low-coupling, small component applications and services, and each microservice matches the business needs it meets.
[0003] The microservice architecture can be viewed as a directed acyclic graph (hereinafter referred to as a directed graph) composed of multiple service nodes (hereinafter referred to as nodes), and there is a parent-child logical relationship between the nodes. Therefore, when a node in the directed graph fails, it may cause a chain reaction downstream, and ultimately reduce the availability of the entire microservice architecture. The failure is reflected or the failure warning is issued, which may not be the source of the failure, but the end of the failure chain. At this time, manual tracing and troubleshooting are required, which is time-consuming and labor-intensive, and it is impossible to quickly restore the availability of the architecture. Figure 1 As shown, when service 1 fails, it is not known whether it is service 1 itself that fails, or whether the failure of service 3 causes the failure of service 1, or the failure of service 4 causes the failure of service 1, or other complex reasons. These all require manual investigation.
[0004] There are two important issues in the daily application scenarios of microservice architecture, namely finding the cause of a fault when it occurs, which is actually fault diagnosis (Fault Diagnosis), and predicting a fault before it occurs, which is actually a fault prediction (Fault Prediction) problem. They are summarized here as optimization problems of microservice architecture.
[0005] Taking Azure, AWS, and Netflix as examples, the industry currently has the following technical solutions:
[0006] (1) Azure Fault Diagnosis Component
[0007] Azure, developed by Microsoft, supports fault diagnosis of microservice architecture by using cloud service monitoring and deploying diagnostic components. Azure can enable monitoring services to sample and collect CPU usage, network usage and other indicator values every 5 minutes, and store them in user accounts so that users can view them at any time.
[0008] The fault diagnosis component provided by Azure is actually a log collector that distinguishes sources. It combines the information records of application logs, Windows application logs, .NET event sources, etc. when the exception occurs, and provides developers with some statistical information, such as the number of requested connections, the number of instance restarts, etc., and draws this information into a report, which is displayed when the developer wants to start analysis. Therefore, the Azure fault diagnosis component does not actually have the ability to reason and analyze, but is only a monitoring record collector.
[0009] (2) AWS Cloudwatch
[0010] AWS (Amazon Web Service) is a cloud computing service platform provided by Amazon. AWS provides similar fault detection methods as Azure, that is, using cloud monitors to monitor indicators such as the CPU usage of containers. Unlike Azure, AWS also provides user-defined triggers to maintain the high availability of microservice architectures. Users can use Lamda functions and EC2 Run Command to set triggers. When an AWS fails, new instances are automatically started to replace the failed instances, or automatic capacity expansion (Auto Scaling) is performed to avoid service failure. Similarly, AWS currently does not provide a means to automatically generate fault diagnosis reports using machine learning or other solutions.
[0011] (3) Netflix spatial clustering algorithm
[0012] As a well-known streaming media Internet company, Netflix has fully applied the microservice architecture to the entire application system. Therefore, Netflix has also done a lot of research on the maintenance and optimization of the microservice architecture. Netflix's goal is to find servers that are in a "sub-healthy" or "suboptimal" state, that is, when the server indicators are normal, find the tendency of the server to behave abnormally, which is similar to a fault prediction problem.
[0013] Netflix uses an unsupervised learning method, namely the density-based spatial clustering method DBSCAN, to automatically identify servers that may have abnormalities. This method is essentially a clustering algorithm, that is, to find other clusters that may be about to fail near a failed server. This method requires two parameters, one is the distance and the other is the minimum cluster size. Furthermore, Netflix uses a simulated annealing algorithm to avoid manual parameter adjustment. This series of fault detection work is completely automated.
[0014] Currently, data released by Netflix shows that this solution has an accuracy rate of 93% and a recall rate of 87%. Netflix is still working on optimizing this solution.
[0015] However, in the process of implementing the embodiments of the present disclosure, the inventors found that the above-mentioned related technologies have at least the following defects:
[0016] The Azure fault diagnosis component does not actually have reasoning and analysis capabilities, but is just a simple monitoring record collector. Failures occur in a sequential and chain-like manner, making it difficult to locate the fundamental problem, and it still relies on manual resolution after an alarm occurs.
[0017] The trigger type represented by AWS adds a conditional function based on the alarm. Although it makes the system scalable to a certain extent, it still stays on the most superficial phenomenon of the problem and cannot solve the source of the fault, nor can it predict the fault before it occurs.
[0018] Fault diagnosis and fault prediction methods that use machine learning algorithms such as clustering are too dependent on data sets. When the data set is small or of poor quality, the diagnosis / prediction results are very unstable and difficult to intervene and manipulate. Summary of the invention
[0019] In view of this, the present disclosure provides a fault location method, a fault location device, a computer system and a computer-readable storage medium.
[0020] One aspect of the present disclosure provides a fault location method, which is applied to a directed acyclic microservice architecture composed of multiple nodes, each node in the above microservice architecture is used to provide a corresponding predetermined service, and the above method includes: obtaining attribute data of a first node in the above microservice architecture, wherein the node attribute of the above first node is known; configuring the attribute data of a second node in the above microservice architecture to be a null value, wherein the node attribute of the above second node is unknown; using a Bayesian network corresponding to the above microservice architecture to process the attribute data of the above first node and the null value of the above second node to obtain a corresponding processing result; and based on the above processing result, determining the node attribute of the above second node in the above microservice architecture to locate the faulty node in the above microservice architecture.
[0021] According to an embodiment of the present disclosure, the method further includes: before using the Bayesian network for processing, preprocessing the attribute data of the first node and the null value of the second node to obtain the attribute data and null value satisfying a predetermined format, respectively.
[0022] According to an embodiment of the present disclosure, the above-mentioned Bayesian network is used to process the attribute data of the above-mentioned first node and the null value of the above-mentioned second node to obtain corresponding processing results, including: using the above-mentioned Bayesian network to process the attribute data and null values that meet the above-mentioned predetermined format, and predicting the possible values of the null values that meet the above-mentioned predetermined format, wherein different possible values of each node correspond to different node attributes of the node.
[0023] According to an embodiment of the present disclosure, the method further includes: constructing a topological structure of the Bayesian network; and determining a conditional probability distribution of each node included in the topological structure, thereby forming the Bayesian network.
[0024] According to an embodiment of the present disclosure, the above-mentioned construction of the topological structure of the above-mentioned Bayesian network includes: determining the boundaries of the nodes contained in the above-mentioned Bayesian network; determining the parent-child logical relationship between the nodes within the above-mentioned boundaries; and constructing a directed edge between any two nodes with the parent-child logical relationship, thereby forming the topological structure of the above-mentioned Bayesian network.
[0025] According to an embodiment of the present disclosure, the above-mentioned determination of the parent-child logical relationship between each node within the above-mentioned boundary includes: determining the business logic relationship and / or dependency relationship between each node within the above-mentioned boundary; and determining the parent-child logical relationship between each node within the above-mentioned boundary based on the above-mentioned business logic relationship and / or the above-mentioned dependency relationship.
[0026] Another aspect of the present disclosure provides a fault locating device, which is applied to a directed acyclic microservice architecture composed of multiple nodes, each node in the above microservice architecture is used to provide a corresponding predetermined service, and the above device includes: an acquisition module, used to acquire attribute data of a first node in the above microservice architecture, wherein the node attribute of the above first node is known; a configuration module, used to configure the attribute data of a second node in the above microservice architecture to be a null value, wherein the node attribute of the above second node is unknown; a processing module, used to process the attribute data of the above first node and the null value of the above second node using a Bayesian network corresponding to the above microservice architecture to obtain a corresponding processing result; and a first determination module, used to determine the node attribute of the above second node in the above microservice architecture based on the above processing result, so as to locate the faulty node in the above microservice architecture.
[0027] According to an embodiment of the present disclosure, the processing module further includes: before using the Bayesian network for processing, preprocessing the attribute data of the first node and the null value of the second node to obtain the attribute data and null value satisfying a predetermined format, respectively.
[0028] According to an embodiment of the present disclosure, the above-mentioned processing module is used to: use the above-mentioned Bayesian network to process attribute data and null values that satisfy the above-mentioned predetermined format, and predict possible values of null values that satisfy the above-mentioned predetermined format, wherein different possible values of each node correspond to different node attributes of the node.
[0029] According to an embodiment of the present disclosure, the above-mentioned device also includes: a construction module, which is used to construct the topological structure of the above-mentioned Bayesian network; and a second determination module, which is used to determine the conditional probability distribution of each node included in the above-mentioned topological structure, so as to form the above-mentioned Bayesian network.
[0030] According to an embodiment of the present disclosure, the above-mentioned construction module includes: a first determination unit, used to determine the boundary of the nodes contained in the above-mentioned Bayesian network; a second determination unit, used to determine the parent-child logical relationship between the nodes within the above-mentioned boundary; and a construction unit, used to construct a directed edge between any two nodes with a parent-child logical relationship, thereby forming the topological structure of the above-mentioned Bayesian network.
[0031] According to an embodiment of the present disclosure, the above-mentioned second determination unit is used to: determine the business logic relationship and / or dependency relationship between each node within the above-mentioned boundary; and determine the parent-child logical relationship between each node within the above-mentioned boundary based on the above-mentioned business logic relationship and / or the above-mentioned dependency relationship.
[0032] Another aspect of the present disclosure provides a computer system, including: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method described above.
[0033] Another aspect of the present disclosure provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method described above.
[0034] Another aspect of the present disclosure provides a computer program, which includes computer executable instructions, and the instructions are used to implement the method described above when executed.
[0035] Through the embodiments of the present disclosure, for service failures or failures that have already occurred in the microservice architecture, or service nodes that are about to experience service failures or failures, fault diagnosis and prediction can be performed through a fault location method based on a Bayesian network, thereby reducing labor costs and improving operation and maintenance efficiency. At the same time, since one of the characteristics of the Bayesian network is that it can adapt to data missing situations, based on the Bayesian network, it can adapt to the problem that the probability distribution of unknown service nodes cannot be statistically analyzed, so that service nodes that have already failed or are predicted to fail can be located. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The above and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0037] Figure 1 A schematic diagram of a microservice architecture consisting of multiple service nodes is shown schematically;
[0038] Figure 2 A schematic diagram of a Bayesian network according to an embodiment of the present disclosure is schematically shown;
[0039] Figure 3 A schematic diagram of a Bayesian network according to another embodiment of the present disclosure is schematically shown;
[0040] Figure 4 A flowchart of constructing a Bayesian network according to an embodiment of the present disclosure is schematically shown;
[0041] Figure 5 A flowchart schematically illustrates a topological structure of a Bayesian network according to an embodiment of the present disclosure;
[0042] Figure 6 A schematic diagram schematically shows a topological structure according to an embodiment of the present disclosure;
[0043] Figure 7 A flowchart of a fault location method according to an embodiment of the present disclosure is schematically shown;
[0044] Figure 8 A block diagram schematically shows a fault location device according to an embodiment of the present disclosure; and
[0045] Fig. 9 A block diagram of a computer system suitable for implementing a fault location method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0046] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0047] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0048] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0049] The Bayesian network is a probabilistic graphical model (PGM) based on the Bayesian method. The Bayesian method refers to a method for calculating the probability of a hypothesis based on the Bayesian formula. The Bayesian formula can be expressed as follows:
[0050]
[0051] Among them A 1 ∪A 2 ∪...∪A m =1 and A 1 ∩A 2 ∩...∩A m =0, that is, A 1 ...A m is the m non-intersecting sub-events of a certain inevitable event. Therefore, the Bayesian formula calculates the posterior probability of an event based on the sample probability of the existing data and the prior probability of the hypothesis. The Bayesian method is an analytical method that uses the Bayesian formula to calculate the posterior probability and thus obtain the value of the unknown parameter.
[0052] Figure 2 A schematic diagram of a Bayesian network according to an embodiment of the present disclosure is schematically shown.
[0053] A Bayesian network is a directed acyclic graph of probability. Each node is a random variable and has its own conditional probability distribution (CPD). The directed edges between nodes represent the logical relationship between random variables, and the conditional probability of a child node represents the intensity of the influence of the parent node on it.
[0054] like Figure 2As shown, the Bayesian network includes nodes A to E, the conditional probability distribution corresponding to each node, directed edges, and the entire graph is acyclic. Among them, the probability of TRUE of each node can represent the probability that the node is normal, and the probability of FALSE of each node can represent the probability that the node may fail. Nodes A to E can be a machine where a single service is deployed, a Docker or a virtual machine, etc. Each node can provide a corresponding predetermined service, and the predetermined service can be an independent program with one or a group of similar functional interfaces. According to an embodiment of the present disclosure, a group of services that use the same deployment scheme, the same cluster, and process closely related logic in business can be called a service system. Combining the various related service systems, a system with little or no external dependence can be called an application.
[0055] In related technologies, for example, the Azure fault diagnosis component does not have the ability to make inferences and analyses, but is simply a monitoring record collector. Faults occur in a time-series and chain-like manner, making it difficult to locate fundamental problems, and still rely on manual resolution after an alarm occurs. The trigger type represented by AWS adds conditional functions to the alarm. Although this makes the system scalable to a certain extent, it still stays at the most superficial phenomenon of the problem, and cannot solve the source of the fault or predict it before it occurs. Fault diagnosis and fault prediction methods that use machine learning algorithms such as clustering are too dependent on data sets. When the data set is small or of poor quality, the diagnosis / prediction results are very unstable and difficult to intervene and manipulate.
[0056] In view of this, in order to locate a service fault (Fault) or failure (Failure) that has occurred in a microservice architecture, or a service node that is about to experience a service fault or failure, an embodiment of the present disclosure provides a fault locating method, by obtaining attribute data of a first node in the microservice architecture, wherein the node attributes of the first node are known; configuring the attribute data of a second node in the microservice architecture to be a null value, wherein the node attributes of the second node are unknown; using a Bayesian network corresponding to the microservice architecture to process the attribute data of the first node and the null value of the second node to obtain a corresponding processing result; and based on the processing result, determining the node attributes of the second node in the microservice architecture to locate the faulty node in the microservice architecture.
[0057] The present disclosure uses a Bayesian network-based fault location method to perform fault diagnosis and prediction, thereby reducing labor costs and improving operation and maintenance efficiency. At the same time, since one of the characteristics of the Bayesian network is that it can adapt to data missing situations, the Bayesian network can adapt to the problem that the probability distribution of unknown service nodes cannot be statistically analyzed, so that service nodes that have already failed or are predicted to fail can be located.
[0058] In order to understand the technical concept of the present disclosure, the following will explain how to use the Bayesian network for fault diagnosis and fault prediction.
[0059] Figure 3 A schematic diagram of a Bayesian network according to another embodiment of the present disclosure is schematically shown.
[0060] like Figure 3 As shown in the figure, the Bayesian network is a directed acyclic graph about probability, including nodes A, B, and C. Among them, the failure (error) probability of node A is 10%, the warning (warning) probability is 20%, and the normal (normal) probability is 70%. The directed line segments from A to B and C represent that B and C are downstream services of A and will be affected by the state of A. Therefore, the probability table of B and C is a conditional probability table, that is: under the probability of A failing, the probability of B failing is 100%; under the probability of A warning, B has a 15% chance of failing and a 45% chance of warning. Therefore, based on this Bayesian network diagram, the state of the remaining nodes can be inferred in real time based on the observation of nodes A, B, and C.
[0061] For example, if node B is found to be faulty, then the current state of B is error. According to the conditional probability table, the probability of A failing is 90%, that is, there is a 90% chance that A is the source of B's failure (fault diagnosis scenario). On the contrary, if A is observed to be faulty, then Figure 3 The conditional probability shown is that when A fails, the probability of B and C failing is 100%, so the failure of A will inevitably lead to the failure of B and C (fault prediction scenario). Through this example, we can see how Bayesian networks are applied to fault diagnosis and fault prediction in architecture.
[0062] It should be understood that Figure 3 The number of nodes in is only for illustration purposes and any number of nodes may be provided as required.
[0063] Reference below Figure 4 and Figure 5 , the construction process of the Bayesian network is explained in combination with a specific embodiment.
[0064] Figure 4 The flowchart of constructing a Bayesian network according to an embodiment of the present disclosure is schematically shown.
[0065] like Figure 4 As shown, the method includes operations S410 to S420.
[0066] In operation S410, a topological structure of a Bayesian network is constructed.
[0067] According to the embodiments of the present disclosure, constructing the topological structure of the Bayesian network is the first and most important step in creating the Bayesian network. The nodes of the Bayesian network determine which variables are involved in the inference of probability, the attributes and conditional probabilities of the nodes determine the performance and change mode of the variables, and the directed edges between the nodes reflect the influence relationship between the variables.
[0068] In operation S420, a conditional probability distribution of each node in the topological structure is determined, thereby forming a Bayesian network.
[0069] According to the embodiments of the present disclosure, after the topological structure of the Bayesian network is established, an important task is to complete the conditional probability table of each node, that is, the parameter setting of the Bayesian network.
[0070] In a Bayesian network, the conditional probability distribution of each node can be represented by a conditional probability table (CPT). The CPT needs to define the possible values of the node. In the embodiment of the present disclosure, the value range of each node is set to (normal, warning, error), that is, the performance state of the node is normal, warning, and failure / fault state. The physical meaning corresponding to the different value states of the node can be determined by professionals based on actual conditions.
[0071] According to an embodiment of the present disclosure, the conditional probability distribution of each node may be obtained based on statistics of a large amount of historical data.
[0072] For observable nodes, we can simply obtain the frequencies of various states of these nodes, further calculate the frequencies of various values of the node, and use this set of frequencies as the conditional probability in the CPT of the node.
[0073] For example, for service A, in 100 observations, error occurred 2 times, then P(error)=2 / 100=2%; warning occurred 15 times, then P(warning)=15 / 100=15%; the rest is normal, P(normal)=83 / 100=83%.
[0074] For unobservable nodes, it is impossible to directly observe and record the physical indicators of the container where the service node is located, or it is only possible to perform incomplete observation and recording. In this case, frequency cannot be used to replace conditional probability, and modeling is needed to infer the conditional probability distribution of unknown nodes. This step requires an understanding of the performance mode of unknown nodes, which can be guided by expert domain knowledge to try to obtain a suitable model from a priori perspective.
[0075] For example, in the Gaussian model is the probability model of the unobservable node. With the help of the parent-child logical relationship between this node and other nodes, let the parent node of node x be z, and σ be the probability distribution of z. By observing the characteristics of the Gaussian model, it can be found that the value of the Gaussian model decreases as x increases. In actual situations, the probability of a normal node is much greater than the probability of an error, so the probability of an error is f(x=3, σ), warning is f(x=2, σ), and normal is f(x=1, σ). This ensures that the current node is affected by the state of the parent node while being consistent with the actual situation (normal probability is greater).
[0076] Therefore, the probability of nodes that cannot be directly observed (i.e., unobservable nodes) can be modeled as:
[0077]
[0078]
[0079]
[0080] Finally, the conditional probability distribution of each node can be obtained by reference Figure 3 As shown, no further description is given here.
[0081] Reference below Figure 5 , the topological structure of constructing the Bayesian network is explained in combination with a specific embodiment.
[0082] Figure 5 The flowchart of constructing the topological structure of the Bayesian network according to the embodiment of the present disclosure is schematically shown.
[0083] like Figure 5 As shown, constructing the topological structure of the Bayesian network includes operations S510 to S530.
[0084] In operation S510 , boundaries of nodes included in the Bayesian network are determined.
[0085] In operation S520, the parent-child logical relationship between the nodes within the boundary is determined.
[0086] According to an embodiment of the present disclosure, when determining the parent-child logical relationship between nodes within a boundary, it is necessary to determine the business logic relationship and / or dependency relationship between the nodes within the boundary, and based on the business logic relationship and / or dependency relationship, determine the parent-child logical relationship between the nodes within the boundary.
[0087] In operation S530, a directed edge is constructed between any two nodes having a parent-child logical relationship, thereby forming a topological structure of the Bayesian network.
[0088] In actual projects, there are inevitably dependencies between subsystems belonging to the same large-scale application system. In the process of forming a Bayesian network, it is necessary to clarify the research object and try to divide the boundaries of data dependency and service dependency so that the service nodes included in the graph belong to the same data closed loop, and the dependencies between services are mainly internal dependencies, while the number of external dependencies can be ignored. If the subsystems established and maintained by multiple teams are split and reorganized to form an inference network, this inference is unreliable, and it is difficult to obtain relevant data, and the team does not have the authority to operate and modify it.
[0089] Therefore, we first need to determine the boundaries of the nodes that belong to the Bayesian network.
[0090] As mentioned above, it is necessary to clarify the direction of data flow in the business process, organize and summarize the services through which the data flows, and summarize the variables that need to be included in the Bayesian network.
[0091] For example, a team handles air ticket booking services. The business process includes querying tickets, filling in information, generating orders, payment process, confirming orders, inventory deductions, querying orders, etc. The business logic chain is complete, and the user order information also forms a closed loop here. Then the ticket query service, information writing service, order generation service... should all be included in the scope of the Bayesian network node. When making payments, it is necessary to call the coupon service of other teams, which can be considered not to belong to the scope of the Bayesian network node, because the failure of the coupon interface will not lead to the failure of the user's order.
[0092] Secondly, it is necessary to determine the logical relationship between nodes, that is, the parent-child relationship between nodes.
[0093] The parent-child logical relationship between nodes determines that when performing probabilistic inference, it must be the cause of the parent node that leads to the effect of the child node. Only on this basis can the causal model be analyzed.
[0094] The logical relationship between nodes can be formed through business logic processes and interface dependencies.
[0095] The business logic process needs to rely on the architect to design and make decisions. For example, the architect decides to generate an order first, fill in the order information when the user places an order, and assign it to the user. In this case, the Generate Order Service is the parent node of the Order Information Write Service. On the contrary, if the architect decides to write the order information back to the database first, and then retrieve the information from the database through the message queue to generate the order echo page, then the Order Information Write Service is the parent node of the Generate Order Service.
[0096] Interface dependency is the embodiment of the actual logical relationship of the program. For example, although the query process does not have a direct business upstream and downstream relationship with inventory deductions, the inventory deduction service actually uses the API provided by the query service. In this case, there should be a directed edge between the two nodes, because the query service's ability to provide APIs directly determines whether the inventory deduction service's service capabilities are normal.
[0097] After determining the nodes and directed edges required by the Bayesian network, the initial Bayesian network structure is formed. Figure 1 to Figure 3 As shown, no further description is given here.
[0098] According to an embodiment of the present disclosure, after a usable Bayesian network is constructed, the attribute values of some or all nodes in the Bayesian network can be determined based on historical data, that is, the conditional probability distribution of some or all nodes in the Bayesian network can be determined.
[0099] The following will introduce the data used to build Bayesian networks, especially the structure and input process of attribute learning data, including how to generate training sets and how to split training data and test data.
[0100] In a Bayesian network, an input that conforms to the format is called a case. Each case is a row of node values. The data structure is shown in Table 1.
[0101] Table 1
[0102] Serial number Node 1 Node 2 Node 3 … Node n 0 Node 1 value Node 2 value Node 3 value … Node n value
[0103] Figure 6 A schematic diagram of a Bayesian network structure is shown schematically. Figure 6 In the Bayesian network structure shown in the figure, if A and B cause D to fail, the input CASE rows formed are shown in Table 2.
[0104] Table 2
[0105] Serial number A B C D E 0 error error normal error normal
[0106] If C causes D to fail, the input CASE line is as shown in Table 3.
[0107] Table 3
[0108] Serial number A B C D E 0 normal normal error error normal
[0109] Multiple cases obtained from various records of actual observations eventually form the training set of the Bayesian network. For example, there are 1,000 such observations, of which 40 are errors at node A, so the error probability of node A is 4%; in the case of node A being an error (40 records), the number of faults at node B is 10, then P(B=error|A=error)=10 / 40=25%. By calculating the conditional probability of each node in the network, a complete Bayesian network can be obtained.
[0110] The input data received by the Bayesian network as prediction data is in the same form as the training data mentioned above, which are all discrete CASE, except that the node attributes to be predicted or diagnosed are set to empty. Such a record is called the current finding. The input format of the prediction data is as shown in Table 4, where node k is the observed node, and the value of the known node k is the enumeration value 1, where the enumeration value 1 can represent an attribute, for example, it can be faulty or normal, and NaN means that the attribute is set to empty.
[0111] Table 4
[0112] Serial number Node 1 Node 2 … Node k … Node n 0 NaN NaN NaN The node k value is 1 … NaN
[0113] Figure 7 The flowchart of the fault location method according to the embodiment of the present disclosure is schematically shown.
[0114] The fault location method is applied to a directed acyclic microservice architecture consisting of multiple nodes, where each node in the microservice architecture is used to provide a corresponding predetermined service, such as Figure 7 As shown, the method includes operations S710 to S740.
[0115] In operation S710, attribute data of a first node in a microservice architecture is obtained, wherein the node attributes of the first node are known.
[0116] According to an embodiment of the present disclosure, the number of the first nodes may be one or more. In actual situations, if the number of the first nodes is determined in advance for predicting a fault scenario, the first nodes may be observable nodes. The attribute data of the first nodes may be probability values of different attributes obtained through training based on historical data, wherein the attribute types include but are not limited to fault, warning, and normal.
[0117] In operation S720, attribute data of a second node in the configuration microservice architecture is a null value, wherein the node attribute of the second node is unknown.
[0118] According to an embodiment of the present disclosure, the number of the second node may be one or more. In actual situations, the second node may be an unobservable node.
[0119] Before using the Bayesian network for processing, the attribute data of the first node and the null value of the second node may be preprocessed to obtain the attribute data and the null value that meet the predetermined format, respectively.
[0120] In operation S730, the attribute data of the first node and the null value of the second node are processed using a Bayesian network corresponding to the microservice architecture to obtain a corresponding processing result.
[0121] The Bayesian network is used to process attribute data and null values that meet the predetermined format, and predict possible values of null values that meet the predetermined format, wherein different possible values of each node correspond to different node attributes of the node. For example, a fault attribute corresponds to a possible value, and a normal attribute also corresponds to a possible value. The possible value can be represented by a probability value.
[0122] In operation S740 , based on the processing result, a node attribute of a second node in the microservice architecture is determined to locate a faulty node in the microservice architecture.
[0123] According to the embodiments of the present disclosure, Figure 6 Take the Bayesian network structure shown in Figure 5 as an example. For example, if a failure of node D is observed, the cause of the failure of node D needs to be traced. That is, the first node is D, and the node attributes of the second nodes A, B, C, and E are unknown. The Bayesian network needs to be used to determine the attributes of the second nodes A, B, C, and E. The input CASE rows formed are shown in Table 5.
[0124] Table 5
[0125] Serial number A B C D E 0 NaN NaN NaN error NaN
[0126] Input this record in which the attribute data of all nodes except the observed node D are empty values, and the Bayesian network will predict the possible values of the empty nodes, where node D is a known observed node, the probability of attribute 1 of node D is 1, and the probability of attribute 2 of node D is 0, where attribute 1 can refer to error and attribute 2 can refer to normal. The predicted result format is as shown in Table 6, and the probability values corresponding to the attributes of the remaining nodes (i.e. the possible values of the empty value) will be output separately.
[0127] Table 6
[0128]
[0129] According to an embodiment of the present disclosure, the probability values corresponding to the attributes of the remaining nodes can be used as processing results, and the node attributes of the second node in the microservice architecture can be determined by the probability values corresponding to the attributes of the remaining nodes to locate the faulty node in the microservice architecture. For example, the probability values corresponding to the attributes of the remaining nodes can be used to determine whether each node is in a normal state or a faulty state. The real faulty node that caused the first node to fail can be determined based on the status information of each node.
[0130] Through the embodiments of the present disclosure, a new solution that is different from existing solutions in the industry is proposed to solve the maintenance and optimization problems of microservice architecture. Since the Bayesian network has the characteristic of adapting to missing data (i.e., null values), the Bayesian network is used for fault location, which overcomes the defects of unstable diagnosis or prediction results in related technologies and can improve the accuracy of diagnosis / prediction.
[0131] Through the embodiments of the present disclosure, different from the traditional monitoring agent method, this solution adds a machine learning method to reduce the workload of people; it is also different from pure machine learning solutions, such as spatial clustering algorithms, decision tree algorithms, etc., and can be combined with expert domain knowledge to improve the accuracy.
[0132] Figure 8 A block diagram of a fault location device according to an embodiment of the present disclosure is schematically shown.
[0133] The fault location device is applied to a directed acyclic microservice architecture composed of multiple nodes, and each node in the microservice architecture is used to provide a corresponding predetermined service, such as Figure 8 As shown, the fault location device 800 includes an acquisition module 810 , a configuration module 820 , a processing module 830 and a first determination module 840 .
[0134] The acquisition module 810 is used to acquire attribute data of a first node in the microservice architecture, wherein the node attributes of the first node are known.
[0135] The configuration module 820 is used to configure the attribute data of the second node in the microservice architecture to be a null value, wherein the node attribute of the second node is unknown.
[0136] The processing module 830 is used to process the attribute data of the first node and the null value of the second node using a Bayesian network corresponding to the microservice architecture to obtain a corresponding processing result.
[0137] The first determination module 840 is used to determine the node attribute of the second node in the microservice architecture based on the processing result to locate the faulty node in the microservice architecture.
[0138] Through the embodiments of the present disclosure, for service faults (Fault) or failures (Failure) that have already occurred in the microservice architecture, or service nodes that are about to experience service faults or failures, fault diagnosis and prediction can be performed through a fault location method based on a Bayesian network, reducing labor costs and improving operation and maintenance efficiency. At the same time, since one of the characteristics of the Bayesian network is that it can adapt to data missing situations, based on the Bayesian network, it can adapt to the problem that the probability distribution of unknown service nodes cannot be statistically analyzed, so that service nodes that have already failed or are predicted to fail can be located.
[0139] According to an embodiment of the present disclosure, the processing module 820 is further used to pre-process the attribute data of the first node and the null value of the second node before processing using the Bayesian network to obtain the attribute data and the null value that meet the predetermined format respectively.
[0140] According to an embodiment of the present disclosure, the processing module 820 is used to use a Bayesian network to process attribute data and null values that satisfy a predetermined format, and predict possible values of null values that satisfy a predetermined format, wherein different possible values of each node correspond to different node attributes of the node.
[0141] According to an embodiment of the present disclosure, the fault locating device 800 further includes a building module and a second determining module.
[0142] The building block is used to construct the topology of a Bayesian network.
[0143] The second determination module is used to determine the conditional probability distribution of each node included in the topological structure, thereby forming a Bayesian network.
[0144] According to an embodiment of the present disclosure, the construction module includes: a first determination unit, used to determine the boundary of the nodes contained in the Bayesian network; a second determination unit, used to determine the parent-child logical relationship between the nodes within the boundary; and a construction unit, used to construct a directed edge between any two nodes with a parent-child logical relationship, thereby forming a topological structure of the Bayesian network.
[0145] According to an embodiment of the present disclosure, the second determination unit is used to determine the business logic relationship and / or dependency relationship between nodes within the boundary; and determine the parent-child logical relationship between nodes within the boundary based on the business logic relationship and / or dependency relationship.
[0146] According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits, or at least part of the functions of any one of them can be implemented in one module. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be split into multiple modules for implementation. According to the embodiments of the present invention, any one or more of the modules, submodules, units, and subunits can be at least partially implemented as hardware circuits, such as field programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems on chips, systems on substrates, systems on packages, application specific integrated circuits (ASICs), or can be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, according to the embodiments of the present invention, one or more of the modules, submodules, units, and subunits can be at least partially implemented as computer program modules, and when the computer program modules are run, the corresponding functions can be performed.
[0147] For example, any multiple of the acquisition module 810, the configuration module 820, the processing module 830, and the first determination module 840 can be combined in one module / unit / subunit for implementation, or any one of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more modules / units / subunits in these modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present disclosure, at least one of the acquisition module 810, the configuration module 820, the processing module 830, and the first determination module 840 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or the same part of any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the acquisition module 810 , the configuration module 820 , the processing module 830 and the first determination module 840 may be at least partially implemented as a computer program module, and when the computer program module is executed, a corresponding function may be performed.
[0148] It should be noted that the implementation methods of the device part in the embodiments of the present disclosure are the same or similar to the implementation methods of the method part in the embodiments of the present disclosure. For the description of the implementation methods of the device part, please refer to the description of the implementation methods of the method part, which will not be repeated here.
[0149] Fig. 9A block diagram of a computer system suitable for implementing the method described above according to an embodiment of the present disclosure is schematically shown. Fig. 9 The computer system shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0150] like Fig. 9 As shown, the computer system 900 according to the embodiment of the present disclosure includes a processor 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903. The processor 901 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 901 may also include an onboard memory for caching purposes. The processor 901 may include a single processing unit or multiple processing units for performing different actions of the method flow according to the embodiment of the present disclosure.
[0151] In RAM 903, various programs and data required for the operation of system 900 are stored. Processor 901, ROM 902 and RAM 903 are connected to each other through bus 904. Processor 901 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 902 and / or RAM 903. It should be noted that the program can also be stored in one or more memories other than ROM 902 and RAM 903. Processor 901 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.
[0152] According to an embodiment of the present disclosure, the system 900 may further include an input / output (I / O) interface 905, which is also connected to the bus 904. The system 900 may further include one or more of the following components connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.
[0153] According to an embodiment of the present disclosure, the method flow according to an embodiment of the present disclosure can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the processor 901, the above-mentioned functions defined in the system of the embodiment of the present disclosure are executed. According to an embodiment of the present disclosure, the system, equipment, device, module, unit, etc. described above can be implemented by a computer program module.
[0154] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0155] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. For example, it may include, but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.
[0156] For example, according to an embodiment of the present disclosure, the computer-readable storage medium may include the ROM 902 and / or the RAM 903 described above and / or one or more memories other than the ROM 902 and the RAM 903 .
[0157] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0158] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0159] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A fault location method is applied to a directed acyclic microservice architecture composed of multiple nodes, each node in the microservice architecture is used to provide a corresponding predetermined service, and the method comprises: Acquire attribute data of a first node in the microservice architecture, wherein the node attributes of the first node are known; Configuring attribute data of a second node in the microservice architecture to be a null value, wherein the node attribute of the second node is unknown; Processing the attribute data of the first node and the null value of the second node using a Bayesian network corresponding to the microservice architecture to obtain a corresponding processing result; and Based on the processing result, determining a node attribute of the second node in the microservice architecture to locate a faulty node in the microservice architecture; Among them, the construction process of the Bayesian network includes: determining the probability model of the second node, wherein the probability model includes a Gaussian model; when the model result of the probability model decreases as the value of the second node increases, configuring the value of the second node where an error occurs to be greater than the value where a warning occurs to be greater than the value where a normal occurs to satisfy the actual situation that the probability of the second node appearing normally is greater than the probability of an error.
2. The method according to claim 1, wherein: The method further comprises: Before using the Bayesian network for processing, the attribute data of the first node and the null value of the second node are preprocessed to obtain the attribute data and the null value that meet a predetermined format, respectively.
3. The method according to claim 2, wherein: The using the Bayesian network to process the attribute data of the first node and the null value of the second node to obtain corresponding processing results includes: The Bayesian network is used to process attribute data and null values that meet the predetermined format, and possible values of the null values that meet the predetermined format are predicted, wherein different possible values of each node correspond to different node attributes of the node.
4. The method according to claim 1, wherein: The method further comprises: Constructing the topological structure of the Bayesian network; and A conditional probability distribution of each node included in the topological structure is determined to form the Bayesian network.
5. The method according to claim 4, wherein: The topological structure of the Bayesian network is constructed, including: Determining the boundaries of nodes included in the Bayesian network; Determining the parent-child logical relationship between nodes within the boundary; and A directed edge is constructed between any two nodes having a parent-child logical relationship, thereby forming the topological structure of the Bayesian network.
6. The method according to claim 5, wherein: Determining the parent-child logical relationship between the nodes within the boundary includes: Determining business logic relationships and / or dependency relationships between nodes within the boundary; and Based on the business logic relationship and / or the dependency relationship, a parent-child logic relationship between nodes within the boundary is determined.
7. A fault location device, applied to a directed acyclic microservice architecture composed of multiple nodes, each node in the microservice architecture is used to provide a corresponding predetermined service, the device comprising: An acquisition module, configured to acquire attribute data of a first node in the microservice architecture, wherein the node attributes of the first node are known; A configuration module, used to configure the attribute data of a second node in the microservice architecture to be a null value, wherein the node attribute of the second node is unknown; a processing module, configured to process the attribute data of the first node and the null value of the second node using a Bayesian network corresponding to the microservice architecture to obtain a corresponding processing result; and A first determination module, configured to determine, based on the processing result, a node attribute of the second node in the microservice architecture, so as to locate a faulty node in the microservice architecture; Among them, the construction process of the Bayesian network includes: determining the probability model of the second node, wherein the probability model includes a Gaussian model; when the model result of the probability model decreases as the value of the second node increases, configuring the value of the second node where an error occurs to be greater than the value where a warning occurs to be greater than the value where a normal occurs to satisfy the actual situation that the probability of the second node appearing normally is greater than the probability of an error.
8. The device according to claim 7, wherein: The processing module is also used for: Before using the Bayesian network for processing, the attribute data of the first node and the null value of the second node are preprocessed to obtain the attribute data and the null value that meet a predetermined format, respectively.
9. The device according to claim 8, wherein: The processing module is used for: The Bayesian network is used to process attribute data and null values that meet the predetermined format, and possible values of the null values that meet the predetermined format are predicted, wherein different possible values of each node correspond to different node attributes of the node.
10. The device according to claim 7, wherein: The device also includes: A construction module, used to construct the topological structure of the Bayesian network; and The second determination module is used to determine the conditional probability distribution of each node included in the topological structure, so as to form the Bayesian network.
11. The device according to claim 10, wherein: The building blocks include: A first determining unit, configured to determine the boundaries of the nodes included in the Bayesian network; A second determining unit is used to determine the parent-child logical relationship between the nodes within the boundary; and The construction unit is used to construct a directed edge between any two nodes having a parent-child logical relationship, thereby forming a topological structure of the Bayesian network.
12. The device according to claim 11, wherein The second determining unit is used for: Determining business logic relationships and / or dependency relationships between nodes within the boundary; and Based on the business logic relationship and / or the dependency relationship, a parent-child logic relationship between nodes within the boundary is determined.
13. A computer system comprising: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, enables the processor to implement the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
System fault positioning method and system based on Bayesian network
CN110032463A