Micro-service resource bottleneck positioning method

By analyzing the log and indicator information of the microservice runtime, combining the analysis and decision-making of the large language model, using reinforcement learning to determine the target Prompt format, accurately locate the bottleneck of microservice resource and schedule resources, the problem of insufficient resource management in the existing technology is solved, and precise control of resources and avoiding waste is achieved.

CN119782017AActive Publication Date: 2025-04-08ANHUI UNIV
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411828358.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-12
Publication Date
2025-04-08
Estimated Expiration
2044-12-12

AI Technical Summary

Technical Problem

The existing technology cannot accurately locate the specific reasons for the abnormal microservice resource, which leads to the granularity of resource management limited to the service layer, and the resources of various microservices cannot be accurately regulated, resulting in waste of resources.

Method used

By using the target Prompt format to parse the log information and indicator information of the microservice runtime, and analyze and decide on the analysis results of these information in combination with the large language model to find resource bottlenecks that affect the performance of microservices. The specific steps include the agent determining the target Prompt format through the reinforcement learning model, using the large language model to analyze logs and indicator information, obtaining information about specific resource items, and thus inferring resource bottlenecks.

Benefits of technology

It has achieved accurate positioning of the bottleneck of microservice resource, and can schedule resources in a targeted manner, avoid resource waste, and accurately regulate the resources of various microservices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782017A_ABST
    Figure CN119782017A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-service resource bottleneck positioning method based on reinforcement learning and a large language model, and relates to the field of software engineering micro-services. The method comprises the following steps: analyzing log information and index information during micro-service operation by utilizing a target Prompt format, performing analysis and decision on analysis results of the log information and the index information through a large language model, and finding out resource bottlenecks influencing micro-service performance. The log information and the index information are combined into the prompt format through the intelligent agent, the prompt format is transmitted to the large language model, the current task response time and the current task processing accuracy of the prompt format are obtained through decision processing of the large language model, information of specific resource items is obtained, and therefore resources are scheduled in a targeted mode, and the efficiency of resource scheduling is improved. If the CPU resource is not enough, the CPU resource is scheduled in a targeted manner instead of synchronously improving the scheduling of all the resources, so that the resource of each micro-service is accurately regulated and controlled, and the resource waste is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software engineering microservices, and in particular to a method for locating microservice resource bottlenecks. Background Art

[0002] The microservice architecture splits large monolithic applications into multiple independent services that communicate through lightweight mechanisms. Each microservice focuses on a certain business function and can be independently developed, deployed, and iterated. These microservices communicate with each other through HTTP or RPC protocols, but due to the unpredictability of external loads and the complex interactions between microservices, cloud providers will provide microservices with too many resources (such as CPU cores and memory capacity) to ensure service reliability, which usually results in a waste of resources.

[0003] At present, the solution to resource waste is to find the root cause of microservice end-to-end performance anomalies from the call chain and indicator data of the microservice runtime, and then adjust the resource parameters of the service through the optimization algorithm. However, the resource management granularity of this method is only at the service layer, that is, it can only locate resource anomalies at the service level, but cannot find out whether the service is short of CPU resources or memory resources. At this time, in order to solve the problem, the processor will increase the allocation of all related resources of the service, so that some already sufficient resources are also increased, resulting in the inability to accurately regulate the resources of each microservice, resulting in resource waste.

[0004] There is currently no effective solution to the problem that existing service solutions cannot accurately locate the cause of resource anomalies. Summary of the invention

[0005] The present invention provides a microservice resource bottleneck locating method to solve the problem that existing service solutions cannot accurately locate the cause of resource anomalies.

[0006] The present invention provides a method for locating a microservice resource bottleneck, the method comprising:

[0007] Use the target prompt format to parse the log information and indicator information of the microservice runtime, and use the large language model to analyze and make decisions on the parsed results of the log information and indicator information to find the resource bottleneck that affects the performance of the microservice;

[0008] The target prompt format is determined by a reinforcement learning model. The reinforcement learning model includes an agent, a state, an action, a reward, and a strategy. The state includes the current task response time of the large language model, the current task processing accuracy, and the current prompt format. The action includes updating the current prompt format according to the current strategy. The steps for determining the target prompt format include:

[0009] The S100 agent sends the current Prompt format to the large language model;

[0010] S200 determines that the large language model is based on the current task response time and the current task processing accuracy in the current prompt format, and calculates the current reward through the reward function, and the reward function is:

[0011] r t =λ1*ResTScore t +λ2*PrefScore t

[0012] Among them, r t is the current reward, λ1 is the weight of the resource consumption score, and λ2 is the weight of the delay change score;

[0013] ResTScore t PrefScore is the resource consumption score of the large language model at time t, which is determined according to the current task response time of the large language model. t is the delay change score of the large language model at time t, which is determined according to the current task processing accuracy of the large language model.

[0014] The S300 agent updates the current strategy with the current state and current reward, and the agent updates the current prompt format according to the updated current strategy;

[0015] S400 loops through the actions of S100, S200, and S300 until the maximum cumulative reward appears, and takes the Prompt format corresponding to the last non-zero reward as the target Prompt format;

[0016] The function for accumulating rewards is:

[0017]

[0018] Among them, γ∈(0,1] represents the discount factor and E is the mathematical expectation.

[0019] Furthermore, the grammatical format is defined as B n (A1,…,A n ,c)=A1cA2c…cA n ;

[0020] Among them B n (A1,…,A n ,c) represents the whole sentence of Prompt, c represents the separator between fields, and the basic field is A(d,s,t), where d represents the first symbol, s represents the second symbol, and t represents text data;

[0021] Different prompt formats have different first and second symbols.

[0022] Furthermore, the first symbol is a descriptor.

[0023] Furthermore, the second symbol is a separator.

[0024] Furthermore, the ResTScore t is defined as

[0025] Among them, ResT t is the current task response time of the large language model at time t, ResTScore t Determined based on the current task response time of the large language model.

[0026] Furthermore, the PerfScore t is defined as

[0027] Among them, Acc t is the current task processing accuracy of the large language model at time t, PerfSocre t Determined by the current task processing accuracy of the large language model.

[0028] Furthermore, the agent updates the current strategy with the current state and current reward, including:

[0029] Based on the actor-critic network architecture, the objective function L is maximized. CLIP (θ) is used to update the current policy.

[0030] Furthermore, the maximization objective function L CLIP (θ) is defined as:

[0031] L CLIP (θ)=E[min(α t (θ)A t, clip(α t (θ),1-∈,1+∈)A t )];

[0032] Among them, ∈ represents the clipping parameter and At represents the advantage function at time step t.

[0033] Furthermore, the α t (θ) is defined as

[0034] Among them, α t (θ) represents the probability ratio of the new and old strategies.

[0035] The present invention provides a microservice resource bottleneck location method, which has the following beneficial effects:

[0036] 1. The present invention combines log information and indicator information into a prompt format through an intelligent agent, and transmits the prompt format to a large language model. Through the decision of the large language model, the information of specific resource items is obtained to infer resource bottlenecks, so as to schedule resources in a targeted manner. For example, if it is concluded that the CPU resources are insufficient, the CPU resources will be scheduled in a targeted manner, rather than simultaneously improving the scheduling of all resources, so as to accurately regulate the resources of various microservices and avoid resource waste. The details of one or more embodiments of the present application are presented in the following drawings and descriptions to make other features, purposes and advantages of the present application more concise and easy to understand. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 It is a schematic diagram of the resource bottleneck location architecture;

[0038] Figure 2 It is a flowchart of reinforcement learning optimization prompt;

[0039] Figure 3 It is a flowchart of Prompt root cause location. DETAILED DESCRIPTION

[0040] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0041] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0042] It should be noted that Prompt means prompt engineering, LLM means large language model. The prompt format means a whole sentence composed of a prompt field combination. The current prompt format means a whole sentence composed of a specific prompt field combination.

[0043] See also Figures 1 to 3 In the present invention, a method for locating a microservice resource bottleneck is provided, and the method comprises step S000:

[0044] Step S000 uses the target prompt format to parse the log information and indicator information of the microservice runtime, analyzes and makes decisions on the parsed results of the log information and indicator information through a large language model, and finds the key resource bottlenecks that affect the performance of the microservice.

[0045] It should be noted that for the text input into LLM, a grammar needs to be defined to express the specific prompt format. The prompt format is for example {Question: <text>|Answer: <text>}. Among them, Question and Answer are descriptors, colon is a separator, and vertical bar is a segmentation character. And both descriptors and separators can be replaced with other symbols or empty symbols. Since the large language model is very sensitive to the Prompt format, different Prompt formats will affect the accuracy of the large language model in task processing. Therefore, finding the Prompt format that best suits the large language model (i.e., the target Prompt format in step S000) is the key for the large language model to find the resource bottleneck that affects the performance of microservices.

[0046] In some embodiments, a complete corpus is B n (A1,…,A n ,c)=A1cA2c…cA n .

[0047] Among them B n (A1,…,A n ,c) represents the whole sentence of Prompt, c represents the separator between fields, and the basic field is A(d,s,t), where d represents the first symbol, s represents the second symbol, and t represents text data.

[0048] Different prompt formats have different first and second symbols.

[0049] The first symbol can be a descriptor or a blank character. The second symbol can be a separator or a blank character.

[0050] Specifically, each group A i cA j are all fragments of question-answer corpus, and c is used to split fields. i is the input problem description, and A j It is the result of answering based on the description. For example, if the input question is {[2023-10-05 14:23:45]ERROR:Out of Memory Error-Unable to allocate additional memory.}, the large language model can analyze it to know that this log describes that the microservice has a performance abnormality due to insufficient memory at a certain moment. Then the large language model can answer the question based on this question: {increase memory}, and solve the problem by increasing memory. Multiple sets of question and answer corpus fragments are provided to the large language model, and finally, through its powerful analysis ability, the answer to the last question is given, that is, A n The output result is:

[0051] For example, in some microservices, there are not many memory-related logs, so LLM may not be able to give accurate results. However, in the indicator-related data, it can be clearly found that the memory usage rate is high, or the memory fragmentation rate is high, which indicates that the memory resources are insufficient and the memory should be increased. There is no need to design and train a model here. You can complete the task by letting LLM understand the meaning of the input text based on the prompt.

[0052] The target prompt format is determined by a reinforcement learning model. The reinforcement learning model includes an agent, a state, an action, a reward, and a strategy. The state (environment) includes the current task response time of the large language model, the current task processing accuracy, and the current prompt format. The action includes updating the current prompt format according to the current strategy. The steps for determining the target prompt format include S100, S200, and S300:

[0053] The S100 agent sends the current Prompt format to the large language model.

[0054] S200 determines that the large language model is based on the current task response time and the current task processing accuracy in the current prompt format, and calculates the current reward through the reward function, and the reward function is:

[0055] r t =λ1*ResTScore t +λ2*PrefScore t

[0056] Among them, r t is the current reward, λ1 is the weight of the resource consumption score, and λ2 is the weight of the delay change score.

[0057] ResTScore t is defined as

[0058] Among them, ResT t is the current task response time of the large language model at time t, ResTScore t Determined based on the current task response time of the large language model.

[0059] PerfScore t is defined as

[0060] Among them, Acc t is the current task processing accuracy of the large language model at time t, PerfSocre t Determined based on the current task processing accuracy of the large language model. Substitute the current task response time and the current task processing accuracy into the resource consumption score function and the delay change score function respectively, and substitute the obtained data into the reward function to get the reward score corresponding to the current prompt format.

[0061] The S300 agent updates the current strategy with the current state and current reward points, and the agent updates the current Prompt format based on the updated current strategy.

[0062] Among them, the agent updates the current strategy with the current state and current reward, including:

[0063] Based on the actor-critic network architecture, the objective function L is maximized. CLIP (θ) is used to update the current policy.

[0064] The optimization process of Prompt is performed using the reinforcement learning PPO algorithm. PPO is an online policy optimization algorithm based on the actor-critic network architecture. Here, the critic network refers to the state-value equation used to evaluate the current policy, while the actor network updates the policy according to the recommendations of the critic network. Specifically, the reward score r t Substitute the state value function V ω (s), we can get the expected reward that can be obtained by following the current strategy in a given state s, and update the parameters by minimizing the loss function.

[0065] V ω (s)=E[R(s t ,a t )+γV ω (s t+1 )|s t =s]

[0066] Advantage function A t Measuring the expected reward advantage of taking an action in a given state compared to the average action, which helps the policy network understand which actions are more likely to lead to higher rewards, thereby guiding the policy to improve towards these actions. In order to measure the difference between the actual reward obtained and the current estimated state value, the residual function is defined as:

[0067] δ t =r t +γ*V ω (s t+1 )-V ω (s t )

[0068] Substitute the expected return into the residual function δ t Get bonus points r t The difference between expected return and expected return.

[0069] Then we can transform the residual function δ t Substitute into the advantage function A t , we can use Generalised Advantage Estimation (GAE) to calculate the advantage of the strategy at time step t:

[0070]

[0071] where k represents the offset from time step t and λ∈[0,1] is a hyperparameter used to balance bias and variance.

[0072] Finally, the advantage function A t Substitute into the maximized objective function L CLIP (θ), when maximizing the objective function L CLIP When the value of (θ) is the largest, it means that this strategy is the better strategy.

[0073] Maximize the objective function L CLIP (θ) is defined as:

[0074] L CLIP (θ)=E[min(α t (θ)A t ,clip(α t (θ),1-∈,1+∈)A t )].

[0075] Among them, ∈ represents the clipping parameter and At represents the advantage function at time step t.

[0076] α t (θ) is defined as

[0077] Among them, α t (θ) represents the probability ratio of the new and old strategies.

[0078] S400 executes the actions of S100, S200 and S300 in a loop until the maximum cumulative reward appears, and takes the Prompt format corresponding to the last non-zero reward as the target Prompt format.

[0079] The function for accumulating rewards is:

[0080]

[0081] Among them, γ∈(0,1] represents the discount factor and E is the mathematical expectation.

[0082] The current reward can be calculated based on the resource consumption score and the delay change score. The principle is that the current prompt format is better than the previous prompt format, so the current reward is a positive value greater than zero. Therefore, when the cumulative reward is at the maximum value, it proves that the current reward of the subsequent prompt format is not greater than zero compared to the current prompt format, that is, it is not better than the current prompt format, so it can be concluded that the current prompt format is the optimal prompt format, that is, the target prompt format.

[0083] The present invention combines log information and indicator information into a prompt format through an intelligent agent, and transmits the prompt format to a large language model. Through decision processing by the large language model, the information of specific resource items is obtained to infer resource bottlenecks, thereby scheduling resources in a targeted manner. For example, if it is concluded that CPU resources are insufficient, CPU resources will be scheduled in a targeted manner instead of simultaneously improving the scheduling of all resources, thereby achieving precise regulation of resources of various microservices and avoiding resource waste.

[0084] See also Figure 2 In the Markov decision process, the agent combines the prompt fields in the prompt space (prompt engineering space) according to the initial strategy to form a certain prompt format. The agent transmits the prompt format to the large language model for processing to obtain the current task response time and the current task processing accuracy. The current task response time and the current task processing accuracy data are filled into the reward function to obtain the reward score r t , the reward score r t Substitute the state value function V ω (s), we can get the expected return that can be obtained by following the current strategy in a given state s, and substitute the expected return into the residual function δ t Get bonus points r t The difference between the expected return and the residual function δ t Substitute into the advantage function A t We can use Generalised Advantage Estimation (GAE) to calculate the advantage of the strategy at time step t, and finally convert the advantage function A t Substitute into the maximized objective function L CLIP (θ), when maximizing the objective function L CLIP When the value of (θ) is the largest, it means that this strategy is the better strategy.

[0085] Among them, the initial strategy is a random data, which is randomly selected by the agent.

[0086] In addition, a microservice resource allocation method is provided, including:

[0087] Determine the resource bottlenecks that affect microservice performance through the microservice resource bottleneck location method;

[0088] Determine whether there is a target resource item that has reached a resource bottleneck. If so, allocate resources corresponding to the target resource item to the microservice.

[0089] As described above, at least one embodiment of each part of the microservice resource bottleneck location method provided by the present invention has been described. It should be noted that each part of the microservice resource bottleneck location method can be combined using different embodiments to form different embodiments of the microservice resource bottleneck location method.

[0090] For example, in a specific overall embodiment, the microservice resource bottleneck location method is divided into two stages:

[0091] In the first stage, we first use reinforcement learning to explore the impact of different prompt formats on the accuracy of LLM processing tasks and find the optimal prompt (target prompt format). The second stage is to use the optimal prompt to parse the microservice runtime log and indicator information, and by analyzing these two source data, find the key resource bottlenecks that affect the performance of microservices.

[0092] 1Stage 1 Prompt format optimization based on reinforcement learning

[0093] 1.1Prompt format and definition

[0094] For the text input into LLM, we define a grammar to express the specific prompt format. <text>|Answer: <text>For example, before asking LLM questions, we need to provide certain corpus data as the premise of LLM understanding task. Each corpus contains (descriptor, separator, data text, segmentation, descriptor, separator, data text). Before the separator is the information we provide, also called input, and after the separator is the answer given based on this information, also called output. LLM completes the task by analyzing the given expected input and output understanding task, and then generating output for the final input.

[0095] LLM is sensitive to the format of the prompt. Any change to any character in it will affect the result. Therefore, we abstract the above expectations. We define a basic field as A(d,s,t), where d represents the descriptor, s represents the separator, and t represents the text data. A complete corpus is defined as B n (A1,…,A n ,c) where c represents the separator between fields, i.e. the end of the previous field. Therefore, our input can be expressed as:

[0096] B n (A1,…,A n ,c)=A1cA2c…cA n

[0097] In the Prompt field, except for the data field which is fixed, other descriptors, separators, etc. can be replaced with other symbols, and even the original characters can be replaced with blank characters. Therefore, we can generate multiple Prompt combinations to test the processing accuracy of LLM for tasks.

[0098] Specifically, each group A i cA j A is a question-and-answer prediction, and c is used to separate fields. The former is the input question description, and the latter is the answer based on the description. Let's take an error log when the microservice is running as an example: {[2023-10-05 14:23:45]ERROR:Out of Memory Error-Unable to allocate additionalmemory.}. This log describes that the microservice has a performance abnormality due to insufficient memory at a certain moment. We will use this log as A i input, then A j The output should be {increase memory}. We provide similar multiple sets of questions and answers to LLM, and finally, through its powerful analytical ability, it gives the answer to the last question, namely A n The output result is:

[0099] It can be found that this way of inputting question-answer corpus is similar to using deep learning technology to calculate the model, but LLM's calculation and analysis speed is faster. We do not need to manually design the model and train it, and we can use deep model technology to complete the task. However, the difficulty of LLM lies in how to choose the right prompt to ensure the accuracy of the task.

[0100] 1.2 Prompt selection based on reinforcement learning

[0101] Different prompts will make LLM's task processing performance different. Therefore, there is a mapping relationship. The task processing performance will change with the choice of prompt. Therefore, we need an optimization algorithm to explore the prompt format space and select the optimal prompt format.

[0102] Reinforcement learning formalizes the decision-making task as a Markov decision process. At any discrete time step t, the reinforcement learning agent will make a decision based on the observed environment state s. t ∈S, and based on the current strategy π θ (parameterized as θ) given an action a t ∈A. At the next time step s t+1 , the agent will observe a new state s t+1 , and through the given reward function R(s t ,a t ) gets an immediate reward r t Here we call the tuple (s t ,a t ,r t ,s t+1 ) is a transition and will be stored in the replay buffer for model update. The agent's goal is to optimize the strategy to maximize the expected cumulative reward J in the decision-making process. R (π):

[0103]

[0104] where γ∈(0,1] represents the discount factor. For our Prompt format exploration problem, we will make specific definitions of these state actions.

[0105] Status:s t Indicates the status indicators of the current LLM processing task, such as response speed, task processing accuracy, and prompt format.

[0106] Action: a t Indicates the behavior of selecting a format in the Prompt space. It represents an array, where each value in the array represents a replaceable character in the Prompt field. Therefore, the policy determines a Prompt format by giving a set of action arrays.

[0107] Reward: r t It represents the gain from changing from the old state to the new state after executing the action. We hope to make LLM more responsive and accurate by changing the action, so the reward design can be divided into two parts.

[0108] In terms of response speed, the LLM task response time ResT of two adjacent time steps can be used t The ratio of quantifies the change in speed. We define ResTScore t Score the resource consumption at time step t:

[0109]

[0110] Similarly, the task processing accuracy at time step t is Acc t ,We can also calculate the latency variation score PerfScore in a similar way t :

[0111]

[0112] Finally, the reward function can be expressed as:

[0113] r t =λ1*ResTScore t +λ2*PrefScore t

[0114] Furthermore, we use the reinforcement learning PPO algorithm to perform the optimization process of Prompt. PPO is an online policy optimization algorithm based on the actor-critic network architecture. Here, the critic network refers to the state-value equation, which is used to evaluate the current policy, while the actor network updates the policy according to the recommendations of the critic network. Specifically, the state-value function V ω (s) is defined as the expected reward that can be obtained by following the current policy in a given state s and can be obtained by minimizing the loss function Update the parameters.

[0115] V ω (s)=E[R(s t ,a t )+γV ω (s t+1 )|s t =s]

[0116] The advantage function measures the expected return advantage of taking an action in a given state compared to the average action, which helps the policy network understand which actions are more likely to lead to higher rewards, thereby guiding the policy to improve towards these actions. In order to measure the difference between the actual reward obtained and the current estimated state value, the Temporal Difference (TD) residual is defined as:

[0117] δ t =r t +γ*V ω (s t+1 )-V ω (s t )

[0118] We can then use Generalised Advantage Estimation (GAE) to calculate the advantage at time step t:

[0119]

[0120] Where k represents the offset from time step t, and λ∈[0,1] is a hyperparameter used to balance bias and variance. At the same time, the actor network can maximize the objective function L CLIP (θ) to update the strategy:

[0121] L CLIP (θ)=E[min(α t (θ)A t ,clip(α t (θ),1-∈,1+∈)A t )]

[0122] in represents the probability ratio of the new and old strategies, and ∈ represents the clipping parameter, which controls the distance between the new strategy and the old strategy, which can limit the update amplitude and make the training more stable.

[0123] 2Stage 2Root cause location based on the optimal prompt

[0124] 2.1Prompt locates resource bottlenecks

[0125] First, we categorize and label the runtime data anomalies of microservices, such as insufficient CPU, insufficient memory, insufficient network bandwidth, insufficient storage space, etc. Each type of input data can have multiple labels. We input the pre-processed corpus data into LLM for analysis, and then collect new log and indicator data during the operation of microservices, input them into LLM, and then give the results of resource positioning.

[0126] However, the operation data of microservices is scattered and multi-dimensional, and often requires simultaneous analysis of logs and indicator data to locate. Therefore, LLM's analysis of logs may not be able to directly infer the results, but there is the possibility of indirect secondary inference. That is, after LLM gives the results of logs, the final results of the two data sources can be unified by analyzing LLM's results of indicator data.

[0127] For example, in some microservices, there are not many memory-related logs, so LLM may not be able to give accurate results. However, in the indicator-related data, it can be clearly found that the memory usage rate is high, or the memory fragmentation rate is high, which indicates that the memory resources are insufficient and the relevant resources should be increased. Executing tasks from the perspective of multi-source data analysis is somewhat similar to multimodal technology. However, there is no need to design and train a model here. As long as LLM understands the meaning of the input text based on Prompt, the task can be completed.

[0128] 2.2 Microservice Resource Allocation and Performance Recovery

[0129] Once the key resource bottleneck is located, performance recovery can be achieved by adjusting the resource parameters of the microservice. The resource bottleneck here can be located in a more fine-grained manner to determine the specific type of resource shortage, such as insufficient memory, insufficient disk space, insufficient CPU processing power, etc.

[0130] In addition to using Bayesian optimization or reinforcement learning to explore resources, we can also use LLM to make recommendations on how much resources to add.

[0131] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0132] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.< / text> < / text> < / text> < / text>

Claims

1. A method for locating microservice resource bottlenecks, characterized in that: The method comprises: Use the target prompt format to parse the log information and indicator information of the microservice runtime, and use the large language model to analyze and make decisions on the parsed results of the log information and indicator information to find the resource bottleneck that affects the performance of the microservice; The target prompt format is determined by a reinforcement learning model. The reinforcement learning model includes an agent, a state, an action, a reward, and a strategy. The state includes the current task response time of the large language model, the current task processing accuracy, and the current prompt format. The action includes updating the current prompt format according to the current strategy. The steps for determining the target prompt format include: The S100 agent sends the current Prompt format to the large language model; S200 determines that the large language model is based on the current task response time and the current task processing accuracy in the current prompt format, and calculates the current reward through the reward function, and the reward function is: r t =λ1*ResTScore t +λ2*PrefScore t Among them, r t is the current reward, λ1 is the weight of the resource consumption score, and λ2 is the weight of the delay change score; ResTScore t PrefScore is the resource consumption score of the large language model at time t, which is determined according to the current task response time of the large language model. t is the delay change score of the large language model at time t, which is determined according to the current task processing accuracy of the large language model. The S300 agent updates the current strategy with the current state and current reward, and the agent updates the current prompt format according to the updated current strategy; S400 loops through the actions of S100, S200, and S300 until the maximum cumulative reward appears, and takes the Prompt format corresponding to the last non-zero reward as the target Prompt format; The function for accumulating rewards is: Among them, γ∈(0,1] represents the discount factor and E is the mathematical expectation.

2. The microservice resource bottleneck location method according to claim 1, characterized in that: The syntax format is defined as B n (A1,…,A n ,c)=A1cA2c…cA n ; Among them B n (A1,…,A n ,c) represents the whole sentence of Prompt, c represents the separator between fields, and the basic field is A(d,s,t), where d represents the first symbol, s represents the second symbol, and t represents text data; Different prompt formats have different first and second symbols.

3. The microservice resource bottleneck location method according to claim 2, characterized in that: The first symbol is a descriptor.

4. The microservice resource bottleneck location method according to claim 2, characterized in that: The second symbol is a separator.

5. The microservice resource bottleneck location method according to claim 1, characterized in that: The ResTScore t is defined as Among them, ResT t is the current task response time of the large language model at time t, ResTScore t Determined based on the current task response time of the large language model.

6. The microservice resource bottleneck location method according to claim 1, characterized in that: The PerfScore t is defined as Among them, Acc t is the current task processing accuracy of the large language model at time t, PerfSocre t Determined by the current task processing accuracy of the large language model.

7. The microservice resource bottleneck location method according to claim 1, characterized in that: The agent updates the current strategy with the current state and current reward, including: Based on the actor-critic network architecture, the objective function L is maximized. CLIP (θ) is used to update the current policy.

8. The microservice resource bottleneck location method according to claim 7, characterized in that: The maximized objective function L CLIP (θ) is defined as: L CLIP (θ)=E[min(α t (i)A t ,clip(a t (θ),1-∈,1+∈)A t )]; Among them, ∈ represents the clipping parameter and At represents the advantage function at time step t.

9. The microservice resource bottleneck location method according to claim 8, characterized in that: The α t (θ) is defined as Among them, α t (θ) represents the probability ratio of the new and old strategies.

10. A microservice resource allocation method, characterized in that: include: Determine various resource bottlenecks that affect microservice performance by using the microservice resource bottleneck locating method described in any one of claims 1 to 9; It is determined whether there is a target resource item that reaches a resource bottleneck. If so, resources corresponding to the target resource item are allocated to the microservice.

Citation Information

Patent Citations

  • Micro-service resource scheduling method and system

    CN111158895A

  • Performance-aware large-scale micro-service intelligent multi-resource cooperative scheduling method and system

    CN115037749A

  • Heterogeneous multi-edge cloud collaborative micro-service deployment and routing joint optimization method and system

    CN116915686A

  • Resource dynamic scheduling technology of distributed cloud computing system

    CN117762644A

  • Micro-service fault diagnosis method and device based on large language model and electronic equipment

    CN117891640A