A method and apparatus for predicting service node abnormal state
By constructing a monitoring system and analyzing the state transition matrix, and using Markov chains to predict the abnormal states of service nodes in a distributed microservice system, the problem of long anomaly investigation time in existing technologies is solved, real-time monitoring and anomaly prediction of service nodes are realized, and system stability is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIONPAY
- Filing Date
- 2022-11-23
- Publication Date
- 2026-06-05
AI Technical Summary
In distributed microservice systems, existing technologies cannot effectively monitor and predict abnormal states of service nodes, resulting in long troubleshooting times and an inability to predict abnormal situations in advance, which affects system stability.
A monitoring system is built to analyze the historical operating status of service nodes through state transition matrices, predict future abnormal states using Markov chains, and evaluate the correlation between service nodes by combining system relationship graphs and Dijkstra distance, thereby identifying potential abnormal nodes in advance.
It enables real-time monitoring and anomaly prediction of service nodes in a distributed microservice system, reducing anomaly investigation time and improving system stability and response speed.
Smart Images

Figure CN116149927B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of operation and maintenance technology, and in particular to a method and apparatus for predicting abnormal states of service nodes. Background Technology
[0002] In a distributed microservice system architecture, an incoming user request passes through different service nodes sequentially, is processed, and then a result is returned to the user. If any service node experiences a delay or problem in this entire processing chain, the final result may be abnormal. Current technical solutions typically investigate the status of each service node only after a business anomaly occurs. However, in a distributed service architecture, different service nodes may be developed by different teams or deployed on different servers. Therefore, as more and more business system functions are added and the interrelationships between systems become increasingly complex, identifying the specific service node in the chain that caused the problem for a business anomaly requires a significant amount of time. Furthermore, investigating the status of each service node only after a business anomaly occurs lacks the ability to predict and infer potential problems at each service node, thus hindering timely mitigation of anomalies.
[0003] Therefore, there is an urgent need for a solution to monitor and predict the status of each service node. Summary of the Invention
[0004] This application provides a method and apparatus for predicting abnormal states of service nodes, used to monitor and predict the state of each service node.
[0005] Firstly, this application provides a method for predicting abnormal states of service nodes. The method includes: obtaining the operating state of each service node in a monitoring system at a first moment; the monitoring system is constructed around the service nodes in the distributed microservice system that are the objects of monitoring; determining the transition probability of the monitoring system to various set states at a second moment based on the operating state of each service node and the state transition matrix of the monitoring system; the state transition matrix is obtained through the historical operating states of each service node in the monitoring system; and determining the service node corresponding to the abnormal state from the set states whose transition probabilities meet preset requirements as the service node that may be abnormal at the second moment.
[0006] In one possible design, the monitoring system is built around the service node in the distributed microservice system that serves as the monitoring object, and includes: identifying a service node in the distributed microservice system as the monitoring object; selecting service nodes from the system relationship graph of the distributed microservice system whose association with the monitoring object is greater than a preset threshold; the system relationship graph is generated through the call relationships of each service node in the distributed microservice system; and combining the monitoring object and the service node with an association greater than the preset threshold to form the monitoring system.
[0007] In one possible design, the system relationship graph is generated through the call relationships between the service nodes in the distributed microservice system, including: generating the system relationship graph with each service node in the distributed microservice system as a vertex and the call relationship between any two service nodes in the distributed microservice system as an edge; wherein the weight of any edge is the number of calls between the two service nodes.
[0008] In one possible design, selecting service nodes from the system relationship graph of the distributed microservice system whose correlation with the monitored object is greater than a preset threshold includes: for any service node in the distributed microservice system, determining the sum of the weights of each edge from the service node to the monitored object based on the system relationship graph of the distributed microservice system; and determining service nodes whose weight sums meet the distance requirement as service nodes whose correlation with the monitored object is greater than the preset threshold.
[0009] In one possible design, the state transition matrix is obtained through the historical operating states of each service node within the monitoring system, including: collecting the historical operating states of each service node within the monitoring system at multiple times; for any first set state among various set states, counting the number of times the monitoring system transitions from the first set state to any second set state in adjacent times during the historical operating states; the first set state is any set state among the N types of set states of the monitoring system, and the second set state is any set state among the N types of set states of the monitoring system; determining the transition frequency corresponding to the first set state based on the number of times each second set state occurs; and determining the state transition matrix of the monitoring system under one-step transition based on the transition frequency corresponding to each first set state.
[0010] In one possible design, the transition probability of the monitoring system to various set states at the second time point is determined based on the operating status of each service node and the state transition matrix of the monitoring system. This includes: determining the time interval n between the first time point and the second time point; and determining the transition probability of the monitoring system in various set states after n-step transitions based on the state transition matrix of the monitoring system under one-step transition.
[0011] In one possible design, the method further includes: updating the historical operating status of the monitoring system at preset time intervals; and recalculating the state transition matrix of the monitoring system based on the updated historical operating status.
[0012] Secondly, embodiments of this application provide an apparatus for predicting abnormal states of service nodes, comprising:
[0013] The acquisition module is used to acquire the running status of each service node in the monitoring system at the first moment; the monitoring system is built around the service nodes in the distributed microservice system that are the monitoring objects.
[0014] The processing module is used to determine the transition probability of the monitoring system to various set states at a second time point based on the operating status of each service node and the state transition matrix of the monitoring system; the state transition matrix is obtained through the historical operating status of each service node in the monitoring system.
[0015] The processing module is further configured to determine, from the set states where the conversion probability meets the preset requirements, the service node corresponding to the abnormal state as the service node that may be abnormal at the second time moment.
[0016] In one possible design, the monitoring system is built around the service nodes in the distributed microservice system that serve as the monitoring objects. The processing module is further configured to: determine a service node in the distributed microservice system as the monitoring object; select service nodes from the system relationship graph of the distributed microservice system whose association with the monitoring object is greater than a preset threshold; the system relationship graph is generated through the call relationships of each service node in the distributed microservice system; and combine the monitoring object and the service nodes with an association greater than the preset threshold to form the monitoring system.
[0017] In one possible design, the processing module is further configured to generate the system relationship graph using each service node in the distributed microservice system as a vertex and the call relationship between any two service nodes in the distributed microservice system as an edge; wherein the weight of any edge is the number of calls between the two service nodes.
[0018] In one possible design, the processing module is further configured to, for any service node in the distributed microservice system, determine the sum of the weights of each edge from the service node to the monitored object based on the system relationship graph of the distributed microservice system; and determine the service nodes whose weight sums meet the distance requirements as service nodes whose correlation with the monitored object is greater than a preset threshold.
[0019] In one possible design, the processing module is further configured to collect the historical operating states of each service node within the monitoring system at multiple times; for any first set state among various set states, count the number of times the monitoring system transitions from the first set state to any second set state in adjacent times during the historical operating states; the first set state is any set state among the N types of set states of the monitoring system, and the second set state is any set state among the N types of set states of the monitoring system; determine the transition frequency corresponding to the first set state based on the number of times each second set state is reached; and determine the state transition matrix of the monitoring system under one-step transition based on the transition frequency corresponding to each first set state.
[0020] In one possible design, the processing module is further configured to determine the time interval n between the first time moment and the second time moment; and based on the state transition matrix of the monitoring system under one-step transition, after n-step transition, determine the transition probability of the monitoring system in various set states.
[0021] In one possible design, the device further includes an update module for updating the historical operating status of the monitoring system at preset time intervals; the processing module is also used to recalculate the state transition matrix of the monitoring system based on the updated historical operating status.
[0022] Thirdly, embodiments of this application also provide a computing device, including:
[0023] Memory, used to store program instructions;
[0024] A processor is configured to invoke program instructions stored in the memory and execute the method described in any possible design of the first aspect, according to the obtained program instructions.
[0025] Fourthly, embodiments of this application also provide a computer-readable storage medium storing computer-readable instructions that, when read and executed by a computer, cause the method described in any possible design of the first aspect to be implemented. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a schematic diagram of a system architecture applicable to an embodiment of this application;
[0028] Figure 2 A flowchart illustrating a method for predicting abnormal states of service nodes provided in an embodiment of this application;
[0029] Figure 3 A flowchart illustrating a method for constructing a monitoring system provided in an embodiment of this application;
[0030] Figure 4 A system relationship provided for embodiments of this application Figure 1 ;
[0031] Figure 5 A simplified system relationship provided for embodiments of this application Figure 1 ;
[0032] Figure 6 A system relationship provided for embodiments of this application Figure 2 ;
[0033] Figure 7 A simplified system relationship provided for embodiments of this application Figure 2 ;
[0034] Figure 8 A flowchart illustrating a method for generating a state transition matrix of a monitoring system, provided in an embodiment of this application;
[0035] Figure 9 A schematic diagram of the structure of a device for predicting abnormal states of service nodes provided in an embodiment of this application;
[0036] Figure 10 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0038] In the embodiments of this application, "multiple" refers to two or more. Terms such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.
[0039] To better understand the technical solution of this application, the design principle of the technical solution of this application will be briefly introduced below.
[0040] In handling production events, we often retrieve historical events to understand related events and the operational status of various systems at the time of the event. This allows us to assess the potential impact and develop targeted response strategies. Markov chains can also predict system trends by analyzing historical events.
[0041] Many deterministic phenomena follow the following evolutionary rules: the state of a system or process at time t0 can determine the state of the system or process at time t>t0, without relying on historical data of the state of the system or process before t0.
[0042] Definition of a Markov process: using X(t) = (v 2t ,v 2t ,...,v sysnum t X represents the state of the system set V at time t. t All states constitute the state space I. If for time t there are any n values t1... <t2<...<t n ,n≥3,t i ∈T, under the condition X(t) i )=x i ,x i Under the condition ∈I, i=1,2,...n-1, X(t) i )=x i X(t) n The conditional distribution function of X(t) is exactly equal to the conditional distribution function of X(t). n-1 )=x n-1 The conditional distribution function under the given conditions, i.e.
[0043] P(X(t n )≤x n |X(t1)=x1,X(t2)=x2,...,X(t n-1 )=x n-1 )
[0044] =P(X(t) n )≤x n |X(t n-1 )=x n-1 ),X n ∈R
[0045] Let the state X(t) of the system at time t be the stochastic process we are observing. Considering that the state of the system is discrete, we regard it as a discrete Markov process, i.e., a Markov chain, denoted as X. n=X(n), n = 1, 1, 2, ..., can be viewed as the result of successive observations of a discrete-state Markov process on the time set T1 = 0, 1, 2, ... . We define the state space of the chain as I = {a1, a2, ...}, then for any positive integer n, r and 0 ≤ t1 <t2<…<t r <t m ;t i For m, m+n∈T1, we have
[0046]
[0047] Where a i ∈I, that is, at time m, the state is a. i Under the given conditions, the state transitions to state a at time m+n. j The transition probability is
[0048] P ij (m,m+n)=P{X m+n =a j |X m =a i}
[0049] The matrix composed of state transition probabilities is called the state transition matrix. Of course, P ij When (m,m+n) depends only on i, j and the time interval n, it is denoted as P. ij (n). P ij (n)=P{X m+n =a j |X m =a i The n-step probability matrix of a Markov chain is called P(n), and the n-step transition probability matrix is P(n) = P ij (n), the one-step transition probability matrix is P(1). According to the CK equation,
[0050] P(n)={P(1)} n
[0051] The next crucial step is to calculate the one-step transition probability matrix of the system state. This can be obtained from the historical data of event logs, which provides the historical release matrix of the system state. Assume the system's state space is I = {0, 1}, where 1 represents a non-faulty state and 0 represents a faulty state. By collecting event log data, we can analyze that when the system fails at time t, the probability of it recovering to normal at time t+1 is p; when the system is normal at time t, the probability of it remaining normal at time t+1 is q.
[0052]
[0053] Using the state transition matrix, we can calculate the probability P(n) that the state changes from 0 to 1 at time t+n after the current time t. 01 This refers to the probability that the system recovers from a fault state. In this example, the system state is only divided into faulty and non-faulty states. In fact, the state space can be divided more finely according to the actual situation, and the state transition matrix can be expanded accordingly. Furthermore, the transition probability can be recalculated in real time based on the system state, improving the accuracy of the state transition probability.
[0054] Figure 1 A system architecture diagram applicable to embodiments of this application is shown, such as Figure 1 As shown, the system architecture includes at least a distributed microservice system 110, a state analysis system 120, and a terminal device 130. The distributed microservice system 110 and the state analysis system 120, as well as the distributed microservice system 110 and the terminal device 130, can be directly or indirectly connected via wired or wireless communication, which is not specifically limited herein.
[0055] The distributed microservice system 110 includes multiple service nodes for receiving requests sent by users through terminal devices 130. After the user's request is processed by different service nodes in the distributed microservice system 110, the result is returned to the user through terminal devices 130. Each service node in the business service system 110 can be an independent physical server, a server cluster consisting of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0056] The status analysis system 120 is used to obtain the status of each service node in the distributed microservice system 110, and then predict the service nodes that may fail in the future based on the status of each service node.
[0057] It should be noted that the above Figure 1 The system architecture shown is merely an example, and the embodiments in this application do not impose any specific limitations on it.
[0058] Figure 2 An exemplary flowchart of a method for predicting abnormal states of service nodes provided in an embodiment of this application is shown, such as... Figure 2 As shown, the method includes the following steps:
[0059] Step 201: Obtain the operating status of each service node in the monitoring system at the first moment.
[0060] In this embodiment, the monitoring system is built around the service nodes in the distributed microservice system that serve as the monitoring objects. The monitoring system includes multiple service nodes, and monitors the operational status of each service node. The operational status of each service node can include normal operation, undergoing changes, or failure. The operational status of each service node can be set according to actual needs.
[0061] Figure 3 An exemplary flowchart illustrates a method for constructing a monitoring system according to an embodiment of this application, such as... Figure 3 As shown, the method includes the following steps:
[0062] Step 301: Identify a service node in the distributed microservice system as the monitoring object.
[0063] Step 302: Select service nodes from the system relationship diagram of the distributed microservice system whose correlation with the monitored object is greater than a preset threshold.
[0064] In this embodiment, the system relationship graph is generated through the call relationships between service nodes in the distributed microservice system. Specifically, the system relationship graph can be generated using each service node in the distributed microservice system as a vertex and the call relationship between any two service nodes as an edge. The weight of any edge can be the number of calls between two service nodes, the call distance between two service nodes, etc. For example, the number of calls between two service nodes can be the number of TCP connections between the two service nodes, the number of calls to the MGW service, the number of calls to the Upmesh service, etc.
[0065] For example, a system relationship graph can be a directed multigraph, where G = (V, E) consists of a non-empty vertex set V, an edge set E, and functions from E to (u, v) | u, v ∈ V. If f(e1) = f(e2), then edges e1 and e2 are multi-edges. Treating the set of service nodes as a vertex set V and the call relationship between two service nodes as an edge set E, each service node and the abstract relationship between them can be abstracted into a directed multigraph. If the number of multi-edges is defined as the weight of each edge, it can be defined as a weighted directed graph G.
[0066] For example, each TCP connection can be viewed as an edge. By obtaining the network data of each service node, we can obtain the adjacency matrix of G, where e ij For service node V i To service node V j The calling relationship.
[0067]
[0068] Based on the above relationships, we can obtain a weighted directed graph of the call relationships between service nodes, such as... Figure 4 As shown.
[0069] In step 302, when selecting service nodes from the system relationship graph of the distributed microservice system whose correlation with the monitored object is greater than a preset threshold, the weights of each edge from the service node to the monitored object can be determined first, based on the system relationship graph of the distributed microservice system. Then, service nodes whose weights satisfy the distance requirement are identified as those whose correlation with the monitored object is greater than the preset threshold.
[0070] Step 303: Combine the monitored objects and service nodes that exceed the preset threshold to form a monitoring system.
[0071] Considering that when specifying a monitoring object, it's unnecessary to consider service nodes with minimal relationships to the monitored object, the monitoring relationship diagram can be simplified. Specifically, the Dijkstra distance between service nodes can be calculated, and the Dijkstra distance range of the monitoring system's influence area can be set as 'd'. This yields a sub-diagram of the influence range of each node. The simplified sub-diagram is shown below. Figure 5 As shown.
[0072] For example, when considering monitoring the account information exchange service node and its surrounding service nodes, and predicting the overall state of this monitoring system, firstly, by obtaining network call relationships, an adjacency matrix between the account information verification service node and its surrounding service nodes is abstracted, and a system relationship graph is generated, such as... Figure 6 As shown in the diagram. The correlation between service nodes is assessed based on the Dijstra distance between them. Then, by limiting the Dijstra distance, the overall monitoring system can be simplified. The simplified diagram is shown below. Figure 7 As shown.
[0073] Step 202: Based on the operating status of each service node and the state transition matrix of the monitoring system, determine the transition probability of the monitoring system to various set states at the second time point.
[0074] In this embodiment, the state transition matrix is obtained by monitoring the historical operating status of each service node in the system.
[0075] Figure 8 An exemplary flowchart illustrates a method for generating a state transition matrix of a monitoring system according to an embodiment of this application. Figure 8 As shown, the method includes the following steps:
[0076] Step 801: Collect the historical operating status of each service node in the monitoring system at multiple times.
[0077] Step 802: For any first setting state among various setting states, count the number of times the monitoring system changes from the first setting state to any second setting state in adjacent time periods during historical operation.
[0078] Wherein, the first setting state is any one of the N types of setting states of the monitoring system; the second setting state is any one of the N types of setting states of the monitoring system.
[0079] Step 803: Determine the switching frequency corresponding to the first setting state based on the number of times each second setting state is reached.
[0080] Step 804: Determine the state transition matrix of the monitoring system under one-step transition based on the transition frequency corresponding to each first set state.
[0081] The following example illustrates the method for generating the state transition matrix of a monitoring system.
[0082] Assume that the monitoring system S includes four service nodes {service node A, service node B, service node C, and service node D}, and each service node has three operating states {normal operation, under change, fault}, denoted as {0, 1, 2}. Then the monitoring system S has 3 4 There are several operating states, namely the system operating state space I = {(0,0,0,0), (0,0,0,1), (0,0,0,1)……(2,2,2,2)}.
[0083] Assume that the historical operating status of each service node in the monitoring system S at 1,000,000 time points is collected as shown in Table 1:
[0084] Table 1
[0085]
[0086]
[0087] Based on the historical data collected above, the state transition matrix of the monitoring system s under one-step transformation can be obtained. The specific steps are as follows:
[0088] For each operating state of the monitoring system s, the number of times the monitoring system s transitions from that operating state to each of the various operating states at adjacent time points is counted. Taking the operating state (0,0,0,0) of the monitoring system s as an example, the number of times the monitoring system s transitions from the operating state (0,0,0,0) to various operating states ({(0,0,0,0), (0,0,0,1), (0,0,0,1)……(2,2,2,2)}) at adjacent time points is counted as shown in Table 2:
[0089] Table 2
[0090] Running status frequency (0,0,0,0) 26909.0 (0,0,0,1) 7783.0 (0,0,0,2) 7713.0 (0,0,1,0) 7745.0 (0,0,1,1) 2281.0 ... ... (2,2,1,1) 188.0 (2,2,1,2) 171.0 (2,2,2,0) 612.0 (2,2,2,1) 179.0 (2,2,2,2) 172.0
[0091] As shown in Table 2, in the historical data, the monitoring system changed from running state (0,0,0,0) to running state (0,0,0,0) 26909 times and changed to running state (0,0,0,1) 7783 times at adjacent times.
[0092] Similarly, for each operating state of the monitoring system s, the number of times the monitoring system s changes from that operating state to various operating states at adjacent time points can be counted. In this way, the system state X = i, i ∈ I can be counted and converted into the frequency matrix of each state in the system state space.
[0093] By calculating the probability of each column of the system state matrix, we can obtain the 1-step state transition probability matrix P(1) as follows.
[0094]
[0095] By using the state transition matrix of the monitoring system s under one-step transformation, we can obtain the probability of the system transitioning to each operating state at time t+1 when the operating state of the monitoring system s at time t is (0,0,0,0). For example, when the operating state of the monitoring system s at time t is (0,0,0,0), the probability of it transitioning to the operating state (0,0,0,0) at time t+1 is 16.39%, the probability of it transitioning to the operating state (0,0,0,1) at time t+1 is 4.67%, and the probability of it transitioning to the operating state (0,0,0,2) at time t+1 is 4.70%; when the operating state of the monitoring system s at time t is (2,2,2,1), the probability of it transitioning to the operating state (0,0,0,0) at time t+1 is 16.56%, and the probability of it transitioning to the operating state (0,0,0,1) at time t+1 is 5.48%.
[0096] Since the one-step probability matrix is derived from historical event statistics, the operation of this mechanism can continuously collect new events and add them to the historical event set to update the one-step transition matrix to adapt to system changes and generated events.
[0097] Based on the derivation formula above, P(n) = {P(1)} n The state transition matrix at time t+n can be obtained through matrix multiplication, allowing the derivation of the system state at time t+n. For example, the following is a two-step transition probability matrix.
[0098]
[0099]
[0100] Using the two-step transition matrix described above, we can obtain the probability of the system transitioning to each state at time t+2 when the system state at time t is (0,0,0,0). For example, we can find that if the system is in a normal operating state at time t, the probability that the system will still be in a normal state at time t+2 is the highest, and the transition probability is 16.41%.
[0101] In step 202, when determining the transition probability of the monitoring system to various set states at the second time point based on the operating status of each service node and the state transition matrix of the monitoring system, the time interval n between the first time point and the second time point can be determined first. Then, based on the state transition matrix of the monitoring system under one-step transition, after n-step transition, the transition probability of the monitoring system in various set states can be determined.
[0102] Step 203: From the set states where the conversion probability meets the preset requirements, determine the service node corresponding to the abnormal state as the service node that may be abnormal at the second moment.
[0103] For example, assuming that the probability of the system's operating state changing to (0,0,0,0) at time t+3 is the highest when the system is in normal operating state (0,0,0,0) at time t using the 3-step transition matrix, then it can be inferred that service node D has a high probability of being in a fault state at time t+3, that is, service node D may experience an anomaly at time t+3, and it is necessary to investigate the service node in advance.
[0104] In one possible implementation, the historical operating status of the monitoring system can be updated at preset time intervals, and then the state transition matrix of the monitoring system can be recalculated based on the updated historical operating status.
[0105] This application provides a method for predicting abnormal states of service nodes. It collects the call relationships between service nodes and generates these relationships based on a directed weighted graph. Dijkstra's distance is used to evaluate the correlation between service nodes, and the entire set of service nodes is divided into subsystem sets. By statistically analyzing historical events, Markov chains are used to predict the state changes of the subsystem sets within a certain future timeframe, thus proactively identifying and addressing potentially abnormal service nodes.
[0106] Based on the same technological concept Figure 9 An exemplary illustration is provided by an embodiment of this application for an apparatus for predicting abnormal states of service nodes. For example... Figure 9 As shown, the device 900 includes:
[0107] The acquisition module 901 is used to acquire the running status of each service node in the monitoring system at the first moment; the monitoring system is built around the service nodes in the distributed microservice system that are the monitoring objects.
[0108] The processing module 902 is used to determine the transition probability of the monitoring system to various set states at a second time point based on the operating status of each service node and the state transition matrix of the monitoring system; the state transition matrix is obtained through the historical operating status of each service node in the monitoring system.
[0109] The processing module 902 is further configured to determine, from the set states where the conversion probability meets the preset requirements, the service node corresponding to the abnormal state as the service node that may be abnormal at the second moment.
[0110] In one possible design, the monitoring system is built around the service nodes in the distributed microservice system that serve as the monitoring objects. The processing module 902 is further configured to determine a service node in the distributed microservice system as the monitoring object; select service nodes from the system relationship graph of the distributed microservice system whose association with the monitoring object is greater than a preset threshold; the system relationship graph is generated through the call relationships of each service node in the distributed microservice system; and combine the monitoring object and the service nodes with an association greater than the preset threshold to form the monitoring system.
[0111] In one possible design, the processing module 902 is further configured to generate the system relationship graph using each service node in the distributed microservice system as a vertex and the call relationship between any two service nodes in the distributed microservice system as an edge; wherein the weight of any edge is the number of calls between the two service nodes.
[0112] In one possible design, the processing module 902 is further configured to, for any service node in the distributed microservice system, determine the sum of the weights of each edge from the service node to the monitored object based on the system relationship graph of the distributed microservice system; and determine the service nodes whose weight sums meet the distance requirements as service nodes whose correlation with the monitored object is greater than a preset threshold.
[0113] In one possible design, the processing module 902 is further configured to collect the historical operating states of each service node in the monitoring system at multiple times; for any first set state among various set states, count the number of times the monitoring system transitions from the first set state to any second set state in adjacent times during the historical operating states; the first set state is any set state among the N types of set states of the monitoring system, and the second set state is any set state among the N types of set states of the monitoring system; determine the transition frequency corresponding to the first set state based on the number of times each second set state is reached; and determine the state transition matrix of the monitoring system under one-step transition based on the transition frequency corresponding to each first set state.
[0114] In one possible design, the processing module 902 is further configured to determine the time interval n between the first time moment and the second time moment; and based on the state transition matrix of the monitoring system under one-step transition after n-step transition, determine the transition probability of the monitoring system in various set states.
[0115] In one possible design, the device further includes an update module 903, which updates the historical operating status of the monitoring system at preset intervals; the processing module 902 is also used to recalculate the state transition matrix of the monitoring system based on the updated historical operating status.
[0116] Based on the same technical concept, embodiments of this application provide a computing device, such as... Figure 10 As shown, it includes at least one processor 1001 and a memory 1002 connected to at least one processor. In this embodiment, the specific connection medium between the processor 1001 and the memory 1002 is not limited. Figure 10 Taking the connection between processor 1001 and memory 1002 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0117] In this embodiment of the application, the memory 1002 stores instructions that can be executed by at least one processor 1001. By executing the instructions stored in the memory 1002, at least one processor 1001 can perform the above-described method for predicting abnormal states of service nodes.
[0118] The processor 1001 is the control center of the computing device. It can connect to various parts of the computer device through various interfaces and lines, and perform resource settings by running or executing instructions stored in the memory 1002 and calling data stored in the memory 1002.
[0119] Optionally, the processor 1001 may include one or more processing units. The processor 1001 may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip; in some embodiments, they may be implemented separately on independent chips.
[0120] The processor 1001 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0121] Memory 1002, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 1002 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic memory, magnetic disk, optical disk, etc. Memory 1002 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. In the embodiments of this application, memory 1002 can also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0122] Based on the same technical concept, embodiments of this application also provide a computer-readable storage medium storing a computer-executable program, the computer-executable program being used to cause a computer to perform the method for predicting abnormal states of service nodes listed in any of the above methods.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application 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, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. 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... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0125] 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.
[0126] 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.
[0127] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0128] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for predicting abnormal states of service nodes, characterized in that, include: The system acquires the operating status of each service node within the monitoring system at the first moment. Each service node in the monitoring system is a part of the service nodes in the distributed microservice system. The monitoring system is built around the service node in the distributed microservice system that is the object of monitoring. The service node that is the object of monitoring is the account information exchange service node. The distributed microservice system is used to receive requests sent by users through terminal devices. After the requests are processed by different service nodes, the results are returned to the user through the terminal device. Based on the operating status of each service node and the state transition matrix of the monitoring system, the transition probability of the monitoring system converting to various set states at the second time point is determined. The operating status of each service node includes normal operation, change in progress, and fault. The state transition matrix is obtained through the historical operating status of each service node in the monitoring system. From the set states where the conversion probability meets the preset requirements, the service nodes corresponding to the abnormal states are identified as service nodes that may be abnormal at the second time, so as to investigate service nodes that may be abnormal in advance. The monitoring system is constructed according to the following steps: For any service node in the distributed microservice system, based on the system relationship graph of the distributed microservice system, the weight sum of each edge from the service node to the monitored object is determined. Service nodes whose weight sum meets the distance requirement are determined as service nodes whose correlation with the monitored object is greater than a preset threshold. The system relationship graph is generated through the call relationship of each service node in the distributed microservice system, and the weight of any edge is the number of calls between two service nodes. The monitoring system is composed of the monitored object and the service node that exceeds the preset threshold.
2. The method according to claim 1, characterized in that, Based on the operating status of each service node and the state transition matrix of the monitoring system, the transition probabilities of the monitoring system transforming into various preset states at the second time point are determined, including: Determine the time interval n between the first time point and the second time point; Based on the state transition matrix of the monitoring system under one-step transformation, after n-step transformation, the transformation probability of the monitoring system in various set states is determined.
3. The method according to claim 1, characterized in that, The state transition matrix is obtained through the historical operating states of each service node within the monitoring system, including: Collect the historical operating status of each service node in the monitoring system at multiple times; For any first setting state among various setting states, count the number of times the monitoring system changes from the first setting state to any second setting state in adjacent time periods during the historical operation state; the first setting state is any setting state among the N types of setting states of the monitoring system, and the second setting state is any setting state among the N types of setting states of the monitoring system; determine the switching frequency corresponding to the first setting state based on the number of times each second setting state is reached. The state transition matrix of the monitoring system under one-step transition is determined based on the transition frequency corresponding to each first set state.
4. The method according to claim 3, characterized in that, The method further includes: The historical operating status of the monitoring system is updated at preset intervals. The state transition matrix of the monitoring system is recalculated based on the updated historical operating status.
5. An apparatus for predicting abnormal states of service nodes, characterized in that, include: The acquisition module is used to acquire the running status of each service node in the monitoring system at the first moment. Each service node in the monitoring system is a part of the service nodes in the distributed microservice system. The monitoring system is built around the service node in the distributed microservice system that is the monitoring object. The service node that is the monitoring object is the account information exchange service node. The distributed microservice system is used to receive requests sent by users through terminal devices, process the requests through different service nodes, and return the results to the user through the terminal device. The processing module is used to determine the transition probability of the monitoring system to various set states at a second time point based on the operating status of each service node and the state transition matrix of the monitoring system. The operating status of each service node includes normal operation, change in progress, and fault. The state transition matrix is obtained through the historical operating status of each service node in the monitoring system. The processing module is also used to determine the service node corresponding to the abnormal state from the set state where the conversion probability meets the preset requirements as the service node that may be abnormal at the second time, so as to check the service node that may be abnormal in advance. The processing module is specifically used to determine the time interval n between the first time moment and the second time moment; and to determine the transition probability of the monitoring system in various set states after n-step transformations based on the state transition matrix of the monitoring system under one-step transformation. The processing module is further configured to construct the monitoring system according to the following steps: for any service node in the distributed microservice system, based on the system relationship graph of the distributed microservice system, determine the sum of the weights of each edge from the service node to the monitored object, and determine the service nodes whose weight sums meet the distance requirements as service nodes whose correlation with the monitored object is greater than a preset threshold, wherein the system relationship graph is generated through the call relationship of each service node in the distributed microservice system, and the weight of any edge is the number of calls between two service nodes; and combine the monitored object and the service nodes with a correlation greater than the preset threshold to form the monitoring system.
6. A computing device, characterized in that, include: Memory, used to store program instructions; A processor is configured to invoke program instructions stored in the memory and execute the method as described in any one of claims 1 to 4 according to the obtained program instructions.
7. A computer-readable storage medium, characterized in that, Includes computer-readable instructions that, when read and executed by a computer, cause the method as described in any one of claims 1 to 4 to be implemented.