Micro-service dependency relationship discovery method, device, equipment and medium

By building a directed graph in a container cluster and inputting a trained model, the microservice dependencies are dynamically discovered, which solves the problems of inaccurate and untimely identification in traditional methods, and realizes efficient microservice dependencies management.

CN120583144APending Publication Date: 2025-09-02PING AN PAY ELECTRONIC PAYMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510797023.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

Traditional methods are difficult to accurately and timely discover dynamically changing dependencies between microservices, resulting in inaccurate and untimely identification.

Method used

By continuously collecting communication direction and traffic feature data in the container cluster, a directed graph is built, and a trained microservice dependency discovery model is input to dynamically discover the dependencies between microservices.

Benefits of technology

It improves the real-time and accuracy of microservice dependency discovery, adapts to the elastic scaling and dynamic scheduling needs of microservices, and improves the operation and maintenance efficiency and reliability of microservice architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583144A_ABST
    Figure CN120583144A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of networks, and discloses a micro-service dependency discovery method, device, equipment and medium, and the method comprises the steps: continuously collecting the communication direction of each communication among all application examples deployed in a container cluster in N time windows and the traffic characteristic data of the communication, according to the metadata of the application instance in any time window, the communication direction of each communication and the flow characteristic data, constructing a directed graph representing the communication relationship among all the application instances in the container cluster in the time window, and inputting the directed graphs corresponding to all the time windows into a trained model subjected to micro-service dependency relationship discovery so as to find the micro-service dependency relationship. And obtaining the dependency relationship among the micro-services corresponding to all the application examples in the N time window inner container clusters. The technical scheme provided by the invention can be applied to business management systems such as financial science and technology, medical treatment, health and pension and the like based on the micro-service architecture, dynamic discovery of the micro-service dependency relationship is realized, and the real-time performance and the accuracy of discovery of the micro-service dependency relationship are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a microservice dependency discovery method, apparatus, device, and medium. Background Art

[0002] With the accelerated advancement of informatization, microservices architecture has been widely adopted in business management systems for financial technology, healthcare, and elderly care. By breaking down complex financial and healthcare business functions into multiple independent, reusable microservices, such as payment and clearing, risk assessment, user authentication, and transaction settlement, this can significantly improve the flexibility, scalability, and maintainability of financial systems, accelerate the launch and iteration of new features, and better adapt to the rapidly changing needs of financial services.

[0003] However, with the increase in the number of microservices and the increasing complexity of interactions between services, the dependencies between microservices have become intricate and highly dynamic. Traditional methods based on rules or static analysis to discover dependencies between microservices have gradually revealed their limitations. For example, the interactions between microservices in financial and medical business systems are often based on dynamic factors such as real-time transaction requests, market fluctuations, and user behavior, such as the rapid coordination of multiple risk control microservices in high-frequency trading scenarios and the dynamic calling of multi-level clearing microservices in large-value payments. In these scenarios, service dependencies may change in real time with business traffic, policy adjustments, or abnormal events. Traditional methods based on rules or static analysis are difficult to adapt to these dynamically changing interaction patterns, resulting in inaccurate and untimely dependency identification.

[0004] Therefore, how to achieve dynamic discovery of microservice dependencies has become an urgent problem to be solved. Summary of the Invention

[0005] Embodiments of the present invention provide a microservice dependency discovery method, apparatus, computer device, and storage medium to solve the problem of how to dynamically discover microservice dependencies.

[0006] A microservice dependency discovery method, comprising: Continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, where N is an integer greater than zero and each application instance contains at least one container; For any time window, obtain the metadata of each application instance in the time window, and construct a directed graph representing the communication relationship between all application instances in the container cluster in the time window based on the metadata of all application instances in the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication; The directed graphs corresponding to all time windows are input into a model that has been trained for microservice dependency discovery to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

[0007] A microservice dependency discovery device, comprising: A data collection module is used to continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, where N is an integer greater than zero and each application instance contains at least one container; A first graph construction module is configured to obtain metadata for each application instance within any time window, and to construct a directed graph representing the communication relationships between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and traffic characteristic data of the corresponding communications; The dependency discovery module is used to input the directed graphs corresponding to all time windows into a model that has been trained for microservice dependency discovery, and obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

[0008] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned microservice dependency discovery method when executing the computer program.

[0009] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned microservice dependency discovery method.

[0010] The above-mentioned microservice dependency discovery method, device, computer equipment and storage medium continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows. For any time window, based on the metadata of all application instances in the time window, the communication direction of each communication between all application instances and the traffic characteristic data of the corresponding communication, a directed graph representing the communication relationship between all application instances in the container cluster within the time window is constructed. The directed graphs corresponding to all time windows are input into the model that has been trained for microservice dependency discovery to obtain the dependency relationship between the microservices corresponding to all application instances in the container cluster within N time windows.

[0011] By combining a trained model for microservice dependency discovery with data on the communication direction and traffic characteristics of each communication between all application instances deployed in the container cluster over N continuously collected time windows, a directed graph is constructed for each time window, revealing the dependencies between the microservices corresponding to all application instances in the container cluster. This enables dynamic discovery of microservice dependencies, improving the real-time and accuracy of microservice dependency discovery, adapting to the demands of elastic scaling and dynamic scheduling of microservices, and providing strong support for the stable operation, efficient management, and precise troubleshooting of the microservice architecture, thereby enhancing the operational efficiency and reliability of the microservice architecture. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0013] Figure 1 This is a schematic diagram of an application environment of a microservice dependency discovery method according to an embodiment of the present invention; Figure 2 This is a flow chart of a microservice dependency discovery method according to an embodiment of the present invention; Figure 3 is another flow chart of a microservice dependency discovery method according to an embodiment of the present invention; Figure 4 is another flow chart of a microservice dependency discovery method according to an embodiment of the present invention; Figure 5 This is a schematic diagram of a microservice dependency discovery device according to an embodiment of the present invention; Figure 6 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0014] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0015] The microservice dependency discovery method provided by the embodiment of the present invention can be applied as follows: Figure 1Specifically, the microservice dependency discovery method is applied in a microservice dependency discovery system, which includes the following: Figure 1 The client and server shown in the figure communicate over a network to solve the problem of dynamically discovering microservice dependencies. The client, also known as the user end, is the program that corresponds to the server and provides local services to clients. The client can be installed on, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented as a standalone server or a server cluster consisting of multiple servers.

[0016] In one embodiment, if Figure 2 As shown, a microservice dependency discovery method is provided, which is applied in Figure 1 The server in the example is used as an example, and the steps are as follows: Step S201: continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows.

[0017] In this embodiment, the container cluster may refer to a distributed operating environment composed of containerization technology, and the application instance may refer to the smallest deployable unit of an application or service that runs independently on a node of the container cluster. Each application instance contains at least one container. For example, the container cluster may refer to a Kubernetes cluster, and the application instance may refer to a pod deployed on a node of the Kubernetes cluster. Each pod contains at least one container. In a Kubernetes cluster, a microservice application may be deployed as one or a pair of independent application instances to jointly provide services to the outside world.

[0018] The time window may refer to a pre-set continuous time interval of fixed or variable length, and the traffic characteristic data may refer to attribute data related to the data transmitted during communication between application instances, which may include the timestamp of each communication between any two application instances, the amount of data communicated, and the frequency of communication.

[0019] Specifically, by calling a tool with traffic monitoring function, traffic characteristic data such as the communication direction and corresponding communication timestamp, communication frequency and data volume of each communication between all application instances in the container cluster within N time windows are continuously collected.

[0020] Step S202: For any time window, obtain the metadata of each application instance in the time window, and construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window based on the metadata of all application instances in the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication.

[0021] In this embodiment, the metadata of each application instance may include a unique identifier of the application instance, the name of the microservice to which it belongs, a version number, and resource usage.

[0022] Specifically, for any time window, the communication weight of any two application instances in each communication direction is determined based on the communication direction of each communication between all application instances in the time window and the traffic characteristic data of the corresponding communication. Any application instance is regarded as a node, the metadata of the application instance is the attribute of the node, each communication direction between the application instance and another application instance with a communication relationship is an edge between the corresponding nodes, and the communication weight in the corresponding communication direction is the weight of the corresponding edge. The directed graph corresponding to the time window is constructed.

[0023] Step S203: Input the directed graphs corresponding to all time windows into the model that has been trained for microservice dependency discovery to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

[0024] In this embodiment, the model that has been trained for microservice dependency discovery can be a graph neural network model that has been trained for microservice dependency discovery. For example, the model can adopt a graph neural network model with GraphSAGE as the basic framework.

[0025] Specifically, the directed graphs corresponding to all time windows are input into a model that has been trained for microservice dependency discovery. The model is used to extract and summarize features of the directed graphs corresponding to all time windows to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

[0026] For example, in the financial payment scenario, the dependency relationship between the microservices can be that the order service needs to rely on the payment service to complete the transaction, that is, the application instance in the order service needs to wait for the application instance in the payment service to complete the payment function before it can generate the corresponding order; in the medical consultation scenario, the consultation service depends on the doctor scheduling service and the patient electronic medical record database, that is, after the patient electronic database is started, the consultation service can query the patient's historical medical records, and the application instance in the consultation service can obtain the list of doctors who are seeing the patient by calling the interface of the application instance in the doctor scheduling service.

[0027] Optionally, after obtaining the dependencies between microservices corresponding to all application instances in the container cluster within N time windows, the dependencies between microservices corresponding to all application instances in the container cluster can be verified for accuracy to obtain verification results. Based on the verification results, the model that has been trained for microservice dependency discovery is updated.

[0028] The dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows can also be visualized through a human-computer interaction interface to help users intuitively understand and optimize the microservice architecture. The user can monitor the interaction events triggered by the human-computer interaction interface, such as filtering operations and drilling operations, and perform corresponding interaction operations based on the interaction events by calling the interaction analysis tool.

[0029] In this embodiment, dynamic discovery of microservice dependencies is achieved, the real-time and accuracy of microservice dependency discovery is improved, the needs of elastic scaling and dynamic scheduling of microservices are adapted, and strong support is provided for the stable operation, efficient management and accurate troubleshooting of the microservice architecture, thereby improving the operation and maintenance efficiency and reliability of the microservice architecture.

[0030] In one embodiment, if Figure 3 As shown, a microservice dependency discovery method is provided. In the above step S202, a directed graph representing the communication relationship between all application instances in the container cluster within the time window is constructed based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication, including the following steps: Step S301: any two application instances having a communication relationship within a time window are regarded as an instance pair. For any instance pair, the communication direction of each communication of the instance pair and the traffic characteristic data of the corresponding communication are determined.

[0031] Step S302: According to the communication direction of each communication of the instance and the traffic characteristic data of the corresponding communication, all traffic characteristic data corresponding to each communication direction of the instance are determined.

[0032] Step S303: Obtain the communication weight of the instance for the corresponding communication direction based on all traffic characteristic data corresponding to each communication direction of the instance.

[0033] Step S304: Treat each application instance in the instance pair as a node, the metadata of each application instance as the attribute of the corresponding node, each communication direction between the instance pairs as an edge between the corresponding nodes, and the communication weight of the corresponding communication direction as the weight of the corresponding edge, to construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window.

[0034] In this embodiment, the communication weight may refer to a score representing the communication strength of the instance in the corresponding communication direction.

[0035] Specifically, all application instances corresponding to the time window are grouped, and any two application instances with a communication relationship are grouped into an instance pair. According to the communication direction of each communication of the instance pair and the traffic characteristic data of the corresponding communication, all traffic characteristic data corresponding to the instance pair in each communication direction are determined. According to all traffic characteristic data in each communication direction, the communication weight in the corresponding communication direction is obtained. Each application instance in the instance pair is a node, the metadata of each application instance is an attribute of the corresponding node, each communication direction between the instance pair is an edge between the corresponding nodes, and the communication weight of the corresponding communication direction is the weight of the corresponding edge, so as to construct a directed graph corresponding to the time window.

[0036] Optionally, the communication traffic characteristic data includes the instance pair's communication records, communication data volume, communication response time, and communication error rate. In the process of obtaining the communication weight of the instance pair's corresponding communication direction based on all traffic characteristic data corresponding to each communication direction of the instance pair, the communication frequency of the instance pair in that communication direction can be calculated based on all communication records corresponding to that communication direction and the duration of the time window. The total communication data volume of the instance pair in that communication direction can be calculated based on all communication data volume corresponding to that communication direction. The average communication response time of the instance pair in that communication direction can be calculated based on all communication response times corresponding to that communication direction. The average communication error rate of the instance pair in that communication direction can be calculated based on all communication error rates corresponding to that communication direction. The communication weight of the instance pair in that communication direction can be obtained based on the communication frequency, total communication data volume, average communication response time, and average communication error rate of the instance pair in that communication direction.

[0037] In this embodiment, by aggregating and analyzing the communication data (communication frequency, data volume, response time, and error rate) between application instances within a time window, a weighted directed graph is constructed to represent the communication relationship between application instances. This can fully and truly reflect the communication relationship between application instances within the time window and the communication intensity of the corresponding communication, thereby improving the accuracy of microservice dependency discovery when performing dependency discovery based on the constructed directed graph.

[0038] In one embodiment, if Figure 4 As shown, a microservice dependency discovery method is provided, which includes the following steps after continuously collecting the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows in the above step S201: Step S401: for any time window, clean the traffic characteristic data of each communication between all application instances in the time window to obtain cleaned traffic characteristic data.

[0039] Step S402: performing standardization processing on all cleaned flow characteristic data to obtain standard flow characteristic data.

[0040] In the above step S202, a directed graph representing the communication relationship between all application instances in the container cluster within the time window is constructed based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication, and further includes: Step S403: Construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the standard traffic characteristic data of the corresponding communication.

[0041] Specifically, for any time window, all traffic feature data collected within the time window are cleaned to remove noise data to obtain cleaned traffic feature data, and the cleaned traffic feature data are characterized to obtain standard traffic feature data. In the process of constructing the directed graph corresponding to the time window, the directed graph corresponding to the time window is constructed based on the metadata of all application instances corresponding to the time window, the communication direction of each communication between all application instances and the standard traffic feature data of the corresponding communication.

[0042] In this embodiment, by cleaning and standardizing the collected traffic feature data, a directed graph is constructed based on the cleaned and standardized traffic feature data, thereby improving the accuracy of the constructed directed graph, thereby improving the accuracy of microservice dependency discovery when dependency discovery is performed based on the constructed directed graph.

[0043] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0044] In one embodiment, a microservice dependency discovery device is provided, which corresponds one-to-one to the microservice dependency discovery method in the above embodiment. Figure 5 As shown, the microservice dependency discovery device includes a data acquisition module 51, a first graph construction module 52 and a dependency discovery module 53. The functional modules are described in detail as follows: A data collection module 51 is configured to continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, where N is an integer greater than zero and each application instance includes at least one container; A first graph construction module 52 is configured to obtain metadata for each application instance within any time window, and construct a directed graph representing the communication relationships between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communications; The dependency discovery module 53 is used to input the directed graphs corresponding to all time windows into a model that has been trained for microservice dependency discovery, and obtain the dependency relationships between the microservices corresponding to all application instances in the container cluster within N time windows.

[0045] Optionally, the first graph construction module 52 includes: a first determining unit, configured to define any two application instances having a communication relationship within the time window as an instance pair, and, for any instance pair, determine a communication direction of each communication of the instance pair and traffic characteristic data of the corresponding communication; A second determining unit is configured to determine all traffic characteristic data corresponding to each communication direction of the instance according to the communication direction of each communication and the traffic characteristic data of the corresponding communication; A weight calculation unit, configured to obtain a communication weight of the instance for the corresponding communication direction based on all traffic characteristic data corresponding to each communication direction of the instance; A graph forming unit is configured to construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window, by treating each application instance in the instance pair as a node, metadata of each application instance as an attribute of the corresponding node, each communication direction between the instance pairs as an edge between the corresponding nodes, and a communication weight of the corresponding communication direction as a weight of the corresponding edge.

[0046] Optionally, the weight calculation unit includes: a frequency calculation subunit, configured to calculate, for any communication direction of the instance pair, the communication frequency of the instance pair in the communication direction according to all communication records corresponding to the communication direction and the duration of the time window; a data volume calculation subunit, configured to calculate a total communication data volume of the instance pair in the communication direction according to all communication data volumes corresponding to the communication direction; a time calculation subunit, configured to calculate an average communication response time of the instance in the communication direction based on all communication response times corresponding to the communication direction; an error rate calculation subunit, configured to calculate an average communication error rate of the instance pair in the communication direction based on all communication error rates corresponding to the communication direction; The comprehensive evaluation subunit is used to obtain the communication weight of the instance pair in the communication direction according to the communication frequency, total communication data volume, average communication response time and average communication error rate of the instance pair in the communication direction.

[0047] Optionally, the microservice dependency discovery device further includes: A cleaning module is used to clean the traffic characteristic data of each communication between all application instances in any time window to obtain cleaned traffic characteristic data; A standardization module is used to standardize all cleaned flow characteristic data to obtain standard flow characteristic data; The second graph construction module is used to construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the standard traffic characteristic data of the corresponding communication.

[0048] Optionally, the microservice dependency discovery device further includes: A verification module is used to verify the accuracy of the dependency relationships between microservices corresponding to all application instances in the container cluster and obtain verification results; The model update module is used to update the model that has been trained for microservice dependency discovery based on the verification result.

[0049] Optionally, the microservice dependency discovery device further includes: The visualization module is used to visualize the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

[0050] For the specific definition of the microservice dependency discovery device, please refer to the definition of the microservice dependency discovery method above, which will not be repeated here. The various modules in the above-mentioned microservice dependency discovery device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0051] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a microservice dependency discovery method is implemented.

[0052] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the microservice dependency discovery method in the above embodiment is implemented. For example, Figure 2 S201-S203 shown, or Figures 2 to 4 Alternatively, when the processor executes the computer program, the functions of each module / unit in the embodiment of the microservice dependency discovery device are realized, for example Figure 5 The microservice dependency discovery functions shown are not described here in detail to avoid repetition.

[0053] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the microservice dependency discovery method in the above embodiment is implemented, for example Figure 2 S201-S203 shown, or Figures 2 to 4 Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the embodiment of the above-mentioned microservice dependency discovery device are realized, for example Figure 5 The microservice dependency discovery functions shown are not described here in detail to avoid repetition.

[0054] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0055] Those skilled in the art will clearly understand that for the sake of convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0056] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A microservice dependency discovery method, characterized in that: include: Continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, where N is an integer greater than zero and each application instance contains at least one container; For any time window, obtain the metadata of each application instance in the time window, and construct a directed graph representing the communication relationship between all application instances in the container cluster in the time window based on the metadata of all application instances in the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication; The directed graphs corresponding to all time windows are input into a model that has been trained for microservice dependency discovery to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

2. The microservice dependency discovery method according to claim 1, wherein: The step of constructing a directed graph representing the communication relationships between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication, includes: Any two application instances having a communication relationship within the time window are considered an instance pair, and for any instance pair, a communication direction of each communication of the instance pair and traffic characteristic data of the corresponding communication are determined; Determine all traffic characteristic data corresponding to each communication direction of the instance according to the communication direction of each communication and the traffic characteristic data of the corresponding communication; Obtaining a communication weight of the instance for the corresponding communication direction based on all traffic characteristic data corresponding to each communication direction of the instance; Each application instance in the instance pair is regarded as a node, the metadata of each application instance is regarded as an attribute of the corresponding node, each communication direction between the instance pairs is regarded as an edge between the corresponding nodes, and the communication weight of the corresponding communication direction is regarded as the weight of the corresponding edge, to construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window.

3. The microservice dependency discovery method according to claim 2, wherein: The communication traffic characteristic data includes the communication record, communication data volume, communication response time, and communication error rate of the instance pair. The communication weight of the corresponding communication direction of the instance pair is obtained based on all the traffic characteristic data corresponding to each communication direction of the instance pair, including: For any communication direction of the instance pair, calculating the communication frequency of the instance pair in the communication direction according to all communication records corresponding to the communication direction and the duration of the time window; Calculating the total communication data volume of the instance pair in the communication direction according to all communication data volumes corresponding to the communication direction; Calculating an average communication response time of the instance pair in the communication direction based on all communication response times corresponding to the communication direction; Calculating an average communication error rate of the instance pair in the communication direction based on all communication error rates corresponding to the communication direction; The communication weight of the instance pair in the communication direction is obtained according to the communication frequency, the total communication data volume, the average communication response time and the average communication error rate of the instance pair in the communication direction.

4. The microservice dependency discovery method according to claim 1, wherein: After continuously collecting the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, the method further includes: For any time window, clean the traffic characteristic data of each communication between all application instances within the time window to obtain cleaned traffic characteristic data; Performing standardization on all cleaned flow characteristic data to obtain standard flow characteristic data; The method of constructing a directed graph representing the communication relationships between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the traffic characteristic data of the corresponding communication, further includes: A directed graph representing the communication relationship between all application instances in the container cluster within the time window is constructed based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and the standard traffic characteristic data of the corresponding communication.

5. The microservice dependency discovery method according to claim 1, wherein: After inputting the directed graphs corresponding to all time windows into the model that has been trained for microservice dependency discovery to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows, the method further includes: Verify the accuracy of dependencies between microservices corresponding to all application instances in the container cluster to obtain verification results; According to the verification result, the model that has been trained for microservice dependency discovery is updated.

6. The microservice dependency discovery method according to claim 1, wherein: After inputting the directed graphs corresponding to all time windows into the model that has been trained for microservice dependency discovery to obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows, the method further includes: The dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows are visualized.

7. A microservice dependency discovery device, characterized in that: include: A data collection module is used to continuously collect the communication direction and traffic characteristic data of each communication between all application instances deployed in the container cluster within N time windows, where N is an integer greater than zero and each application instance contains at least one container; A first graph construction module is configured to obtain metadata for each application instance within any time window, and to construct a directed graph representing the communication relationships between all application instances in the container cluster within the time window based on the metadata of all application instances within the time window, the communication direction of each communication between all application instances, and traffic characteristic data of the corresponding communications; The dependency discovery module is used to input the directed graphs corresponding to all time windows into a model that has been trained for microservice dependency discovery, and obtain the dependency relationships between microservices corresponding to all application instances in the container cluster within N time windows.

8. The microservice dependency discovery device according to claim 7, wherein: The first graph construction module includes: a first determining unit, configured to define any two application instances having a communication relationship within the time window as an instance pair, and, for any instance pair, determine a communication direction of each communication of the instance pair and traffic characteristic data of the corresponding communication; A second determining unit is configured to determine all traffic characteristic data corresponding to each communication direction of the instance according to the communication direction of each communication and the traffic characteristic data of the corresponding communication; A weight calculation unit, configured to obtain a communication weight of the instance for the corresponding communication direction based on all traffic characteristic data corresponding to each communication direction of the instance; A graph forming unit is configured to construct a directed graph representing the communication relationship between all application instances in the container cluster within the time window, by treating each application instance in the instance pair as a node, metadata of each application instance as an attribute of the corresponding node, each communication direction between the instance pairs as an edge between the corresponding nodes, and a communication weight of the corresponding communication direction as a weight of the corresponding edge.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the microservice dependency discovery method according to any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the microservice dependency discovery method according to any one of claims 1 to 6 is implemented.