Micro-service configuration parameter optimization method and device and electronic equipment
By building a knowledge graph and identifying key microservice nodes, the problems of high cost and slow positioning of microservice node configuration optimization in the microservice architecture are solved, fast and accurate parameter optimization is achieved, and the performance of microservice nodes is improved.
Patent Information
- Application Number
- CN202510692848.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-09-05
AI Technical Summary
In a microservices architecture, how to quickly locate and optimize the optimal configuration of microservice nodes to reduce data processing costs and ensure optimal performance, especially in terms of complex issues such as network communication, data consistency, and load balancing.
By obtaining microservice node information, a knowledge graph is constructed, the importance of nodes is sorted according to the dependencies between them, key microservice nodes are determined, and their parameter configurations are observed to determine the optimal parameters.
It achieves rapid and optimal configuration of microservice nodes, reduces data processing costs, ensures optimal performance of microservice nodes, and improves the accuracy and efficiency of parameter optimization.
Smart Images

Figure CN120602331A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, and electronic device for optimizing microservice configuration parameters. Background Art
[0002] In recent years, the microservices architecture has achieved significant growth and widespread adoption in software development. Its rise primarily addresses the limitations of monolithic, tightly coupled architectures and meets the growing demands of internet companies for high availability, scalability, and rapid delivery. In a monolithic architecture, all functional modules are tightly coupled within a single codebase, making maintenance and expansion increasingly difficult as the system scales. The microservices architecture effectively addresses these issues by decomposing applications into multiple, independently running services. In a microservices architecture, each microservice can be deployed independently, minimizing the impact on other services while further improving deployment flexibility and efficiency. The ability to independently scale effectively enhances system scalability. Furthermore, with significantly reduced coupling, failures in individual services minimize the impact on the overall system, enhancing fault tolerance. Finally, continuous integration and deployment technologies enable agile software development and delivery, seamlessly integrating microservices, shortening development and release cycles, and improving software delivery efficiency.
[0003] The goal of any system is to serve users. Therefore, ensuring continuous and efficient service operation is a critical issue for systems built on a microservices architecture. Microservices are inherently distributed systems, and network communication, data consistency, load balancing, and resource allocation are crucial to service performance management. Low-performance service applications can significantly limit execution efficiency, negatively impacting users and limiting the operations of service providers. Service application performance is inextricably linked to service configuration. Microservice nodes have complex dependencies, and a single lagging service can significantly affect the latency of other coexisting services. However, optimizing every microservice in the network is prohibitively expensive and challenging. Therefore, rapidly determining the optimal configuration of microservice nodes to maximize their performance remains an unresolved challenge. Summary of the Invention
[0004] The present application provides a microservice configuration parameter optimization method, device and electronic device to achieve rapid optimization of the configuration parameters of microservice nodes, reduce data processing costs, and ensure optimal performance of microservice nodes.
[0005] According to one aspect of the present application, a method for optimizing microservice configuration parameters is provided, comprising:
[0006] Obtain microservice node information, and build a knowledge graph based on the microservice node information;
[0007] Sort the importance of the microservice nodes in the knowledge graph according to the dependency relationships between the microservice nodes to determine the key microservice nodes;
[0008] For each of the key microservice nodes, the operation status of the parameter configuration of the key microservice node is observed to determine the optimal parameters corresponding to the key microservice node.
[0009] According to another aspect of the present application, a microservice configuration parameter optimization device is provided, comprising:
[0010] A node information acquisition module is used to obtain microservice node information and construct a knowledge graph based on the microservice node information;
[0011] A key node determination module is used to sort the importance of the microservice nodes in the knowledge graph according to the dependency relationship between the microservice nodes and determine the key microservice nodes;
[0012] The optimal parameter determination module is used to observe the operation status of the parameter configuration of each key microservice node and determine the optimal parameters corresponding to the key microservice node.
[0013] According to another aspect of the present application, an electronic device is provided, comprising:
[0014] at least one processor, and a memory communicatively coupled to the at least one processor;
[0015] In which, the memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the microservice configuration parameter optimization method described in any embodiment of the present application.
[0016] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the microservice configuration parameter optimization method described in any embodiment of the present application when executed.
[0017] According to another aspect of the present application, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the microservice configuration parameter optimization method described in any embodiment of the present application.
[0018] The technical solution of the embodiment of the present application obtains microservice node information and constructs a knowledge graph based on the microservice node information; sorts the importance of the microservice nodes in the knowledge graph according to the dependency relationship between the microservice nodes, and determines the key microservice nodes; observes the operation status of the parameter configuration of each key microservice node, determines the optimal parameters corresponding to the key microservice node, and realizes rapid optimization of the configuration parameters of the microservice node, reduces data processing costs, and ensures the optimal performance of the microservice node; constructs a knowledge graph based on the microservice node information, and uses the knowledge graph to analyze the relationship between the microservice nodes and Accurately describe the information of the microservice node itself and comprehensively describe the overall network structure of the microservice node; further sort the microservice nodes according to their importance through the dependency relationship between the microservice nodes, determine the key microservice nodes, observe the operation of the parameter configuration of each key microservice node, determine the corresponding optimal parameters, and achieve configuration parameter optimization. Since this application selects the key microservice nodes with higher importance for parameter configuration tuning, it is possible to quickly determine the optimal parameters of the key microservice nodes with higher importance, achieve rapid tuning of the microservice nodes, and ensure the optimal performance of the microservice nodes; solve the problems of high parameter optimization configuration cost and slow positioning.
[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0021] Figure 1 This is a flowchart of a microservice configuration parameter optimization method provided in accordance with the first embodiment of the present application;
[0022] Figure 2 This is a flowchart of a microservice configuration parameter optimization method provided in accordance with the second embodiment of the present application;
[0023] Figure 3 This is an example graph of an edge of a microservice node and an outgoing node provided according to the second embodiment of the present application;
[0024] Figure 4 This is a system architecture diagram for optimizing microservice configuration parameters according to the second embodiment of the present application;
[0025] Figure 5 This is a structural diagram of a microservice configuration parameter optimization device provided according to the third embodiment of the present application;
[0026] Figure 6 Schematic diagram of the structure of an electronic device that implements the microservice configuration parameter optimization method of an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in a sequence other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Example 1
[0030] Figure 1 This is a flowchart of a microservice configuration parameter optimization method provided in the first embodiment of the present application. This embodiment is applicable to the case of optimizing the configuration parameters of a microservice node. The method can be executed by a microservice configuration parameter optimization device. The microservice configuration parameter optimization device can be implemented in the form of hardware and / or software. The microservice configuration parameter optimization device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0031] S101. Obtain microservice node information and build a knowledge graph based on the microservice node information.
[0032] In this embodiment, microservice node information can be understood as relevant information of the microservice node during the call process. It can be the node information of the microservice node itself, for example, one or more information such as the node name and node identifier, or it can be information generated when the microservice node performs the corresponding operation, for example, one or more information such as the operation execution time and the corresponding parent node. A microservice node, also known as a microservice, is a software architecture organization that decouples a single application into a set of independently deployed services, with a single service representing an application service node. A knowledge graph refers to a data structure used to describe entities and their relationships, and associates information through a graph.
[0033] During the execution of a service request, different microservice nodes may be called, and the service request is completed through the cooperation between these different microservice nodes. For example, different microservice nodes may be called in sequence to complete the service request. The system records the relevant information of the microservice nodes when they are called during the execution of the service request, analyzes the relevant information, and forms microservice node information. The system can record and save the relevant information of the microservice nodes in real time, and directly obtain and analyze the stored information of the microservice nodes when optimizing configuration parameters. The system analyzes the microservice node information to determine the call sequence relationship of the microservice nodes, the attribute information of the microservice nodes themselves, and other data, and builds a knowledge graph based on this data.
[0034] In a complex microservice network, a single service lagging behind may cause significant changes in the service delays of other coexisting services. This embodiment of the application can improve the accuracy of parameter optimization by comprehensively depicting the entire microservice network through the knowledge graph.
[0035] S102. Sort the importance of the microservice nodes in the knowledge graph according to the dependency relationships between the microservice nodes to determine the key microservice nodes.
[0036] In this embodiment, a key microservice node can be understood as a microservice node with relatively high importance among microservice nodes. The number of microservice nodes in a network structure is usually multiple, and different microservice nodes can implement different functions, and corresponding operations are completed through cooperation between different microservice nodes. The importance of different microservice nodes is different. In order to reduce data processing costs and increase parameter optimization speed, the embodiment of the present application selects some microservice nodes from the microservice nodes as key microservice nodes for parameter optimization.
[0037] The knowledge graph stores different microservice nodes and can also store the dependencies between microservice nodes. By analyzing the dependencies between microservice nodes, the importance of microservice nodes is determined, the importance of each microservice node is ranked, and microservice nodes with higher importance are selected as key microservice nodes. The calculation of the importance of microservice nodes can be achieved through pre-set formulas, algorithms, etc. Since it is unrealistic and costly to optimize all microservice nodes in the network, this application identifies key microservice nodes in a complex network by analyzing the dependencies between microservice nodes, avoiding ineffective optimization of non-critical service nodes that have performance bottlenecks.
[0038] S103: For each key microservice node, observe the operation status of the parameter configuration of the key microservice node to determine the optimal parameters corresponding to the key microservice node.
[0039] In this embodiment, the optimal parameters can be understood as the parameters configured when the key microservice node achieves the optimal operating effect. The optimal parameters may be different under different optimization objectives. For example, under different circumstances where the optimization objectives of the key microservice node are the highest memory utilization, the fastest response speed, etc., the corresponding optimal parameters may be different. Corresponding parameter optimization is performed for each key microservice node to determine its corresponding optimal parameters. The optimization method can be: controlling the key microservice node to operate under different parameter configurations. The parameter configuration of the key microservice node operation can be predetermined or recommended based on an algorithm or model; collecting the operating data of the key microservice node under different parameter configurations and analyzing the operating conditions, determining the parameter configuration when the microservice node operates optimally, and using it as the optimal parameter corresponding to the key microservice node.
[0040] The embodiment of the present application provides a microservice configuration parameter optimization method to solve the problems of high parameter optimization configuration cost and slow positioning, realize rapid optimization configuration of the configuration parameters of microservice nodes, reduce data processing costs, and ensure the optimal performance of microservice nodes; construct a knowledge graph based on the microservice node information, accurately describe the relationship between microservice nodes and the information of the microservice nodes themselves through the knowledge graph, and comprehensively describe the overall network structure of the microservice nodes; further sort the microservice nodes according to their importance through the dependency relationship between the microservice nodes, determine the key microservice nodes, observe the operation status of the parameter configuration of each key microservice node, determine its corresponding optimal parameters, and realize configuration parameter optimization. Since the present application screens out the key microservice nodes with higher importance for parameter configuration tuning, the optimal parameters of the key microservice nodes with higher importance can be quickly determined, and the rapid tuning of the microservice nodes can be realized to ensure the optimal performance of the microservice nodes.
[0041] Example 2
[0042] Figure 2 This is a flowchart of a microservice configuration parameter optimization method provided in Example 2 of this application. This embodiment is refined based on the above embodiment. Figure 2 As shown, the method includes:
[0043] S201. Record the execution information of the service request through the full-link tracking request, and generate link information based on the execution information, where the execution information includes the call information of the microservice node.
[0044] In this embodiment, the full-link tracking request can be understood as a data processing request for recording the execution information during the full-link execution process. The execution information can be understood as the information generated during the execution of the service request, such as the microservice node called by the service request, the order and time of the call, etc. The link information can be understood as the information of a link generated during the full-link execution process, such as the link identifier, the microservice nodes included in the link, and the order or relationship between the microservice nodes. The call information of the microservice node can be understood as the information generated when the microservice node is called during the execution of the service request.
[0045] Inject tracking code into the service application in advance through code insertion; after initiating a service request, call the tracking code through the full-link tracking request, and then record the execution information of the service request. For example, initiate a corresponding service request based on the operation triggered by the user to complete the corresponding function; for example, when a user purchases a product through a shopping app, the corresponding microservice node is triggered to conduct a transaction, and the purchase of the product is finally completed. In this process, it may be necessary to trigger multiple microservice nodes to cooperate to complete the purchase of the product. The process from the user initiating a shopping service request to completing the shopping is the execution process of the service request. The information generated by this process can be used as execution information. The execution information includes the call information of the microservice node, such as the call time and call order of the microservice node. The type of information included in the link information can be pre-defined. For example, the link information includes a link identifier. After the execution information is collected, a link identifier is generated for this link. The link identifier can be used to uniquely identify this link, and the execution information can be used as link information, or the required information can be filtered out from the execution information as link information.
[0046] For example, data tracing can be achieved through code instrumentation, which allows for persistent storage of trace text. An instrumentation script is pre-generated, identifying the classes and functions to be instrumented, as well as the instrumentation points. Based on this instrumentation script, the tracing code is dynamically injected into the running service application, specifically into the microservice node. A full-link tracing request records the execution information of the service request. All trace information obtained can be persistently stored.
[0047] By using full-link tracing requests, you can track and monitor a service request from entry to exit through all microservice nodes. This allows you to fully and effectively understand the flow of system content requests and provides strong support for the operation and maintenance of microservice nodes, such as discovering performance bottlenecks and locating faulty nodes.
[0048] S202: Analyze the link information according to a predefined link tracking information format, and determine and save the microservice node information.
[0049] In this embodiment, the link tracking information format can be understood as the recording format of the information generated during the link tracking process. The link tracking information format can be pre-configured based on actual business needs. Based on the link tracking information format, the type of information to be stored can be determined. The link information can then be analyzed based on the type of information to be stored, and the corresponding type of information can be selected and stored as microservice node information.
[0050] Optionally, the microservice node information includes at least one of the following: service call start time, service call end time, uniform resource locator, status label, and identification information of the microservice node.
[0051] The status tag can be used to describe the status of the microservice node, for example, one or more information such as CPU utilization, memory utilization, network I / O, etc. The embodiment of the present application can record the basic resource monitoring data of the microservice node as a supplementary service indicator to evaluate the node status. The node status can be information such as CPU utilization, memory utilization, network I / O, etc. This monitoring can be implemented through hardware or system-provided software tools.
[0052] For each service request, this application can generate a globally unique tracing ID (for example, a link identifier TraceID) and multiple span IDs (for example, a node identifier Span ID), uniquely identify the link through the Trace ID, and identify the microservice node through the SpanID. In the link, end-to-end circulation corresponds to a service call, Span represents a service call in the link, and Span ID is a unique ID that identifies each end operation in the request. The beginning and end of the service call correspond to the upstream and downstream services respectively. The upstream service will call the downstream service during the execution process, and a new Span will be generated. At this time, the upstream service Span is the parent Span of the downstream service Span. In order to facilitate traceability, a unique Parent ID can be assigned. In addition, at the start and end of the service call, the corresponding start time, end time, Universal Resource Locator (URL), status label, ID information of the microservice node, etc. can be recorded in the Span. The corresponding microservice node can be determined by the URL.
[0053] S203: Perform data cleaning on the microservice node information and convert the microservice node information into semi-structured node information to be constructed.
[0054] In this embodiment, the node information to be constructed can be understood as the information of the nodes used to construct the knowledge graph. The microservice node information is cleaned to remove invalid data and duplicate redundant data, and the microservice node information is converted into semi-structured data and used as the node information to be constructed. When performing data cleaning, the data can be analyzed according to the set rules to filter out invalid and redundant data, and then the data format is converted to semi-structured node information to be constructed. The microservice node information includes different types of information. For different types of information, data cleaning can be performed in an appropriate manner. For example, for indicator data in the microservice node information, such as average response time, in order to avoid noise interference, the complete service request can be repeatedly executed to perform noise data processing on all data. Exemplarily, this can be achieved through methods such as mean value and K-means clustering. Reduce data noise through data cleaning.
[0055] S204 , extracting knowledge from the node information to be constructed, and constructing a triplet of the microservice node. The triplet includes the node information, service request relationship, and service node attributes of the microservice node.
[0056] In this embodiment, the node information may be one or more information such as the microservice node name, version, and identifier; the service request relationship is the calling relationship between microservice nodes, and may also include information such as the calling frequency; the service node attributes may store service indicators, for example, one or more information such as average response time, throughput, and resources, and the resources may be one or more resource information such as CPU and memory usage.
[0057] The node information to be constructed is subjected to knowledge extraction, and the data required for constructing the knowledge graph is extracted. For example, the type of data required for constructing the knowledge graph is predefined, and the corresponding data is extracted according to the type of data. The extracted data may include information such as the node information of the microservice node, the service request relationship, and the service node attributes; a triple of the microservice node is formed based on the node information, service request relationship, and service node attributes of the microservice node. Exemplarily, the triple can be represented by (V, E, P), where V represents the service node entity, including node information such as the microservice name and version; E represents the service request relationship, which is the call relationship between microservice nodes, including the call frequency; P represents the service node attributes, and stores service indicators, such as one or more information such as the average response time, throughput, and resources.
[0058] S205. Store the triples of each microservice node in the graph database to form a knowledge graph.
[0059] The information in the triplet (V, E, P) of each microservice node is stored in the graph database, with the microservice node as the endpoint and the service request relationship as the edge connecting the two endpoints, representing the associated microservice nodes to form a knowledge graph; finally, the relationship between the related microservice nodes is visualized through the knowledge graph.
[0060] S206. Sort the importance of the microservice nodes in the knowledge graph according to the dependency relationships between the microservice nodes to determine the key microservice nodes.
[0061] In the knowledge graph, the dependencies of microservice nodes and related runtime service indicators can be determined; the importance of microservice nodes can be ranked through the above data, and the directed graph of the dependencies between request execution paths and microservice nodes can be constructed. Calculate node importance with service metrics. Represents a node set, that is, a microservice node set, Represents an edge set, that is, a set of call relationships between microservice nodes.
[0062] As an optional embodiment, this optional embodiment further ranks the importance of the microservice nodes in the knowledge graph according to the dependency relationship between the microservice nodes, and determines the optimization of the key microservice nodes as follows: for each microservice node in the knowledge graph, the importance of the microservice node is calculated based on the dependency relationship between the microservice nodes and the initial importance; based on the importance of each microservice node, it is determined whether the convergence condition is met; if so, the importance of each microservice node is ranked, and the key microservice node is determined based on the ranking result; if not, the initial importance of each microservice node is updated based on the importance of each microservice node, and the step of calculating the importance of the microservice node based on the dependency relationship between the microservice nodes and the initial importance is returned to execute.
[0063] In this embodiment, the initial importance can be understood as the initial value of the importance of the key microservice node. This value can be initialized and assigned before parameter optimization. For example, the initial importance can be 1 / N, where N is the number of microservice nodes. Convergence conditions can include the change in the importance of the microservice node being within a certain range, the number of iterations for calculating the importance of the microservice node exceeding a set threshold, and so on.
[0064] Initialize the importance of each microservice node in the knowledge graph in advance, determine the initial importance of each microservice node, analyze the dependencies between microservice nodes, determine the edges from other microservice nodes to this microservice node, and the edges from this microservice node to other microservice nodes, and calculate the importance of each microservice node in combination with the initial importance and the corresponding calculation formula. The importance of each microservice node can be calculated in the same way as described above. Set the convergence condition in advance. After completing an iterative calculation, analyze the importance of each microservice node to determine whether the convergence condition is met. For example, the convergence condition is that the changes in the importance of each microservice node are within a certain range, or the proportion of the number of microservice nodes whose importance changes within a certain range to the total number of microservice nodes exceeds a set proportion, or the number of iterations of the importance calculation exceeds a set threshold, etc. If it is determined that the convergence condition is met, the iteration of importance calculation ends. The importance of each microservice node obtained at this time is the final corresponding importance of each microservice node. The importance of each microservice node is ranked, and based on the ranking result, the microservice nodes with high importance are selected as key microservice nodes. For example, the top M microservice nodes with high importance are selected as key microservice nodes. The size of M can be preset and can be determined based on the total number of microservice nodes, or determined based on actual business scenarios. For example, M is 10, M is half of the total number of microservice nodes, etc. If it is determined that the convergence condition is not met, the importance of the microservice node determined this time is used as the new initial importance of the microservice node to update the initial importance. The process returns to the step of calculating the importance of the microservice node based on the dependency relationship between the microservice nodes and the initial importance, and the importance of the microservice nodes is re-iteratively calculated until the convergence condition is met.
[0065] As an optional embodiment, this optional embodiment further optimizes the calculation of the importance of the microservice nodes based on the dependency relationship between the microservice nodes in combination with the initial importance, including steps A1-A2:
[0066] A1. Determine the incoming edge set of the microservice nodes based on the dependency relationship between the microservice nodes. The incoming edge set includes the outgoing edge nodes.
[0067] In this embodiment, the incoming edge set can be understood as a set consisting of microservice nodes. Taking microservice node v as an example, microservice node u in the incoming edge set of microservice node v points to microservice node v through an edge. Microservice node u in the incoming edge set is an outgoing edge node. Outgoing edge node u refers to a microservice node that points to other nodes through an edge.
[0068] Analyze the dependencies between microservice nodes and determine the direction of the edges between them based on these dependencies. For example, to calculate the importance of microservice node v, determine all outgoing edge nodes u pointing to microservice node v based on the direction of the edges between microservice nodes. The set of outgoing edge nodes u is denoted as the incoming edge set. In this step, incoming edges are edges relative to microservice node v, meaning they point to microservice node v. Outgoing edges are edges relative to microservice node u, meaning they point from microservice node u to other microservice nodes.
[0069] A2. Calculate the importance of the microservice node based on the outbound weight and initial importance of each outbound node.
[0070] In this embodiment, the outbound edge weight can be understood as the weight of the edge between microservice nodes; the outbound edge weight of the outbound edge node u is the weight of the edge from the outbound edge node u to all other microservice nodes it points to. The weight of each edge is determined in advance. For example, the weight of each edge is calculated based on indicators such as call frequency and throughput. The weight is optimized by data such as service call frequency to enhance the adaptability of the load environment. After determining the outbound edge node u, the weight of the edge corresponding to the outbound edge node u is recorded as the edge weight. The outbound edge weights from the outbound edge node u to the microservice node v and other microservice nodes are analyzed, and the importance of the microservice node v is calculated in combination with the initial importance.
[0071] Optionally, an embodiment of the present application provides a calculation formula for the importance of a microservice node:
[0072]
[0073] Where PR(v) is the importance of microservice node v, PR(u) is the initial importance of outgoing node u, ω(u,v) is the outgoing edge weight corresponding to the edge (u,v) between outgoing node u and microservice node v, ω(u,k) is the outgoing edge weight corresponding to the edge (u,k) between outgoing node u and microservice node k, OUT(u) is the set of all outgoing edges of outgoing node u, IN(v) is the set of incoming edges pointing to microservice node v, and d is a random coefficient.
[0074] In the above formula The weight ratio of the edge (u, v) between the outgoing node u and the microservice node v to all the outgoing edge weights of the outgoing node u; the outermost layer is accumulated Represents the PR value of all corresponding outgoing nodes u pointing to the microservice node v. The PR value refers to
[0075] For example, Figure 3Provide an example diagram of the edges of a microservice node and an outgoing edge node. For an outgoing edge node u, it can have multiple outgoing edges, each pointing to a different node. In the figure, an outgoing edge node u has three outgoing edges as an example. Two of the outgoing edges point to microservice nodes k1 and k2, respectively. The outgoing edge weights for one are ω(u,k1) and ω(u,k2), respectively. One outgoing edge points to microservice node v, and the corresponding outgoing edge weight is ω(u,k v ),ω(u,k v ) is ω(u,v), microservice node k3 and microservice node k4 are other outgoing edge nodes pointing to microservice node v.
[0076] S207: For each key microservice node, observe the operation status of the parameter configuration of the key microservice node to determine the optimal parameters corresponding to the key microservice node.
[0077] As an optional embodiment, this optional embodiment further observes the operation status of the parameter configuration of the key microservice node, determines the optimal parameters corresponding to the key microservice node, and optimizes steps B1-B5:
[0078] B1. Get the current configuration parameters.
[0079] In this embodiment, the current configuration parameters are configuration parameters of the key microservice node, which can be the actual configuration parameters during the operation of the key microservice node. After the microservice node is deployed, the configuration information of the microservice node is configured, and the configuration information of the microservice node is collected. The collected configuration information can be used as the current configuration parameters for parameter tuning of the key microservice node. During the operation of the key microservice node, the configuration parameters can be collected and saved in real time; when tuning the parameters of the key microservice node, a configuration parameter can be selected from the multiple configuration parameters that have been collected as the current configuration parameter; or, when determining to tune the parameters of the key microservice node, the configuration parameters of the key microservice node are collected in real time as the current configuration parameters.
[0080] B2. Input the current configuration parameters into the current policy network for mapping to obtain the recommended configuration parameters.
[0081] In this embodiment, the current policy network can be understood as a network model that can be updated in real time during parameter tuning. The recommended configuration parameters can be understood as the optimal configuration parameters obtained through network prediction.
[0082] Pre-build a policy network, which can be a neural network model or another type of model. Obtain the current policy network and use it as the current policy network. Input the current configuration parameters into the current policy network. The current policy network maps the current configuration parameters based on the parameters of the policy network and maps the current configuration parameters to the recommended configuration parameters.
[0083] For example, an embodiment of the present application provides a mapping formula for recommended configuration parameters:
[0084] a t =μ(s t |θ μ );
[0085] Among them, a t represents the recommended configuration parameters at time t (also known as the behavior taken by the agent at time t), s t represents the current configuration parameters at time t (also known as the agent's environmental state at time t), θ μ are the parameters of the current policy network; μ is the policy, which can map the current configuration parameters to the recommended configuration parameters based on the parameters of the current policy network.
[0086] B3. Modify the configuration parameters of the key microservice nodes according to the recommended configuration parameters, and obtain the optimization target obtained by running the key microservice nodes based on the modified configuration parameters.
[0087] In this embodiment, the optimization target can be the actual operating data of the key microservice node, or it can be data calculated based on the operating data; for example, the optimization target can be a performance indicator. Exemplarily, the optimization target is one or more performance indicators such as CPU utilization, memory utilization, and response time. The method of modifying the configuration parameters of the key microservice node according to the recommended configuration parameters can be to directly modify the configuration parameters of the key microservice node to the recommended configuration parameters, or to fine-tune the configuration parameters of the key microservice node based on the recommended configuration parameters, for example, to increase or decrease the size of the parameter value. The key microservice node runs based on the modified configuration parameters, collects the operating data of the key microservice node after the configuration parameters are modified, and determines the optimization target based on the operating data.
[0088] B4. Determine whether the iteration stop condition is met. If so, execute B5; otherwise, execute B6.
[0089] In this embodiment, the iteration stopping condition can be understood as a condition for determining whether the parameter optimization iteration should be stopped, such as when the number of iterations exceeds a certain threshold, when the current policy network converges, etc. The iteration stopping condition is pre-set, and each optimization cycle is considered to be one iteration. Whether the iteration stopping condition is met is determined. If so, B5 is executed; if not, B6 is executed.
[0090] B5. Determine the optimal parameters based on all the recommended configuration parameters and optimization objectives.
[0091] Analyze all recommended configuration parameters and optimization targets, determine the optimal configuration parameters, and obtain the optimal parameters. For example, the recommended configuration parameters and optimization targets are input into a pre-trained model for analysis and prediction. The model predicts and outputs the optimal parameters based on the input data.
[0092] B6. Input the current configuration parameters, recommended configuration parameters, and optimization objectives into the value network for value calculation to obtain the expected return value. Gradient update the current policy network based on the expected return value. Obtain the new current configuration parameters, use the updated current policy network as the new current policy network, and return to execute step B2.
[0093] In this embodiment, the value network can be understood as a network model that can be pre-trained. The expected return value can be understood as information used to provide feedback on the actions of the policy network. The current configuration parameters, recommended configuration parameters, and optimization objectives are input into the value network. The value network performs value calculations based on the input data, determines, and outputs the expected return value. Based on the expected return value and the policy gradient theorem, the gradient of the current policy network is updated to obtain a new current policy network. The new current configuration parameters are used as the updated current policy network, and a new current configuration parameter is obtained. The recommended configuration parameters can be used as the new current configuration parameter, or one of the collected configuration parameters can be used as the new current configuration parameter. Return to execute B2 for parameter mapping until the iteration stop condition is met and the optimal parameters are determined.
[0094] For parameter tuning of each key microservice node, you can first determine the optimal parameters for one key microservice node, then configure its parameters to the optimal parameters, and then continue to adjust the optimal parameters of the next key microservice node until the optimal parameters of all key microservice nodes are determined. When selecting key microservice nodes to determine the optimal parameters, you can randomly select or select them in order based on one or more factors such as the business scenario and the importance of the key microservice node.
[0095] For example, an embodiment of the present application provides a value network:
[0096]
[0097] Among them, s t Represents the current configuration parameters at time t (also known as the agent's environmental state at time t); a t represents the recommended configuration parameters at time t (also known as the behavior taken by the agent at time t); r(s t ,a t ) Environmental status s t In performing behavior a t The reward value returned after γ represents the discount factor, which ranges from (0,1]; Q μ (s t+1 ,μ(s t+1 )) indicates using μ strategy in s t+1 The expected value of the reward obtained by selecting an action in the state.
[0098] For example, the present invention provides a method for calculating the gradient update of a policy network:
[0099]
[0100] Among them, θ μ represents the policy network parameters, θ Q Represents the value network parameters.
[0101] As an optional embodiment, this optional embodiment further determines the optimal parameters based on all the obtained recommended configuration parameters and optimization targets as follows: comparing the optimization targets to determine the optimal target; and taking the recommended configuration parameters corresponding to the optimal target as the optimal parameters.
[0102] In this embodiment, the optimal goal can be understood as the operating performance of the key microservice nodes and the data with the best effect; for example, if the optimization goal is memory utilization, the optimal goal is the highest memory utilization; if the optimization goal is response time, the optimal goal is the shortest response time, and so on. When multiple types of parameters are included in the optimization goal, the optimal effect can be balanced. For example, if the optimization goal includes memory utilization and response time, the optimal goal is that both memory utilization and response time are in the top few.
[0103] The present invention provides a method for optimizing microservice configuration parameters. This method addresses the complex service dependencies and configuration optimization efficiency challenges in microservices by tracking service links through full-link tracing requests. It also constructs a knowledge graph of microservice nodes, screens out key microservice nodes through microservice node importance calculation, and ultimately optimizes the parameters of key microservice nodes based on a policy network and a value network. Addressing the complex dependencies between microservices, the call relationships between microservice nodes are recorded through instrumentation, and service metrics are additionally recorded. Based on the full-link request tracing data, a microservice knowledge graph is constructed and visualized. Addressing the difficulty in identifying key links in a microservice chain, the importance of microservice nodes is calculated based on the dependencies between microservice nodes, enhancing adaptability to load environments. The parameter optimization method provided by the present invention saves time, has high accuracy, and significantly improves the performance of microservice nodes. The present invention captures and displays the relationship network of microservice nodes and ranks the importance of microservice nodes. By optimizing key microservice nodes, the return on investment is increased. By searching for the optimal configuration through online iterations of the value network and the policy network, the optimal configuration can be located more quickly and accurately.
[0104] For example, Figure 4 This paper provides a system architecture diagram for optimizing microservice configuration parameters. The system includes: link tracking module, node network module, configuration exploration module, automatic deployment module, etc. The main functions are as follows:
[0105] (1) Link tracking module, which defines the format of link tracking information and implements microservice node tagging and context recording during the service request execution process through code instrumentation, such as basic information such as microservice name, as well as performance or resource information such as node CPU utilization and service throughput.
[0106] By using full-link tracing requests, you can track and monitor a request from entry to exit through all microservice nodes. This allows you to fully and effectively understand the flow of system content requests and provides strong support for microservice operation and maintenance work, such as discovering performance bottlenecks and locating faulty nodes.
[0107] (2) The node network module cleans the data obtained from link tracing, extracts text information to build a knowledge graph of the microservice network, and implements persistent storage and visual display functions. The importance of service nodes is measured through a weighted algorithm.
[0108] The node network module is a concrete implementation of the microservice network, consisting of a source data layer, a node view layer, and a node measurement layer. At the source data layer, data noise is reduced by cleaning the full-link request tracking information. The node view layer processes the information text, extracts triples, and uses them to construct a knowledge graph, while also visualizing the service network. The node measurement layer is responsible for screening out key nodes in the service chain.
[0109] (3) Configuration exploration module: First, the configuration space to be observed is defined, which includes the value range space of resources, application configurations, and related configuration items; the current configuration parameters can be the configuration space to be observed. The related configuration items can be set based on instructions and practical experience. Then, training is carried out through multi-agent reinforcement learning methods, and online configuration exploration is achieved through iteration. Based on historical samples during the online exploration process, the learning model is continuously optimized to simulate and approximate the relationship between the configuration and optimization target in the real environment, and finally the optimal configuration is located.
[0110] After ranking the importance of microservice nodes, parameter optimization of key microservice nodes is achieved through configuration tuning. In fact, both the resource configuration parameters and application configuration parameters of microservices affect service performance, and the relationships between configurations and between configurations and optimization targets are complex and non-independent. To deeply explore and optimize performance, the embodiments of this application will comprehensively consider resource configuration and application configuration to form the configuration space to be observed, and realize configuration exploration and optimal configuration positioning through reinforcement learning methods.
[0111] Reinforcement learning is a machine learning method that uses actions, rewards, and observed states to iteratively update and optimize an agent through continuous interaction between the agent and the environment. The optimization goal is achieved by maximizing the environment's reward. In this embodiment of the application, the microservice node is identified as the Environment, the configuration representing the current system state is the State, and the explored and recommended configuration is considered the Action.
[0112] First, an initial agent is built to simulate the input network of the current environment state. The input state (i.e., current configuration parameters) is taken as input, and a set of actions (i.e., recommended configuration parameters) is output. The relevant actions are mapped to a set of configuration parameters, deployed to real microservice nodes, and executed. The rewards (i.e., expected return) are obtained based on the execution results of the microservice nodes (i.e., the optimization target). The rewards simulate the expert's experience and judgment of the real environment during the tuning process, providing influential feedback between the agent and the environment. The rewards are independent of the workload and depend solely on the optimization target.
[0113] (4) Automatic deployment module, which belongs to the basic support module. Based on container technology, it is mainly responsible for the deployment of service applications and the elastic expansion of container resources through horizontal and vertical exploration and scaling mechanisms. For application configuration, it can realize dynamic update of service application configuration through mounting.
[0114] The automatic deployment module provides foundational support, primarily responsible for microservice deployment and dynamic configuration updates, enabling execution chain tracking and configuration exploration. Based on mature Docker container technology, it simplifies the code release process and significantly mitigates differences in system environments.
[0115] Image creation: Use scripting languages to automate the orchestration pipeline and automatically pull and check the code; then build the project and create a Docker image for the application service.
[0116] Container deployment and dynamic configuration updates: This system integrates container technology and scripting languages to orchestrate container deployment. For example, horizontal and vertical elastic scaling mechanisms are used to define basic container resources, such as the number of containers to start, the number of CPUs used, and the memory size. Furthermore, service application configuration can be managed through mounting, allowing configuration content from external files to be mounted into the container, enabling dynamic configuration updates for service applications.
[0117] The automatic deployment module of the embodiment of the present application provides automated operations for service deployment and dynamic configuration updates. After the service is deployed, the configuration parameters on the microservice node are updated and data collection is performed to build the initial experience pool of the reinforcement learning algorithm. In the actual working process, the configuration exploration module Agent will also interact with the Environment, select actions according to the current strategy (Actor network), and store the samples obtained from the interaction into the experience pool. During the interaction process, the module can dynamically update the action selected by the strategy network to modify the corresponding configuration parameter value, and execute the task to obtain the target indicator value (reward).
[0118] Example 3
[0119] Figure 5 This is a schematic diagram of the structure of a microservice configuration parameter optimization device provided in Example 3 of this application. Figure 5 As shown, the device includes: a node information acquisition module 31, a key node determination module 32 and an optimal parameter determination module 33.
[0120] A node information acquisition module 31 is used to obtain microservice node information and construct a knowledge graph based on the microservice node information;
[0121] A key node determination module 32 is used to sort the importance of the microservice nodes in the knowledge graph according to the dependency relationship between the microservice nodes and determine the key microservice nodes;
[0122] The optimal parameter determination module 33 is configured to observe the operation status of the parameter configuration of each key microservice node and determine the optimal parameters corresponding to the key microservice node.
[0123] The embodiment of the present application provides a microservice configuration parameter optimization device to solve the problems of high parameter optimization configuration cost and slow positioning, realize rapid optimization configuration of configuration parameters of microservice nodes, reduce data processing costs, and ensure the optimal performance of microservice nodes; construct a knowledge graph based on microservice node information, accurately describe the relationship between microservice nodes and the information of the microservice nodes themselves through the knowledge graph, and comprehensively describe the overall network structure of the microservice nodes; further sort the microservice nodes according to their importance through the dependency relationship between the microservice nodes, determine the key microservice nodes, observe the operation status of the parameter configuration of each key microservice node, determine its corresponding optimal parameters, and realize configuration parameter optimization. Since the present application screens out key microservice nodes with higher importance for parameter configuration tuning, the optimal parameters of key microservice nodes with higher importance can be quickly determined, and the rapid tuning of microservice nodes can be realized to ensure the optimal performance of microservice nodes.
[0124] Optionally, the node information acquisition module 31 includes:
[0125] A link tracking unit, configured to record the execution information of the service request through a full-link tracking request, and generate link information based on the execution information, wherein the execution information includes the call information of the microservice node;
[0126] The node information determination unit is used to analyze the link information according to a predefined link tracking information format, determine and save the microservice node information.
[0127] Optionally, the microservice node information includes at least one of the following: service call start time, service call end time, uniform resource locator, status label, and identification information of the microservice node.
[0128] Optionally, the node information acquisition module 31 includes:
[0129] A data cleaning unit, configured to clean the microservice node information and convert the microservice node information into semi-structured node information to be constructed;
[0130] A knowledge extraction unit is used to extract knowledge from the node information to be constructed, and construct a triple of microservice nodes, wherein the triple includes node information, service request relationship and service node attributes of the microservice node;
[0131] The knowledge graph forming unit is used to store the triples of each microservice node in a graph database to form a knowledge graph.
[0132] Optionally, the key node determination module 32 includes:
[0133] An importance calculation unit, configured to calculate the importance of each microservice node in the knowledge graph based on the dependency relationship between the microservice nodes and the initial importance;
[0134] The convergence judgment unit is used to judge whether the convergence condition is met according to the importance of each microservice node; if so, sort the importance of each microservice node and determine the key microservice node according to the sorting result; if not, update the initial importance of each microservice node according to the importance of each microservice node, and return to execute the step of calculating the importance of the microservice node according to the dependency relationship between the microservice nodes and the initial importance.
[0135] Optionally, the judgment unit is specifically configured to: determine an incoming edge set of the microservice node according to the dependency relationship between the microservice nodes, wherein the incoming edge set includes outgoing edge nodes; and calculate the importance of the microservice node according to the outgoing edge weight and initial importance of each outgoing edge node;
[0136] The calculation formula for the importance of the microservice node is:
[0137]
[0138] Wherein, PR(v(is the importance of the microservice node v, PR(u) is the initial importance of the outgoing node u, ω(u,v) is the outgoing edge weight corresponding to the edge (u,v) between the outgoing node u and the microservice node v, ω(u,k) is the outgoing edge weight corresponding to the edge (u,v) between the outgoing node u and the microservice node k. u, k) corresponding outbound edge weight, OUT(u) is the set of all outbound edges of the outbound node u, IN(v) is the set of inbound edges pointing to the microservice node v, and d is a random coefficient.
[0139] Optionally, the optimal parameter determination module 33 includes:
[0140] a recommended configuration determining unit, configured to obtain current configuration parameters, input the current configuration parameters into the current policy network for mapping, and obtain recommended configuration parameters;
[0141] an optimization target determination unit, configured to modify the configuration parameters of the key microservice node according to the recommended configuration parameters, and obtain an optimization target obtained by operating the key microservice node based on the modified configuration parameters;
[0142] The iterative judgment unit is used to judge whether the iteration stop condition is met. If so, the optimal parameters are determined based on all the recommended configuration parameters and optimization objectives obtained; if not, the current configuration parameters, the recommended configuration parameters and the optimization objectives are input into the value network for value calculation to obtain the expected return value, and the current policy network is gradient updated according to the expected return value; new current configuration parameters are obtained, the updated current policy network is used as the new current policy network, and the step of inputting the current configuration parameters into the current policy network for mapping to obtain the recommended configuration parameters is returned.
[0143] Optionally, the iterative judgment unit is specifically used to: compare the optimization objectives to determine the optimal objective; and use the recommended configuration parameters corresponding to the optimal objective as the optimal parameters.
[0144] The microservice configuration parameter optimization device provided in the embodiments of the present application can execute the microservice configuration parameter optimization method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method.
[0145] Example 4
[0146] Figure 6 A schematic diagram of the structure of an electronic device 40 that can be used to implement an embodiment of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.
[0147] like Figure 6As shown, the electronic device 40 includes at least one processor 41 and a memory, such as a read-only memory (ROM) 42, a random access memory (RAM) 43, etc., which is communicatively connected to the at least one processor 41. The memory stores a computer program that can be executed by the at least one processor, and the processor 41 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 42 or the computer program loaded from the storage unit 48 into the random access memory (RAM) 43. Various programs and data required for the operation of the electronic device 40 can also be stored in the RAM 43. The processor 41, ROM 42, and RAM 43 are connected to each other via a bus 44. An input / output (I / O) interface 45 is also connected to the bus 44.
[0148] Multiple components in the electronic device 40 are connected to the I / O interface 45, including an input unit 46, such as a keyboard, a mouse, etc.; an output unit 47, such as various types of displays, speakers, etc.; a storage unit 48, such as a magnetic disk, an optical disk, etc.; and a communication unit 49, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 49 allows the electronic device 40 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0149] Processor 41 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 41 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processor, controller, microcontroller, etc. Processor 41 executes the various methods and processes described above, such as the microservice configuration parameter optimization method.
[0150] In some embodiments, the microservice configuration parameter optimization method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as storage unit 48. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 40 via ROM 42 and / or communication unit 49. When the computer program is loaded into RAM 43 and executed by processor 41, one or more steps of the microservice configuration parameter optimization method described above can be performed. Alternatively, in other embodiments, processor 41 can be configured to execute the microservice configuration parameter optimization method in any other appropriate manner (e.g., by means of firmware).
[0151] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0152] Computer programs for implementing the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0153] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the microservice configuration parameter optimization method described in any embodiment of the present application.
[0154] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. A computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0156] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0157] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0158] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this application can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of this application can be achieved. This is not limited herein.
[0159] The above specific embodiments do not constitute a limitation on the scope of protection of this application. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application shall be included within the scope of protection of this application.
Claims
1. A method for optimizing microservice configuration parameters, characterized in that: include: Obtain microservice node information, and construct a knowledge graph based on the microservice node information; Sort the importance of the microservice nodes in the knowledge graph according to the dependency relationships between the microservice nodes to determine the key microservice nodes; For each of the key microservice nodes, the operation status of the parameter configuration of the key microservice node is observed to determine the optimal parameters corresponding to the key microservice node.
2. The method according to claim 1, characterized in that The obtaining of microservice node information includes: Record the execution information of the service request through the full link tracking request, and generate link information based on the execution information, which includes the call information of the microservice node; The link information is analyzed according to a predefined link tracking information format to determine and save microservice node information.
3. The method according to claim 1 or 2, characterized in that The microservice node information includes at least one of the following: service call start time, service call end time, uniform resource locator, status label, and identification information of the microservice node.
4. The method according to claim 1, wherein The constructing of a knowledge graph according to the microservice node information includes: Performing data cleaning on the microservice node information and converting the microservice node information into semi-structured node information to be constructed; Performing knowledge extraction on the node information to be constructed to construct a triplet of the microservice node, wherein the triplet includes node information of the microservice node, service request relationship, and service node attributes; The triples of each microservice node are stored in a graph database to form a knowledge graph.
5. The method according to claim 1, characterized in that The step of ranking the microservice nodes in the knowledge graph by importance according to the dependencies between the microservice nodes and determining the key microservice nodes includes: For each microservice node in the knowledge graph, the importance of the microservice node is calculated based on the dependency relationship between the microservice nodes and the initial importance; Determine whether the convergence condition is met based on the importance of each microservice node; If so, rank the importance of each microservice node and determine the key microservice nodes based on the ranking results; If not, the initial importance of each microservice node is updated according to the importance of each microservice node, and the process returns to the step of calculating the importance of the microservice node according to the dependency relationship between the microservice nodes and the initial importance.
6. The method according to claim 5, characterized in that The calculating the importance of the microservice node according to the dependency relationship between the microservice nodes and the initial importance includes: Determine an incoming edge set of the microservice node according to the dependency relationship between the microservice nodes, wherein the incoming edge set includes an outgoing edge node; Calculating the importance of the microservice node according to the outbound weight and initial importance of each outbound node; The calculation formula for the importance of the microservice node is: Wherein, PR(v) is the importance of the microservice node v, PR(u) is the initial importance of the outgoing node u, ω(u,v) is the outgoing edge weight corresponding to the edge (u,v) between the outgoing node u and the microservice node v, ω(u,k) is the outgoing edge weight corresponding to the edge (u,k) between the outgoing node u and the microservice node k, OUT(u) is the set of all outgoing edges of the outgoing node u, IN(v) is the set of incoming edges pointing to the microservice node v, and d is a random coefficient.
7. The method according to claim 1, characterized in that The observing the operation status of the parameter configuration of the key microservice node to determine the optimal parameters corresponding to the key microservice node includes: Obtaining current configuration parameters, inputting the current configuration parameters into the current policy network for mapping, and obtaining recommended configuration parameters; Modifying the configuration parameters of the key microservice node according to the recommended configuration parameters, and obtaining an optimization target obtained by running the key microservice node based on the modified configuration parameters; Determine whether the iteration stop condition is met. If so, determine the optimal parameters based on all the recommended configuration parameters and optimization objectives. If not, the current configuration parameters, the recommended configuration parameters and the optimization target are input into the value network for value calculation to obtain the expected value of return, and the current policy network is gradient updated according to the expected value of return; new current configuration parameters are obtained, and the updated current policy network is used as the new current policy network, and the step of inputting the current configuration parameters into the current policy network for mapping to obtain the recommended configuration parameters is returned.
8. The method according to claim 7, characterized in that Determining the optimal parameters based on all the recommended configuration parameters and optimization objectives includes: Comparing the optimization objectives and determining the optimal objective; The recommended configuration parameters corresponding to the optimal target are used as the optimal parameters.
9. A microservice configuration parameter optimization device, characterized in that: include: A node information acquisition module is used to obtain microservice node information and construct a knowledge graph based on the microservice node information; A key node determination module is used to sort the importance of the microservice nodes in the knowledge graph according to the dependency relationship between the microservice nodes and determine the key microservice nodes; The optimal parameter determination module is used to observe the operation status of the parameter configuration of each key microservice node and determine the optimal parameters corresponding to the key microservice node.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the microservice configuration parameter optimization method according to any one of claims 1 to 8.