Microservice framework call chain governance method and device, equipment and storage medium
By obtaining and analyzing the complete call chain map under the microservice framework, the problem of excessive complexity of call chains among microservices is solved, and the governance and display of call chains is realized, business efficiency is improved and the system call architecture is optimized.
Patent Information
- Application Number
- CN202311345448.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-17
- Publication Date
- 2025-04-18
AI Technical Summary
The complexity between call chains between microservices is beyond the reach of manpower, and when making calls, there are usually problems with long and complex levels of single business calls, which leads to inefficiency in business.
By obtaining the complete call chain map under the microservice framework, performing analysis and processing, the target complete call chain is obtained and stored in a relational database, so that the front-end interface can call and display the corresponding complete call chain.
It realizes the governance of the call chain under the microservice framework, reduces the complexity of the call chain, improves business efficiency, and provides data support for optimizing the system call architecture.
Smart Images

Figure CN119847778A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a call chain management method, device, equipment and storage medium for a microservice framework. Background Art
[0002] The essence of microservice architecture is to split complex and large-scale projects according to business functional areas, forming multiple small, reusable, independent service units to complete the functions required by the original project. The most significant problem with the use of microservice architecture is that the difficulty of interface service management increases exponentially with the increase in the number of services. Originally, the combination of different functional modules in a system only requires calling module functions within the same system, and cross-system calls will use network interface services, so the number of interfaces is small and easy to manage; while the calls between different functions of the microservice architecture need to be processed through network interfaces, the number of interfaces has increased significantly, and due to its reusability, the boundaries of the interface usage range tend to be blurred, which greatly increases the difficulty of interface management.
[0003] There are many situations in which microservices have service management issues, and different situations have different solutions. The call chain of microservices is one of the governance solutions. The principle of microservice call chain tracking is to match and analyze the log information recorded by the service to find all related call records of a request to form a call chain. The current large-scale microservice system has complex dependencies, which makes the call chain of microservices more complex. The probability of a single call going wrong is relatively higher, and the corresponding cost of locating the problem is also higher.
[0004] Currently, call chain tracking between microservices is often performed using methods such as pinpoint and zipkin. Most systems use call chain data directly, or collect data for alarm, exception analysis, or precision testing. However, with the increase in current business scenarios, the complexity of call chains between microservices has exceeded human capabilities, and when making calls, there are usually long and complex call levels for a single business, resulting in low business efficiency. Therefore, how to govern the call chain under the microservice framework is a problem that needs to be solved at present. Summary of the invention
[0005] The present application provides a call chain management method, device, equipment and storage medium for a microservice framework, which is used to solve the problem in the prior art that the complexity of the call chain between microservices has exceeded human capabilities, and when making calls, there is usually a long and complex level of a single business call, which leads to low business efficiency.
[0006] In a first aspect, the present application provides a call chain governance method for a microservice framework, the method comprising:
[0007] Obtain a complete call chain graph under a microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework;
[0008] Analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework;
[0009] The target complete call chain is stored in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
[0010] Optionally, analyzing and processing the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework includes:
[0011] Determine multiple candidate complete call chains according to the complete call chain graph;
[0012] Allocating the multiple candidate complete call chains to multiple logic processing modules respectively;
[0013] Controlling the plurality of logic processing modules to hierarchically traverse the plurality of candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determining whether the candidate complete call chains meet a preset condition;
[0014] When it is determined that the candidate complete call chain meets the preset condition, the candidate complete call chain is used as the target complete call chain.
[0015] Optionally, the target complete call chain includes: the longest complete call chain, the cyclic complete call chain and the complex complete call chain, and the controlling the multiple logic processing modules hierarchically traverses multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains to determine whether the candidate complete call chains meet preset conditions, including:
[0016] Control each logic processing module to obtain the call chain length of the allocated candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes;
[0017] Determining whether the candidate call chain is the longest complete call chain according to the call chain length and the call chain lengths corresponding to other candidate complete call chains in the complete call chain graph;
[0018] According to the number of corresponding call nodes, the connection relationship between the call nodes, and the number and connection relationship of call nodes corresponding to other candidate complete call chains, determine whether the candidate call chain is a cyclic complete call chain or a complex complete call chain.
[0019] Optionally, obtaining a complete call chain graph under the microservice framework includes:
[0020] Obtain a service list corresponding to the microservice framework, and according to the service list, call the pinpoint native interface to obtain the association relationship between multiple call nodes under the microservice framework;
[0021] Determine multiple call chains corresponding to the microservice framework according to the association relationship between the multiple call nodes;
[0022] Screening and processing the multiple call chains according to preset rules to obtain multiple candidate complete call chains;
[0023] Based on the multiple candidate complete call chains, a complete call chain graph under the microservice framework is generated.
[0024] Optionally, the method further includes:
[0025] Obtain analysis results sent by multiple logic processing modules;
[0026] Based on multiple analysis results, a target complete call chain report is generated, and the target complete call chain report is stored in the OSS database, so that the front-end interface calls and displays the corresponding target complete call chain report from the OSS database.
[0027] Optionally, the multiple logic processing modules are distributedly deployed on multiple hosts, and the method further includes:
[0028] Get load information for multiple hosts;
[0029] Determine a target host according to the load information of the multiple hosts, the target host being a host whose load information exceeds a load threshold;
[0030] The logic processing module corresponding to the target host is controlled to stop analyzing and processing.
[0031] In a second aspect, the present application provides a call chain management device for a microservice framework, the device comprising:
[0032] An acquisition module is used to acquire a complete call chain graph under a microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework;
[0033] A processing module, used to analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework;
[0034] The storage module is used to store the target complete call chain in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
[0035] Optionally, the device further includes: a determination module, an allocation module, and a control module;
[0036] The determination module is used to determine a plurality of candidate complete call chains according to the complete call chain graph;
[0037] The allocation module is used to allocate the multiple candidate complete call chains to multiple logic processing modules respectively;
[0038] The control module is used to control the multiple logic processing modules to hierarchically traverse multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determine whether the candidate complete call chains meet preset conditions;
[0039] The determination module is further configured to use the candidate complete call chain as the target complete call chain when it is determined that the candidate complete call chain meets a preset condition.
[0040] Optionally, the target complete call chain includes: the longest complete call chain, the cyclic complete call chain and the complex complete call chain;
[0041] The control module is further used to control each logic processing module to obtain the call chain length of the allocated candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes;
[0042] The determination module is further configured to determine whether the candidate call chain is the longest complete call chain according to the call chain length and the call chain lengths corresponding to other candidate complete call chains in the complete call chain graph;
[0043] The determination module is also used to determine whether the candidate call chain is a cyclic complete call chain or a complex complete call chain based on the number of corresponding call nodes, the connection relationship between the call nodes, and the number and connection relationship of call nodes corresponding to other candidate complete call chains.
[0044] Optionally, the device further comprises: a generating module;
[0045] The acquisition module is further used to obtain a service list corresponding to the microservice framework, and according to the service list, call the pinpoint native interface to obtain the association relationship between multiple call nodes under the microservice framework;
[0046] The determination module is further used to determine multiple call chains corresponding to the microservice framework according to the association relationship between the multiple call nodes;
[0047] The processing module is further used to filter and process the multiple call chains according to preset rules to obtain multiple candidate complete call chains;
[0048] The generation module is used to generate a complete call chain graph under the microservice framework based on the multiple candidate complete call chains.
[0049] Optionally, the acquisition module is further used to acquire analysis results sent by multiple logic processing modules;
[0050] The storage module is also used to generate a target complete call chain report based on multiple analysis results, and store the target complete call chain report in the OSS database, so that the front-end interface calls and displays the corresponding target complete call chain report from the OSS database.
[0051] Optionally, the multiple logic processing modules are distributedly deployed on multiple hosts;
[0052] The acquisition module is also used to acquire load information of multiple hosts;
[0053] The determination module is further configured to determine a target host according to the load information of the multiple hosts, wherein the target host is a host whose load information exceeds a load threshold;
[0054] The control module is also used to control the logic processing module corresponding to the target host to stop analyzing and processing.
[0055] In a third aspect, the present application provides a call chain management device for a microservice framework, comprising: at least one processor and a memory;
[0056] The memory stores computer-executable instructions;
[0057] The at least one processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the call chain governance method of the microservice framework as described in the first aspect and various possible implementation methods of the first aspect.
[0058] In a fourth aspect, an embodiment of the present invention provides a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the call chain governance method of the microservice framework described in the first aspect and various possible implementation methods of the first aspect.
[0059] The present application provides a call chain governance method, device, equipment and storage medium for a microservice framework. Obtain a complete call chain graph under the microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework; analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework; store the target complete call chain in a relational database so that the front-end interface calls and displays the corresponding complete call chain from the relational database. This solution can visualize the call chain, providing strong data support for optimizing the system call architecture, reducing the call level of a single business, and improving call efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0061] Figure 1 This is the process of the call chain governance method of the microservice framework provided by this application Figure 1 ;
[0062] Figure 2 This is the process of the call chain governance method of the microservice framework provided by this application Figure 2 ;
[0063] Figure 3 It is a structural diagram of the call chain management device of the microservice framework provided by this application;
[0064] Figure 4 It is a structural diagram of the call chain management device of the microservice framework provided by this application.
[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0067] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein, for example.
[0068] In the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in 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.
[0069] First, the terms involved in this application are explained:
[0070] Pinpoint: Pinpoint is an open source application performance management tool that can provide solutions to handle massive amounts of tracking data. It provides real-time detection and tracking functions and can be used to monitor large-scale distributed systems. It is based on Java development, which is conducive to the modification of source code in the later stage of the project. It has a very intuitive user interface and meets the current needs of the project. It can track distributed transactions and messages across distributed applications. Pinpoint can automatically detect application topology and clearly understand the application architecture. Pinpoint horizontal expansion can support large-scale server clusters.
[0071] OSS: (Object Storage Service, object storage service, referred to as OSS), is an HTTP protocol data storage and retrieval tool for unstructured data and metadata objects. It is a resource object hosting service that integrates storage and access. It is used to store static resources and also provides common functions such as backup and disaster recovery. OSS can separate dynamic and static data, store static resources in OSS, and store dynamic data locally or on cloud servers. The two are loaded separately, which greatly improves the overall performance; from another perspective, it can free up more local server resources for computing. These resources are the objects mentioned above. At the same time, OSS also has the ability to be accessed externally.
[0072] Relational database: A relational database is a database that uses a relational model to organize data. It stores data in the form of rows and columns to facilitate user understanding. This series of rows and columns in a relational database is called a table, and a group of tables constitutes a database. For example, MySQL uses a relational model to organize data, storing data in different tables instead of putting all data in a large warehouse, which increases speed and flexibility; MySQL is small in size, fast in speed, and has a low total cost of ownership. Generally, the development of small, medium and large websites chooses MySQL as the website database.
[0073] Distributed deployment: Distributed deployment means splitting an application or service into multiple independent parts, each of which can run on a separate computer or server to improve the performance and reliability of the application. Distributed deployment has high reliability, scalability, and flexibility. When a part fails, other parts can continue to run. Distributed deployment can add or reduce the number of computers or servers as needed, thereby conveniently expanding or reducing the scale of the application. Distributed deployment can also easily modify the architecture or functions of the application to meet changing needs.
[0074] Neo4j: Neo4j (Neo4j Graph Database, a graph-oriented NoSQL database, referred to as Neo4j), Neo4j is a graph database management system, a storage system based on structured and relational data, which is based on the graph model and provides a high-performance, reliable, and scalable storage and query mechanism. In Neo4j, we can use the Cypher query language to read and write data, which can achieve fast and high-performance queries.
[0075] D3.js: D3.js (Data-Driven Documents, D3 for short) is a JavaScript library for creating data-driven documents. You can bind any data to the HTML document object model, and then apply data-driven transformations to the document. You can use D3 to create a variety of data visualization effects, such as bar charts, scatter plots, tree diagrams, line charts, etc. It can be data-driven, document-rich, has powerful visual effects and scalability, and can generate graphics directly on the web page.
[0076] VUE: VUE is a JavaScript framework for building user interfaces. The main features of Vue include responsive data binding, component-based development, virtual DOM, and flexible template syntax. Vue's core library focuses only on the view layer and can be easily integrated with other libraries or existing projects. It is easy to learn and use, and provides a rich ecosystem and documentation support. It has been widely used in the field of front-end development and has a large community and user base both at home and abroad.
[0077] The current large-scale microservice system dependencies are relatively complex, which makes the microservice call chain relatively complex. The probability of a problem with a single call is relatively higher, and the corresponding cost of locating the problem is also higher.
[0078] In view of the above-mentioned problem of managing the call chain under the microservice framework, in the prior art, the call chain tracking between microservices is often carried out by means of pinpoint, zipkin, etc. Most systems use the call chain data directly, or collect data and then perform alarms, abnormal analysis or precise testing. However, with the increase in current business scenarios, the complexity of the call chain between microservices has exceeded human capabilities, and when making calls, there is usually a problem that the single business call level is lengthy and complex, resulting in low business efficiency. Therefore, how to manage the call chain under the microservice framework is the problem to be solved at present.
[0079] In response to the above problems, this application provides a call chain governance method for a microservice framework. By obtaining a complete call chain graph under the microservice framework and analyzing and processing the call chain graph accordingly, the governance of the service chain can be realized, and the service chain can also be displayed on the front-end page. This application further mines the call chain data of large-scale microservice systems, analyzes and processes the call chain, and visualizes the analysis and processing results, providing strong data support for optimizing the system call architecture, reducing the call level of a single business, and improving call efficiency.
[0080] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0081] Figure 1 This is a flow diagram of the call chain management method of the microservice framework provided in the embodiment of the present application. Figure 1 .like Figure 1 As shown, the call chain governance method of the microservice framework shown in this embodiment includes:
[0082] S101: Obtain a complete call chain graph under a microservice framework, where the complete call chain graph is used to indicate association relationships between call chains under the microservice framework.
[0083] Among them, the complete call chain graph under the microservice framework can be obtained by calling the relevant interface and undergoing relevant processing. The association relationship between the call chains is the link relationship between the call chains in the graph. The link relationship can obtain multiple call chains through specific rules.
[0084] It can be understood that to obtain a complete call chain graph under a microservice framework, multiple call chains are first determined according to the association relationship between the call chains under the framework, and then the call chains are filtered to obtain a complete call chain graph.
[0085] It can be understood that obtaining a complete call chain graph under this framework can greatly facilitate the governance of subsequent call chains and avoid the complexity of subsequent governance of call chains.
[0086] S102: Analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework.
[0087] The complete call chain graph is analyzed and processed mainly according to the features of multiple call chains in the graph, so that the multiple call chains can be classified and processed according to the relevant features, and the processed target complete call chain can be obtained.
[0088] It can be understood that after analyzing and processing the complete call chain graph, the classification and governance of the call chain can be achieved, that is, the governed call chain can be obtained, which provides convenience for the subsequent use of the call chain.
[0089] S103: storing the target complete call chain in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
[0090] Among them, the front-end interface is mainly used to display the complete call chain of the processed target, and the query of the call chain and other operations can be implemented through the front-end interface.
[0091] The call chain governance method of the microservice framework provided in this embodiment obtains a complete call chain graph under the microservice framework, and the complete call chain graph is used to indicate the association relationship between the call chains under the microservice framework; the complete call chain graph is analyzed and processed to obtain the target complete call chain corresponding to the microservice framework; the target complete call chain is stored in a relational database, so that the front-end interface can call and display the corresponding complete call chain from the relational database; the solution can visualize the call chain, and provide strong data support for optimizing the system call architecture, reducing the call level of a single business, and improving the call efficiency.
[0092] Figure 2 Schematic diagram of the process of the call chain management method of the microservice framework provided in the embodiment of the present application Figure 2 .like Figure 2 As shown, this embodiment is Figure 1 Based on the embodiment, the call chain governance method of the microservice framework is described in detail. The call chain governance method of the microservice framework shown in this embodiment includes:
[0093] S201: Obtain a service list corresponding to a microservice framework, and according to the service list, call a pinpoint native interface to obtain associations between multiple call nodes under the microservice framework.
[0094] Among them, the service list is a list containing multiple call chains; the association relationship between multiple call nodes is the link information between the call nodes. This information is obtained by calling the pinpoint native interface to obtain all Span information under a traceID. Through this information, multiple call chains under the framework can be obtained.
[0095] Among them, traceID is an identifier in the distributed system, which is used to track requests in the entire distributed system. According to traceID, all Span information under the traceID can be traced. Each Span contains the start time, time consumed and related information of an operation. This information can be processed by specific rules to restore multiple call chains under the framework for subsequent call chain management.
[0096] S202: Determine multiple call chains corresponding to the microservice framework according to the association relationship between the multiple call nodes.
[0097] Among them, multiple call chains are determined according to the association relationship, that is, the link information represented by the association relationship is subjected to data processing, so that all call node combinations of the multiple call chains can be obtained, and the combination of the call nodes can obtain the graph of the call chain.
[0098] S203: Screening and processing the multiple call chains according to preset rules to obtain multiple candidate complete call chains.
[0099] Among them, the preset rules are to filter out incomplete, problematic call chains and repeated call chains, and the desired candidate call chains are obtained after processing by the rules, that is, the candidate call chains refer to multiple call chains processed by the preset rules.
[0100] It can be understood that after processing by the preset rules, incomplete, problematic call chains and duplicate call chains will be removed, which will greatly facilitate the subsequent governance of the call chains, save a lot of resources and governance costs, and improve the efficiency of the governance system.
[0101] S204: Generate a complete call chain graph under the microservice framework based on the multiple candidate complete call chains.
[0102] Among them, the complete call chain graph is a graph that includes multiple call chains, and the graph records the call link relationship between each call chain.
[0103] The complete call chain graph can be formatted for subsequent call chain management. The formatting process can be through the Neo4j read-write module to provide formatted read-write functions for the subsequent management analysis module. The read-write module is adapted to the Neo4j API interface and the format of the collected data.
[0104] S205: Distribute the multiple candidate complete call chains to multiple logic processing modules respectively.
[0105] Among them, the allocation method of allocating multiple candidate complete call chains to multiple logic processing modules is polling allocation. After polling and allocating the call chains to multiple logic processing modules, the analysis and processing of the call chains can be completed in an orderly and efficient manner.
[0106] S206: Control the multiple logic processing modules to hierarchically traverse multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determine whether the candidate complete call chains meet preset conditions.
[0107] Among them, the preset conditions for the candidate complete call chains can be to set corresponding conditions based on the characteristics of each candidate complete call chain. The preset conditions can be multiple preset conditions. After processing the preset conditions, multiple candidate complete call chains can be classified, thereby avoiding the need to search the call chains of the entire call chain system in sequence when querying, which greatly improves the resource and time costs of call chain management.
[0108] Optionally, the target complete call chain may include, for example, the longest complete call chain, the cyclic complete call chain, and the complex complete call chain. When determining whether the candidate complete call chain meets the preset conditions, different preset conditions may be set for different target complete call chains. The following is a detailed description using the longest complete call chain, the cyclic complete call chain, and the complex complete call chain as examples.
[0109] Control each logic processing module to obtain the call chain length of the allocated candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes;
[0110] The way in which each logic processing module obtains the call chain length of the assigned candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes may be completed through a hierarchical traversal.
[0111] Determining whether the candidate call chain is the longest complete call chain according to the call chain length and the call chain lengths corresponding to other candidate complete call chains in the complete call chain graph;
[0112] Among them, determining whether the candidate call chain is the longest complete call chain is to compare the lengths of the candidate complete call chain and other candidate complete call chains under the logic module, and finally the longest complete call chain under the module can be obtained. By comparing the longest complete call chains of multiple logic modules, the longest call chain set of multiple complete call chains can be obtained.
[0113] It can be understood that the preset condition of the longest complete call chain can also be a corresponding search for a value of the length of a given call chain, and the given value can be set according to the length condition required by the user.
[0114] According to the number of corresponding call nodes, the connection relationship between the call nodes, and the number and connection relationship of call nodes corresponding to other candidate complete call chains, determine whether the candidate call chain is a cyclic complete call chain or a complex complete call chain.
[0115] Among them, the method for determining whether the candidate call chain is a circular complete call chain can be to determine it by finding the link relationship between the call nodes of the complete call chain. For example, the call nodes of the call chain can be A, B, C, D, and E. By confirming whether the first and last nodes of the call chain are both one of them, for example, if the first and last nodes of the call chain are both A, it can be confirmed that the call chain is a circular call chain. Among them, when it is determined that the first and last call nodes are the same, it is also necessary to confirm whether the length of the call node is only one. When it is one, the candidate complete call chain is filtered as a non-circular call chain.
[0116] Whether the candidate call chain is a complex and complete call chain can be determined by analyzing whether the link relationship between each call node in the call chain is one call node linking multiple other call nodes. When filtering based on the number of one call node linking other call nodes, the filtering conditions can also be set according to user needs.
[0117] Optionally, the multiple logic processing modules are distributedly deployed on multiple hosts, and the method also includes: obtaining load information of the multiple hosts; determining a target host based on the load information of the multiple hosts, the target host being a host whose load information exceeds a load threshold; and controlling the logic processing module corresponding to the target host to stop analysis and processing.
[0118] The load threshold may be set according to the common operating conditions of each host.
[0119] It is understandable that since multiple complete call chains need to be traversed hierarchically, the logic processing module will consume a high amount of CPU. Therefore, the logic processing module can be deployed in the host in a distributed manner. This distributed deployment method can fully utilize the advantages of the cluster to improve the speed of processing the complete call chain data, while avoiding the impact on the host performance when the load of one host is too high. In addition, through the distributed deployment of the logic processing module, the data processing capability can be dynamically expanded.
[0120] S207: When it is determined that the candidate complete call chain meets a preset condition, the candidate complete call chain is used as the target complete call chain.
[0121] Optionally, obtain analysis results sent by multiple logic processing modules; generate a target complete call chain report based on the multiple analysis results, and store the target complete call chain report in the OSS database, so that the front-end interface calls and displays the corresponding target complete call chain report from the OSS database.
[0122] Among them, the complete call chain report stored in OSS can be downloaded on the front end, and the front end interface will provide the interface required for downloading the report.
[0123] S208: Storing the target complete call chain in a relational database.
[0124] The data of the relational database can be scalable. The data can be provided to the front-end interface according to the user's query conditions, and the structured data can be converted into JSON format and provided to the front-end.
[0125] The front end can display the complete call chain diagram to be queried graphically based on D3.js according to the user's query conditions. When it is necessary to query the longest complete call chain, the cyclic complete call chain and the complex complete call chain, the corresponding call chain can be displayed based on VUE according to the query conditions. The VUE interface can also provide reports for download.
[0126] The call chain governance method of the microservice framework provided in this embodiment obtains the service list corresponding to the microservice framework, and calls the pinpoint native interface according to the service list to obtain the association relationship between multiple call nodes under the microservice framework; according to the association relationship, multiple call chains corresponding to the microservice framework are determined; multiple call chains are screened and processed, including removing duplicate chains, incomplete or problematic call chains, to obtain multiple complete call chains, and a complete call chain map is generated. By traversing the complete call chain in layers, the longest complete call chain, the cyclic complete call chain and the complex complete call chain are screened according to the call chain length, the number of call nodes, and the connection relationship between the call nodes, and they can be downloaded and displayed by the front end; by distributing the logic processing module, the advantages of the cluster are fully utilized to improve the speed of data processing, while avoiding the impact on the host performance when a host load is too high, and having the ability to dynamically expand data processing, avoiding the problem of high CPU consumption by the logic processing module. Provide strong data support for optimizing the system call architecture, reducing the call level of a single business, and improving the call efficiency.
[0127] Figure 3 A schematic diagram of the structure of the call chain management device of the microservice framework provided in the embodiment of the present application. Figure 3 As shown, the call chain management device 300 of the microservice framework provided by the present application includes:
[0128] An acquisition module 301 is used to acquire a complete call chain graph under a microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework;
[0129] The processing module 302 is used to analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework;
[0130] The storage module 303 is used to store the target complete call chain in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
[0131] Optionally, the device further includes: a determination module 304, an allocation module 305, and a control module 306;
[0132] The determination module 304 is used to determine a plurality of candidate complete call chains according to the complete call chain graph;
[0133] The allocation module 305 is used to allocate the multiple candidate complete call chains to multiple logic processing modules 302 respectively;
[0134] The control module 306 is used to control the multiple logic processing modules 302 to hierarchically traverse multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determine whether the candidate complete call chains meet the preset conditions;
[0135] The determination module 304 is further configured to use the candidate complete call chain as the target complete call chain when it is determined that the candidate complete call chain meets a preset condition.
[0136] Optionally, the target complete call chain includes: the longest complete call chain, the cyclic complete call chain and the complex complete call chain;
[0137] The control module 306 is further used to control each logic processing module 302 to obtain the call chain length of the allocated candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes;
[0138] The determination module 304 is further configured to determine whether the candidate call chain is the longest complete call chain according to the call chain length and the call chain lengths corresponding to other candidate complete call chains in the complete call chain graph;
[0139] The determination module 304 is further used to determine whether the candidate call chain is a cyclic complete call chain or a complex complete call chain based on the number of corresponding call nodes, the connection relationship between the call nodes, and the number and connection relationship of call nodes corresponding to other candidate complete call chains.
[0140] Optionally, the device further includes: a generating module 307;
[0141] The acquisition module 301 is further used to obtain a service list corresponding to the microservice framework, and according to the service list, call the pinpoint native interface to obtain the association relationship between multiple call nodes under the microservice framework;
[0142] The determination module 304 is further used to determine multiple call chains corresponding to the microservice framework according to the association relationship between the multiple call nodes;
[0143] The processing module 302 is further used to filter and process the multiple call chains according to preset rules to obtain multiple candidate complete call chains;
[0144] The generation module 307 is used to generate a complete call chain graph under the microservice framework according to the multiple candidate complete call chains.
[0145] Optionally, the acquisition module 301 is further used to acquire analysis results sent by multiple logic processing modules 302;
[0146] The storage module 303 is also used to generate a target complete call chain report based on multiple analysis results, and store the target complete call chain report in the OSS database, so that the front-end interface calls and displays the corresponding target complete call chain report from the OSS database.
[0147] Optionally, the multiple logic processing modules 302 are distributedly deployed on multiple hosts;
[0148] The acquisition module 301 is also used to acquire load information of multiple hosts;
[0149] The determination module 304 is further configured to determine a target host according to the load information of the plurality of hosts, wherein the target host is a host whose load information exceeds a load threshold;
[0150] The control module 306 is further used to control the logic processing module 302 corresponding to the target host to stop analyzing and processing.
[0151] Figure 4 This is a schematic diagram of the structure of the call chain management device of the microservice framework provided in this application. Figure 4 As shown, the present application provides a call chain management device for a microservice framework, and the call chain management device 400 for the microservice framework includes: a receiver 401, a transmitter 402, a processor 403 and a memory 404.
[0152] Receiver 401, used for receiving instructions and data;
[0153] A transmitter 402, used for sending instructions and data;
[0154] Memory 404, for storing computer-executable instructions;
[0155] The processor 403 is used to execute the computer-executable instructions stored in the memory 404 to implement the various steps performed by the call chain management method of the microservice framework in the above embodiment. For details, please refer to the relevant description in the above-mentioned call chain management method embodiment of the microservice framework.
[0156] Optionally, the memory 404 may be independent or integrated with the processor 403 .
[0157] When the memory 404 is independently provided, the electronic device further includes a bus for connecting the memory 404 and the processor 403 .
[0158] The present application also provides a computer-readable storage medium, which stores computer execution instructions. When a processor executes the computer execution instructions, a call chain management method of a microservice framework as executed by the call chain management device of the above-mentioned microservice framework is implemented.
[0159] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0160] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0161] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A call chain management method for a microservice framework, characterized in that: The method comprises: Obtain a complete call chain graph under a microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework; Analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework; The target complete call chain is stored in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
2. The method according to claim 1, characterized in that: The analyzing and processing of the complete call chain graph to obtain the target complete call chain corresponding to the microservice framework includes: Determine multiple candidate complete call chains according to the complete call chain graph; Allocating the multiple candidate complete call chains to multiple logic processing modules respectively; Controlling the plurality of logic processing modules to hierarchically traverse the plurality of candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determining whether the candidate complete call chains meet a preset condition; When it is determined that the candidate complete call chain meets the preset condition, the candidate complete call chain is used as the target complete call chain.
3. The method according to claim 2, characterized in that The target complete call chain includes: the longest complete call chain, the cyclic complete call chain and the complex complete call chain. The controlling the multiple logic processing modules hierarchically traverses the multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains to determine whether the candidate complete call chains meet the preset conditions, including: Control each logic processing module to obtain the call chain length of the allocated candidate complete call chain, the number of corresponding call nodes, and the connection relationship between the call nodes; Determining whether the candidate call chain is the longest complete call chain according to the call chain length and the call chain lengths corresponding to other candidate complete call chains in the complete call chain graph; According to the number of corresponding call nodes, the connection relationship between the call nodes, and the number and connection relationship of call nodes corresponding to other candidate complete call chains, determine whether the candidate call chain is a cyclic complete call chain or a complex complete call chain.
4. The method according to claim 1, characterized in that: The complete call chain graph under the microservice framework is obtained, including: Obtain a service list corresponding to the microservice framework, and according to the service list, call the pinpoint native interface to obtain the association relationship between multiple call nodes under the microservice framework; Determine multiple call chains corresponding to the microservice framework according to the association relationship between the multiple call nodes; Screening and processing the multiple call chains according to preset rules to obtain multiple candidate complete call chains; Based on the multiple candidate complete call chains, a complete call chain graph under the microservice framework is generated.
5. The method according to claim 3, characterized in that: The method further comprises: Obtain analysis results sent by multiple logic processing modules; Based on multiple analysis results, a target complete call chain report is generated, and the target complete call chain report is stored in the OSS database, so that the front-end interface calls and displays the corresponding target complete call chain report from the OSS database.
6. The method according to claim 3, characterized in that The multiple logic processing modules are distributedly deployed on multiple hosts, and the method further includes: Get load information for multiple hosts; Determine a target host according to the load information of the multiple hosts, the target host being a host whose load information exceeds a load threshold; The logic processing module corresponding to the target host is controlled to stop analyzing and processing.
7. A call chain management device for a microservice framework, characterized in that: include: An acquisition module is used to acquire a complete call chain graph under a microservice framework, wherein the complete call chain graph is used to indicate the association relationship between call chains under the microservice framework; A processing module, used to analyze and process the complete call chain graph to obtain a target complete call chain corresponding to the microservice framework; The storage module is used to store the target complete call chain in a relational database, so that the front-end interface calls and displays the corresponding complete call chain from the relational database.
8. The device according to claim 7, characterized in that The device also includes: a determination module, an allocation module, and a control module; The determination module is used to determine a plurality of candidate complete call chains according to the complete call chain graph; The allocation module is used to allocate the multiple candidate complete call chains to multiple logic processing modules respectively; The control module is used to control the multiple logic processing modules to hierarchically traverse multiple candidate complete call chains in the complete call chain graph according to the assigned candidate complete call chains, and determine whether the candidate complete call chains meet preset conditions; The determination module is further configured to use the candidate complete call chain as the target complete call chain when it is determined that the candidate complete call chain meets a preset condition.
9. A call chain management device for a microservice framework, characterized in that: include: Memory; processor; Wherein, the memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the call chain method of the microservice framework as described in any one of claims 1-6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the call chain method of the microservice framework as described in any one of claims 1 to 6.