Service dependency relationship analysis method and device
By analyzing the business request logs between services and calculating decision values to determine dependencies, the problems of inefficiency and high cost in the existing technology are solved, and efficient and accurate dependency analysis is achieved.
Patent Information
- Application Number
- CN202311122191.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-05-10
- Filing Date
- 2023-08-31
- Publication Date
- 2024-11-12
AI Technical Summary
When analyzing the dependencies between services in a software system, the prior art is inefficient, unable to update the dependencies dynamically and adaptively, and requires a large number of fault simulations or code analysis, which is costly and has low accuracy.
By obtaining the business request logs between services, extracting source information and destination information, and calculating decision values to determine the dependencies between services, without the need for failure simulation or code analysis, the dependencies are dynamically and adaptively analyzed.
It improves the efficiency and accuracy of service dependency analysis, reduces costs, can dynamically update dependencies, and simplifies the analysis process.
Smart Images

Figure CN118939526A_ABST
Abstract
Description
[0001] This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on May 10, 2023, with application number 202310523865.5 and application name “A Dependency Analysis Method and Analysis Platform Based on Log Information”, all contents of which are incorporated by reference in this application. Technical Field
[0002] The embodiments of the present application relate to the field of cloud computing technology, and in particular to a method and device for analyzing service dependencies. Background Art
[0003] In the field of cloud computing, software systems are often composed of multiple services, which usually have a calling relationship with each other. The calling and being called relationship between services can be called a dependency relationship or a calling relationship. Analyzing the dependency relationship between services in a software system helps in system design, permission control, fault analysis, optimizing resource allocation, and system performance tuning.
[0004] Currently, the dependencies between services are determined by analyzing the code files of the services. For example, after grabbing the code files of the services, the dependencies of the services are determined based on the initialization information of the services in the code files (the initialization information includes the dependency packages for the service operation and the services associated with the service initialization, etc.).
[0005] In the above method, the workload of analyzing the code files is relatively large. In large-scale software systems, the efficiency of this method of determining the dependencies between services through code files is relatively low. Summary of the invention
[0006] The embodiments of the present application provide a method and device for analyzing service dependencies, which can improve the efficiency of analyzing service dependencies.
[0007] In order to achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0008] In a first aspect, an embodiment of the present application provides a method for analyzing service dependencies, which is applied to a cloud management platform, where the cloud management platform is used to manage an infrastructure, where a user-deployed first service and a second service are running on the infrastructure, where the first service runs on a first service node of the infrastructure, and where the second service runs on a second service node of the infrastructure, the method comprising: obtaining service information to be analyzed input by a user, where the service information to be analyzed is used to determine the first service and the second service, where the first service and the second service generate business requests during operation; and obtaining a request log of the business request, where the request log is generated by the first service and the second service in the process of processing the business request; and determining decision information based on the request log, where the decision information includes source information and / or destination information of the business request; and then determining the dependency relationship between the first service and the second service based on the decision information.
[0009] The service dependency analysis method provided in the embodiment of the present application determines the dependency between services based on the request log of existing business requests. Compared with the prior art, the method is simple and practical, does not require a large number of fault simulations, does not require the modification of the software system, and does not require the analysis of a large number of code files, and can improve the efficiency of analyzing service dependencies.
[0010] Furthermore, the service dependency analysis method provided in the embodiment of the present application also has the advantages of high accuracy, low cost, and the ability to dynamically and adaptively analyze dependencies.
[0011] In a possible implementation, the source information in the service request includes identification information of the first service node, and the destination information in the service request includes identification information of the service node of the second service. Based on this, the above-mentioned determination of decision information based on the request log includes: extracting the identification information of the first service node and / or the identification information of the second service node from the request log according to the log format of the request log to obtain the decision information.
[0012] The log format is the composition format of various information in the log. According to the log format, the required information can be quickly extracted from the log. For example, according to the log format, it can be known which fields in the log correspond to which information. In this way, when it is necessary to extract certain information, the required information can be obtained by extracting the information of the specified field according to the log format.
[0013] Optionally, the above-mentioned log format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the log format input by the user and extracts the required information from the log according to the log format; alternatively, the above-mentioned log format may also be pre-defined, which is not limited in the embodiment of the present application.
[0014] In one possible implementation, the request log includes at least one of the following: a system log, a business log, a gateway log or a middleware log; wherein the middleware log is generated by the second service node, the system log and the business log are generated by the first service node, and the gateway log is generated by a gateway device between the first service node and the second service node.
[0015] In a possible implementation, the request log of the business request is obtained as described above, including: obtaining first node information and second node information according to the service information to be analyzed, wherein the first node information is used to indicate the first service, and the second node information is used to indicate the second service; and obtaining request logs generated by the first service and the second service in the process of processing business requests from the full request log according to the first node information and the second node information; the full request log is the request log generated by multiple services deployed on the infrastructure in the process of calling each other. Obtaining the request logs generated by the first service node and the second service node in the process of processing business requests from the full log and filtering out some irrelevant request logs can help improve the accuracy of dependency analysis.
[0016] In a possible implementation, the first node information includes the name of the first service and the identification information of the first service node, and the second node information includes the name of the second service and the identification information of the second service node. Based on this, the above-mentioned acquisition of the first node information and the second node information according to the service information to be analyzed includes: acquiring the information of the first service node according to the service information to be analyzed, and extracting the name of the first service and the identification information of the first service node from the information of the first service node according to the node information format to obtain the first node information; and acquiring the information of the second service node according to the service information to be analyzed, and extracting the name of the second service and the identification information of the second service node from the information of the second service node according to the node information format to obtain the second node information.
[0017] The node information format is the composition format of various information of the node. According to the node information format, the required information can be quickly extracted from the node information. For example, according to the node information format, it can be known which fields in the service node information correspond to which information. In this way, when it is necessary to extract certain information, the required information can be obtained by extracting the information of the specified field according to the node information format. Optionally, the node information format of the service nodes in different software systems may be different, and the node information format of different service nodes in the same software system may also be different.
[0018] Optionally, the above-mentioned node information format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the node information format input by the user and extracts the required information from the information of the service node according to the node information format; alternatively, the above-mentioned node information format may also be pre-defined, which is not limited in the embodiments of the present application.
[0019] In one possible implementation, the above-mentioned determining the dependency relationship between the first service and the second service based on the decision information includes: calculating the decision value of the dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node; if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0020] It should be understood that the number of the above decision information is n, and the calculation formula of the decision value of the dependency relationship is:
[0021]
[0022] Among them, Score(var) represents the decision value of the dependency relationship, α i is the weight value of the i-th decision information (which may be called the reconciliation coefficient). According to the above calculation formula, the decision value of the dependency relationship between the first service and the second service is the weighted sum of the scores of all decision information.
[0023] In a possible implementation, the source information in the business request also includes information about the first API of the first service, and the destination information in the business request includes information about the second API of the second service. Based on this, the above-mentioned determination of decision information based on the request log includes: extracting identification information of the first service node and / or identification information of the second service node from the request log according to the log format of the request log, and extracting information about the first API and / or information about the second API to obtain decision information.
[0024] In a possible implementation, the above-mentioned determination of the dependency relationship between the first service and the second service based on the decision information includes: calculating the decision value of the API dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node, as well as the information of the first API and / or the information of the second API; if the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service. Among them, the existence of an API dependency relationship between the first service and the second service includes at least one of the following: the first API of the first service depends on the second service; the first service depends on the second API of the second service; or the first API of the first service depends on the second API of the second service. It can be seen that the service dependency analysis method provided in the embodiment of the present application can analyze the service dependencies from a finer granularity and improve the accuracy of the service dependency analysis.
[0025] In a possible implementation, the service dependency analysis method provided in the embodiment of the present application further includes: constructing a dependency topology map based on the dependency between the first service and the second service. The dependency topology map can intuitively reflect the dependency between services (including service-level dependencies and API-level dependencies).
[0026] In a second aspect, an embodiment of the present application provides a service dependency analysis method, which is applied to a cloud management platform, wherein the cloud management platform is used to manage an infrastructure, wherein multiple services deployed by users run on the infrastructure, and the multiple services generate business requests during operation. The multiple services include a first service and a second service, wherein the first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure. The method includes: obtaining service information to be analyzed input by a user, and the service information to be analyzed is used to determine the first service and the second service; and obtaining a request log of business requests sent by multiple services, and the request log is generated in the process of multiple services processing business requests; and determining decision information based on the request log, and the decision information includes source information and / or destination information of the business request; and then determining the dependency relationship between the first service and the second service based on the decision information.
[0027] The service dependency analysis method provided in the embodiment of the present application determines the dependency between services based on the request log of existing business requests. Compared with the prior art, the method is simple and practical, does not require a large number of fault simulations, does not require the modification of the software system, and does not require the analysis of a large number of code files, and can improve the efficiency of analyzing service dependencies.
[0028] Furthermore, the service dependency analysis method provided in the embodiment of the present application also has the advantages of high accuracy, low cost, and the ability to dynamically and adaptively analyze dependencies.
[0029] In a possible implementation, the source information of the service request includes identification information of a source service node among multiple service nodes running multiple services, and the destination information of the service request includes identification information of a destination service node among multiple service nodes; the service request is sent from a service running on the source service node to a service running on the destination service node. The above-mentioned determination of decision information based on the request log includes: extracting identification information of the source service node and / or identification information of the destination service node from the request log according to the log format of the request log to obtain the decision information.
[0030] The log format is the composition format of various information in the log. According to the log format, the required information can be quickly extracted from the log. For example, according to the log format, it can be known which fields in the log correspond to which information. In this way, when it is necessary to extract certain information, the required information can be obtained by extracting the information of the specified field according to the log format.
[0031] Optionally, the above-mentioned log format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the log format input by the user and extracts the required information from the log according to the log format; alternatively, the above-mentioned log format may also be pre-defined, which is not limited in the embodiment of the present application.
[0032] In a possible implementation, the service dependency analysis method provided in the embodiment of the present application also includes: obtaining first node information and second node information based on the service information to be analyzed, the first node information is used to indicate the first service, and the second node information is used to indicate the second service. The above-mentioned determination of the dependency between the first service and the second service based on the decision information includes: determining the target decision information from the decision information based on the first node information and the second node information, the target decision information including the identification information of the first service node and / or the identification information of the second service node; and determining the dependency between the first service and the second service based on the target decision information. Filtering out the decision information in which the source service node is the first service node and the destination service node is the second service node from multiple decision information as the target decision information, filtering out some irrelevant decision information, and helping to improve the accuracy of the dependency analysis.
[0033] In a possible implementation, the first node information includes the name of the first service and the identification information of the first service node, and the second node information includes the name of the second service and the identification information of the second service node. The above-mentioned obtaining the first node information and the second node information according to the service information to be analyzed includes: obtaining the information of the first service node according to the service information to be analyzed, and extracting the name of the first service and the identification information of the first service node from the information of the first service node according to the node information format to obtain the first node information; and obtaining the information of the second service node according to the service information to be analyzed, and extracting the name of the second service and the identification information of the second service node from the information of the second service node according to the node information format to obtain the second node information.
[0034] The node information format is the composition format of various information of the node. According to the node information format, the required information can be quickly extracted from the node information. For example, according to the node information format, it can be known which fields in the service node information correspond to which information. In this way, when it is necessary to extract certain information, the required information can be obtained by extracting the information of the specified field according to the node information format. Optionally, the node information format of the service nodes in different software systems may be different, and the node information format of different service nodes in the same software system may also be different.
[0035] Optionally, the above-mentioned node information format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the node information format input by the user and extracts the required information from the information of the service node according to the node information format; alternatively, the above-mentioned node information format may also be pre-defined, which is not limited in the embodiments of the present application.
[0036] In one possible implementation, the above-mentioned determining the dependency relationship between the first service and the second service based on the target decision information includes: calculating the decision value of the dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node in the target decision information; if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0037] The number of the above-mentioned multiple decision information is n, and each decision information is set with a score. For example, for the i-th decision information, if the decision information is the target decision information, the score S corresponding to the decision information is set. i Set to 1. If the decision information does not belong to the target decision information, set the score S corresponding to the decision information. i is 0.
[0038] In a possible implementation, the calculation formula of the decision value of the dependency relationship is:
[0039]
[0040] Among them, Score(var) represents the decision value of the dependency relationship, n is the total number of decision information of the entire software system, and S i is the score of the i-th decision information, α i is the weight value of the decision information (which can be called the harmonic coefficient).
[0041] According to the above calculation formula, since the score of non-target decision information is 0, in fact, the decision value of the dependency relationship between the first service and the second service is the weighted sum of the scores of all target decision information.
[0042] In a possible implementation, the source information of the business request also includes information about the API of the source service among the multiple services, and the destination information of the business request also includes information about the API of the destination service among the multiple services. The above-mentioned determination of decision information based on the request log includes: extracting identification information of the source service node and / or identification information of the destination service node from the request log according to the log format of the request log, and extracting information about the API of the source service and / or information about the API of the destination service to obtain decision information.
[0043] In a possible implementation, the above-mentioned determination of the dependency relationship between the first service and the second service based on the decision information includes: determining the target decision information from the decision information based on the first node information and the second node information, the target decision information including the identification information of the first service node and / or the identification information of the second service node, and the information of the first API of the first service and / or the information of the second API of the second service; and calculating the decision value of the API dependency relationship between the first service and the second service based on the target decision information; if the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service. Among them, the existence of an API dependency relationship between the first service and the second service includes at least one of the following: the first API of the first service depends on the second service; the first service depends on the second API of the second service; or the first API of the first service depends on the second API of the second service. It can be seen that the service dependency analysis method provided in the embodiment of the present application can analyze the dependency relationship of the service from a finer granularity and improve the accuracy of the service dependency analysis.
[0044] In a possible implementation, the service dependency analysis method provided in the embodiment of the present application further includes: constructing a dependency topology map based on the dependency between the first service and the second service. The dependency topology map can intuitively reflect the dependency between services (including service-level dependencies and API-level dependencies).
[0045] In the third aspect, the embodiment of the present application provides a cloud management platform, which is used to manage infrastructure, on which a user-deployed first service and a second service are running, the first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure, and the cloud management platform includes a first acquisition module, a second acquisition module, a log processing module, and an analysis module. Among them, the first acquisition module is used to obtain the service information to be analyzed input by the user, and the service information to be analyzed is used to determine the first service and the second service, wherein the first service and the second service generate business requests during operation; the second acquisition module is used to obtain the request log of the business request, and the request log is generated by the first service and the second service in the process of processing the business request; the log processing module is used to determine the decision information based on the request log, and the decision information includes the source information and / or destination information of the business request; the analysis module is used to determine the dependency relationship between the first service and the second service based on the decision information.
[0046] In a possible implementation, the source information in the service request includes the identification information of the first service node, and the destination information in the service request includes the identification information of the service node of the second service. Based on this, the log processing module is specifically used to extract the identification information of the first service node and / or the identification information of the second service node from the request log according to the log format of the request log to obtain the decision information.
[0047] In one possible implementation, the request log includes at least one of the following: a system log, a business log, a gateway log or a middleware log; wherein the middleware log is generated by the second service node, the system log and the business log are generated by the first service node, and the gateway log is generated by a gateway device between the first service node and the second service node.
[0048] In one possible implementation, the cloud management platform also includes a node information processing module; the node information processing module is used to obtain first node information and second node information based on the service information to be analyzed, the first node information is used to indicate the first service, and the second node information is used to indicate the second service; the second acquisition module is specifically used to obtain the request log generated in the process of the first service and the second service processing business requests from the full request log based on the first node information and the second node information; the full request log is the request log generated by multiple services deployed on the infrastructure in the process of calling each other.
[0049] In a possible implementation, the first node information includes the name of the first service and the identification information of the first service node, and the second node information includes the name of the second service and the identification information of the second service node. Based on this, the node information processing module is specifically used to obtain the information of the first service node according to the service information to be analyzed, and extract the name of the first service and the identification information of the first service node from the information of the first service node according to the node information format to obtain the first node information; and obtain the information of the second service node according to the service information to be analyzed, and extract the name of the second service and the identification information of the second service node from the information of the second service node according to the node information format to obtain the second node information.
[0050] In one possible implementation, the above-mentioned analysis module is specifically used to calculate the decision value of the dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node; if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0051] In a possible implementation, the source information in the business request also includes information about the first application programming interface API of the first service, and the destination information in the business request includes information about the second API of the second service. Based on this, the log processing module is specifically used to extract the identification information of the first service node and / or the identification information of the second service node from the request log according to the log format of the request log, and extract the information of the first API and / or the information of the second API to obtain the decision information.
[0052] In a possible implementation, the above-mentioned analysis module is specifically used to calculate the decision value of the API dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node, as well as the information of the first API and / or the information of the second API; if the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service. The existence of an API dependency relationship between the first service and the second service includes at least one of the following: the first API of the first service depends on the second service; the first service depends on the second API of the second service; or the first API of the first service depends on the second API of the second service.
[0053] In a possible implementation, the cloud management platform further includes a generation module; the generation module is used to construct a dependency topology map according to the dependency relationship between the first service and the second service.
[0054] In the fourth aspect, the embodiment of the present application provides a cloud management platform, which is used to manage infrastructure. Multiple services deployed by users are running on the infrastructure. The multiple services generate business requests when running. The multiple services include a first service and a second service. The first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure. The cloud management platform includes: a first acquisition module, a second acquisition module, a log processing module, and an analysis module. Among them, the first acquisition module is used to obtain the service information to be analyzed input by the user, and the service information to be analyzed is used to determine the first service and the second service; the second acquisition module is used to obtain the request log of the business request, and the request log is generated in the process of multiple services processing the business request; the log processing module is used to determine the decision information based on the request log, and the decision information includes the source information and / or the destination information in the business request; the analysis module is used to determine the dependency relationship between the first service and the second service based on the decision information.
[0055] In a possible implementation, the source information in the service request includes identification information of a source service node among multiple service nodes running multiple services, and the destination information of the service request includes identification information of a destination service node among multiple service nodes; the service request is sent from a service running on the source service node to a service running on the destination service node. Based on this, the log processing module is specifically used to extract identification information of the source service node and / or identification information of the destination service node from the request log according to the log format of the request log to obtain decision information.
[0056] In a possible implementation, the cloud management platform further includes a node information processing module; the node information processing module is used to obtain first node information and second node information according to the service information to be analyzed, the first node information is used to indicate the first service, and the second node information is used to indicate the second service. The above-mentioned analysis module is specifically used to determine target decision information from the decision information according to the first node information and the second node information; the target decision information includes the identification information of the first service node and / or the identification information of the second service node; and according to the target decision information, determine the dependency relationship between the first service and the second service.
[0057] In a possible implementation, the first node information includes the name of the first service and the identification information of the first service node, and the second node information includes the name of the second service and the identification information of the second service node. Based on this, the node information processing module is specifically used to obtain the information of the first service node according to the service information to be analyzed, and extract the name of the first service and the identification information of the first service node from the information of the first service node according to the node information format to obtain the first node information; and obtain the information of the second service node according to the service information to be analyzed, and extract the name of the second service and the identification information of the second service node from the information of the second service node according to the node information format to obtain the second node information.
[0058] In one possible implementation, the above-mentioned analysis module is specifically used to calculate the decision value of the dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node in the target decision information; if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0059] In a possible implementation, the source information of the business request also includes information about the API of the source service among the multiple services, and the destination information of the business request also includes information about the API of the destination service among the multiple services. Based on this, the log processing module is specifically used to extract the identification information of the source service node and / or the identification information of the destination service node from the request log according to the log format of the request log, and extract the information about the API of the source service and / or the information about the API of the destination service to obtain the decision information.
[0060] In a possible implementation, the above-mentioned analysis module is specifically used to determine target decision information from the decision information according to the first node information and the second node information, and the target decision information includes the identification information of the first service node and / or the identification information of the second service node, as well as the information of the first API of the first service and / or the information of the second API of the second service; and based on the target decision information, calculate the decision value of the API dependency relationship between the first service and the second service; if the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service. Among them, the existence of an API dependency relationship between the first service and the second service includes at least one of the following: the first API of the first service depends on the second service; the first service depends on the second API of the second service; or the first API of the first service depends on the second API of the second service.
[0061] In a possible implementation, the cloud management platform further includes a generation module, where the generation module is used to construct a dependency topology map according to the dependency relationship between the first service and the second service.
[0062] In one possible implementation, the request log of the service request includes at least one of the following: a system log, a service log, a gateway log or a middleware log; wherein the middleware log is generated by the destination service node, the system log and the service log are generated by the source service node, and the gateway log is generated by the gateway device between the source service node and the destination service node.
[0063] In a fifth aspect, an embodiment of the present application provides a computing device cluster, including 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 executes the method described in any one of the first aspect and its possible implementations or the method described in any one of the second aspect and its possible implementations.
[0064] In a sixth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed by a computing device cluster, enables the computing device cluster to execute the method described in any one of the first aspect and its possible implementations or the method described in any one of the second aspect and its possible implementations.
[0065] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method described in the above-mentioned first aspect and any one of its possible implementations or the method described in the above-mentioned second aspect and any one of its possible implementations.
[0066] In an eighth aspect, an embodiment of the present application provides a chip, comprising a memory and a processor. The memory is used to store computer instructions. The processor is used to call and run the computer instructions from the memory to execute the method described in any one of the first aspect and its possible implementations or the method described in any one of the second aspect and its possible implementations.
[0067] It should be understood that the beneficial effects achieved by the technical solutions of the third to eighth aspects of the embodiments of the present application and the corresponding possible implementation methods can be referred to the technical effects of the first aspect, the second aspect and their corresponding possible implementation methods mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 A schematic diagram of an infrastructure architecture provided for an embodiment of the present application;
[0069] Figure 2 One of the schematic diagrams of the system architecture for dependency analysis of a service provided in an embodiment of the present application;
[0070] Figure 3 A second schematic diagram of a system architecture for dependency analysis of a service provided in an embodiment of the present application;
[0071] Figure 4 One of the schematic diagrams of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0072] Figure 5 A second schematic diagram of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0073] Figure 6 A third schematic diagram of a method for analyzing dependency relationships of a service provided in an embodiment of the present application;
[0074] Figure 7 A fourth schematic diagram of a method for analyzing dependency relationships of a service provided in an embodiment of the present application;
[0075] Figure 8 A fifth schematic diagram of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0076] Fig. 9 Schematic diagram of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0077] Fig.10 A third schematic diagram of a system architecture for dependency analysis of a service provided in an embodiment of the present application;
[0078] Fig.11 Schematic diagram of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0079] Fig.12 Schematic diagram 8 of a method for analyzing dependency of a service provided in an embodiment of the present application;
[0080] Fig.13 A schematic diagram of a dependency topology diagram of a service provided in an embodiment of the present application;
[0081] Fig.14 A schematic diagram of the structure of a cloud management platform provided in an embodiment of the present application;
[0082] Fig.15 A schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0083] Fig.16 A schematic diagram of the structure of a computer cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0084] The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0085] The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects rather than to describe a specific order of objects. For example, a first service and a second service are used to distinguish different services rather than to describe a specific order of services.
[0086] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0087] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more than two. For example, multiple services refers to two or more services.
[0088] An embodiment of the present application provides a method for analyzing service dependencies, which can be applied to a cloud management platform. It can be understood that the cloud management platform is used to manage infrastructure, and multiple services deployed by users run on the infrastructure. The multiple services can be run on different service nodes in the infrastructure respectively.
[0089] First, some concepts involved in a service dependency analysis method and device provided in an embodiment of the present application are explained.
[0090] 1. Dependencies between services
[0091] A service can communicate with other services. Specifically, each service makes service calls through the network to achieve a certain function.
[0092] Multiple services running on the infrastructure can call each other, that is, some of the multiple services are callers (i.e., calling services), and some are called (called services). The calling relationship between calling services and called services can also be called the dependency relationship between services. For example, if service 1 calls service 2, then service 1 and service 2 have a dependency relationship, and service 1 depends on service 2.
[0093] Generally, dependencies between services may include service-level dependencies and application program interface (API)-level dependencies. Service-level dependencies may also be referred to as service-granular dependencies, which represent the calling relationship between one service and another. API-level calling relationships may also be referred to as API-granular dependencies, which represent the calling relationship between one service and the API of another service. For example, API 1 of service 1 calls API 2 of service 2, or service 1 calls API 2 of service 2 (in this case, the API of service 1 is not involved), or API 1 of service 1 calls service 2 (in this case, the API of service 2 is not involved).
[0094] It should be understood that the specification (or call type) followed when services call each other can be representational state transfer (REST) or remote procedure call (RPC). Among them, for REST, the commonly used communication protocol is hypertext transfer protocol (HTTP), and the corresponding call requests can be divided into the following methods: get (GET), create (POST), modify (PUT) and delete (DELETE. For RTC, the commonly used communication protocol is transmission control protocol (TCP).
[0095] Optionally, the service in the embodiment of the present application may also be a microservice. It should be understood that a microservice is a small service composed of a single application program, with an independent process and a lightweight processing mechanism. A microservice can be designed according to business functions, that is, a microservice is a single small service developed but with business functions. A microservice can be deployed on a single or multiple servers.
[0096] 2. Service Node
[0097] The service node in the embodiment of the present application is a device that runs a certain service. Figure 1 The schematic diagram of an infrastructure architecture is shown, the infrastructure includes a first computing device, a second computing device and a gateway device (such as an API gateway), the computing device may be a server, a computer, etc. Each computing device may include one or more service nodes, and a service may be run on the service node. For example, Figure 1The first computing device includes 3 service nodes, and the second computing device includes 2 service nodes. It is assumed that service A is running on service node 1 of the first computing device, and service B is running on service node 2 of the second computing device. The gateway device is used to forward messages between service A and service B.
[0098] The service node can be a physical device or a virtual device. Optionally, the service process can be deployed in a physical machine, a virtual machine or a container. The service process has a unique process ID. In actual applications, a service node can be dynamically selected from multiple service nodes through load balancing as the node for running the service this time.
[0099] It should be understood that each service node has a unique node IP address. Multiple service nodes can belong to the same cluster or different clusters, and each cluster has a unique cluster ID (which can be recorded as cluster ID). Usually, one service node corresponds to one service, or one cluster corresponds to one service.
[0100] For a service node, the information of the service node (which can be called the basic information of the service node) may include: the IP address of the service node, the name of the service node, the name of the service deployed in the service node, the name of the process of the service deployed in the service node, and the ID of the cluster to which the service node belongs. Optionally, in some cases, each service node is provided with a node information collection plug-in (agent), which can collect the information of the service node and store the information of the service node in a node information management platform, which can be a central server in an IT system for resource management (such as managing virtual machine resources or IP resources), or a node information management module, etc.
[0101] 4. Request log
[0102] Based on the above description, for a certain business demand, during the business operation process, it involves calls between multiple services, that is, one service sends a business request to another service, and a corresponding request log is generated in the process of processing the business request. Specifically, the request log involved in the embodiment of the present application may include: system log, business log, gateway log or middleware log.
[0103] 4.1 System log
[0104] System logs mainly include system core logs, audit logs, etc. Taking the Linux system as an example, the system includes / var / log / message and var / log / audit / , etc. For example, when service A initiates a business request to service B, the system log of service B includes the date and time when the request event is generated, the source host that generates the request event (from a service node of the service), the process name that generates the request event (such as the process number), and the actual log information.
[0105] For example, service A initiates a business request to service B and calls service B. The system log recorded by service A is:
[0106] system_log_1=Nov 09 12:39:08localhost sz
[15879] :[bin / bash]:[curl–k192.168.0.1]return code=[7],execute failed by[root], where:
[0107] NOV 09 12:39:08 is the time when the request event is generated;
[0108] Localhost is the source host of the request event. It should be understood that by determining the source host, the IP address of the source host can be determined, that is, the IP address of the service node of service A;
[0109] sz
[15879] is the program and process number that generated the request event;
[0110] 192.168.0.1 is the IP address of the service node of service B;
[0111] Return code = [7] indicates whether the call is successful.
[0112] 4.2 Business Log
[0113] A business log is a log that records business-related information generated by the requester after the business request ends. For example, in a scenario where a service calls another service, the calling service sends a business request, and the business log generated after receiving a response message from the called service may include the sending time of the business request, the ID of the business request, the name of the calling service, the IP address of the service node of the calling service, the API address of the calling service (which can be the URL of the API), the mode of the business request, the result of the business request (normal or abnormal), user information, resource information, the name of the called service, the IP address of the service node of the called service, the API address of the called service (which can be the URL of the API), the request return code (http code), etc.
[0114] For example, service A initiates a business request to service B and calls the API of service B. After the call is completed, the business log recorded by service A is:
[0115] trace_log_1=(2023 / 04 / 17-14:17:33-GMT+08:00,8a7ce38c-dce7-11ed-893f-b1dff287654d,serviceA,10.63.41.145, / v1 / {project_id} / instance / {instance_id},GET,normal,user 1,resource 1,serviceB,10.172.162.12, / v1 / {project_id} / bucket / {bucket_id},200), where:
[0116] 2023 / 04 / 17-14:17:33-GMT+08:00 is the time when the business request is sent;
[0117] 8a7ce38c-dce7-11ed-893f-b1dff287654d is the ID of the business request;
[0118] serviceA is the name of the calling service, that is, the calling service is service A;
[0119] 10.63.41.145 is the IP address of the service node that calls the service, that is, the IP address of the service node of service A;
[0120] / v1 / {project_id} / instance / {instance_id} is the URL for calling the service API. The URL can indicate the API, which can be understood as the user calling the API of service A;
[0121] GET is the service request method, for example, the service request method can be GET or POST;
[0122] Normal is the result of the business request. Normal means normal, that is, the call is successful.
[0123] User1 is the user who initiates the service request;
[0124] Resource1 is the resource used to initiate the service request;
[0125] serviceB is the name of the called service, that is, the called service is service B;
[0126] 10.172.162.12 is the IP address of the service node of the called service, that is, the IP address of the service node of service B;
[0127] / v1 / {project_id} / bucket / {bucket_id} is the URL of the API of the called service. The URL can indicate the API, which can be understood as service A calling the API of service B.
[0128] 200 is the http code, which means normal.
[0129] 4.3 Gateway Log
[0130] The gateway log is a routing log of the business request, which is generated by the gateway device. For example, in a scenario where one service calls another service, the gateway device receives the business request of the calling service and forwards the business request to the called service. Subsequently, the gateway device receives a response message to the business request from the called service and forwards the response message to the calling service. During this process, the gateway log generated by the gateway device may include the forwarding time of the business request, the IP address of the service node of the calling service, the name of the called service, the process name of the called service, the API address of the called service (which can be the URL of the API), the request protocol, the mode of the business request, the request return code (http code), the IP address of the service node of the called service, the mode of authentication, the source of the request, the result of the business request (normal or abnormal), the request attributes, the type of business request, etc.
[0131] For example, service A initiates a business request to service B, and the business request is forwarded by the API gateway. The gateway log recorded by the API gateway is:
[0132] gateway_log_1=(2023-02-25 08:57:19,10.63.41.145,serviceB,instance1, / v1 / {project_id} / bucket / {bucket_id},HTTP / 1.1,GET,200,10.172.162.12,TOKEN,ApiCall,NORMAL,external,http), where:
[0133] 2023-02-25 08:57:19 is the forwarding time of the business request
[0134] 10.63.41.145 is the IP address of the service node that calls the service, that is, the IP address of the service node of service A;
[0135] serviceB is the name of the called service, and the called service is service B;
[0136] instance1 is the process name of the called service (the process name can be the instance name);
[0137] / v1 / {project_id} / bucket / {bucket_id} is the API address of the called service (can be the URL of the API);
[0138] HTTP / 1.1 is the request protocol;
[0139] GET is the service request method;
[0140] 200 is the request return code (http code);
[0141] 10.172.162.12 is the IP address of the service node of the called service, that is, the IP address of the service node of service B;
[0142] TOKEN is a method of authentication;
[0143] ApiCall is the request source, which indicates that the request comes from an interface. The request source can also include the interface.
[0144] NORMAL is the result of the business request (normal or abnormal), NORMAL means normal;
[0145] external is a request attribute. external means it comes from outside the software system, such as from the user;
[0146] http is the type of service request.
[0147] 4.4 Middleware log
[0148] Middleware logs are generated by middleware. For example, in a service call scenario, the logs generated by the middleware of the called service, such as the access logs of Tomcat (a technology for implementing middleware), may include the IP address of the service node that calls the service, the IP address of the service node that is called, the time when the called service receives the business request, the method of the business request, the API address of the called service (which may be the URL of the API), the request protocol, the request return code (http code), the time consumed by the request, etc.
[0149] For example, service A initiates a business request to service B. The middleware log recorded by service B's middleware is:
[0150] tomcat_access_log = (10.63.41.145, 10.172.162.12, [14 / Jul / 2018:12:34:42+0800],"GET / v1 / 123 / instance / 1HTTP / 1.1", 200, 251), where:
[0151] 10.63.41.145 is the IP address of the service node that calls the service, that is, the IP address of the service node of service A;
[0152] 10.172.162.12 is the IP address of the service node of the called service, that is, the IP address of the service node of service B;
[0153] [14 / Jul / 2018:12:34:42+0800] is the time when the called service receives the business request;
[0154] GET in "GET / v1 / 123 / instance / 1HTTP / 1.1" is the service request method;
[0155] In "GET / v1 / 123 / instance / 1HTTP / 1.1", / v1 / 123 / instance / 1 is the API address of the called service;
[0156] HTTP / 1.1 in "GET / v1 / 123 / instance / 1HTTP / 1.1" is the request protocol;
[0157] 200 is the request return code (http code);
[0158] 251 is the time taken by the request.
[0159] Optionally, in some cases, a log collection plug-in may be provided for each service, and the log collection plug-in may collect the above-mentioned various logs and store the logs in a log management platform (eg, a log storage module).
[0160] At present, software systems are often composed of multiple services. In many scenarios such as software system design, permission control, fault analysis, optimal resource allocation, and system performance tuning, it is necessary to complete corresponding processing based on the dependency relationships between multiple services in the software system.
[0161] For example, in a permission control scenario, suppose a user calls service A. During the calling process, service A also needs to call service B, that is, service A and service B have a dependency relationship. In this case, if the user can know in advance that service A and service B have a dependency relationship, the user can apply for both permission to access service A and permission to access service B when applying for permission. In this way, the user can call service A smoothly.
[0162] In the fault analysis scenario, if service A fails, other services that depend on service A will also fail to function properly. Therefore, knowing the dependency between services is helpful for fault analysis. For example, service B calls service A. When service A fails, service B can no longer call service A normally. At this time, the fault analysis result is that both service A and service B fail.
[0163] In the scenario of optimizing resource allocation, resources can be effectively allocated based on the calling relationship between services. For example, if the user takes a long time to call service A, if it is known that service A also needs to call service B, it may be because service B has insufficient resources, which causes service A to take a long time to call service B. In this case, more resources can be allocated to service B.
[0164] In the system performance tuning scenario, targeted tuning can be performed based on the calling relationship between services. For example, suppose service A calls service B, and service B calls service C. When the user calls service A, it is found that the calling speed is slow. At this time, based on the relationship between services A, B, and C, the specific reasons for the slow calling speed can be determined based on the time taken by service B to call service C and the time taken by service A to call service B. For example, it can be determined whether it is caused by the slow calling of service B to service C or the slow calling of service A to service B. Therefore, some performance optimization can be performed on the services with slow calling speed.
[0165] Software system design may include, for example, one or more of the above-mentioned permission control, fault analysis, resource configuration, system performance tuning, etc. Therefore, it can be seen that software system design needs to refer to the dependencies between services.
[0166] In the prior art, service dependencies are usually analyzed based on methods such as fault simulation, tag tracking or code analysis, but these methods still have various defects in some cases. The following briefly describes several existing service dependency analysis methods.
[0167] A method for analyzing service-level dependencies is to determine the dependencies between services by analyzing the code files of the services. For example, after grabbing the code files of the services, the dependencies of the services are determined according to the initialization information of the services in the code files (the initialization information includes the dependency packages for the service operation and the services associated with the service initialization, etc.). In this method, the workload of analyzing the code files is large. In large-scale software systems, the efficiency of this method of determining the dependencies between services through code files is low. In addition, omissions are prone to occur when analyzing the code files, resulting in low accuracy of the dependency analysis results. And when the dependencies between services in the software system change dynamically, it is impossible to analyze the dependencies dynamically and adaptively.
[0168] A method for analyzing the API-level dependencies of services is: analyzing the dependencies of APIs between services based on the Mock fault analysis method. The Mock fault analysis method is a method for verifying whether the dependencies of APIs between assumed services are established through fault simulation. In this method, fault simulation is required, and the workload of fault simulation is large. For more complex software systems (such as a large number of services, a large number of APIs, and a long call relationship link), the workload of fault simulation will increase exponentially, making the efficiency of service dependency analysis low. And because of the large workload, omissions are prone to occur, and it is impossible to cover all scenarios, and dependency analysis is difficult to achieve. Furthermore, after the software system is expanded or upgraded, if a new API is added, the test case needs to be rewritten, and this method cannot adaptively analyze the dependencies.
[0169] Another method for analyzing the API-level dependencies of services is to analyze the API dependencies between services based on the tag tracking method. On the basis of the known service-level call relationship, the calling service implants a tag in the call request, and the tag will be passed to the called service with the call request, and will be passed down step by step. In addition, for each service on the call chain, after receiving the call request, the call request needs to be "dyed" to generate a dyeing ID, and then generate a call log containing the service name, the service API and the dyeing ID, and then analyze the call log with the same dyeing ID to learn the API dependencies between services. In this method, if a new service is added to the software system or a new call to the new service is added, the software system needs to be improved so that the new service in the software system has the ability to report the call log according to the log format configured by the log platform. The cost of improving the software system is high, and in this case, the dependency cannot be analyzed dynamically and adaptively.
[0170] Another method for analyzing the API-level dependencies of services is to determine the API dependencies between services by statically analyzing the code files of the services. In this method, the workload of analyzing the code files is large, resulting in low efficiency in analyzing the dependencies between services. In addition, omissions are prone to occur when analyzing the code files, and the accuracy of the dependency analysis results is not high. In addition, when the dependencies between services in the software system change dynamically, it is impossible to analyze the dependencies dynamically and adaptively.
[0171] In view of the problems existing in the prior art, the embodiment of the present application provides a method for analyzing the dependency of a service, which can be applied to a cloud management platform, and the cloud management platform is used to manage infrastructure. Multiple services are deployed by users on the infrastructure, and business requests are generated when multiple services are running. The multiple services include a first service and a second service, wherein the first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure. After the cloud management platform obtains the service information to be analyzed input by the user for determining the first service and the second service, it obtains the request log of the business request, which is generated in the process of processing business requests by multiple services; and determines the decision information according to the request log, which includes the source information and / or the destination information in the business request; and determines the dependency between the first service and the second service according to the decision information. The method analyzes the dependency between services based on the request log of the existing business request. Compared with the prior art, the service dependency analysis method provided by the embodiment of the present application is simple and practical, and does not require a large number of fault simulations, nor does it require the transformation of the software system, nor does it require the analysis of a large number of code files, which can improve the efficiency of analyzing the dependency of services.
[0172] Furthermore, the service dependency analysis method provided in the embodiment of the present application also has the advantages of high accuracy, low cost, and the ability to dynamically and adaptively analyze dependencies.
[0173] The service dependency analysis method provided in the embodiment of the present application can be applied to Figure 2 In the system architecture shown, reference Figure 2 The system architecture includes an infrastructure and a cloud management platform for managing the infrastructure. Multiple services deployed by users are running on the infrastructure, wherein a first service (i.e., a service process of the first service) is running on a first service node of the infrastructure, and a second service (i.e., a service process of the second service) is running on a second service node of the infrastructure. The API gateway in the infrastructure is used to forward business requests between the first service and the second service. The cloud management platform can obtain request logs of business requests in response to information input by users (e.g., service information to be analyzed), and analyze dependencies between services based on the request logs.
[0174] Exemplary, combined Figure 2 ,like Figure 3 As shown, in the system architecture for service dependency analysis, each service can correspond to a log collection plug-in, the service node running each service corresponds to a node information collection plug-in, and the API gateway corresponds to a log collection plug-in. Taking the first service and the second service as an example, Figure 3 The log collection plug-in corresponding to the first service in can collect system logs, business logs and middleware logs and store them in the log management platform. The log collection plug-in corresponding to the API gateway can collect gateway logs and store them in the log management platform. The log collection plug-in corresponding to the second service can collect system logs, business logs and middleware logs. The node information collection plug-in can collect information about service nodes and store it in the node information management platform. It can be understood that the log management platform stores logs collected by the log collection plug-ins of all services running on the infrastructure, and the node information platform stores information about all service nodes in the infrastructure.
[0175] Exemplarily, when the first service calls the second service (i.e., the first service and the second service process a business request), the logs collected by the log collection plug-in of the first service include business logs and system logs, the log collection plug-in of the API gateway collects gateway logs, and the log collection plug-in of the second service collects middleware logs.
[0176] Combination Figure 3 The dependency analysis platform determines that the dependency relationship between the first service and the second service needs to be analyzed based on the service information to be analyzed input by the user, and then the dependency analysis platform pulls logs from the log management platform. It should be understood that the request logs obtained from the log management platform are logs generated by all services running on the infrastructure in the process of mutual calls, that is, the logs pulled by the dependency analysis platform from the log management platform are full logs, and the full logs are processed to obtain decision information for containing source information and / or destination information of the business request; further, the dependency analysis platform pulls node information (including information of the first service node and information of the second service node) from the node information management platform, and obtains first node information indicating the first service and second node information indicating the second service through node information processing; thereafter, the dependency analysis platform determines the source information and / or destination information of the business request processed by the first service and the second service from the obtained decision information based on the first node information and the second node information, and then performs dependency analysis on the first service and the second service based on the target decision information.
[0177] Optionally, Figure 3The dependency analysis platform in can be implemented by one or more computing devices, for example, it can be implemented by three computing devices, that is, the dependency analysis platform includes a computing device for performing log processing functions (which can be called a log processing server), a computing device for performing node information processing functions, and a computing device for performing dependency analysis functions. Alternatively, it can be implemented by two computing devices, that is, the dependency analysis platform includes a computing device for log processing and node information processing (that is, the above-mentioned log processing function and node information processing function are integrated in the same computing device) and a computing device for dependency analysis. Alternatively, it can be implemented by one computing device, that is, the dependency analysis platform includes computing devices for log processing, node information processing, and dependency analysis.
[0178] Optionally, Figure 3 The log management platform, node information management platform and dependency analysis platform can be three independent platforms, or the log management platform, node information management platform and dependency analysis platform can be combined into one platform, which is set according to actual needs and is not limited in the embodiments of the present application.
[0179] Combination Figure 2 and Figure 3 The system architecture shown in the figure takes the analysis of the dependency between the first service and the second service running on the infrastructure as an example to describe in detail the service dependency analysis method provided by the embodiment of the present application. The method is applied to a cloud management platform, which is used to manage the infrastructure. The infrastructure runs multiple services deployed by users, and the multiple services generate business requests when running. The multiple services include a first service and a second service. The first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure. Figure 4 As shown, the method includes S401-S404.
[0180] S401. Obtain service information to be analyzed input by a user, where the service information to be analyzed is used to determine a first service and a second service.
[0181] In an embodiment of the present application, the dependency analysis platform can provide an operation interface for dependency analysis. When a user needs to know the dependency between a first service and a second service running on an infrastructure, the user can input information indicating the first service and the second service (referred to as service information to be analyzed) in the operation interface of the cloud management platform. The cloud management platform obtains the service information to be analyzed in response to the user's input operation, determines the need to analyze the dependency between the first service and the second service based on the service information to be analyzed, and triggers the service dependency analysis process.
[0182] Optionally, the information of the service to be analyzed may include information indicating a first service and information indicating a second service, the information indicating the first service including but not limited to the name or address of the first service, and the name or address of a service node running the first service, and the information indicating the second service including but not limited to the name or address of the second service, and the name or address of a service node running the second service.
[0183] S402: Obtain a request log of a business request, where the request log is generated in a process in which multiple services process the business request.
[0184] It can be understood that the process of one service calling another service is the process of one service sending a business request to another service. Corresponding logs will be generated in the process of processing the business request. That is, the request logs of the obtained business requests are the logs generated by all services running on the infrastructure when they send business requests to each other and process the business requests. In other words, the request logs are full request logs.
[0185] In the embodiment of the present application, multiple services can be run on the infrastructure, and multiple services can call each other, that is, there are multiple call relationship links between multiple services, for example, a call relationship link is: service A→service B→service C, that is, service A calls service B, and service B calls service C. In the process of one service calling another service (that is, one service sends a service request to another service), each service and gateway device will generate a request log corresponding to the service request (hereinafter referred to as the request log of the service request).
[0186] For ease of description, in the following embodiments, the calling service is referred to as the source service, the called service is referred to as the destination service, the service node running the source service is referred to as the source service node, and the service node running the destination service is referred to as the destination service node. For example, the first service mentioned above is the source service, the first service node is the source service node, the second service is the destination service, and the second service node is the destination service node. The above service request is sent by the service running on the source service node to the service running on the destination service node.
[0187] Optionally, the request log includes at least one of the following: system log, service log, gateway log or middleware log. The system log and middleware log in the request log are generated by the destination service node, the service log is generated by the source service node, and the gateway log is generated by the gateway device between the source service node and the destination service node. It can be understood that these request logs are collected by the log collection plug-in and stored in the above Figure 3 In the log management platform shown.
[0188] In the embodiment of the present application, if the service node and the gateway device are already provided with a log collection plug-in, the cloud management platform can directly obtain the relevant logs from the log management platform. If the service node and the gateway device are not provided with a log collection plug-in, a log collection plug-in and a log management platform for storing logs need to be created.
[0189] In one implementation, the method for obtaining the request log of the business request can be: the user enters the address of the log on the operation interface of the cloud management platform, the cloud management platform obtains the address entered by the user, and obtains the request log from the log management platform according to the address of the log. Exemplarily, the log address can be an API, and the cloud management platform obtains the log from the log management platform by calling the API. For example, if the user enters the API of the business log, the cloud management platform can obtain all business logs by calling the API.
[0190] S403: Determine decision information according to the request log, where the decision information includes source information and / or destination information in the service request.
[0191] Optionally, the source information in the service request includes the identification information of the source service node, the destination information in the service request includes the identification information of the destination service node, and the identification information of the service node may be the IP address of the service node. It is understandable that usually one service is deployed on one service node, so the IP address of the service node may indicate the service running on the service node.
[0192] Optionally, combined Figure 4 ,like Figure 5 As shown, the above S403 is implemented through S4031.
[0193] S4031. Extract identification information of the source service node and / or identification information of the destination service node from the request log according to the log format of the request log to obtain decision information.
[0194] It should be understood that the log format is the composition format of various information in the log. According to the log format, the required information can be quickly extracted from the log. For example, according to the log format, it can be known which fields in the log correspond to which information. In this way, when it is necessary to extract certain information, the required information can be obtained by extracting the information of the specified field according to the log format.
[0195] Optionally, the above-mentioned log format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the log format input by the user and extracts the required information from the log according to the log format; alternatively, the above-mentioned log format may also be pre-defined, which is not limited in the embodiment of the present application.
[0196] In an embodiment of the present application, after the cloud management platform obtains the request logs of all business requests, it is necessary to process all request logs, that is, to extract valid information from the logs according to the log format. The valid information is used for service dependency analysis, and the valid information is called decision information.
[0197] For examples of log formats of different business logs, reference may be made to some examples of system logs, business logs, gateway logs, and middleware logs in the above embodiments. Optionally, the log formats of logs in different software systems may be different, and the log formats of different types of logs in the same software system may also be different.
[0198] In combination with the introduction to system logs, service logs, gateway logs and middleware logs in the above embodiments, it can be seen that the system log includes information about the source host of the service request, that is, the IP address of the source service node. It can be seen that the system log usually contains coarse-grained information (or original input) for determining service-level dependencies.
[0199] The business log includes the IP address of the source service node, the URL of the source service API, the IP address of the destination service node, and the URL of the destination service API. It can be seen that the business log usually contains information for determining service-level dependencies and information for determining service API-level dependencies.
[0200] The gateway log includes the IP address of the source service node, the URL of the destination service API, and the IP address of the destination service node. It can be seen that the gateway log usually contains fine-grained information for determining the API-level dependencies of the service.
[0201] The middleware log includes the IP address of the source service node, the IP address of the destination service node, and the API address of the destination service. It can be seen that the middleware log usually contains fine-grained information for determining service API-level dependencies.
[0202] It can be understood that the decision information extracted from the log is a decision vector composed of the extracted individual information.
[0203] Exemplarily, the format of the decision vector extracted from the system log may be:
[0204] system_record = (ret_code, source_ip, target ip); where ret_code is the return code;
[0205] The format of the decision vector extracted from the gateway log can be:
[0206] gateway_access=(source_ip,target_ip,target_instance_id,,auth_type);
[0207] Among them, source_ip represents the IP address of the source service node, target_ip represents the IP address of the destination service node, target_instance_id represents the instance ID of the destination service, that is, the process ID of the destination service, and auth_type represents the authentication method.
[0208] The format of the decision vector extracted from the middleware log can be:
[0209] tomcat_access_record=(source_ip, target_ip, http_method, ret_code);
[0210] Among them, source_ip represents the IP address of the source service node, target_ip represents the IP address of the destination service node, http_method represents the service request method, and ret_code represents the request return code, such as http code.
[0211] It should be noted that as business needs change, the calling relationship between various services also changes. Therefore, the above process of obtaining decision information is a dynamic process.
[0212] Optionally, in the embodiment of the present application, in order to perform dependency analysis more accurately, it is also necessary to appropriately filter the decision information and select multiple valid decision information.
[0213] In one case, if the decision information obtained according to the request log does not include the IP address of the source service node and / or the IP address of the destination service node, the decision information is filtered out, not stored, and regarded as invalid information.
[0214] In another case, when the decision information obtained according to the request log includes the IP address of the source service node and the IP address of the destination service node, but does not include other information, if the decision information has not been stored, then the decision information is stored; if the decision information has been stored, then the decision information is filtered out, so as to avoid storing duplicate decision information.
[0215] In another case, if the decision information obtained according to the request log includes the IP address of the source service node and the IP address of the destination service node, and includes other information, such as the URL of the API of the source service, the URL of the API of the destination service, etc., then the decision information is stored and regarded as valid information.
[0216] In the above, the cloud management platform can obtain the request logs generated by multiple services deployed on the infrastructure during the mutual calling process, and obtain multiple decision information corresponding to the multiple services based on the request logs.
[0217] S404: Determine the dependency relationship between the first service and the second service according to the decision information.
[0218] In some embodiments, when the request log of the business request obtained above only includes the log generated in the process of the first service and the second service processing the business request, the decision information obtained based on the request log is decision information only related to the first service and the second service, then according to the decision information, determining the dependency relationship between the first service and the second service specifically includes: based on the identification information of the first service node and / or the identification information of the second service node in the decision information, calculating the decision value of the dependency relationship between the first service and the second service; if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0219] It should be understood that the number of the above decision information is n, and the calculation formula of the decision value of the dependency relationship is:
[0220]
[0221] Among them, Score(var) represents the decision value of the dependency relationship, α i is the weight value of the i-th decision information (which may be called the reconciliation coefficient). According to the above calculation formula, the decision value of the dependency relationship between the first service and the second service is the weighted sum of the scores of all decision information.
[0222] It should be noted that the above-mentioned weight values can be pre-configured. Optionally, the weight values can be set according to the area where the service process is deployed, that is, the weight values and the area where the service process is deployed are pre-configured in the configuration file according to the corresponding relationship, so that the deployment area of the service can be determined according to information such as the process ID or cluster ID of the service, and the corresponding weight value can be obtained from the configuration file according to the deployment area of the process.
[0223] In some embodiments, a large number of services are running on the infrastructure, and the request log of the business request obtained above includes the logs generated in the process of processing the business request of all services (i.e., the full log), so the decision information obtained from the request log includes multiple decision information. When analyzing the dependency relationship between the first service and the second service, it is necessary to filter out the decision information related to the first service and the second service from the multiple decision information.
[0224] Based on this, combined Figure 4 ,like Figure 6 As shown, before determining the dependency relationship between the first service and the second service according to the decision information, the service dependency analysis method provided in the embodiment of the present application further includes S405.
[0225] S405: Acquire first node information and second node information according to the service information to be analyzed input by the user.
[0226] The first node information is used to indicate the first service, and the second node information is used to indicate the second service. The first node information includes the name of the first service and the identification information of the first service node, and the second node information includes the name of the second service and the identification information of the second service node. The node information may also include other information, for example, the process ID of the service.
[0227] Take a service as an example, a vector composed of partial information extracted from the information of the service node running the service. For example, for service A, the node information indicating the service A can be a vector (serviceA, 10.63.41.145, instance1), where serviceA represents the name of service A, 10.63.41.145 represents the IP address of the service node of service A, and instance1 represents the process ID of service A. For service B, the node information indicating the service B can be a vector (serviceB, 10.172.162.12, instance2), where serviceB represents the name of service B, 10.172.162.12 represents the IP address of the service node of service B, and instance2 represents the process ID of service B.
[0228] Optionally, the first node information and the second node information may be acquired through the following S4051-S4052.
[0229] S4051. Obtain information of a first service node according to the service information to be analyzed, and extract a name of a first service and identification information of the first service node from the information of the first service node according to a node information format to obtain first node information.
[0230] S4052: Acquire information of the second service node according to the service information to be analyzed, and extract the name of the second service and identification information of the second service node from the information of the second service node according to the node information format to obtain second node information.
[0231] It should be understood that the information of the service node may include: the IP address of the service node, the name of the service node, the name of the service deployed in the service node, the name of the process of the service deployed in the service node, and the ID of the cluster to which the service node belongs.
[0232] In the embodiment of the present application, when a service calls another service, each service node will generate service node information, which is collected by the node information collection plug-in corresponding to each service node and stored in the above Figure 3 In the node information management platform shown.
[0233] Similar to the above-mentioned collection logs, if a node information collection plug-in has been set up in the service node, the cloud management platform can directly obtain the service node information from the node information management platform. If a node information collection plug-in is not set up in the service node, it is necessary to create a node information collection plug-in and a node information management platform for storing the service node information.
[0234] Optionally, the service node of a service may include one or more. For example, in the process of the first service calling the second service multiple times, the service node of the first service may be a different node among the multiple service nodes corresponding to the first service, and the service node of the second service may be a different node among the multiple service nodes corresponding to the second service. Exemplarily, when the first service calls the second service for the first time, the service node of the first service is service node 1, and the service node of the second service is service node 2; when the first service calls the second service for the second time, the service node of the first service is service node 3, and the service node of the second service is service node 4.
[0235] In one implementation, after the user inputs the service information to be analyzed, the cloud management platform can determine that the services whose dependencies are to be analyzed are the first service and the second service. At this time, the cloud management platform can be triggered to obtain the information of the first service node and the second service node from the node information management platform.
[0236] In another implementation, the service information to be analyzed input by the user may also include the address of the service node information (e.g., the address of the first service node information and the address of the second service node information), so that the cloud management platform obtains the information of the first service node and the second service node according to the address of the service node information input by the user. Exemplarily, the node information address may be an API, and the cloud management platform obtains the service node information from the node information management platform by calling the API.
[0237] After the cloud management platform obtains the information of the first service node and the information of the second service node, the cloud management platform needs to extract valid information from the information of the service node according to the node information format. The valid information is used for service dependency analysis. The valid information of the service node is called node information, such as the first node information and the second node information mentioned above. Among them, the node information format is the composition format of various information of the node. According to the node information format, the required information can be quickly extracted from the information of the node. For example, according to the node information format, it can be known which fields in the information of the service node correspond to which information. In this way, when it is necessary to extract certain information, the information of the specified field can be extracted according to the node information format to obtain the required information. Optionally, the node information format of service nodes in different software systems may be different, and the node information format of different service nodes in the same software system may also be different.
[0238] Optionally, the above-mentioned node information format is input by the user in the operation interface of the cloud management platform. The cloud management platform obtains the node information format input by the user and extracts the required information from the information of the service node according to the node information format; alternatively, the above-mentioned node information format may also be pre-defined, which is not limited in the embodiments of the present application.
[0239] Continue to refer Figure 6 Based on the description of S405, in another implementation, the above S404 may include S4041-S4042.
[0240] S4041. Determine target decision information from decision information according to the first node information and the second node information.
[0241] Among them, the target decision information includes identification information of the first service node and / or identification information of the second service node, and the target decision information includes one or more decision information, which is the decision information corresponding to the scenario in which the first service indicated by the first node information calls the second service indicated by the second node information.
[0242] In the embodiment of the present application, when analyzing the dependency relationship between the first service and the second service, the decision information in which the source service node is the first service node and the destination service node is the second service node is selected from multiple decision information as the target decision information, and some irrelevant decision information is filtered out, which helps to improve the accuracy of the dependency analysis. The target decision information includes the IP address of the first service node (i.e., source_ip) and the IP address of the second service node (target_ip).
[0243] For example, if the decision information is obtained based on the business log, the IP address of the service node in the first node information is 10.63.41.145, and the IP address of the service node in the second node information is 10.172.162.12, then the decision information with source_ip of 10.63.41.145 and target ip of 10.172.162.12 is selected from multiple decision information and used as a target decision information. For example, the selected target decision information is:
[0244] trace_record_1=(8a7ce38c-dce7-11ed-893f-b1dff287654d,10.63.41.145, / v1 / {project_id} / instance / {instance_id},10.172.162.12, / v1 / {project_id} / bucket / {bucket_id},200).
[0245] For example, if the decision information is obtained based on the gateway log, the IP address of the service node in the first node information is 10.63.41.145, and the IP address of the service node in the second node information is 10.172.162.12, then the decision information with source_ip of 10.63.41.145 and target ip of 10.172.162.12 is selected from multiple decision information and used as a target decision information. For example, the selected target decision information is:
[0246] gateway_access_1=(10.63.41.145,10.172.162.12,instance2, / v1 / {project_id} / bucket / {bucket_id},TOKEN).
[0247] For example, if the decision information is obtained based on the middleware log, the IP address of the service node in the first node information is 10.63.41.145, and the IP address of the service node in the second node information is 10.172.162.12, then the decision information with source_ip of 10.63.41.145 and target ip of 10.172.162.12 is selected from multiple decision information and used as a target decision information. For example, the selected target decision information is:
[0248] tomcat_access_record_1=(10.63.41.145,10.172.162.12, / v1 / 123 / instance / 1,GET,200).
[0249] S4042. Determine the dependency relationship between the first service and the second service according to the target decision information.
[0250] Optionally, combined Figure 6 ,like Figure 7 As shown, the above S4042 can be implemented through S4042a-S4042b.
[0251] S4042a. Calculate a decision value of a dependency relationship between the first service and the second service based on the target decision information.
[0252] It should be understood that the number of the above-mentioned multiple decision information is n, and each decision information is set with a score. For example, for the i-th decision information, if the decision information is the target decision information, the score S corresponding to the decision information is set. i Set to 1. If the decision information does not belong to the target decision information, set the score S corresponding to the decision information. i is 0.
[0253] In a possible implementation, the calculation formula of the decision value of the dependency relationship is:
[0254]
[0255] Among them, Score(var) represents the decision value of the dependency relationship, n is the total number of decision information of the entire software system, and S i is the score of the i-th decision information, α i is the weight value of the decision information (which can be called the harmonic coefficient).
[0256] According to the above calculation formula, since the score of non-target decision information is 0, in fact, the decision value of the dependency relationship between the first service and the second service is the weighted sum of the scores of all target decision information.
[0257] S4042b. If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0258] In the embodiment of the present application, if the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, that is, it can be determined that the first service depends on the second service. Optionally, the specific value of the above decision threshold can be set according to actual needs, and this application does not limit it.
[0259] According to the method for determining the dependency relationship between the first service and the second service, the dependency relationship between the second service and other services (such as the third service) can be further determined, so that a complete call relationship link in the software system can be determined.
[0260] The above is the analysis process of service-level dependencies. The service dependency analysis method provided in the embodiment of the present application can also be used to analyze service API-level dependencies. It can analyze service dependencies at a finer granularity and improve the accuracy of service dependency analysis. Combined with the above, when analyzing service API-level dependencies, the source information of the above-mentioned business request also includes information on the API of the source service among multiple services running on the infrastructure, and the destination information of the business request also includes information on the API of the destination service among multiple services running on the infrastructure. Therefore, combined with Figure 4 ,like Figure 8 As shown, the above S403 can be implemented through S4032.
[0261] S4032. According to the log format of the request log, extract the identification information of the source service node and / or the identification information of the destination service node from the request log, and extract the information of the API of the source service and / or the information of the API of the destination service to obtain decision information.
[0262] For example, the format of the decision vector extracted from the business log can be:
[0263] trace_record=(request_id,source_ip,source_url_path,target_ip,target_url_path,ret_code);
[0264] Among them, request_id represents the ID of the service request, source_ip represents the IP address of the source service node, source_url_path represents the URL of the source service API, target_ip represents the IP address of the destination service node, target_url_path represents the URL of the destination service API, and ret_code represents the request return code, such as http code.
[0265] For example, the format of the decision vector extracted from the gateway log can be:
[0266] gateway_access=(source_ip, target_ip, target_instance_id, target_url_path, auth_type);
[0267] Among them, source_ip represents the IP address of the source service node, target_ip represents the IP address of the destination service node, target_instance_id represents the instance ID of the destination service, that is, the process ID of the destination service, target_url_path represents the URL of the API of the destination service, and auth_type represents the authentication method.
[0268] For example, the format of the decision vector extracted from the middleware log can be:
[0269] tomcat_access_record=(source_ip, target_ip, target_url_path, http_method, ret_code);
[0270] Among them, source_ip represents the IP address of the source service node, target_ip represents the IP address of the destination service node, target_url_path represents the URL of the destination service API, http_method represents the service request method, and ret_code represents the request return code, such as http code.
[0271] like Fig. 9 As shown, after the first node information and the second node information are determined (S405), the above S404 can be specifically implemented through S4043-S4045.
[0272] S4043. Determine target decision information from the decision information based on the first node information and the second node information, where the target decision information includes identification information of the first service node and / or identification information of the second service node, and information of the first API of the first service and / or information of the second API of the second service.
[0273] Optionally, the target decision information is any of the following:
[0274] Decision information corresponding to a scenario in which a first API of a first service calls a second API of a second service;
[0275] Decision information corresponding to a scenario in which a first API of a first service calls a second service; or
[0276] Decision information corresponding to a scenario in which the first service calls the second API of the second service.
[0277] S4044. Calculate a decision value of an API dependency relationship between the first service and the second service based on the target decision information.
[0278] S4045. If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service.
[0279] The API dependency relationship between the first service and the second service includes at least one of the following:
[0280] The first API of the first service depends on the second service;
[0281] The first service depends on a second API of the second service; or
[0282] A first API of a first service depends on a second API of a second service.
[0283] For the relevant contents of S4043-S4045, please refer to the relevant description in the above embodiment.
[0284] Exemplary, combined Figure 2 and Figure 3 The system architecture shown in Fig.10 As shown, the dependency analysis platform determines that the dependency between the first service and the second service needs to be analyzed based on the service information to be analyzed input by the user, and then the dependency analysis platform pulls logs from the log management platform, and the dependency analysis platform pulls node information (including information of the first service node and information of the second service node) from the node information management platform, and obtains first node information indicating the first service and second node information indicating the second service through node information processing; thereafter, the dependency analysis platform determines the request log generated in the process of the first service and the second service processing the business request from the acquired request log based on the first node information and the second node information, and then obtains decision information from the request log, and then based on the decision information, performs dependency analysis on the first service and the second service.
[0285] Optionally, in some implementations, after the dependency analysis platform determines that it is necessary to analyze the dependency between the first service and the second service based on the service information to be analyzed input by the user, the dependency analysis platform may first pull the node information (including the information of the first service node and the information of the second service node) from the node information management platform, and obtain the first node information indicating the first service and the second node information indicating the second service through node information processing; then, based on the first node information and the second node information, pull the request log generated in the process of the first service and the second service processing the business request from the log management platform; then, obtain the decision information from the request log, and then perform a dependency analysis on the first service and the second service based on the decision information.
[0286] Combination Fig.10The system architecture shown in the figure takes the analysis of the dependency relationship between the first service and the second service running on the infrastructure as an example to describe in detail the service dependency analysis method provided by the embodiment of the present application. The method is applied to a cloud management platform, which is used to manage the infrastructure. The infrastructure runs the first service and the second service deployed by the user. The first service runs on the first service node of the infrastructure, and the second service runs on the second service node of the infrastructure. Fig.11 As shown, the method includes S1101-S1104.
[0287] S1101. Obtain service information to be analyzed input by a user, where the service information to be analyzed is used to determine a first service and a second service.
[0288] S1102: Obtain a request log of the business request, where the request log is generated by the first service and the second service in the process of processing the business request.
[0289] Optionally, combined Fig.11 ,like Fig.12 As shown, S1102 can be specifically implemented through S11021-S11022.
[0290] S11021. Obtain first node information and second node information according to the service information to be analyzed, where the first node information is used to indicate a first service, and the second node information is used to indicate a second service.
[0291] For the specific implementation process of obtaining the first node information and the second node information, reference may be made to the description of S4051 - S4052 in the above embodiment, which will not be repeated here.
[0292] S11022. According to the first node information and the second node information, obtain from the full request log the request logs generated by the first service and the second service in the process of processing the business request.
[0293] Full request logs are request logs generated when multiple services deployed on the infrastructure call each other.
[0294] S1103. Determine decision information according to the request log, where the decision information includes source information and / or destination information in the service request.
[0295] The source information in the service request includes the identification information of the first service node, and the destination information in the service request includes the identification information of the service node of the second service.
[0296] Optionally, the above S1103 is implemented through S11031.
[0297] S11031. Extract identification information of the first service node and / or identification information of the second service node from the request log according to the log format of the request log to obtain decision information.
[0298] S1104: Determine the dependency relationship between the first service and the second service according to the decision information.
[0299] Optionally, S1104 can be implemented through S11041-S11042.
[0300] S11041. Calculate a decision value of a dependency relationship between a first service and a second service based on identification information of the first service node and / or identification information of the second service node.
[0301] S11042. If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
[0302] It should be understood that the number of the above decision information is n, and the calculation formula of the decision value of the dependency relationship is:
[0303]
[0304] Among them, Score(var) represents the decision value of the dependency relationship, α i is the weight value of the i-th decision information (which may be called the reconciliation coefficient). According to the above calculation formula, the decision value of the dependency relationship between the first service and the second service is the weighted sum of the scores of all decision information.
[0305] The above is the analysis process of service-level dependencies. The service dependency analysis method provided in the embodiment of the present application can also be used to analyze the API-level dependencies of services. The service dependencies can be analyzed from a finer granularity, thereby improving the accuracy of the service dependency analysis. In combination with the above, when analyzing the API-level dependencies of services, the source information of the above-mentioned business request also includes the API information of the source service among the multiple services running on the infrastructure, and the destination information of the business request also includes the API information of the destination service among the multiple services running on the infrastructure. Therefore, the above-mentioned S1103 can also be implemented through S11032.
[0306] S11032. According to the log format of the request log, extract the identification information of the first service node and / or the identification information of the second service node from the request log, and extract the information of the API of the first service and / or the information of the API of the second service to obtain decision information.
[0307] Correspondingly, the above S1104 can be specifically implemented through S11043-S11045.
[0308] S11043. Calculate a decision value of an API dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node, and the information of the first API and / or the information of the second API.
[0309] S11045. If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service.
[0310] For a detailed description of the above S1101-S1104 and other related steps, please refer to the above description of S401-S404 and related steps, which will not be repeated here.
[0311] Optionally, after the dependency between the services is determined as above, the service dependency analysis method provided in the embodiment of the present application also includes: constructing a dependency topology map based on the dependency between the first service and the second service, and the dependency topology map can intuitively reflect the dependency between the first service and the second service (including service-level dependencies and API-level dependencies).
[0312] It can be understood that based on the above method of analyzing the dependency between the first service and the second service, the dependency between all services on the running infrastructure can be analyzed to obtain the analysis results of the dependency between multiple services, and then a topological diagram indicating the dependency between multiple services can be generated.
[0313] Fig.13 A schematic diagram showing a dependency topology diagram is shown in FIG. Fig.13 , using examples to illustrate the meaning of the dependencies shown in the topology diagram.
[0314] For example, a dependency relationship in the topology graph can be represented as 0 ,DEP_S 1 >, S0 represents service 0. This dependency means that service 0 depends on service 1 and cannot be determined further. This is a service-level dependency.
[0315] For example, a dependency relationship in the topology diagram 0 ,DEP_S 3 _OP 1 >, S3 represents service 3, OP1 represents an API of service 3, and the dependency relationship means that service 0 depends on the OP of service 3 1 , we can continue to determine the dependencies. 3 _OP 1 ,DEP_S 5 >, S5 represents service 5, and the meaning of this dependency is the OP of service 3 1 Depends on service 5, but cannot determine further.
[0316] For example, a dependency relationship in the topology diagram 0 ,DEP_S 3 _OP 1 >, S3 represents service 3, OP1 represents an API of service 3, and the dependency relationship means that service 0 depends on the OP of service 3 1 , we can continue to determine the dependencies. 3 _OP 1 ,DEP_S 4 _OP 2 >, S4 represents service 4. This dependency relationship means that OP1 of service 3 depends on OP2 of service 4, but the judgment cannot be continued downward.
[0317] To sum up, the service dependency analysis method provided in the embodiment of the present application can determine the dependency between services based on the request log of existing business requests. Compared with the prior art, the service dependency analysis method provided in the embodiment of the present application is simple and practical. It does not require a large number of fault simulations, nor does it require the modification of the software system. It also does not require the analysis of a large number of code files, and can improve the efficiency of analyzing service dependencies.
[0318] Furthermore, the service dependency analysis method provided in the embodiment of the present application also has the advantages of high accuracy, low cost, and the ability to dynamically and adaptively analyze dependencies.
[0319] It is understandable that in order to realize the above functions, the above cloud management platform includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the method steps of each example described in the embodiments disclosed herein, the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.
[0320] The embodiment of the present application can divide the functional modules of the above-mentioned cloud management platform according to the above-mentioned method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0321] In the case of dividing each functional module into corresponding functional modules, Fig.14 A possible structural diagram of the cloud management platform involved in the above embodiment is shown. The cloud management platform is used to manage infrastructure, multiple services deployed by users are running on the infrastructure, multiple services generate business requests when running, multiple services include a first service and a second service, the first service runs on a first service node of the infrastructure, and the second service runs on a second service node of the infrastructure. The cloud management platform may include a first acquisition module 1401, a second acquisition module 1402, a log processing module 1403, and an analysis module 1404.
[0322] The first acquisition module 1401 is used to execute S401 and S1101 in the above method embodiment; the second acquisition module 1402 is used to execute S402, S1102, and S11022 in the above method embodiment; the log processing module 1403 is used to execute S403, S4031, S4032, S1103, S11031, and S11032 in the above method embodiment. The analysis module 1404 is used to execute S404 (including S4041-S4042, S4043-S4045) in the above method embodiment, wherein S4042 includes S4042a-S4042b, and S1104 (including S11041-S11042, S11043-S11045).
[0323] Optionally, combined Fig.14 The cloud management platform provided in the embodiment of the present application also includes a node information processing module 1405 and a generation module 1406. The node information processing module 1405 is used to execute S405 (including S4051, S4052) and S11021 in the above method embodiment, and the generation module 1406 is used to execute the action of constructing a dependency topology graph in the above method embodiment.
[0324] The various modules of the above-mentioned cloud management platform can also be used to perform other actions in the above-mentioned method embodiment. All relevant contents of each step involved in the above-mentioned method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0325] For more details on how the modules included in the cloud management platform implement the above functions, please refer to the descriptions in the previous method embodiments, which will not be repeated here. Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
[0326] Above Fig.14 The functions of the cloud management platform shown can be implemented by at least one computing device. Fig.15 A hardware structure diagram of a computing device 1500 provided in an embodiment of the present application is shown below. Fig.15 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0327] like Fig.15 As shown, the computing device 1500 may include: a processor 1501, a memory 1502, and a communication interface 1503. The processor 1501, the memory 1502, and the communication interface 1503 may be connected to each other via a bus 1504, or in other ways.
[0328] The processor 1501 is the control center of the computing device 1500 . The processor 1501 may be a general-purpose central processing unit (CPU) or other general-purpose processors. The general-purpose processor may be a microprocessor or any conventional processor.
[0329] The controller in the processor 1501 is the nerve center and command center of the computing device 1500. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions. Optionally, a memory can also be set in the processor 1501 to store instructions and data. Exemplarily, the processor 1501 may include one or more CPUs, such as Fig.15 CPU 0 and CPU 1 are shown in .
[0330] The memory 1502 includes, but is not limited to, a random access memory (RAM), a read only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, or an optical memory, a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer. In the embodiment of the present application, the memory 1502 can store information such as computer instructions.
[0331] In a possible implementation, the memory 1502 may exist independently of the processor 1501. The memory 1502 may be connected to the processor 1501 via a bus 1504, and is used to store data (such as decision information, etc.), instructions, or program codes. When the processor 1501 calls and executes the instructions or program codes stored in the memory 1502, the relevant steps in the dependency analysis method of the service provided in the embodiment of the present application can be implemented.
[0332] In another possible implementation, the memory 1502 may also be integrated with the processor 1501 .
[0333] The communication interface 1503 may be a transceiver module for communicating with other devices or communication networks (e.g., Figure 3 The communication interface 1503 can receive instructions, messages or data, etc. by communicating with the log management platform or node information processing platform shown in the figure), such as Ethernet, RAN, wireless local area networks (WLAN), etc. The transceiver module can be a device such as a transceiver or a transceiver. Optionally, the communication interface 1503 can also be a transceiver circuit located in the processor 1501, which is used to realize the signal input and signal output of the processor. The communication interface 1503 can be a wired interface (port), such as a fiber distributed data interface (FDDI), a gigabit Ethernet (GE) interface, or the communication interface 1503 can also be a wireless interface.
[0334] The bus 1504 may be an industry standard architecture (ISA) bus, 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. The bus may also be divided into a serial bus and a parallel bus. For ease of representation, Fig.15 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0335] Optionally, the computing device 1500 in the embodiment of the present application may further include an input / output interface 1505, which is used to connect to an input device and receive information input by a user through the input device (e.g., service information to be analyzed, log address, log format, etc.). The input device includes, but is not limited to, a keyboard, a touch screen, a microphone, etc. The input / output interface 1505 is also used to connect to an output device and output the processing result (e.g., a dependency topology diagram) of the processor 1501, and the output device includes, but is not limited to, a display, a printer, etc.
[0336] It should be noted that Fig.15 The computing device shown is only one example of a computing device that can have more than Fig.15 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components.
[0337] The memory 1502 of the computing device 1500 stores executable program codes, and the processor 1501 executes the executable program codes to respectively implement the functions of the first acquisition module 1401, the second acquisition module 1402, the log processing module 1403, the analysis module 1404, the node information processing module 1405, and the generation module 1406, thereby implementing the service dependency analysis method. That is, the memory 1502 stores instructions for the cloud management platform to execute the service dependency analysis method.
[0338] Optionally, the first acquisition module 1401, the second acquisition module 1402, the log processing module 1403, the analysis module 1404, the node information processing module 1405 and the generation module 1406 may all be implemented by software or by hardware.
[0339] Exemplarily, the implementation of the analysis module 1404 is described below by taking the analysis module 1404 as an example. Similarly, the implementation of the first acquisition module 1401, the second acquisition module 1402, the log processing module 1403, the node information processing module 1405 and the generation module 1406 can refer to the implementation of the analysis module 1404.
[0340] When implemented by software, the analysis module 1404 may be an application or a code block running on a computer device. The computer device may be at least one of a physical host, a virtual machine, a container, and other computing devices. Furthermore, the above-mentioned computer device may be one or more. For example, the analysis module 1404 may be an application running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the application may be distributed in the same availability zone (AZ) or in different AZs. The multiple hosts / virtual machines / containers used to run the application may be distributed in the same region or in different regions. Typically, a region may include multiple AZs.
[0341] Similarly, multiple hosts / virtual machines / containers for running the application can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Typically, a region can include multiple VPCs, and a VPC can include multiple AZs.
[0342] When implemented by hardware, the analysis module 1404 may include at least one computing device, such as a server, etc. Alternatively, the analysis module 1404 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD), etc. 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.
[0343] The multiple computing devices included in the analysis module 1404 can be distributed in the same AZ or in different AZs. The multiple computing devices included in the analysis module 1404 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the analysis module 1404 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.
[0344] It should be noted that any one of the first acquisition module 1401, the second acquisition module 1402, the log processing module 1403, the analysis module 1404, the node information processing module 1405 and the generation module 1406 can be used to execute part or all of the steps in the dependency analysis method of the service provided in the embodiment of the present application.
[0345] 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, 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.
[0346] like Fig.16 As shown, the computing device cluster includes at least one computing device 1500. The structure of the computing device 1500 can refer to the above Fig.15 Correspondingly, the memory 1502 in one or more computing devices 1500 in the computing device cluster may store the same instructions for executing the service dependency analysis method.
[0347] In some possible implementations, one or more computing devices 1500 in the computing device cluster may also be used to execute some instructions of the service dependency analysis method. In other words, a combination of one or more computing devices 1500 may be used together to execute instructions of the service dependency analysis method.
[0348] It should be noted that the memory 1502 in different computing devices 1500 in the computing device cluster can store different instructions for executing some functions of the cloud management platform. That is, the instructions stored in the memory 1502 in different computing devices 1500 can implement the functions of one or more of the above-mentioned first acquisition module 1401, second acquisition module 1402, log processing module 1403, analysis module 1404, node information processing module 1405 and generation module 1406. For example, the memory in one computing device stores instructions for executing the functions of the first acquisition module 1401 and the second acquisition module 1402, and the memory in another computing device stores instructions for executing the functions of the log processing module 1403, analysis module 1404, node information processing module 1405 and generation module 1406.
[0349] In some possible implementations, one or more computing devices in a computing device cluster can communicate with each other through a communication interface (eg, Fig.15 The communication interface 1503 shown is connected.
[0350] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network, etc. Each computing device in the computing device cluster is connected to the network via a communication interface in each computing device.
[0351] The present application also provides a computer program product including instructions, which 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 the service dependency analysis method provided by the present application.
[0352] The embodiment of the present application also provides a computer-readable storage medium, which can be any available medium that can be stored by a computing device or a data storage device such as a data center containing 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 that instruct the computing device to perform dependency analysis of the service provided by the embodiment of the present application.
[0353] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, 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 the computer instruction is loaded and executed on a computer, the process or function in accordance with the embodiment of 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 device. The computer instruction 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 instruction can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) mode 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 includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a magnetic disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).
[0354] Through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0355] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that 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 units, which can be electrical, mechanical or other forms.
[0356] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0357] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0358] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, or all or part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk, and other media that can store program codes.
[0359] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for analyzing service dependencies, characterized in that: The method is applied to a cloud management platform, the cloud management platform is used to manage an infrastructure, a first service and a second service deployed by a user are running on the infrastructure, the first service is running on a first service node of the infrastructure, and the second service is running on a second service node of the infrastructure, the method includes: Acquire the service information to be analyzed input by the user, where the service information to be analyzed is used to determine the first service and the second service, wherein the first service and the second service generate business requests when running; Obtaining a request log of the business request, where the request log is generated by the first service and the second service in a process of processing the business request; Determine decision information according to the request log, where the decision information includes source information and / or destination information of the service request; A dependency relationship between the first service and the second service is determined according to the decision information.
2. The method according to claim 1, characterized in that: The source information in the service request includes the identification information of the first service node, and the destination information in the service request includes the identification information of the service node of the second service; The determining the decision information according to the request log includes: According to the log format of the request log, the identification information of the first service node and / or the identification information of the second service node are extracted from the request log to obtain the decision information.
3. The method according to claim 1 or 2, characterized in that: The request log includes at least one of the following: a system log, a business log, a gateway log or a middleware log; wherein the middleware log is generated by the second service node, the system log and the business log are generated by the first service node, and the gateway log is generated by a gateway device between the first service node and the second service node.
4. The method according to any one of claims 1 to 3, characterized in that: The obtaining of the request log of the service request includes: Acquire first node information and second node information according to the service information to be analyzed, where the first node information is used to indicate the first service, and the second node information is used to indicate the second service; According to the first node information and the second node information, the request log generated by the first service and the second service in the process of processing the business request is obtained from the full request log; the full request log is the request log generated by multiple services deployed on the infrastructure in the process of calling each other.
5. The method according to claim 4, characterized in that The first node information includes a name of the first service and identification information of the first service node, and the second node information includes a name of the second service and identification information of the second service node; The acquiring the first node information and the second node information according to the service information to be analyzed includes: According to the service information to be analyzed, information of the first service node is acquired, and the name of the first service and identification information of the first service node are extracted from the information of the first service node in a node information format to obtain the first node information; The information of the second service node is acquired according to the service information to be analyzed, and the name of the second service and the identification information of the second service node are extracted from the information of the second service node in accordance with the node information format to obtain the second node information.
6. The method according to any one of claims 1 to 5, characterized in that: The determining, according to the decision information, the dependency relationship between the first service and the second service includes: Calculating a decision value of a dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node; If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
7. The method according to any one of claims 1 to 6, characterized in that: The source information in the service request further includes information about a first application programming interface API of the first service, and the destination information in the service request includes information about a second API of the second service; The determining the decision information according to the request log includes: According to the log format of the request log, the identification information of the first service node and / or the identification information of the second service node is extracted from the request log, and the information of the first API and / or the information of the second API is extracted to obtain the decision information.
8. The method according to claim 7, characterized in that The determining, according to the decision information, the dependency relationship between the first service and the second service includes: Calculate a decision value of an API dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node, and the information of the first API and / or the information of the second API; If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service; The API dependency relationship between the first service and the second service includes at least one of the following: The first API of the first service depends on the second service; The first service depends on a second API of the second service; or The first API of the first service depends on the second API of the second service.
9. The method according to any one of claims 1 to 8, characterized in that: The method further comprises: A dependency topology graph is constructed based on the dependency relationship between the first service and the second service.
10. A method for analyzing service dependencies, characterized in that: The method is applied to a cloud management platform, the cloud management platform is used to manage an infrastructure, a plurality of services deployed by a user are running on the infrastructure, the plurality of services generate business requests when running, the plurality of services include a first service and a second service, the first service is running on a first service node of the infrastructure, and the second service is running on a second service node of the infrastructure, the method includes: Acquire the service information to be analyzed input by the user, where the service information to be analyzed is used to determine the first service and the second service; Obtaining a request log of the business request, where the request log is generated during a process in which the multiple services process the business request; Determine decision information according to the request log, where the decision information includes source information and / or destination information of the service request; A dependency relationship between the first service and the second service is determined according to the decision information.
11. The method according to claim 10, characterized in that The source information of the service request includes identification information of a source service node among multiple service nodes running the multiple services, and the destination information of the service request includes identification information of a destination service node among the multiple service nodes; The service request is sent by the service running on the source service node to the service running on the destination service node; The determining the decision information according to the request log includes: According to the log format of the request log, the identification information of the source service node and / or the identification information of the destination service node is extracted from the request log to obtain the decision information.
12. The method according to claim 10 or 11, characterized in that: The request log includes at least one of the following: a system log, a business log, a gateway log or a middleware log; wherein the middleware log is generated by the destination service node, the system log and the business log are generated by the source service node, and the gateway log is generated by a gateway device between the source service node and the destination service node.
13. The method according to any one of claims 10 to 12, characterized in that: The method further comprises: Acquire first node information and second node information according to the service information to be analyzed, where the first node information is used to indicate the first service, and the second node information is used to indicate the second service; The determining, according to the decision information, the dependency relationship between the first service and the second service includes: Determining target decision information from the decision information according to the first node information and the second node information; the target decision information includes identification information of the first service node and / or identification information of the second service node; A dependency relationship between the first service and the second service is determined according to the target decision information.
14. The method according to claim 13, characterized in that The first node information includes a name of the first service and identification information of the first service node, and the second node information includes a name of the second service and identification information of the second service node; The acquiring the first node information and the second node information according to the service information to be analyzed includes: According to the service information to be analyzed, information of the first service node is acquired, and the name of the first service and identification information of the first service node are extracted from the information of the first service node in a node information format to obtain the first node information; The information of the second service node is acquired according to the service information to be analyzed, and the name of the second service and the identification information of the second service node are extracted from the information of the second service node in accordance with the node information format to obtain the second node information.
15. The method according to claim 13 or 14, characterized in that The determining, according to the target decision information, the dependency relationship between the first service and the second service includes: Calculate a decision value of a dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node in the target decision information; If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
16. The method according to any one of claims 10 to 15, characterized in that The source information of the service request also includes information of an application programming interface API of a source service among the multiple services, and the destination information of the service request also includes information of an API of a destination service among the multiple services; The determining the decision information according to the request log includes: According to the log format of the request log, the identification information of the source service node and / or the identification information of the destination service node is extracted from the request log, and the information of the API of the source service and / or the API of the destination service is extracted to obtain the decision information.
17. The method according to any one of claims 13 to 16, characterized in that The determining, according to the decision information, the dependency relationship between the first service and the second service includes: Determine target decision information from the decision information according to the first node information and the second node information; the target decision information includes identification information of the first service node and / or identification information of the second service node, and information of a first API of the first service and / or information of a second API of the second service; Calculating a decision value of an API dependency relationship between the first service and the second service based on the target decision information; If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; otherwise, it is determined that there is no API dependency relationship between the first service and the second service; The API dependency relationship between the first service and the second service includes at least one of the following: The first API of the first service depends on the second service; The first service depends on a second API of the second service; or The first API of the first service depends on the second API of the second service.
18. The method according to any one of claims 10 to 17, characterized in that The method further comprises: A dependency topology graph is constructed based on the dependency relationship between the first service and the second service.
19. A cloud management platform, characterized in that: The cloud management platform is used to manage an infrastructure, on which a user-deployed first service and a second service are running, the first service is running on a first service node of the infrastructure, and the second service is running on a second service node of the infrastructure, and the cloud management platform includes a first acquisition module, a second acquisition module, a log processing module, and an analysis module; The first acquisition module is used to acquire the service information to be analyzed input by the user, and the service information to be analyzed is used to determine the first service and the second service, wherein the first service and the second service generate business requests when running; The second acquisition module acquires a request log of the business request, where the request log is generated by the first service and the second service in a process of processing the business request; The log processing module determines decision information according to the request log, where the decision information includes source information and / or destination information of the service request; The analysis module is used to determine the dependency relationship between the first service and the second service according to the decision information.
20. The cloud management platform according to claim 19, characterized in that: The source information in the service request includes the identification information of the first service node, and the destination information in the service request includes the identification information of the service node of the second service; The log processing module is specifically configured to extract the identification information of the first service node and / or the identification information of the second service node from the request log according to the log format of the request log, so as to obtain the decision information.
21. The cloud management platform according to claim 19 or 20, characterized in that: The request log includes at least one of the following: a system log, a business log, a gateway log or a middleware log; wherein the middleware log is generated by the second service node, the system log and the business log are generated by the first service node, and the gateway log is generated by a gateway device between the first service node and the second service node.
22. The cloud management platform according to any one of claims 19 to 21, characterized in that: The cloud management platform also includes a node information processing module; The node information processing module is used to obtain first node information and second node information according to the service information to be analyzed, wherein the first node information is used to indicate the first service, and the second node information is used to indicate the second service; The second acquisition module is specifically used to obtain, from the full request log, the request log generated by the first service and the second service in the process of processing the business request based on the first node information and the second node information; the full request log is the request log generated by multiple services deployed on the infrastructure in the process of calling each other.
23. The cloud management platform according to claim 22, characterized in that: The first node information includes a name of the first service and identification information of the first service node, and the second node information includes a name of the second service and identification information of the second service node; The node information processing module is specifically configured to obtain information of the first service node according to the service information to be analyzed, and extract the name of the first service and identification information of the first service node from the information of the first service node according to a node information format to obtain the first node information; And according to the service information to be analyzed, the information of the second service node is obtained, and the name of the second service and the identification information of the second service node are extracted from the information of the second service node according to the node information format to obtain the second node information.
24. The cloud management platform according to any one of claims 19 to 24, characterized in that: The analysis module is specifically configured to calculate a decision value of a dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node; If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
25. The cloud management platform according to any one of claims 19 to 24, characterized in that: The source information in the service request further includes information about a first application programming interface API of the first service, and the destination information in the service request includes information about a second API of the second service; The log processing module is specifically used to extract the identification information of the first service node and / or the identification information of the second service node from the request log according to the log format of the request log, and extract the information of the first API and / or the information of the second API to obtain the decision information.
26. The cloud management platform according to claim 25, characterized in that: The analysis module is specifically configured to calculate a decision value of an API dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node, and the information of the first API and / or the information of the second API; If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; Otherwise, determining that there is no API dependency relationship between the first service and the second service; The API dependency relationship between the first service and the second service includes at least one of the following: The first API of the first service depends on the second service; The first service depends on a second API of the second service; or The first API of the first service depends on the second API of the second service.
27. The cloud management platform according to any one of claims 19 to 26, characterized in that: The cloud management platform also includes a generation module; The generating module is used to construct a dependency topology diagram according to the dependency relationship between the first service and the second service.
28. A cloud management platform, characterized in that: The cloud management platform is used to manage an infrastructure, on which multiple services deployed by users are running, and the multiple services generate business requests when running, and the multiple services include a first service and a second service, the first service is running on a first service node of the infrastructure, and the second service is running on a second service node of the infrastructure, and the cloud management platform includes: a first acquisition module, a second acquisition module, a log processing module, and an analysis module; The first acquisition module is used to acquire the service information to be analyzed input by the user, and the service information to be analyzed is used to determine the first service and the second service; The second acquisition module is used to acquire a request log of the business request, where the request log is generated in a process where the multiple services process the business request; The log processing module is used to determine decision information according to the request log, where the decision information includes source information and / or destination information in the service request; The analysis module is used to determine the dependency relationship between the first service and the second service according to the decision information.
29. The cloud management platform according to claim 28, characterized in that: The source information in the service request includes identification information of a source service node among multiple service nodes running the multiple services, and the destination information in the service request includes identification information of a destination service node among the multiple service nodes; The service request is sent by the service running on the source service node to the service running on the destination service node; The log processing module is specifically used to extract the identification information of the source service node and / or the identification information of the destination service node from the request log according to the log format of the request log, so as to obtain the decision information.
30. The cloud management platform according to claim 28 or 29, characterized in that: The cloud management platform also includes a node information processing module; The node information processing module is used to obtain first node information and second node information according to the service information to be analyzed, wherein the first node information is used to indicate the first service, and the second node information is used to indicate the second service; The analysis module is specifically configured to determine target decision information from the decision information according to the first node information and the second node information; The target decision information includes identification information of the first service node and / or identification information of the second service node; and according to the target decision information, a dependency relationship between the first service and the second service is determined.
31. The cloud management platform according to claim 30, characterized in that: The first node information includes a name of the first service and identification information of the first service node, and the second node information includes a name of the second service and identification information of the second service node; The node information processing module is specifically configured to obtain information of the first service node according to the service information to be analyzed, and extract the name of the first service and identification information of the first service node from the information of the first service node according to a node information format to obtain the first node information; And according to the service information to be analyzed, the information of the second service node is acquired, and the name of the second service and the identification information of the second service node are extracted from the information of the second service node according to the node information format to obtain the second node information.
32. The cloud management platform according to claim 30 or 31, characterized in that: The analysis module is specifically configured to calculate a decision value of a dependency relationship between the first service and the second service based on the identification information of the first service node and / or the identification information of the second service node in the target decision information; If the decision value is greater than the decision threshold, it is determined that there is a dependency relationship between the first service and the second service, and the first service depends on the second service; otherwise, it is determined that there is no dependency relationship between the first service and the second service.
33. The cloud management platform according to any one of claims 28 to 32, characterized in that: The source information of the service request also includes information of an application programming interface API of a source service among the multiple services, and the destination information of the service request also includes information of an API of a destination service among the multiple services; The log processing module is specifically used to extract the identification information of the source service node and / or the identification information of the destination service node from the request log according to the log format of the request log, and extract the information of the API of the source service and / or the information of the API of the destination service to obtain the decision information.
34. The cloud management platform according to any one of claims 31 to 33, characterized in that: The analysis module is specifically configured to determine target decision information from the decision information according to the first node information and the second node information; the target decision information includes identification information of the first service node and / or identification information of the second service node, and information of a first API of the first service and / or information of a second API of the second service; and based on the target decision information, calculate a decision value of an API dependency relationship between the first service and the second service; If the decision value is greater than the decision threshold, it is determined that there is an API dependency relationship between the first service and the second service; Otherwise, determining that there is no API dependency relationship between the first service and the second service; The API dependency relationship between the first service and the second service includes at least one of the following: The first API of the first service depends on the second service; The first service depends on a second API of the second service; or The first API of the first service depends on the second API of the second service.
35. The cloud management platform according to any one of claims 28 to 34, characterized in that: The cloud management platform also includes a generation module; The generating module is used to construct a dependency topology diagram according to the dependency relationship between the first service and the second service.
36. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising 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 method according to any one of claims 1 to 9 or executes the method according to any one of claims 10-18.
37. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 9 or executes the method according to any one of claims 10 to 18.
38. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 9 or executes the method according to any one of claims 10 to 18.
Citation Information
Cited By
Message notification method and device, computer equipment and storage medium
CN119728626A
