A microservice response time prediction method and system based on graph neural network
Through the microservice response time prediction model based on graph neural network, the problem of microservice system performance optimization is solved, effective support for resource scheduling and expansion is achieved, and the overall performance and stability of the system are improved.
Patent Information
- Application Number
- CN202111297775.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-04
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2041-11-04
AI Technical Summary
In the complex distributed computing environment of microservice deployment, existing technologies find it difficult to effectively optimize system performance, resulting in improper resource scheduling and expansion, and failure to improve overall performance.
By establishing a microservice response time prediction model based on graph neural network, the operation data of microservices is trained using graph neural network to predict the response time in future time periods, and resource scheduling and expansion are performed based on this model.
It achieves overall performance optimization of the microservice system, provides model support for resource scheduling and expansion, avoids frequent intermittent expansion, and improves the stability and efficiency of the system.
Smart Images

Figure CN114020326B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of software application development, and in particular to a microservice response time prediction method and system based on graph neural networks. Background Art
[0002] Microservices are becoming a widely adopted and popular technology in software application development. Microservices decompose software functionality into multiple autonomous service entities, enabling flexible deployment and scalability to meet the needs of increasingly complex business applications. Combining cloud platforms with lightweight container technology, supported by runtime application management, enables performance monitoring of specific microservices and horizontal resource scaling, achieving refined management of the overall performance of software systems.
[0003] On the other hand, due to the independent deployment of microservices, the system has a complex service call chain. Under different external loads and resource configurations, system performance varies significantly, posing a challenge to optimizing overall system performance. For example, if a microservice is detected as a performance bottleneck, expanding its service resources may cause another microservice in its call chain to become a new performance bottleneck, resulting in a failure to improve overall system performance. Therefore, in the complex distributed computing environment of microservice deployment, a performance modeling approach is needed that aims to optimize the entire system (specifically, a software system composed of multiple microservices) to provide model support for resource scheduling and resource expansion in microservice systems. Summary of the Invention
[0004] The embodiments of the present invention provide a microservice response time prediction method and system based on graph neural networks. Through a pre-established microservice response time prediction model, it can take the overall system performance as the modeling target and can be applied to the service capability expansion of microservices.
[0005] In a first aspect, an embodiment of the present invention provides a microservice response time prediction method based on a graph neural network, comprising:
[0006] Run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, number of deployed containers, service request response time, and call relationship diagrams between microservices.
[0007] The operation data is input into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0008] Before making a prediction, the graph neural network is trained, specifically including:
[0009] Configure at least one container template for each microservice of the software system to be modeled, and configure operating resources and an operating environment for the container template based on the operating environment requirements of the microservice;
[0010] Generate a preset external access load, load it to the software system to be modeled, perform a test within a set period, and record the operating data of each microservice in the software system to be modeled to generate a training data set; the operating data also includes the microservice ID, recording time, service response time, container template resource configuration information, and container quantity information; the container template resource configuration information includes CPU, memory, and network bandwidth;
[0011] Build a graph neural network, treat each microservice as a node in the graph neural network, and set a state value h for each microservice i i ;
[0012] Obtain the state value after R rounds of iteration based on the iterative method Define a feedforward fully connected neural network to transform the state value of microservice i after R rounds of iteration Substitute into the fully connected neural network and get the output value O i ; Determine a loss function, and perform graph neural network training based on the loss function and the training data set to obtain a response time prediction model for the microservice.
[0013] As an example, the operating resources include the computing power CPU i , memory capacity MEM i and network bandwidth BAND i .
[0014] Preferably, after generating the training data set, the method further includes:
[0015] Check whether the response time of each microservice violates the service level agreement, which is a pre-set response time threshold;
[0016] If the response time of any microservice does not violate the service level agreement, the preset external access load is linearly increased based on the preset ratio;
[0017] If any microservice is found to violate the service level agreement, the service resources of one container template will be expanded for each microservice that violates the service level agreement;
[0018] If the external access load reaches T times the maximum access load of the software system to be modeled, the test is terminated.
[0019] During the operation, the operation data of each microservice in the software system to be modeled is continuously recorded to generate a training data set.
[0020] Preferably, the initial state of the microservice i is Initial state The initialization method is:
[0021] Convert the number of service requests, container template CPU metrics, memory metrics, network bandwidth metrics, and the number of deployed containers into binary bit strings, concatenate the binary bit strings and add 0 at the end, and assign the resulting d-dimensional vector to
[0022] As a preferred method, the state value after R rounds of iteration is obtained based on the iterative method. Specifically include:
[0023] On the call relationship graph between microservices, collect nodes from the neighboring nodes of node i with probability p to form the neighbor node set N(i). If N(i) is empty, re-collect until N(i) contains at least one node;
[0024] Take the weighted average of the current round status of each node in the neighbor node set and get
[0025]
[0026] In the above formula, j = 1, 2, ..., R, represents the jth iteration; S i v is the trainable weight coefficient;
[0027] calculate Value:
[0028]
[0029] In the above formula, Represents the concatenation of two state vectors, W (j) is the trainable weight coefficient matrix, b (j) is the bias vector;
[0030] Will Do normalization:
[0031]
[0032] Preferably, the loss function is:
[0033] LOSS=∑ i∈X ||O i -Y i ||+L reg
[0034] In the above formula, X is the set of nodes in the entire network, that is, the set of all microservices in the software system; Y iL is the service response time label value of microservice i; reg is the L2 regularization term.
[0035] In a second aspect, an embodiment of the present invention provides a microservice response time prediction system based on a graph neural network, comprising:
[0036] The acquisition module is used to run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, the number of deployed containers, service request response time, and the call relationship diagram between microservices;
[0037] The prediction module is used to input the operating data into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0038] In a third aspect, an embodiment of the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the microservice response time prediction method based on graph neural network as described in the embodiment of the first aspect of the present invention are implemented.
[0039] In a fourth aspect, an embodiment of the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the microservice response time prediction method based on graph neural network as described in the embodiment of the first aspect of the present invention are implemented.
[0040] The embodiment of the present invention provides a microservice response time prediction method and system based on a graph neural network, which establishes a response time prediction model. In order to collect and train the network model, it is necessary to deploy the entire software system, test it, and record its data. The system is tested under different external load conditions and different resource deployment states, and the number of service requests, service response time, resource configuration information (including CPU, memory, network bandwidth, etc.) of the deployed microservices are recorded. The collected data is used as a training data set; the number of service requests, container template information, number of deployed containers, and call relationship graphs between microservices in the software system are used as input; the response time of each microservice in the future period S is used as output to train the model, and finally a response time prediction model for the microservice is obtained, which can provide support for resource scheduling and service resource expansion of the microservice system to optimize the overall performance of the software system. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 This is a flowchart of a method for predicting microservice response time based on a graph neural network according to an embodiment of the present invention;
[0043] Figure 2 Schematic diagram of the physical structure according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of 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. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0045] In the embodiments of the present application, the term "and / or" is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B may represent three situations: A exists alone, A and B exist at the same time, and B exists alone.
[0046] The terms "first" and "second" in the embodiments of the present application are only used for descriptive purposes and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present application, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a system, product or device comprising a series of components or units is not limited to the listed components or units, but may optionally also include components or units that are not listed, or may optionally also include other components or units that are inherent to these products or devices. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0047] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of such phrases in various locations in the specification does not necessarily refer to the same embodiment, nor does it necessarily refer to independent or alternative embodiments that are mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments. The following description and introduction will be expanded upon multiple embodiments.
[0048] Figure 1 The present invention provides a method for predicting microservice response time based on a graph neural network, including:
[0049] Run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, the number of deployed containers, service request response time, and the call relationship diagram between each microservice;
[0050] The operation data is input into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0051] Specifically, before predicting response time, it is necessary to first collect training data, build a neural network, and train it. To collect and train the network model, the entire software system must be deployed, tested, and its data recorded. Specifically, the system is tested under different external load conditions and resource deployment states. For each deployed microservice, the number of service requests, service response time, and resource configuration information (including metrics such as CPU, memory, and network bandwidth) are recorded. This collected data serves as the training dataset, and a prediction model for microservice response time is established through training.
[0052] Configure at least one container template for each microservice of the software system to be modeled, and configure the operating resources and operating environment for the container template based on the operating environment requirements of the microservice; first obtain the deployment code and data of the software system, as well as the relevant operating configuration instructions; prepare M container templates for each of the M microservice modules in the system; determine the resource configuration of the container template i according to the actual situation of the microservice, including the computing power CPU i , memory capacity MEM i and network bandwidth BAND i. In addition to running resources, the container template also needs to install the running environment that the microservice depends on. In order to simplify the performance modeling process, it is assumed that microservices are expanded based on container templates when expanding resources. In other words, for microservice i, the system provides it with n resources of container template i (n is an integer and ≥1). Assume that the microservice framework uses the Ribbon load balancing strategy. Secondly, determine the response time threshold of user requests, that is, the service quality level promised by the software system.
[0053] Generate a preset external access load. First, deploy the system according to the scale of deploying one container template for each microservice, and generate a smaller external access load L.
[0054] The generated external access load is loaded onto the software system to be modeled, and a test is performed within a set period (time S). The operating data of each microservice in the software system to be modeled is recorded to generate a training data set; the operating data also includes the microservice ID, recording time, service response time, container template resource configuration information, and container quantity information; the container template resource configuration information includes CPU, memory, and network bandwidth; and the response time of each microservice is checked to see if it violates the service level agreement, which is a pre-set response time threshold.
[0055] If the response time of any microservice does not violate the service level agreement, the external access load is linearly increased based on the preset ratio; specifically, the original access load is increased by 1 / K each time; and the generated external access load is loaded back onto the software system to be modeled and tested within the set period (time S);
[0056] If any microservice is found to violate the service level agreement, the service resources of one container template will be expanded for each microservice that violates the service level agreement. If the response time of multiple microservices is found to violate the service level agreement, the resources of multiple microservices will be expanded at the same time, and each microservice will expand the service resources of one corresponding container template. The generated external access load will be loaded onto the software system to be modeled and tested within the set period (time S).
[0057] If the external access load reaches T times the maximum access load of the software system to be modeled, the test is terminated. During the operation, the operation data of each microservice in the software system to be modeled is continuously recorded to generate a training data set.
[0058] This embodiment of the present invention proposes using a graph neural network to build a microservice response time prediction model. Specifically, the model's input is the number of service requests for all microservices in the software system, container template information, the number of deployed containers, and a call relationship graph between each microservice. The model's output is the predicted response time for each microservice over a future time period S.
[0059] Build a graph neural network, treat each microservice as a node in the graph neural network, and set a state value h for each microservice i i ; The initial state of the microservice i is Initial state The initialization method is: convert the number of service requests, container template CPU metrics, memory metrics, network bandwidth metrics and the number of deployed containers into binary bit strings, concatenate the binary bit strings and add 0 at the end, and assign the resulting d-dimensional vector to
[0060] In the jth iteration (j=1, 2, ..., R), the state of microservice (node) i is calculated by the following process:
[0061] On the call relationship graph between each microservice, collect nodes from the neighboring nodes of node i with probability p to form the neighbor node set N(i). If N(i) is empty, re-collect until N(i) contains at least one node;
[0062] Take the weighted average of the current round status of each node in the neighbor node set and get
[0063]
[0064] In the above formula, j = 1, 2, ..., R, represents the jth iteration; S i v is the trainable weight coefficient;
[0065] calculate Value:
[0066]
[0067] In the above formula, Represents the concatenation of two state vectors, W (j) is the trainable weight coefficient matrix, b (j) is the bias vector;
[0068] Will Do normalization:
[0069]
[0070] Obtain the state value after R rounds of iteration based on the iterative method Define a feedforward fully connected neural network to transform the state value of microservice i after R rounds of iteration Substitute into the network and get the output value F stands for feed-forward fully connected neural network.
[0071] A loss function is determined, and a graph neural network is trained based on the loss function and the training data set to obtain a response time prediction model for the microservice.
[0072] The loss function is calculated as:
[0073] LOSS=∑ i∈X ||O i -Y i ||+L reg
[0074] In the above formula, X is the set of nodes in the entire network, that is, the set of all microservices in the software system; Y i L is the service response time label value of microservice i; reg is the L2 regularization term.
[0075] Using the data set recorded in the previous performance testing phase, the model is trained using the gradient descent algorithm to ultimately obtain a microservice response time prediction model.
[0076] In a software system deployed as microservices, specific microservices can be independently deployed, performance monitored, and resources scaled. During resource scaling, the aforementioned microservice response time prediction model can be used to guide the resource expansion process. Specifically, this can be applied in the following ways:
[0077] 1. Resource expansion: When the response time of a certain microservice violates the service level agreement, its resources need to be expanded. In order to simplify the expansion process, the present invention assumes that the expansion process is expanded based on the container template of the microservice, that is, each time according to the original container template, one or more container instances are deployed, and the Ribbon load balancing strategy is used. When expanding, it is necessary to determine the number of container instances to be expanded, and the aforementioned microservice response time prediction model can be used. Specifically, based on the status information of each microservice in the system (including the number of service requests, the number of deployed resources, etc.), the input data of the prediction model is generated, and the number of containers on the microservice to be expanded is adjusted. The response time prediction value of the microservice is obtained through the prediction model, and compared with the agreed service level to determine the number of container instances to be expanded.
[0078] Similarly, when resource scaling is required, the microservice response time prediction model can be used to help determine the number of deployed resources.
[0079] 2. Global expansion: Due to the call chain relationship between microservices, when resources are expanded for a certain microservice, the number of requests for downstream microservices may surge, making it a new performance bottleneck, and resources need to be expanded for the new microservice. This problem of frequent intermittent expansion has a great impact on the overall performance of the system. By applying the microservice response time prediction model proposed in the present invention, when expanding resources for a microservice, it is possible to check whether the response time of other microservices violates the service level agreement based on the predicted value of the prediction model. If so, the number of containers is adjusted for the new bottleneck. Through this "adjustment-prediction-check-adjustment" model, resources can be reasonably adjusted for multiple microservices at one time, avoiding the aforementioned disadvantages of frequent intermittent expansion.
[0080] 3. Access flow control: Using the microservice response time prediction model, we can also provide an estimate of the maximum value of the system access load. When the system deployment resources remain unchanged, the access flow can be limited to avoid a decline in service level.
[0081] An embodiment of the present invention further provides a microservice response time prediction system based on a graph neural network, which is based on the microservice response time prediction method based on a graph neural network in each of the above embodiments, including:
[0082] The acquisition module is used to run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, the number of deployed containers, service request response time, and the call relationship diagram between each microservice;
[0083] The prediction module is used to input the operating data into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0084] Based on the same concept, the embodiment of the present invention also provides a schematic diagram of an entity structure, such as Figure 2 As shown, the server may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the steps of the microservice response time prediction method based on the graph neural network as described in the above embodiments. For example, it includes:
[0085] Run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, the number of deployed containers, service request response time, and the call relationship diagram between each microservice;
[0086] The operation data is input into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0087] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0088] Based on the same concept, an embodiment of the present invention further provides a non-transitory computer-readable storage medium storing a computer program. The computer program includes at least one code segment that can be executed by a main control device to control the main control device to implement the steps of the microservice response time prediction method based on a graph neural network as described in the above embodiments. For example, the steps include:
[0089] Run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, number of deployed containers, service request response time, and call relationship diagrams between microservices.
[0090] The operation data is input into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
[0091] Based on the same technical concept, an embodiment of the present application also provides a computer program, which, when executed by a main control device, is used to implement the above method embodiment.
[0092] The program may be stored in whole or in part on a storage medium packaged with the processor, or may be stored in whole or in part on a memory not packaged with the processor.
[0093] Based on the same technical concept, the embodiment of the present application further provides a processor, which is used to implement the above method embodiment. The above processor can be a chip.
[0094] The various embodiments of the present invention can be combined arbitrarily to achieve different technical effects.
[0095] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).
[0096] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A microservice response time prediction method based on graph neural network, characterized in that: include: Run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, number of deployed containers, service request response time, and call relationship diagrams between microservices. Configure at least one container template for each microservice of the software system to be modeled, and configure operating resources and an operating environment for the container template based on the operating environment requirements of the microservice; Generate a preset external access load, load it to the software system to be modeled, perform a test within a set period, and record the operating data of each microservice in the software system to be modeled to generate a training dataset; the operating data also includes the microservice ID, recording time, service response time, container template resource configuration information, and container quantity information; The container template resource configuration information includes CPU, memory and network bandwidth; Build a graph neural network, treat each microservice as a node in the graph neural network, and set a state value h for each microservice i i ; Obtain the state value after R rounds of iteration based on the iterative method Define a feedforward fully connected neural network to transform the state value of microservice i after R rounds of iteration Substitute into the fully connected neural network and get the output value O i ; Determine a loss function, and perform graph neural network training based on the loss function and the training data set to obtain a microservice response time prediction model; The loss function is: LOSS=∑ i∈X ||O i -Y i ||+L reg ; In the above formula, X is the set of nodes in the entire network, that is, the set of all microservices in the software system; Y i L is the service response time label value of microservice i; reg is the L2 regularization term; The operation data is input into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
2. The microservice response time prediction method based on graph neural network according to claim 1 is characterized in that: The operating resources include computing power CPU i , memory capacity MEM i and network bandwidth BAND i .
3. The microservice response time prediction method based on graph neural network according to claim 1 is characterized in that: After generating the training dataset, it also includes: Check whether the response time of each microservice violates the service level agreement, which is a pre-set response time threshold; If the response time of any microservice does not violate the service level agreement, the external access load is linearly increased based on the preset ratio; If any microservice is found to violate the service level agreement, the service resources of one container template will be expanded for each microservice that violates the service level agreement; If the external access load reaches T times the maximum access load of the software system to be modeled, the test is terminated; During the operation, the operation data of each microservice in the software system to be modeled is continuously recorded to generate a training data set.
4. The microservice response time prediction method based on graph neural network according to claim 1 is characterized in that: The initial state of the microservice i is Initial state The initialization method is: Convert the number of service requests, container template CPU metrics, memory metrics, network bandwidth metrics, and the number of deployed containers into binary bit strings, concatenate the binary bit strings and add 0 at the end, and assign the resulting d-dimensional vector to 5. The microservice response time prediction method based on graph neural network according to claim 4 is characterized in that: Obtain the state value after R rounds of iteration based on the iterative method Specifically include: On the call relationship graph between microservices, collect nodes from the neighboring nodes of node i with probability p to form the neighbor node set N(i). If N(i) is empty, re-collect until N(i) contains at least one node; Take the weighted average of the current round status of each node in the neighbor node set and get In the above formula, j = 1, 2, ..., R, represents the jth iteration; is the trainable weight coefficient; calculate Value: In the above formula, Represents the concatenation of two state vectors, W (j) is the trainable weight coefficient matrix, b (j) is the bias vector; Will Do normalization:
6. A microservice response time prediction system based on graph neural network, characterized in that: include: The acquisition module is used to run the software system to be modeled and record the operating data of each microservice in the software system to be modeled. The operating data includes the service request volume, container template information, the number of deployed containers, service request response time, and the call relationship diagram between microservices; It is also used to configure at least one container template for each microservice of the software system to be modeled, and configure operating resources and operating environment for the container template based on the operating environment requirements of the microservice; It is also used to generate a preset external access load, load it to the software system to be modeled, perform testing within a set period of time, and record the operating data of each microservice in the software system to be modeled to generate a training data set; the operating data also includes the microservice ID, recording time, service response time, container template resource configuration information, and container quantity information; The container template resource configuration information includes CPU, memory and network bandwidth; The model training module is used to build a graph neural network, treating each microservice as a node in the graph neural network and setting a state value h for each microservice i. i ; Obtain the state value after R rounds of iteration based on the iterative method Define a feedforward fully connected neural network to transform the state value of microservice i after R rounds of iteration Substitute into the fully connected neural network and get the output value O i ; Determine a loss function, and perform graph neural network training based on the loss function and the training data set to obtain a microservice response time prediction model; The loss function is: LOSS=∑ i∈X ||O i -Y i ||+L reg ; In the above formula, X is the set of nodes in the entire network, that is, the set of all microservices in the software system; Y i L is the service response time label value of microservice i; reg is the L2 regularization term; The prediction module is used to input the operating data into a pre-trained response time prediction model to predict the microservice response time in a future set time period.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the microservice response time prediction method based on graph neural network as described in any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the microservice response time prediction method based on graph neural network as described in any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Docker self-adaptive scheduling system with task sensing function
CN108228347A
Node scheduling method and device of micro server, equipment and storage medium
CN110311987A