Fault analysis method and device, computing equipment cluster and readable storage medium
By obtaining the tags of a single service in the microservice system and link call information of related services, the topology diagram of the service is constructed, and the problem of inefficient service failure analysis in the prior art is solved, and efficient failure analysis is achieved.
Patent Information
- Application Number
- CN202311840267.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-17
- Filing Date
- 2023-12-28
- Publication Date
- 2025-04-18
AI Technical Summary
The prior art is inefficient when performing failure analysis of services in microservice systems, and it is necessary to build a topology diagram of the entire microservice system, resulting in inefficient failure analysis of individual services.
A fault analysis method is proposed, by obtaining the tags of a single service and the link call information of related services, the topology diagram of the service is constructed, and fault analysis is carried out. This method only constructs topology maps related to a single service, improving the efficiency of failure analysis.
Improves the efficiency of failure analysis of individual services, reduces the resources and time required to build topology maps, and reduces the impact on microservice system performance.
Smart Images

Figure CN119854147A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202311350375.6, filed on October 17, 2023, and entitled “A Fault Analysis Method and Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of computer technology, and in particular to a fault analysis method, apparatus, computing device cluster, and readable storage medium. Background Art
[0003] With the continuous development of computer technology, building applications based on microservice architecture has become a more common way to build applications. Among them, applications built based on microservice architecture can be called microservice systems. Microservice systems include multiple services with call relationships, and the running process of an application is the process of calling multiple services based on the call relationship. As the complexity of the call relationship in the microservice system continues to increase, the difficulty of fault analysis of services in the microservice system continues to increase. Therefore, how to quickly perform fault analysis on services is an urgent problem to be solved.
[0004] In the related art, fault analysis is performed on each service in a microservice system based on a call chain. For example, in the process of performing fault analysis on any service in a microservice system, the service identification, call relationship, and execution time of each service in the microservice system are first obtained based on the call chain data of the microservice system, wherein the call chain refers to a link composed of multiple services with a call relationship, and the call chain data refers to the data of the service on the call chain. Then, a topology map of the microservice system is constructed based on the obtained service identification, call relationship, and execution time, and one node of the topology map corresponds to one service. After that, a fault analysis is performed on any service based on the topology map of the microservice system.
[0005] However, since the solution of the related art needs to build a topology map of the entire microservice system for each service to be fault analyzed for fault analysis, the efficiency of this solution in performing fault analysis on a single service in the microservice system is low. Summary of the invention
[0006] The present application proposes a fault analysis method, apparatus, computing device cluster and readable storage medium, which are used to improve the efficiency of fault analysis of a single service.
[0007] In a first aspect, a fault analysis method is provided, which is applied to a cloud server, and the cloud server is used to run multiple services with a calling relationship. The method includes: obtaining a label of a first service, the label is used to identify the first service, and the first service is any one of multiple services; based on the label of the first service, obtaining link calling information of related services of the first service, and the related services include one or more of the following: a second service among multiple services that needs to call the first service, and a third service among multiple services that needs to be called by the first service; based on the link calling information, obtaining a topology map corresponding to the first service, and performing fault analysis on the first service based on the topology map corresponding to the first service.
[0008] In this method, for any service in the microservice system, only the topology map of the service is constructed, so that the efficiency of constructing the topology map is high, and then the efficiency of fault analysis of the service based on the topology map is high. In addition, since the topology map corresponding to the service is only related to the service and its related services, the number of services during fault analysis is small, and the efficiency of fault analysis is high. In addition, compared with the method of collecting information on the links composed of all services in the microservice system to construct a topology map, this method only collects information on links related to some services to construct a topology map, which has less impact on the performance of the microservice system.
[0009] In a possible implementation, the topology map corresponding to the first service is obtained based only on the link call information of the first service's related services. Thus, compared with the method of constructing a topology map based on the information of the links formed by all services in the microservice system, this method is more efficient in constructing the topology map corresponding to the first service.
[0010] In a possible implementation, performing fault analysis on the first service based on the topology map corresponding to the first service includes: obtaining first operation data of the first service, obtaining the type of fault that occurred in the first service based on the first operation data; and performing fault analysis on the first service based on the type of fault and the topology map corresponding to the first service. By obtaining the type of fault that occurred in the first service, services related to the type of fault can be determined from the topology map corresponding to the first service based on the type of fault, thereby narrowing the service scope of fault analysis on the first service and improving the efficiency of fault analysis.
[0011] In a possible implementation, the fault analysis includes determining the services affected by the fault, and performing fault analysis on the first service based on the type of the fault and the topology map corresponding to the first service, including: determining the services affected by the fault from multiple services corresponding to the topology map based on the type of the fault. Based on this method, the services affected by the fault of the first service can be determined, that is, the explosion radius of the first service can be determined, and since the topology map corresponding to the first service is only related to the first service and related services of the first service, the efficiency of determining the explosion radius is high.
[0012] In a possible implementation, the fault analysis further includes analyzing the cause of the fault, and after determining the service affected by the fault from the multiple services corresponding to the topology map, it also includes: obtaining the second operation data of the affected service; and analyzing the cause of the fault of the first service based on the first operation data and the second operation data. Based on this method, the root cause of the fault can be located when the first service fails, and because the topology map corresponding to the first service is only related to the first service and the related services of the first service, the root cause location is more efficient.
[0013] In a possible implementation, obtaining the tag of the first service further includes: obtaining a tag exploration instruction, the tag exploration instruction is used to instruct to perform tag exploration on the first service; and based on the tag exploration instruction, performing an operation of obtaining the tag of the first service. Thus, by controlling the timing of obtaining the tag exploration instruction, the timing of triggering the acquisition of the tag of the first service can be controlled, so that the timing of obtaining the tag of the first service is more in line with the demand.
[0014] In one possible implementation, when related services of a first service include a second service, link call information of related services of the first service is obtained based on a label of the first service, including: sending a first response message to the second service, the first response message being obtained based on a first request message sent by the second service to the first service, the first response message including the label of the first service; and receiving link call information fed back by the second service based on the first response message.
[0015] The second service is the upstream service of the first service, that is, the method can obtain the link call information of the upstream service of the first service. Subsequently, the upstream topology map of the first service can be obtained based on the link call information of the upstream service, wherein the upstream topology map of the first service includes the first service, the upstream service of the first service, and the call relationship between the first service and the upstream service of the first service. In the case where there are multiple upstream services, the upstream topology map also includes the call relationship between multiple upstream services. Therefore, the call relationship included in the upstream topology map of the first service is more comprehensive.
[0016] In one possible implementation, when related services of a first service include a third service, link call information of related services of the first service is obtained based on a label of the first service, including: sending a second request message to the third service, the second request message including the label of the first service; and receiving link call information fed back by the third service based on the second request message.
[0017] The third service is a downstream service of the first service, that is, the method can obtain the link call information of the downstream service of the first service. Subsequently, the downstream topology map of the first service can be obtained based on the link call information of the downstream service, wherein the downstream topology map of the first service includes the first service, the downstream service of the first service, and the call relationship between the first service and the downstream service of the first service. In the case where there are multiple downstream services, the downstream topology map also includes the call relationship between multiple downstream services. Therefore, the call relationship included in the downstream topology map of the first service is more comprehensive.
[0018] In one possible implementation, the cloud server includes a graph database, the number of related services is multiple, and after obtaining the link call information of the related services of the first service, it also includes: storing the link call information of the multiple related services in the graph database in the order in which the link call information of the multiple related services is obtained; obtaining a topology map corresponding to the first service based on the link call information, including: when the number of link call information stored in the graph database is greater than or equal to two, reading the stored link call information from the graph database, and obtaining the topology map corresponding to the first service based on the read link call information.
[0019] Since the information stored in the graph database is suitable for generating a topology map, when the link call information of the related service is stored in the graph database, the efficiency of subsequently obtaining the topology map based on the link call information read from the graph database is high. In addition, since the link call information of the related service is only related to the first service and the related services of the first service, the data volume of the link call information is small, so that the storage resources required to store the link call information are small.
[0020] In a possible implementation, the tag includes a key-value pair, the key in the key-value pair is used to identify the tag, and the value in the key-value pair includes Internet protocol (IP) address information and port information of the first service. Thus, the tag of the first service can uniquely identify the first service.
[0021] In a possible implementation, the link call information includes one or more of the following: uniform resource locator, source IP address information, source port information, destination IP address information, destination port information, time consumption, and response result. The content of the link call information is relatively rich and flexible.
[0022] In the second aspect, a fault analysis device is provided, which is applied to a cloud server, and the cloud server is used to run multiple services with a calling relationship. The device includes: an acquisition module and an analysis module. Among them, the acquisition module is used to obtain a label of a first service, and the label is used to identify the first service, and the first service is any one of multiple services; the acquisition module is also used to obtain link call information of related services of the first service based on the label of the first service, and the related services include one or more of the following: a second service among multiple services that needs to call the first service, and a third service among multiple services that the first service needs to call; the analysis module is used to obtain a topology map corresponding to the first service based on the link call information, and perform fault analysis on the first service based on the topology map corresponding to the first service.
[0023] In a possible implementation, the topology map corresponding to the first service is obtained based only on link call information of services related to the first service.
[0024] In a possible implementation, the analysis module is used to obtain first operating data of a first service, obtain a type of fault occurring in the first service based on the first operating data, and perform fault analysis on the first service based on the type of fault and a topology map corresponding to the first service.
[0025] In a possible implementation, the fault analysis includes determining services affected by the fault, and the analysis module is used to determine the services affected by the fault from a plurality of services corresponding to the topology map based on the type of the fault.
[0026] In a possible implementation, the fault analysis also includes analyzing the cause of the fault, and the analysis module is further used to obtain second operation data of the affected service; based on the first operation data and the second operation data, analyze the cause of the fault of the first service.
[0027] In a possible implementation, the acquisition module is further used to acquire a tag exploration instruction, where the tag exploration instruction is used to instruct to perform tag exploration on the first service; based on the tag exploration instruction, an operation of acquiring the tag of the first service is executed.
[0028] In one possible implementation, when related services of a first service include a second service, an acquisition module is used to send a first response message to the second service, where the first response message is obtained based on a first request message sent by the second service to the first service, and the first response message includes a label of the first service; and receive link call information fed back by the second service based on the first response message.
[0029] In a possible implementation, when related services of the first service include a third service, the acquisition module is used to send a second request message to the third service, where the second request message includes a label of the first service; and receive link call information fed back by the third service based on the second request message.
[0030] In one possible implementation, the cloud server includes a graph database, the number of related services is multiple, and an acquisition module is further used to store link call information of multiple related services in the graph database according to the acquisition order of the link call information of the multiple related services; the analysis module is used to read the stored link call information from the graph database when the number of link call information stored in the graph database is greater than or equal to two, and obtain a topology map corresponding to the first service based on the read link call information.
[0031] In a possible implementation, the tag includes a key-value pair, the key in the key-value pair is used to identify the tag, and the value in the key-value pair includes IP address information and port information of the first service.
[0032] In a possible implementation, the link call information includes one or more of the following: uniform resource locator, source IP address information, source port information, destination IP address information, destination port information, time consumption, and response result.
[0033] In a third aspect, a computing device cluster is provided, which includes at least one computing device, each computing device including a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs any fault analysis method in the first aspect.
[0034] In a fourth aspect, a computer-readable storage medium is provided, the computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes any fault analysis method in the first aspect.
[0035] In a fifth aspect, a communication device is provided, the device comprising: a transceiver, a memory and a processor. The transceiver, the memory and the processor communicate with each other through an internal connection path, the memory is used to store instructions, the processor is used to execute the instructions stored in the memory to control the transceiver to send and receive signals, and the processor is used to run multiple services with a calling relationship; when the processor executes the instructions stored in the memory, the processor executes any fault analysis method in the first aspect.
[0036] Illustratively, there are one or more processors and one or more memories.
[0037] For example, the memory may be integrated with the processor, or the memory may be provided separately from the processor.
[0038] In the specific implementation process, the memory can be a non-transitory memory, such as a read-only memory (ROM), which can be integrated with the processor on the same chip or can be set on different chips. This application does not limit the type of memory and the setting method of the memory and the processor.
[0039] In a sixth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes any fault analysis method in the first aspect.
[0040] In a seventh aspect, a chip is provided, the chip including a processor, the processor being used to call and run instructions stored in a memory from a memory, so that at least one computing device equipped with the chip executes any fault analysis method in the first aspect. Exemplarily, the chip also includes: an input interface, an output interface, and the memory, and the input interface, the output interface, the processor, and the memory are connected via an internal connection path.
[0041] It should be understood that the beneficial effects achieved by the technical solutions of the second to seventh aspects of the present application and their corresponding possible implementation methods can be referred to the technical effects of the above-mentioned first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 It is a service topology diagram built with related technologies;
[0043] Figure 2 It is a schematic diagram of an implementation environment provided by an embodiment of the present application;
[0044] Figure 3 It is a schematic diagram of the architecture of a cloud server provided in an embodiment of the present application;
[0045] Figure 4 is a flow chart of a fault analysis method provided by an embodiment of the present application;
[0046] Figure 5 It is a schematic diagram of a process of sending a first response message to a second service provided by an embodiment of the present application;
[0047] Figure 6 This is a schematic diagram of a process of sending a second request message to a third service provided by an embodiment of the present application;
[0048] Figure 7is a schematic diagram of a tag exploration process provided by an embodiment of the present application;
[0049] Figure 8 is a schematic diagram of an upstream topology diagram provided in an embodiment of the present application;
[0050] Fig. 9 is a schematic diagram of a downstream topology provided in an embodiment of the present application;
[0051] Fig.10 is a schematic diagram of a topology map corresponding to a first service provided in an embodiment of the present application;
[0052] Fig.11 is a schematic diagram of a determined affected service provided by an embodiment of the present application;
[0053] Fig.12 It is a structural schematic diagram of a fault analysis device provided in an embodiment of the present application;
[0054] Fig.13 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0055] Fig.14 It is a connection diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The terms used in the implementation method of this application are only used to explain the embodiments of this application, and are not intended to limit this application. The embodiments of this application are described below in conjunction with the accompanying drawings.
[0057] To facilitate understanding, the terms appearing in the embodiments of the present application are first explained.
[0058] (1) Traffic label: A traffic label is a tag used to identify network traffic and is usually used for network traffic analysis and management. Network administrators can identify and classify network traffic based on traffic labels, thereby monitoring and managing network performance and ensuring network security.
[0059] (2) Root cause location: Root cause location refers to the operation of finding the root cause of the problem in the microservice system through analysis and troubleshooting when a problem or failure occurs in the microservice system.
[0060] (3) Explosion radius: The explosion radius refers to the range of impact that may be caused to other services in a microservice system when a service fails or needs to be modified.
[0061] With the increasing popularity of cloud native technology, the distributed technology used to implement cloud native technology has developed rapidly, and the microservice architecture based on distributed technology has gradually been widely used. The microservice architecture can be used to build applications, and the applications built based on the microservice architecture include multiple services with call relationships. Among them, the application built based on the microservice architecture can be called a microservice system, and each service included in the microservice system can be called a microservice. As the complexity of the application continues to increase, the call depth of the microservice system continues to increase, and the complexity of the call relationship in the microservice system continues to increase. Therefore, when a microservice system fails, how to quickly perform fault analysis on the services in the microservice system is a problem that needs to be solved urgently. Among them, fault analysis includes but is not limited to one or more of the following: root cause location, determination of explosion radius. In this application, the occurrence of a fault can also be understood as the occurrence of an exception, that is, the fault analysis in this application can also be understood as an exception analysis.
[0062] In a related technology, root causes of various services in a microservice system are located based on call chains. For example, in this related technology, call chain data in the microservice system is obtained in real time, and the call chain data is converted into business indicators and monitored in real time, wherein the business indicators include but are not limited to service identification, call relationship, and execution time. When an abnormality is found in the microservice system based on the monitored business indicators, in the process of fault analysis of any service in the microservice system, the call chain data in the time period when the abnormality occurs is first used to construct a service topology map, a process topology map, and a host topology map. Figure 1 It is a service topology diagram constructed by related technologies, in which: Figure 1 (1) in the figure shows the multiple services included in the microservice system and the calling relationship between the multiple services. Figure 1 (2) in the figure is the constructed service topology map. Then, for any service in the microservice system, based on the call chain data of each call chain related to any service, the abnormality score of each node of the call chain related to any service on the topology map is calculated. Then, based on the abnormality score of each node on the topology map, the root cause node is located in the order of call depth from large to small, first process and then host, to achieve root cause location. The located root cause node can be a process node or a host node.
[0063] However, when using the solution of this related technology to locate the root cause, it is necessary to store and aggregate a large amount of data, such as the call chain data of all links in the microservice system, resulting in a large amount of storage resources required to store this data. Furthermore, in this related technology, for any service in the microservice system, it is necessary to build a topology map of the entire microservice system to locate the root cause, resulting in low efficiency in root cause location for a single service. In addition, for any service, it is necessary to first obtain the call chains related to each service in the microservice system based on the service topology map, and then locate the root cause based on the call chain data of each call chain related to any service, which results in low efficiency in root cause location. Furthermore, the solution of this related technology requires the collection of data from all links in the microservice system, which has a greater impact on the performance of the microservice system.
[0064] In another related technology, root cause location is performed for each service in a microservice system based on monitoring data. For example, in this related technology, a topological diagram of the call relationship in the microservice system is generated based on the full amount of monitoring data, wherein the monitoring data includes but is not limited to the central processing unit (CPU) occupancy, memory occupancy, network conditions, disk input / output (I / O) conditions, the number of application requests, and the average response time of the service. Then, the monitoring data is monitored for anomalies according to the starting point in the topological diagram, the data type to which the monitoring data belongs is analyzed, and the data label of the data type is obtained. By analyzing the monitoring data, sorting the obtained data labels, determining the abnormal monitoring data and the service where the monitoring data is located according to the sorting of the data labels, the root cause location is achieved.
[0065] However, when using this related technical solution to locate the root cause, it is also necessary to store and aggregate massive amounts of data, such as CPU usage, memory usage, network conditions, disk I / O conditions, the number of application requests, and the average response time of the service. As a result, when an abnormality occurs in the microservice system, the efficiency of root cause location based on massive amounts of data is low.
[0066] The present application embodiment provides a fault analysis method for improving the efficiency of fault analysis of services in a microservice system. Figure 2, which shows a schematic diagram of the implementation environment of the fault analysis method provided in the embodiment of the present application. The implementation environment is a computing device cluster 20, and the computing device cluster 20 includes at least one computing device. In the case where the computing device cluster 20 includes multiple computing devices, the multiple computing devices can be communicated and connected via a wired or wireless network. Furthermore, in the case where the computing device cluster 20 includes multiple computing devices, the fault analysis method provided in the embodiment of the present application can be independently executed by a computing device in the computing device cluster 20, or can be interactively executed by multiple computing devices included in the computing device cluster 20. The embodiment of the present application does not limit the number of computing devices included in the computing device cluster 20. Figure 2 Only two computing devices are used as examples for illustration. For example, the computing devices included in the computing device cluster 20 are terminals or servers. The terminals include but are not limited to desktops, laptops or smart phones. The servers include but are not limited to physical servers or cloud servers that provide cloud computing services.
[0067] Exemplarily, when the method provided in the embodiment of the present application is applied to a cloud server, the cloud server includes a configuration center, a label exploration device, a data storage device, a database, and a data analysis device. In one possible implementation, a computer program is running on the cloud server, and the configuration center, label exploration device, data storage device, database, and data analysis device are all implemented by the cloud server running the computer program, that is, the configuration center, label exploration device, data storage device, database, and data analysis device are all implemented by software.
[0068] Figure 3 Schematic diagram of the architecture of a cloud server provided in an embodiment of the present application. Figure 3 As shown, the configuration center includes a tag exploration management interface, the configuration center is connected to the tag exploration device, and the data storage device is connected to the tag exploration device, the database and the data analysis device respectively. The connection relationship between the configuration center and the tag exploration device is not shown in FIG. Figure 3 The cloud server also includes a module for running a microservice system, that is, the cloud server also includes a module for running multiple services with a call relationship, which module can be Figure 3 The module for running the microservice system shown in FIG. Figure 3As shown, it is connected to a tag exploration device, or the module may include a tag exploration device. In one possible implementation, the tag exploration management interface is used to implement interaction between the user and the cloud server, and the configuration center is used to manage the tag exploration switch of the service in the microservice system. For example, the user selects the service that needs to be tag explored in the tag exploration management interface. After obtaining the service selected by the user on the tag exploration management interface, the configuration center modifies the configuration information on the configuration center based on the service selected by the user to turn on the tag exploration switch of the service. When the tag exploration switch of the service is turned on, the configuration center instructs the tag exploration device to start exploring the upstream and downstream services of the service. Among them, the upstream service of the service refers to the service that needs to call the service, and the upstream service of the service is also called the consumer end of the service. The downstream service of the service refers to the service called by the service, and the downstream service of the service is also called the provider end of the service.
[0069] Exemplarily, the configuration center is zookeeper (a centralized service management framework), and the configuration center can instruct the label exploration device to start exploring the upstream and downstream of the service by sending exploration instructions to the label exploration device. The label exploration device is used to perform two operations: label transparent transmission and label collection. Among them, label transparent transmission means that after turning on the label exploration switch of the service, the label of the service is added to the message sent by the service, and the labels passed to the service by other services continue to be passed to the services on the same link. Exemplarily, in the case of sending a message to an upstream service, the message is a response message, and in the case of sending a message to a downstream service, the message is a request message. Regardless of the type of message, the label of the service added in the message can be a traffic label of the service.
[0070] Label collection includes collecting link call information when transferring labels, or labels transferred in messages and link call information when transferring labels. Label collection also includes reporting the collected labels and link call information to a data storage device. Exemplarily, services in a microservice system call each other through an application programming interface (API). When labels and link call information are collected, a label exploration device can aggregate the labels and link call information to obtain aggregate information, and report the aggregate information to a data storage device. Since services call each other through APIs, the process of collecting label and link call information can be referred to as a process of collecting at the API granularity, and the process of aggregating label and link call information can be referred to as a process of aggregating at the API granularity.
[0071] For example, Figure 3The data storage device is used to store the reported information in the database in the order of the information reported by the label exploration device. The data storage device is also used to read the stored information from the database and provide information to the data analysis device for fault analysis. The above information includes link call information, or label and link call information. The data analysis device is used to analyze the information read from the database, and generate a topology map corresponding to the service based on the read information, that is, a topology map of the call relationship related to the service. The data analysis device is also used to perform fault analysis based on the topology map corresponding to the service when a problem occurs in the service. The fault analysis includes but is not limited to one or more of the following: determining the explosion radius and locating the root cause.
[0072] Please continue to see Figure 3 , the microservice system run by the cloud server includes services 1 to 15. Taking the tag exploration of service 4 as an example, after the user interacts with the cloud server through the tag exploration management page to start the tag exploration of service 4, the tag exploration device explores the upstream and downstream services of service 4 by performing tag transmission and tag collection operations. The tag exploration device reports information to the data storage device, wherein the reported information includes link call information, or the tag and link call information of service 4. The data storage device stores the reported information in the database in the order of the reported information, and also reads the stored information from the database and provides the read information to the data analysis device. Then, the data analysis device generates a topology map corresponding to service 4 based on the read information. In an embodiment of the present application, after obtaining the topology map corresponding to service 4, if service 4 fails, the impact range of the failure of service 4 can be known according to the topology map corresponding to service 4, that is, the explosion radius of service 4 is obtained. After obtaining the topology map corresponding to service 4, if service 4 fails, the scope of root cause location can also be narrowed according to the topology map corresponding to service 4, thereby improving the efficiency of root cause location.
[0073] The fault analysis method provided in the embodiment of the present application can be as follows Figure 4 As shown, next, combined with Figure 2 The method is described in the implementation environment shown. The method can be applied to Figure 2 The computing device cluster shown, that is, the method can be applied to a cloud server, which is used to run multiple services with a call relationship. Figure 4 As shown, the method includes but is not limited to S401 to S403.
[0074] S401, obtaining a tag of a first service, where the tag is used to identify the first service, and the first service is any one of a plurality of services.
[0075] In one possible implementation, the first service is a service that needs to be subject to tag exploration and is selected by the user through the tag exploration management interface, and the tag of the first service may be a traffic tag. Exemplarily, the tag exploration management interface is a console page. Multiple services with a call relationship run by the cloud server are displayed on the console page, and the user selects the first service that needs to be subject to tag exploration from the multiple services displayed on the console page. Exemplarily, the cloud server includes a configuration center, and the configuration center includes a tag exploration management interface. After the user selects the first service through the tag exploration management interface, the configuration center modifies the configuration information on the configuration center based on the first service to turn on the tag exploration switch of the first service. Furthermore, the configuration center can instruct the tag exploration device to start exploring the upstream and downstream services of the first service.
[0076] For example, the configuration center sends a label exploration instruction to the label exploration device, and the label exploration instruction is used to instruct to perform label exploration on the first service. In an embodiment of the present application, performing label exploration on the first service refers to exploring the upstream and downstream services of the first service based on the label of the first service. That is to say, the label exploration instruction is used to instruct to explore the upstream and downstream services of the first service based on the label of the first service. Exemplarily, when obtaining the label of the first service, it also includes: obtaining the label exploration instruction, and the label exploration instruction is used to instruct to perform label exploration on the first service; based on the label exploration instruction, executing the operation of obtaining the label of the first service. Thus, by controlling the timing of obtaining the label exploration instruction, the timing of triggering the acquisition of the label of the first service can be controlled, so that the timing of obtaining the label of the first service is more in line with the needs.
[0077] In some embodiments, obtaining a label of the first service includes: obtaining a label of the first service based on the IP address information and port information of the first service. By obtaining the label of the first service based on the IP address information and port information of the first service, the label of the first service can uniquely identify the first service. Exemplarily, the label of the first service includes a key-value pair, the key in the key-value pair is used to identify the label, and the value in the key-value pair includes the IP address information and port information of the first service.
[0078] In a possible implementation, the cloud server includes multiple instances, one instance is used to run one process, and each service included in the cloud server corresponds to at least one process. That is, the cloud server may include a module for running multiple services with a call relationship, the module includes the above-mentioned multiple instances, and each of the multiple services is implemented by running a process through at least one instance of the multiple instances. In this case, the IP address information of the first service includes the IP address information of the instance running the process corresponding to the first service, and the port information of the first service includes the port information of the instance running the process corresponding to the first service.
[0079] Exemplarily, after obtaining the label of the first service, the label of the first service is sent to the upstream service and / or downstream service of the first service, wherein the key of the label of the first service sent to the upstream service is the same as or different from the key of the label of the first service delivered to the downstream service. In the case where the key of the label of the first service sent to the upstream service is different from the key of the label of the first service delivered to the downstream service, the key of the label of the first service can indicate whether the label of the first service is used to send to the upstream service or to the downstream service. Furthermore, the upstream topology map and / or downstream topology map of the first service can be obtained based on the label of the first service. For relevant content on obtaining the topology map, please refer to the content in S403 below, which will not be explained in detail here. Exemplarily, the key of the label of the first service delivered to the upstream service is a response tag, and the key of the label of the first service delivered to the downstream service is a request tag.
[0080] S402, based on the tag of the first service, obtain link call information of related services of the first service, where the related services include one or more of the following: a second service among multiple services that needs to call the first service, and a third service among multiple services that needs to be called by the first service.
[0081] Among them, the service that needs to call the first service is the upstream service of the first service, that is, the second service is the upstream service of the first service; the service that the first service needs to call is the downstream service of the first service, that is, the third service is the downstream service of the first service. In one possible implementation, when the related services of the first service include the second service, based on the label of the first service, the link call information of the related services of the first service is obtained, including: sending a first response message to the second service, the first response message is obtained based on the first request message sent by the second service to the first service, and the first response message includes the label of the first service; receiving the link call information fed back by the second service based on the first response message. Exemplarily, the first response message includes a response header, and the response header includes the label of the first service.
[0082] In some embodiments, sending a first response message to a second service includes: obtaining an initial response message based on the first request message, adding tag information of the first service to the initial response message, obtaining a first response message, and sending the first response message to the second service. The initial response message is used to respond to the content requested by the first request message. Exemplarily, adding tag information of the first service to the initial response message to obtain a first response message includes: adding tag information of the first service to the initial response message by means of bytecode enhancement to obtain the first response message. That is, the initial response message is modified by means of bytecode enhancement to achieve adding tag information of the first service to the initial response message to obtain the first response message.
[0083] Exemplarily, in the case where the cloud server includes a module for running the first service, the module also includes a label exploration device, which can be referred to as the label exploration device included by the first service. The initial response message is generated by the first service, and the label exploration device intercepts the interface of the first service sending the message to obtain the initial response message, and then adds the label information of the first service to the initial response message to obtain the first response message, and then sends the first response message to the second service. The embodiment of the present application does not limit the manner in which the label exploration device intercepts the interface of the first service sending the message. For example, the first service is implemented by an instance running a process in the cloud server, and the label exploration device is implemented by a computer program running the instance, and the computer program is capable of intercepting messages sent through the interface of the process, so that the label exploration device can now intercept the interface of the first service sending the message to obtain the initial response message.
[0084] In a possible implementation, multiple services having a calling relationship transmit request messages and response messages through a hypertext transfer protocol (HTTP) or a remote procedure call (RPC) protocol. That is, both the first response message and the first request message can be a message that complies with HTTP or a message that complies with the RPC protocol. Figure 5 Schematic diagram of a process of sending a first response message to a second service provided by an embodiment of the present application. Figure 5 As shown, the related services of the first service include the second service and the third service. The first service receives the first request message sent by the second service, and then the tag exploration device associated with the first service sends a first response message to the second service. Figure 5 As shown in FIG. 1 , the above-mentioned operations related to sending the first response message are performed by Figure 5 The operation of sending a first response message to the second service is summarized as follows: Figure 5 The content of the response header of the first response message is shown.
[0085] Exemplarily, after receiving the first response message, the second service feeds back the link call information based on the first response message. For example, in the case where the cloud server includes a data storage device, the data storage device receives the link call information fed back by the second service based on the first response message. In one possible implementation, the second service includes a label exploration device, and the second service implements the operation of feeding back the link call information through the label exploration device included in the second service. For example, similar to the first service, the second service is implemented by an instance running process in the cloud server, and the label exploration device included in the second service is implemented by a computer program running by the instance, and the computer program is capable of intercepting messages received through the interface of the process, so that the label exploration device can now intercept the interface of the second service receiving messages to obtain the link call information. Furthermore, the label exploration device included in the second service can send the link call information to the data storage device.
[0086] In an embodiment of the present application, the link call information includes, but is not limited to, one or more of the following: uniform resource locator (URL), source IP address information, source port information, destination IP address information, destination port information, time consumption, and response result. For example, in the link call information fed back by the second service, the URL is used to identify the service type provided by the first service, the source IP address information is used to indicate the IP address information of the first service, the source port information is used to indicate the port information of the first service, the destination IP address information is used to indicate the IP address information of the second service, the destination port information is used to indicate the port information of the second service, the time consumption is used to indicate the time to transmit the first response message, and the response result is used to indicate the situation of the first response message. For example, the response result includes one or more of the following: error rate, requested throughput, identifier (identifier, ID) of the process corresponding to the first service, and timestamp.
[0087] In a possible implementation, when the related services of the first service include a third service, based on the label of the first service, obtaining the link call information of the related services of the first service includes: sending a second request message to the third service, the second request message includes the label of the first service; receiving the link call information fed back by the third service based on the second request message. Exemplarily, the second request message includes a request header, and the request header includes the label of the first service. In some embodiments, sending the second request message to the third service includes: obtaining an initial request message, adding the label information of the first service to the initial request message, obtaining a second request message, and sending the second request message to the third service.
[0088] In some embodiments, similar to the method of obtaining the first response message, adding the tag information of the first service to the initial request message to obtain the second request message includes: adding the tag information of the first service to the initial request message by bytecode enhancement to obtain the second request message. That is, the initial request message is modified by bytecode enhancement to achieve adding the tag information of the first service to the initial request message to obtain the second request message.
[0089] Exemplarily, in the case where the first service includes a label exploration device, the initial request message is generated by the first service, the label exploration device intercepts the interface of the first service sending the message to obtain the initial request message, and then adds the label information of the first service to the initial request message to obtain the second request message, and then sends the second request message to the third service. Similar to the first response message and the first request message, the second request message can be a message that complies with HTTP or a message that complies with the RPC protocol. Figure 6 Schematic diagram of a process of sending a second request message to a third service provided by an embodiment of the present application. Figure 6 As shown, the related services of the first service include the second service and the third service. The tag exploration device included in the first service sends a second request message to the third service. The tag exploration device is not in Figure 6 As shown in FIG. 1 , the related operations of sending the second request message are performed by Figure 6 The operation of sending the second request message to the third service is summarized as follows: Figure 6 The content of the request header of the second request message is shown.
[0090] In one possible implementation, after receiving the second request message, the third service feeds back the link call information based on the second request message. For example, in the case where the cloud server includes a data storage device, the data storage device receives the link call information fed back by the third service based on the second request message. Exemplarily, the third service includes a label exploration device, and the third service implements the operation of feeding back the link call information through the label exploration device included in the third service. For example, similar to the second service, the second service is implemented by an instance running process in the cloud server, and the label exploration device included in the third service is implemented by a computer program running by the instance, and the computer program is capable of intercepting messages received through the interface of the process, so that the label exploration device can now intercept the interface of the third service receiving messages to obtain the link call information. Furthermore, the label exploration device included in the third service can send the link call information to the data storage device.
[0091] Exemplarily, in the link call information fed back by the third service, the URL is used to identify the service type provided by the first service, the source IP address information is used to indicate the IP address information of the first service, the source port information is used to indicate the port information of the first service, the destination IP address information is used to indicate the IP address information of the third service, the destination port information is used to indicate the port information of the third service, the time consumption is used to indicate the time for transmitting the second request message, and the response result is used to indicate the situation of the second request message. For example, the response result includes one or more of the following: error rate, requested throughput, ID of the process corresponding to the first service, and timestamp.
[0092] Figure 7 is a schematic diagram of a tag exploration process provided by an embodiment of the present application. Figure 7 Taking the first service as service 4 as an example, the response message sent by service 4 to the upstream service includes the label of service 4, and the request message sent by service 4 to the downstream service includes the label of service 4. Figure 7 As shown, both the upstream service and the downstream service of service 4 can transparently transmit the label of service 4. That is, the upstream service of service 4 can continue to send response messages to the upstream service of the upstream service, and the response message includes the label of service 4; the downstream service of service 4 can continue to send request messages to the downstream service of the downstream service, and the request message includes the label of service 4. For example, in Figure 7 In , the upstream services of service 4 include service 3, the upstream services of service 3 include service 2, and the response message sent by service 3 to service 2 includes the label of service 4. For another example, in Figure 7 In the example, the downstream services of service 4 include service 8, the downstream services of service 8 include service 9, and the request message sent by service 8 to service 9 includes the label of service 4.
[0093] For example, in the embodiment of the present application, the second service that needs to call the first service includes but is not limited to one or more of the following: a service that directly calls the first service, and a service that indirectly calls the first service. Indirectly calling the first service refers to calling a service that directly calls the first service. For example, Figure 7 In the example, service 4 is the first service, and service 3 and service 11 both directly call service 4. Service 3 and service 11 are both second services that need to call the first service. Service 2 directly calls service 3. Service 2 is a service that indirectly calls service 4, and service 2 is also a second service that needs to call the first service. Service 1 directly calls service 2. Service 1 is also a service that indirectly calls service 4, and service 1 is also a second service that needs to call the first service.
[0094] Similarly, the third service that the first service needs to call includes but is not limited to one or more of the following: a service that the first service directly calls, and a service that the first service indirectly calls. The indirect call of the first service refers to a call made by a service that is directly called by the first service. Figure 7 In the example, service 5, service 8, and service 12 are all services directly called by the first service, so service 5, service 8, and service 12 are all third services that the first service needs to call. Service 8 directly calls service 9, so service 9 is a service indirectly called by service 4, and service 9 is also the third service that the first service needs to call. Service 9 directly calls service 10, so service 10 is also a service indirectly called by service 4, and service 10 is also the third service that the first service needs to call.
[0095] Exemplarily, after acquiring the tag of the first service, the related service of the first service sends the link call information. For example, the tag of the first service is transferred to the related service of the first service through the tag exploration device in the cloud server, and the link call information of the related service is sent through the tag exploration device, wherein the link call information can be sent by the tag exploration device to the data storage device in the cloud server.
[0096] In one possible implementation, the related service of the first service also sends a label of the first service. For example, the related service of the first service aggregates the link call information and the label of the first service to obtain aggregate information, and the related service of the first service sends the aggregate information. Thus, in the case where there are multiple first services, the link information reported by the related services of the same first service can be determined based on the label of the first service in the aggregate information. Furthermore, in the case where the key of the label of the first service sent to the upstream service is different from the key of the label of the first service sent to the downstream service, it can be determined based on the label of the first service in the aggregate information whether the aggregate information is the aggregate information sent by the upstream service or the aggregate information sent by the downstream service. For example, the aggregate information sent is as follows:
[0097]
[0098] In a possible implementation, the label exploration device sends information to the data storage device through kafka (a messaging system based on Zookeeper), and the information sent includes link call information or aggregation information, wherein the aggregation information is obtained by aggregating link call information and the label of the first service. Exemplarily, the cloud server includes a graph database, and the number of related services is multiple. After obtaining the link call information of the related services of the first service, it also includes: storing the link call information of the multiple related services in the graph database in the order of obtaining the link call information of the multiple related services; obtaining the topology map corresponding to the first service based on the link call information, including: when the number of link call information stored in the graph database is greater than or equal to two, reading the stored link call information from the graph database, and obtaining the topology map corresponding to the first service based on the read link call information. In some embodiments, when the related services of the first service send aggregation information, that is, when the related services of the first service also send the label of the first service, the aggregation information is stored in the graph database, and the aggregation information is subsequently obtained from the graph database.
[0099] Since the information stored in the graph database is suitable for generating a topology map, when the information sent by the related service is stored in the graph database, the efficiency of subsequently obtaining the topology map based on the information read from the graph database is high. The read information includes but is not limited to link call information or aggregation information. Furthermore, since the information sent by the related service is only related to the first service and the related services of the first service, the amount of data sent by the related service is small, so that less storage resources are required to store the sent information.
[0100] S403: Acquire a topology map corresponding to the first service based on the link call information, and perform fault analysis on the first service based on the topology map corresponding to the first service.
[0101] In one possible implementation, if related services of the first service send aggregation information, and the aggregation information includes link call information and a label of the first service, then obtaining a topology map corresponding to the first service based on the link call information includes: obtaining a topology map corresponding to the first service based on the link call information in the aggregation information.
[0102] In some embodiments, the database in the cloud server stores aggregate information sent by related services of multiple services. In this case, the method further includes: obtaining aggregate information sent by related services of the first service from the stored multiple aggregate information. For example, querying each aggregate information stored in the database according to the tag of the first service, for any aggregate information stored in the database, if the any aggregate information includes the tag of the first service, then the any aggregate information is aggregate information sent by related services of the first service.
[0103] Exemplarily, when the tag of the first service includes a key-value pair, querying each aggregate information stored in the database according to the tag of the first service includes: querying each aggregate information stored in the database according to the key-value pair. In one possible implementation, when the key in the key-value pair is a response tag, the aggregate information queried based on the key-value pair is the aggregate information sent by the upstream service of the first service. Thus, the upstream topology map of the first service can be obtained based on the aggregate information sent by the upstream service of the first service. Among them, the upstream topology map of the first service includes the first service, the upstream service of the first service, and the calling relationship between the first service and the upstream service of the first service. In the case where the number of upstream services of the first service is multiple, the upstream topology map also includes the calling relationship between the multiple upstream services of the first service. Figure 8 is a schematic diagram of an upstream topology provided in an embodiment of the present application. Figure 8 , the upstream topology diagram shows services 1 to 4, service 11 and the calling relationships between these services.
[0104] Similarly, in the case where the key in the key-value pair is a request tag, the aggregate information queried based on the key-value pair is the aggregate information sent by the downstream services of the first service. Thus, the downstream topology map of the first service can be obtained based on the aggregate information sent by the downstream services of the first service. The downstream topology map of the first service includes the first service, the downstream services of the first service, and the calling relationship between the first service and the downstream services of the first service. In the case where there are multiple downstream services of the first service, the downstream topology map also includes the calling relationship between the multiple downstream services of the first service. Fig. 9 is a schematic diagram of a downstream topology provided in an embodiment of the present application. Fig. 9 , the downstream topology diagram shows service 4, service 5, service 8 to service 10, service 12 and the calling relationships between these services.
[0105] After obtaining the aggregation information or link call information sent by the related services of the first service, the topology map corresponding to the first service can be obtained based on the link call information. The topology map corresponding to the first service includes one or more of the following: the upstream topology map of the first service and the downstream topology map of the first service. Fig.10 is a schematic diagram of a topology diagram corresponding to a first service provided in an embodiment of the present application. Fig.10 Take service 4 as the first service as an example. Fig.10 (1) shows multiple services with call relationships run by the cloud server and the call relationships between the multiple services. Fig.10 (2) shows the topology diagram corresponding to service 4.
[0106] Exemplarily, when the link call information includes URL, source IP address information, source port information, destination IP address information and destination port information, the call relationship between services and the service types provided by the services can be obtained based on the link call information, thereby generating a topology map. If the link call information also includes one or more of the following: time consumption, response result, one or more of the following can also be obtained based on the link call information: time consumption of the service, response result of the service, and thus the generated topology map can also include one or more of the following: time consumption of the service, response result of the service. Exemplarily, when multiple services running on a cloud server are called through an API, the generated topology map is called an API-level topology map.
[0107] In a possible implementation, the topology map corresponding to the first service is obtained based only on the link call information of the first service's related services. Thus, compared with the method of constructing a topology map based on the information of the links formed by all services in the microservice system, this method is more efficient in constructing the topology map corresponding to the first service.
[0108] In an embodiment of the present application, after obtaining the topology map corresponding to the first service, a fault analysis can be performed on the first service based on the topology map corresponding to the first service. For example, in the event that a fault occurs in the first service, a fault analysis is performed on the first service based on the topology map corresponding to the first service, including: obtaining first operating data of the first service, obtaining the type of fault that occurs in the first service based on the first operating data; and performing a fault analysis on the first service based on the type of fault and the topology map corresponding to the first service. By obtaining the type of fault that occurs in the first service, services related to the type of fault can be determined from the topology map corresponding to the first service based on the type of fault, thereby narrowing the service scope for fault analysis of the first service and improving the efficiency of fault analysis.
[0109] Exemplarily, the first operating data of the first service includes operating data corresponding to the service type of the first service, so that it is possible to determine whether the service type has a fault based on the operating data corresponding to the service type in the first operating data, thereby obtaining the type of fault that has occurred. Regarding the manner of determining whether the service type has a fault based on the operating data corresponding to the service type in the first operating data, the embodiments of the present application do not limit this. For example, if the operating data corresponding to the service type is greater than a reference threshold, the service type has a fault, and if the operating data corresponding to the service type is less than or equal to the reference threshold, the service type has not a fault, wherein the reference threshold can be determined based on experience or actual needs.
[0110] In a possible implementation, the fault analysis includes determining services affected by the fault, that is, the fault analysis includes determining a blast radius. In this case, based on the type of the fault and the topology map corresponding to the first service, the fault analysis of the first service includes: based on the type of the fault, determining services affected by the fault from a plurality of services corresponding to the topology map.
[0111] For example, based on the call relationship in the topology map, the links formed by the multiple services corresponding to the topology map can be determined, and for any of the formed links, the service type corresponding to the any link can be obtained based on the URL of the service on the any link. Therefore, based on the type of the fault, the service affected by the fault is determined from the multiple services corresponding to the topology map, including: based on the type of the fault, the link corresponding to the type is obtained from the multiple services corresponding to the topology map corresponding to the topology map, and the service on the link is determined as the service affected by the fault. Fig.11 is a schematic diagram of a determined affected service provided by an embodiment of the present application. Fig.11 (1) is the topology diagram corresponding to service 4. Fig.11 (2) is the service determined to be affected by the failure, that is, service 1 to service 4 are the services affected by the failure of service 4.
[0112] Exemplarily, the fault analysis also includes analyzing the cause of the fault, that is, the fault analysis also includes root cause location. In this case, after determining the service affected by the fault from the multiple services corresponding to the topology map, it also includes: obtaining the second operation data of the affected service; based on the first operation data and the second operation data, analyzing the cause of the failure of the first service. Exemplarily, the first operation data includes the operation data corresponding to the type of failure of the first service, and the second operation data includes the operation data of the affected service under this type, so that based on the obtained operation data, the cause of the failure of the first service can be specifically analyzed to achieve root cause location. The embodiment of the present application does not limit the method of specifically analyzing the cause of the failure of the first service based on the obtained operation data. For example, in the case where the operation data includes a response result, if the response result of a service of the affected service is non-response, the cause of the failure of the first service includes the non-response of the service.
[0113] In the method provided in the embodiment of the present application, for any service in the microservice system, the link call information of the related services of the service can be obtained based on the label of the service, and then the topology map corresponding to the service is constructed based on the link call information, and the service is analyzed for faults based on the topology map. Since the method only constructs the topology map of the service, the efficiency of constructing the topology map is high, and then the efficiency of performing fault analysis on the service based on the topology map is high.
[0114] Moreover, since the topology map corresponding to the service is only related to the service and its related services, the number of services involved in fault analysis is small, and the efficiency of fault analysis is high. In addition, compared with the method of collecting information on the links composed of all services in the microservice system to construct a topology map, this method only collects information on links related to some services to construct a topology map, which has less impact on the performance of the microservice system.
[0115] The above describes the fault analysis method of the embodiment of the present application. Corresponding to the above method, the embodiment of the present application also provides a fault analysis device. Fig.12 1 is a schematic diagram of a fault analysis device provided in an embodiment of the present application. The fault analysis device can be applied to a cloud server, and the cloud service is used to run multiple services with a call relationship. Fig.12 The following multiple modules are shown: Fig.12 The fault analysis device shown can perform the above Figure 4 All or part of the operations performed by the cloud server shown. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application are not limited to this. Fig.12 As shown, the device includes: an acquisition module 1201 and an analysis module 1202.
[0116] The acquisition module 1201 is used to obtain a label of the first service, where the label is used to identify the first service, and the first service is any one of multiple services. The acquisition module 1201 is also used to obtain link call information of related services of the first service based on the label of the first service, where the related services include one or more of the following: a second service among multiple services that needs to call the first service, and a third service among multiple services that needs to be called by the first service. The analysis module 1202 is used to obtain a topology map corresponding to the first service based on the link call information, and perform fault analysis on the first service based on the topology map corresponding to the first service.
[0117] In a possible implementation, the topology map corresponding to the first service is obtained based only on link call information of services related to the first service.
[0118] In a possible implementation, the analysis module 1202 is used to obtain first operating data of the first service, obtain the type of fault occurring in the first service based on the first operating data, and perform fault analysis on the first service based on the type of fault and a topology map corresponding to the first service.
[0119] In a possible implementation, the fault analysis includes determining services affected by the fault, and the analysis module 1202 is configured to determine services affected by the fault from a plurality of services corresponding to the topology diagram based on the type of the fault.
[0120] In a possible implementation, the fault analysis also includes analyzing the cause of the fault, and the analysis module 1202 is further used to obtain second operation data of the affected service; based on the first operation data and the second operation data, analyze the cause of the fault of the first service.
[0121] In a possible implementation, the acquisition module 1201 is further used to acquire a tag exploration instruction, where the tag exploration instruction is used to instruct to perform tag exploration on the first service; based on the tag exploration instruction, an operation of acquiring the tag of the first service is executed.
[0122] In one possible implementation, when the related services of the first service include the second service, the acquisition module 1201 is used to send a first response message to the second service, the first response message is obtained based on the first request message sent by the second service to the first service, and the first response message includes a label of the first service; and receive link call information fed back by the second service based on the first response message.
[0123] In a possible implementation, when related services of the first service include a third service, the acquisition module 1201 is used to send a second request message to the third service, where the second request message includes a label of the first service; and receive link call information fed back by the third service based on the second request message.
[0124] In one possible implementation, the cloud server includes a graph database, the number of related services is multiple, and the acquisition module 1201 is also used to store the link call information of multiple related services in the graph database according to the acquisition order of the link call information of the multiple related services; the analysis module 1202 is used to read the stored link call information from the graph database when the number of link call information stored in the graph database is greater than or equal to two, and obtain the topology map corresponding to the first service based on the read link call information.
[0125] In a possible implementation, the tag includes a key-value pair, the key in the key-value pair is used to identify the tag, and the value in the key-value pair includes IP address information and port information of the first service.
[0126] In a possible implementation, the link call information includes one or more of the following: uniform resource locator, source IP address information, source port information, destination IP address information, destination port information, time consumption, and response result.
[0127] In the device provided in the embodiment of the present application, for any service in the microservice system, the link call information of the related services of the service can be obtained based on the label of the service, and then the topology map corresponding to the service is constructed based on the link call information, and the service is analyzed for faults based on the topology map. Since the device only constructs the topology map of the service, the efficiency of constructing the topology map is high, and then the efficiency of performing fault analysis on the service based on the topology map is high.
[0128] Moreover, since the topology map corresponding to the service is only related to the service and its related services, the number of services involved in fault analysis is small, and the efficiency of fault analysis is high. Furthermore, compared with the method of collecting information on links composed of all services in the microservice system to construct a topology map, the device only collects information on links related to some services to construct a topology map, which has less impact on the performance of the microservice system.
[0129] Among them, both the acquisition module 1201 and the analysis module 1202 can be implemented by software or by hardware. Exemplarily, the implementation of the acquisition module 1201 is described below by taking the acquisition module 1201 as an example. Similarly, the implementation of the analysis module 1202 can refer to the implementation of the acquisition module 1201.
[0130] As an example of a software functional module, the module in the device can include the code running on the computing instance. The computing instance can include one or more of the following: a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance can be one or more. For example, the acquisition module 1201 can include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code can be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code can be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple data centers with close geographical locations. Generally, a region can include multiple AZs.
[0131] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0132] As an example of a hardware functional module, the acquisition module 1201 may include at least one computing device, such as a server, etc. Alternatively, the acquisition module 1201 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0133] The multiple computing devices included in the acquisition module 1201 can be distributed in the same region or in different regions. The multiple computing devices included in the acquisition module 1201 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the acquisition module 1201 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0134] It should be noted that, in other embodiments, the acquisition module 1201 can be used to execute any step in the fault analysis method, and the analysis module 1202 can be used to execute any step in the fault analysis method. The steps that the acquisition module 1201 and the analysis module 1202 are responsible for implementing can be specified as needed. The full functions of the fault analysis device can be realized by respectively implementing different steps in the fault analysis method through the acquisition module 1201 and the analysis module 1202.
[0135] The present application also provides a computing device 1300. Fig.13 As shown, the computing device 1300 includes: a bus 1302, a processor 1304, a memory 1306, and a communication interface 1308. The processor 1304, the memory 1306, and the communication interface 1308 communicate through the bus 1302. The computing device 1300 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the computing device 1300.
[0136] The bus 1302 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.13 The bus 1302 may include a path for transmitting information between various components of the computing device 1300 (eg, the memory 1306, the processor 1304, and the communication interface 1308).
[0137] The processor 1304 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0138] The memory 1306 may include a volatile memory, such as a random access memory (RAM). The processor 1304 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0139] The memory 1306 stores executable program codes, and the processor 1304 executes the executable program codes to respectively implement the functions of the acquisition module and the analysis module, thereby implementing the fault analysis method. That is, the memory 1306 stores instructions for executing the fault analysis method.
[0140] The communication interface 1308 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1300 and other devices or communication networks.
[0141] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, a cloud server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0142] Optionally, the structure of at least one computing device included in the computing device cluster can be found in Fig.13 The computing device 1300 is shown. The memory 1306 in one or more computing devices 1300 in the computing device cluster may store the same instructions for executing the fault analysis method.
[0143] In some possible implementations, the memory 1306 of one or more computing devices 1300 in the computing device cluster may also store partial instructions for executing the fault analysis method. In other words, the combination of one or more computing devices 1300 may jointly execute instructions for executing the fault analysis method.
[0144] It should be noted that the memory 1306 in different computing devices 1300 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the fault analysis device. That is, the instructions stored in the memory 1306 in different computing devices 1300 can implement the functions of one or more modules in the acquisition module and the analysis module.
[0145] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Fig.14 A possible implementation is shown. Fig.14 As shown, two computing devices 1400A and 1400B are connected via a network. Specifically, they are connected to the network via a communication interface in each computing device. In this type of possible implementation, computing devices 1400A and 1400B include a bus 1402, a processor 1404, a memory 1406, and a communication interface 1408. The memory 1406 in the computing device 1400A stores instructions for executing the functions of the acquisition module. At the same time, the memory 1406 in the computing device 1400B stores instructions for executing the functions of the analysis module.
[0146] Fig.14 The connection method between the computing device clusters shown may be that considering that the fault analysis method provided in the present application needs to obtain the topology map corresponding to the first service, it is considered to hand over the functions implemented by the analysis module to the computing device 1400B for execution.
[0147] It should be understood that Fig.14The functionality of the computing device 1400A shown in FIG. 1400A may also be implemented by multiple computing devices 1400. Similarly, the functionality of the computing device 1400B may also be implemented by multiple computing devices 1400.
[0148] The embodiment of the present application also provides a communication device, which includes: a transceiver, a memory, and a processor. The transceiver, the memory, and the processor communicate with each other through an internal connection path, the memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to send and receive signals. When the processor executes the instructions stored in the memory, the processor executes any of the above-mentioned fault analysis methods.
[0149] It should be understood that the processor may be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting an advanced RISC machines (ARM) architecture.
[0150] Further, in an optional embodiment, the memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0151] The memory may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM) and direct memory bus random access memory (DR RAM).
[0152] The embodiment of the present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes any of the above-mentioned fault analysis methods.
[0153] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk). The computer-readable storage medium includes instructions, and when the instructions are executed by a computing device, the computing device executes any of the above-mentioned fault analysis methods.
[0154] The embodiment of the present application also provides a chip, which includes a processor, and the processor is used to call and run instructions stored in the memory from the memory, so that the communication device equipped with the chip executes any of the above-mentioned fault analysis methods. Exemplarily, the chip also includes: an input interface, an output interface and a memory, and the input interface, the output interface, the processor and the memory are connected through an internal connection path.
[0155] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more available media integrations. Available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, digital video discs (DVD)), or semiconductor media (eg, solid state disks (SSD)).
[0156] In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. A person of ordinary skill in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0157] The computer program code for implementing the method of the embodiment of the present application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable fault analysis device, so that the program code, when executed by the computer or other programmable fault analysis device, causes the function / operation specified in the flow chart and / or block diagram to be implemented. The program code can be executed completely on a computer, partially on a computer, as an independent software package, partially on a computer and partially on a remote computer or completely on a remote computer or server.
[0158] In the context of the embodiments of the present application, computer program codes or related data may be carried by any appropriate carrier to enable a device, apparatus or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, etc. Examples of signals may include electrical, optical, radio, acoustic or other forms of propagation signals, such as carrier waves, infrared signals, etc.
[0159] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the computing device and module described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0160] In the several embodiments provided in the present application, it should be understood that the disclosed devices, equipment and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, or it can be an electrical, mechanical or other form of connection.
[0161] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0162] In addition, each functional module in each embodiment of the present application can be integrated into one module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0163] In this application, the terms "first", "second", etc. are used to distinguish between identical or similar items with substantially the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is the quantity and execution order limited. It should also be understood that although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various examples, a first service may be referred to as a second service, and similarly, a second service may be referred to as a first service.
[0164] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0165] The term "at least one" in this application means one or more, and the term "multiple" in this application means two or more, for example, multiple services means two or more services. The terms "system" and "network" are often used interchangeably herein.
[0166] It should be understood that the terms used in the description of various examples herein are only for describing specific examples and are not intended to be limiting. As used in the description of various examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0167] It should also be understood that the term “comprise” (also known as “includes,” “including,” “comprises” and / or “comprising”) when used in this specification specifies the presence of stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof.
[0168] It should also be understood that, depending on the context, the phrase “if it is determined that…” or “if [stated condition or event] is detected” may be interpreted to mean “upon determining that…” or “in response to determining that…” or “upon detecting [stated condition or event]” or “in response to detecting [stated condition or event]”.
[0169] It should be understood that determining B based on A does not mean determining B only based on A. B can also be determined based on A and / or other information.
[0170] It should also be understood that the references to "one embodiment", "an embodiment", or "a possible implementation" throughout the specification mean that specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of the present application. Therefore, the references to "in one embodiment" or "in an embodiment", or "a possible implementation" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0171] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A fault analysis method, characterized in that: The method is applied to a cloud server, and the cloud server is used to run multiple services having a calling relationship. The method includes: Acquire a tag of a first service, where the tag is used to identify the first service, and the first service is any one of the multiple services; Based on the label of the first service, obtaining link call information of related services of the first service, where the related services include one or more of the following: a second service among the multiple services that needs to call the first service, and a third service among the multiple services that needs to be called by the first service; A topology map corresponding to the first service is obtained based on the link call information, and a fault analysis is performed on the first service based on the topology map corresponding to the first service.
2. The method according to claim 1, characterized in that The performing fault analysis on the first service based on the topology graph corresponding to the first service includes: Acquire first operation data of the first service, and acquire a type of fault occurring in the first service based on the first operation data; Based on the type of the fault and a topology map corresponding to the first service, a fault analysis is performed on the first service.
3. The method according to claim 2, characterized in that The fault analysis includes determining a service affected by the fault, and the performing fault analysis on the first service based on the type of the fault and a topology map corresponding to the first service includes: Based on the type of the fault, a service affected by the fault is determined from a plurality of services corresponding to the topology map.
4. The method according to claim 3, characterized in that The fault analysis further includes analyzing the cause of the fault, and after determining the service affected by the fault from the multiple services corresponding to the topology map, further includes: Acquire second operation data of the affected service; Based on the first operating data and the second operating data, a cause of the failure of the first service is analyzed.
5. The method according to any one of claims 1 to 4, characterized in that: The step of obtaining the label of the first service further includes: Obtaining a tag exploration instruction, where the tag exploration instruction is used to instruct to perform tag exploration on the first service; Based on the tag exploration instruction, the operation of acquiring the tag of the first service is performed.
6. The method according to any one of claims 1 to 5, characterized in that: In a case where the related services of the first service include the second service, acquiring the link calling information of the related services of the first service based on the label of the first service includes: Sending a first response message to the second service, where the first response message is obtained based on a first request message sent by the second service to the first service, and the first response message includes a tag of the first service; Receive link invocation information fed back by the second service based on the first response message.
7. The method according to any one of claims 1 to 6, characterized in that: In a case where the related services of the first service include the third service, acquiring the link calling information of the related services of the first service based on the label of the first service includes: Sending a second request message to the third service, where the second request message includes a label of the first service; Receive link invocation information fed back by the third service based on the second request message.
8. The method according to any one of claims 1 to 7, characterized in that: The cloud server includes a graph database, the number of the related services is multiple, and after obtaining the link call information of the related services of the first service, the method further includes: storing the link call information of the plurality of related services in the graph database according to the order in which the link call information of the plurality of related services is obtained; The acquiring a topology map corresponding to the first service based on the link calling information includes: When the number of link call information stored in the graph database is greater than or equal to two, the stored link call information is read from the graph database, and a topology map corresponding to the first service is obtained based on the read link call information.
9. The method according to any one of claims 1 to 8, characterized in that: The tag includes a key-value pair, the key in the key-value pair is used to identify the tag, and the value in the key-value pair includes Internet Protocol IP address information and port information of the first service.
10. The method according to any one of claims 1 to 9, characterized in that: The link call information includes one or more of the following: uniform resource locator, source Internet Protocol IP address information, source port information, destination IP address information, destination port information, time consumption, and response result.
11. A fault analysis device, characterized in that: The device is applied to a cloud server, and the cloud server is used to run multiple services having a calling relationship. The device includes: an acquisition module, configured to acquire a tag of a first service, where the tag is used to identify the first service, and the first service is any one of the multiple services; The acquisition module is further used to acquire link call information of related services of the first service based on the label of the first service, where the related services include one or more of the following: a second service among the multiple services that needs to call the first service, and a third service among the multiple services that needs to be called by the first service; An analysis module is used to obtain a topology map corresponding to the first service based on the link call information, and perform a fault analysis on the first service based on the topology map corresponding to the first service.
12. The device according to claim 11, characterized in that The analysis module is configured to obtain first operation data of the first service, and obtain a type of fault occurring in the first service based on the first operation data; Based on the type of the fault and a topology map corresponding to the first service, a fault analysis is performed on the first service.
13. The device according to claim 12, characterized in that The fault analysis includes determining services affected by the fault, and the analysis module is used to determine services affected by the fault from a plurality of services corresponding to the topology map based on the type of the fault.
14. The device according to claim 13, characterized in that The fault analysis also includes analyzing the cause of the fault. The analysis module is further used to obtain second operation data of the affected service; based on the first operation data and the second operation data, analyze the cause of the fault of the first service.
15. The device according to any one of claims 11 to 14, characterized in that: The acquisition module is further used to acquire a label exploration instruction, where the label exploration instruction is used to instruct to perform label exploration on the first service; based on the label exploration instruction, the operation of acquiring the label of the first service is performed.
16. The device according to any one of claims 11 to 15, characterized in that: In a case where the related services of the first service include the second service, the acquisition module is used to send a first response message to the second service, where the first response message is obtained based on a first request message sent by the second service to the first service, and the first response message includes a tag of the first service; Receive link invocation information fed back by the second service based on the first response message.
17. The device according to any one of claims 11 to 16, characterized in that: In a case where the related services of the first service include the third service, the acquisition module is configured to send a second request message to the third service, where the second request message includes a label of the first service; Receive link invocation information fed back by the third service based on the second request message.
18. The device according to any one of claims 11 to 17, characterized in that: The cloud server includes a graph database, the number of the related services is multiple, and the acquisition module is further used to store the link call information of the multiple related services in the graph database according to the acquisition order of the link call information of the multiple related services; The analysis module is used to read the stored link call information from the graph database when the number of the link call information stored in the graph database is greater than or equal to two, and obtain the topology map corresponding to the first service based on the read link call information.
19. The device according to any one of claims 11 to 18, characterized in that: The tag includes a key-value pair, the key in the key-value pair is used to identify the tag, and the value in the key-value pair includes Internet Protocol IP address information and port information of the first service.
20. The device according to any one of claims 11 to 19, characterized in that: The link call information includes one or more of the following: uniform resource locator, source Internet Protocol IP address information, source port information, destination IP address information, destination port information, time consumption, and response result.
21. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, each computing device includes a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the fault analysis method as described in any one of claims 1-10.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the fault analysis method according to any one of claims 1 to 10.
23. A computer program product comprising instructions, characterized in that When the instruction is executed by a computing device cluster, the computing device cluster executes the fault analysis method as described in any one of claims 1-10.
Citation Information
Cited By
Fault analysis method and apparatus, computing device cluster, and readable storage medium
EP4787799A1
Fault analysis method and apparatus, computing device cluster, and readable storage medium
WO2025081847A1