Microservice load prediction method and system based on microservice embedded container
By collecting information and establishing a two-way preference list in the regional gateway, microservices and containers are embedded, load prediction calculation is optimized, and the problems of poor performance and low resource utilization efficiency of microservices embedded in containers are solved, thereby improving the accuracy of load prediction and resource adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG POWER GRID CO LTD
- Filing Date
- 2023-04-19
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods and devices for selecting microservice container instances fail to fully consider the value gain and uncertainty of microservices embedded in containers when selecting microservices and containers. This results in poor performance of microservices embedded in containers, low container resource utilization efficiency, and an inability to meet the needs of regional gateways in handling complex and variable loads.
By collecting container deployment information and microservice information within the distribution area, a first load prediction value is obtained using a preset load prediction calculation method. A two-way preference list is then established through value gain calculation and uncertainty calculation to achieve two-way selection and embedding of microservices and containers, thereby optimizing the load prediction calculation method to improve accuracy.
It improves the accuracy of microservice load prediction, enhances the adaptability of zone gateway resources and services, and solves the problems of poor performance of microservices embedded in containers and low utilization efficiency of container resources.
Smart Images

Figure CN116455908B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cloud computing technology, and in particular to a microservice load prediction method and system based on microservice embedded containers. Background Technology
[0002] With the continuous development of distribution substations, a large number of devices need to be deployed in the substation gateways to handle the load in order to achieve network interconnection and data transmission. However, the scale of substation load is increasing year by year, posing challenges to the efficiency of substation gateway workload allocation and the adaptability of services and resources. Existing methods and devices for selecting microservice container instances only complete the selection of microservices and containers based on user requests, lacking a substation gateway solution that can support microservices embedded in containers. At the same time, the value gain and uncertainty of microservices embedded in containers are not considered when selecting microservices and containers, resulting in poor performance of microservices embedded in containers, low container resource utilization efficiency, and failure to fully leverage the advantages of microservice container technology.
[0003] Existing methods and devices for selecting microservice container instances only select microservices and containers based on user requests. There is a lack of regional gateway solutions that can support the embedding of microservices into containers. This results in insufficient flexibility and intelligence in the utilization of microservices and containers, and fails to meet the needs of regional gateways to handle complex, variable, and highly real-time loads. Some load requirements time out, leading to low stability of regional gateways.
[0004] Meanwhile, existing methods and devices for selecting microservice container instances do not consider the value gain and uncertainty of microservices embedded in containers when selecting microservices and containers. This results in poor performance of microservices embedded in containers, low container resource utilization efficiency, failure to reflect the value gain of the district gateway in handling microservice loads, and inability to meet the requirements of the district gateway in handling complex and variable loads. Summary of the Invention
[0005] To overcome the problems existing in the prior art, this invention discloses a microservice load prediction method and system based on microservice embedded in containers. By embedding microservices with containers, the efficiency of container resource utilization is improved, and the accuracy of microservice load prediction is also improved by embedding microservices with containers.
[0006] To achieve the above objectives, this invention provides a microservice load prediction method based on microservice embedded containers, comprising:
[0007] Collect container deployment information and microservice information within the distribution area, and process the microservice information using a preset load prediction calculation method to obtain a first load prediction value corresponding to the microservice information; the container deployment information includes several containers; the microservice information includes several microservices;
[0008] Based on the first load prediction value, the container deployment information, and the microservice information, the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices are obtained by using a preset value gain calculation method and a value gain variance calculation method, respectively. A first preference list of the plurality of microservices to the plurality of containers is constructed based on the value gain value, and a second preference list of the plurality of containers to the plurality of microservices is constructed based on the value gain uncertainty value.
[0009] Based on the first preference list and the second preference list, a two-way selection is performed through the several microservices and several containers so that the several microservices are embedded into the several containers one by one, thereby obtaining several microservice embedded containers;
[0010] The value gain value and value gain uncertainty value in the plurality of microservice embedded containers are processed by a preset modified value gain calculation method to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively.
[0011] The load prediction calculation method is optimized according to the modified value gain value, and the optimized load prediction calculation method is used to predict the load of each of the microservices to obtain the second load prediction value corresponding to each of the microservices.
[0012] This invention discloses a microservice load prediction method based on microservice embedded containers. First, it acquires container deployment information and microservice information within a distribution area. The container deployment information includes several containers, and the microservice information includes several microservices. The computing resources and tasks within the distribution area are divided into several containers and several microservices based on the microservice information and deployment information, improving the efficiency of each microservice. Next, a first load prediction value is calculated for each microservice contained in the microservice information package using a preset load prediction method. Considering the value gain of the distribution area gateway's load processing and the uncertainty of the load received by the microservices, the value gain value of each microservice to the several containers and the value gain uncertainty value of each container to the several microservices are obtained using preset value gain calculation methods and value gain uncertainty calculation methods, respectively. Then, a bidirectional preference list is established to enable... Based on the preference list, the invention completes the bidirectional selection and embedding of microservices and containers, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. To improve the accuracy of microservice load prediction after a microservice is embedded in a container, the invention calculates the corrected value gain for different microservices embedded in containers, optimizes the load prediction calculation method based on the corrected value gain, and performs load prediction based on the optimized method, thus improving the accuracy of microservice load prediction. The invention establishes a preference list by calculating the value gain and uncertainty of microservices to containers, and completes the embedding of microservices and containers based on the preference list, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. Simultaneously, the collection of microservice information and container deployment information supports microservice embedding in containers, completing the prediction of load for all microservices and improving the adaptability of gateway resources and services.
[0013] As a preferred example, the container deployment information and microservice information within the collection area specifically include:
[0014] Collect available storage and computing resource information within the transformer area gateway, and use the available storage and computing resource information to group and deploy the storage and computing resources within the transformer area gateway into several containers, and obtain the container deployment information;
[0015] Collect the work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices based on the work task information and register them to obtain the microservice information.
[0016] This invention deploys the storage and computing resources of a distribution zone gateway in groups, dividing them into multiple containers to obtain a container deployment scheme. Then, it collects the work tasks within the distribution zone gateway, divides the work tasks into multiple microservices, registers them, and obtains the microservice information. Through the container deployment scheme and the microservice information, the working efficiency of each microservice is improved, and the load of all microservices is predicted.
[0017] As a preferred example, the process of obtaining the value gain values of the plurality of microservices to the plurality of containers and the value gain uncertainty values of the plurality of containers to the plurality of microservices through preset value gain calculation methods and value gain variance calculation methods, specifically includes:
[0018] Based on the first load prediction value, calculate the revenue value of the container processing the first load prediction value and the compatibility between the container and the microservice, so as to obtain the value gain value of the microservice to the container based on the revenue value, the compatibility and the preset revenue coefficient and the weight coefficient of the compatibility.
[0019] The value gain uncertainty of the container to the microservice is obtained by calculating the variance of the value gain value.
[0020] Based on the first load prediction value, this invention calculates the value gain value of the microservice to the container through preset revenue value and adaptability. The greater the load the container handles on the microservice and the higher the adaptability between the container and the microservice, the greater the value gain of the microservice to the container. Then, based on the variance of the value gain value, the uncertainty value of the value gain of the container to the microservice is obtained, so that the embedding of the microservice and the container can be completed according to the value gain value and the value gain uncertainty value, thereby improving the utilization rate of container resources.
[0021] As a preferred example, the steps of constructing a first preference list of the plurality of microservices for the plurality of containers based on the value gain value and constructing a second preference list of the plurality of containers for the plurality of microservices based on the value gain uncertainty value specifically include:
[0022] Based on the value gain of the microservice to the container, the containers are sorted in descending order to obtain the first preference list of the microservice for the container;
[0023] The microservices are sorted in ascending order based on the uncertainty of the value gain of the container on the microservice, to obtain a second preference list of the container for the microservice.
[0024] This invention establishes a first preference list and a second preference list corresponding to the microservice based on the value gain value and value gain uncertainty value between the microservice and the container, so that the container and the microservice can embed the microservice into the container according to the preference list, thereby improving the adaptability of the zone gateway resources and services.
[0025] As a preferred example, the step of performing a two-way selection based on the first preference list and the second preference list through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded one by one into the plurality of containers, specifically includes:
[0026] According to the first preference list, the microservice sends an embedding request to the container with the highest sort order in the first preference list in sequence;
[0027] The container receives several embedding requests sent by the several microservices, selects the embedding request with the highest sorting order from the several embedding requests according to the sorting order of the second preference list, and completes the embedding of the microservices with the container according to the embedding request with the highest sorting order.
[0028] This invention enables the embedding of microservices into containers based on a bidirectional preference list built between the container and the microservice, thus solving the problems of poor performance and low container resource utilization efficiency when embedding microservices into containers.
[0029] As a preferred example, the processing of the value gain value and value gain uncertainty value in the plurality of microservice embedded containers through a preset modified value gain calculation method specifically includes:
[0030] Based on the preset first weighting function of the value gain value and the second function of the value gain uncertainty value, the first value gain value and the first value gain uncertainty value are obtained by multiplying them by the value gain value and the value gain uncertainty value respectively.
[0031] The corrected value gain is obtained by adding the first value gain value and the first value gain uncertainty value.
[0032] This invention utilizes a preset first weighting function and a second weighting function to measure the importance of the value gain value and the value gain uncertainty value of the microservice and the container in the microservice embedded container. This allows for obtaining different corrected value gain values for different microservice embedded containers based on the proportion of the value gain value and the value gain uncertainty value of the microservice and the container in different microservice embedded containers. This enables the optimization of the load prediction calculation method for the corresponding microservice based on the corrected value gain value, thereby improving the accuracy of load prediction.
[0033] As a preferred example, optimizing the load forecasting calculation method based on the modified value gain specifically includes:
[0034] The network prediction parameters included in the load prediction calculation method are updated according to the corrected value gain value to obtain the optimized load prediction calculation method.
[0035] This invention uses the corrected value gain value to update the network prediction parameters in the load prediction calculation method. The higher the corrected value gain, the better the network prediction parameters, and the more accurate the predicted microservice load, thereby improving the accuracy of the microservice load prediction.
[0036] On the other hand, the present invention also discloses a microservice load prediction system based on a microservice embedded container, including an information module, a construction module, an embedding module, a processing module and a prediction module;
[0037] The information module is used to collect container deployment information and microservice information within the distribution area, and to process the microservice information through a preset load prediction calculation method to obtain a first load prediction value corresponding to the microservice information; the container deployment information includes several containers; the microservice information includes several microservices;
[0038] The construction module is used to obtain the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices based on the first load prediction value, the container deployment information and the microservice information, respectively through a preset value gain calculation method and a value gain variance calculation method. Based on the value gain value, it constructs a first preference list of the plurality of microservices to the plurality of containers and a second preference list of the plurality of containers to the plurality of microservices.
[0039] The embedding module is used to perform bidirectional selection based on the first preference list and the second preference list through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded one by one into the plurality of containers, thereby obtaining a plurality of microservice embedding containers.
[0040] The processing module is used to process the value gain value and value gain uncertainty value in the plurality of microservice embedded containers respectively through a preset modified value gain calculation method, so as to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively.
[0041] The prediction module is used to optimize the load prediction calculation method according to the modified value gain value, and to predict the load prediction calculation method for the plurality of microservices respectively, so as to obtain the second load prediction value corresponding to the plurality of microservices respectively.
[0042] This invention discloses a microservice load prediction system based on microservice embedded containers. First, it acquires container deployment information and microservice information within a distribution area. The container deployment information includes several containers, and the microservice information includes several microservices. The computing resources and tasks within the distribution area are divided into several containers and several microservices based on the microservice information and deployment information, improving the efficiency of each microservice. Next, a first load prediction value is calculated for each microservice contained in the microservice information package using a preset load prediction method. Considering the value gain of the distribution area gateway's load processing and the uncertainty of the load received by the microservices, the value gain value of each microservice to the several containers and the value gain uncertainty value of each container to the several microservices are obtained using preset value gain calculation methods and value gain uncertainty calculation methods, respectively. Then, a bidirectional preference list is established to enable... Based on the preference list, the invention completes the bidirectional selection and embedding of microservices and containers, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. To improve the accuracy of microservice load prediction after a microservice is embedded in a container, the invention calculates the corrected value gain for different microservices embedded in containers, optimizes the load prediction calculation method based on the corrected value gain, and performs load prediction based on the optimized method, thus improving the accuracy of microservice load prediction. The invention establishes a preference list by calculating the value gain and uncertainty of microservices to containers, and completes the embedding of microservices and containers based on the preference list, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. Simultaneously, the collection of microservice information and container deployment information supports microservice embedding in containers, completing the prediction of load for all microservices and improving the adaptability of gateway resources and services.
[0043] As a preferred example, the information module includes a deployment information unit and a microservice information unit;
[0044] The deployment information unit is used to collect available storage and computing resource information within the transformer area gateway, and to use the available storage and computing resource information to group and deploy the storage and computing resources within the transformer area gateway into several containers, thereby obtaining the container deployment information.
[0045] The microservice information unit is used to collect work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices and register them according to the work task information to obtain the microservice information.
[0046] This invention deploys the storage and computing resources of a distribution zone gateway in groups, dividing them into multiple containers to obtain a container deployment scheme. Then, it collects the work tasks within the distribution zone gateway, divides the work tasks into multiple microservices, registers them, and obtains the microservice information. Through the container deployment scheme and the microservice information, the working efficiency of each microservice is improved, and the load of all microservices is predicted.
[0047] As a preferred example, the construction module includes a calculation unit and a list unit;
[0048] The calculation unit is used to calculate the revenue value of the container processing the first load prediction value and the adaptability of the container to the microservice based on the first load prediction value, so as to obtain the value gain value of the microservice to the container based on the revenue value, the adaptability and the preset revenue coefficient and the weight coefficient of the adaptability; and to obtain the value gain uncertainty value of the container to the microservice by calculating the variance of the value gain value.
[0049] The list unit is used to sort the containers in descending order according to the value gain value of the microservice to the container to obtain a first preference list of the microservice to the container; and to sort the microservices in ascending order according to the value gain uncertainty value of the container to the microservice to obtain a second preference list of the container to the microservice.
[0050] This invention calculates the value gain of the microservice to the container based on the first load prediction value, through preset revenue value and adaptability. The greater the load the container handles on the microservice and the higher the adaptability between the container and the microservice, the greater the value gain of the microservice to the container. Then, the value gain uncertainty of the container to the microservice is obtained based on the variance of the value gain value, so that the embedding of the microservice and the container can be completed according to the value gain value and the value gain uncertainty value, thereby improving the utilization of container resources. Furthermore, a first preference list and a second preference list corresponding to the microservice are established according to the value gain value and the value gain uncertainty value between the microservice and the container, so that the container and the microservice can be embedded into the container according to the preference list, thereby improving the adaptability of the zone gateway resources and services. Attached Figure Description
[0051] Figure 1: A flowchart illustrating a microservice load prediction method based on microservice embedded containers provided in an embodiment of the present invention;
[0052] Figure 2 : A schematic diagram of the structure of a microservice load prediction system based on a microservice embedded container provided in an embodiment of the present invention;
[0053] Figure 3 : A schematic diagram of the structure of a microservice load prediction system based on a microservice embedded container, provided for another embodiment of the present invention. Detailed Implementation
[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] Example 1
[0056] This invention provides a microservice load prediction method based on microservice embedded containers. For details on the implementation process of this method, please refer to... Figure 1 It mainly includes steps 101 to 105, which mainly include:
[0057] Step 101: Collect container deployment information and microservice information within the distribution area, and process the microservice information using a preset load prediction calculation method to obtain the first load prediction value corresponding to the microservice information; the container deployment information includes several containers; the microservice information includes several microservices.
[0058] In this embodiment, the step specifically includes: collecting available storage and computing resource information within the distribution area gateway, and using the available storage and computing resource information to group and deploy the storage and computing resources within the distribution area gateway into several containers, thereby obtaining container deployment information; collecting work task information within the distribution area gateway, and dividing the work tasks within the distribution area gateway into several microservices and registering them according to the work task information, thereby obtaining microservice information.
[0059] This invention provides an embodiment of the invention that groups and deploys the storage and computing resources of the distribution zone gateway into multiple containers to obtain a container deployment scheme. Then, it collects the work tasks within the distribution zone gateway, divides the work tasks into multiple microservices and registers them to obtain microservice information. By using the container deployment scheme and the microservice information, the working efficiency of each microservice is improved, and the load of all microservices is predicted.
[0060] Step 102: Based on the first load prediction value, the container deployment information, and the microservice information, obtain the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices through a preset value gain calculation method and a value gain variance calculation method, respectively. Construct a first preference list of the plurality of microservices to the plurality of containers based on the value gain value and a second preference list of the plurality of containers to the plurality of microservices based on the value gain uncertainty value.
[0061] In this embodiment, the step specifically includes: calculating the revenue value of the container processing the first load prediction value and the fit between the container and the microservice based on the first load prediction value, so as to obtain the value gain value of the microservice to the container based on the revenue value, the fit, and a preset revenue coefficient and a weight coefficient of the fit; obtaining the value gain uncertainty value of the container to the microservice by calculating the variance of the value gain value; sorting the containers in descending order based on the value gain value of the microservice to the container to obtain a first preference list of the microservice to the container; and sorting the microservices in ascending order based on the value gain uncertainty value of the container to the microservice to obtain a second preference list of the container to the microservice.
[0062] In this embodiment of the invention, based on the first load prediction value, the value gain value of the microservice to the container is calculated using a preset revenue value and adaptability. The greater the load the container handles on the microservice and the higher the adaptability between the container and the microservice, the greater the value gain of the microservice to the container. Then, the value gain uncertainty value of the container to the microservice is obtained based on the variance of the value gain value, so that the embedding of the microservice and the container can be completed according to the value gain value and the value gain uncertainty value, thereby improving the utilization rate of container resources. At the same time, a first preference list and a second preference list corresponding to the microservice are established according to the value gain value and the value gain uncertainty value between the microservice and the container, so that the container and the microservice can be embedded into the container according to the preference list, thereby improving the adaptability of the zone gateway resources and services.
[0063] Step 103: Based on the first preference list and the second preference list, a two-way selection is performed through the several microservices and several containers to embed the several microservices into the several containers one by one, thereby obtaining several microservice embedded containers.
[0064] In this embodiment, the step specifically includes: according to the first preference list, the microservice sequentially sends an embedding request to the container with the highest sorting order in the first preference list; the container receives several embedding requests sent by the several microservices, selects the embedding request with the highest sorting order among the several embedding requests according to the sorting order of the second preference list, and completes the embedding of the microservice and the container according to the embedding request with the highest sorting order.
[0065] This invention, based on a preference list bidirectionally constructed between the container and the microservice, enables the embedding of the microservice into the container, thus solving the problems of poor performance and low resource utilization efficiency of microservice embedding into containers.
[0066] Step 104: Process the value gain value and value gain uncertainty value in the plurality of microservice embedded containers respectively by means of a preset modified value gain calculation method to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively.
[0067] In this embodiment, the step specifically includes: multiplying the value gain value and the value gain uncertainty value by a preset first weighting function of the value gain value and a second function of the value gain uncertainty value, respectively, to obtain a first value gain value and a first value gain uncertainty value; and obtaining the corrected value gain value by adding the first value gain value and the first value gain uncertainty value.
[0068] This invention utilizes a preset first weighting function and a second weighting function to measure the importance of the value gain value and the value gain uncertainty value of the microservice and the container in the microservice embedded container. This allows for obtaining different corrected value gain values for the microservice embedded container based on the proportion of the value gain value and the value gain uncertainty value of the microservice and the container in different microservice embedded containers. This enables the optimization of the load prediction calculation method for the corresponding microservice based on the corrected value gain value, thereby improving the accuracy of load prediction.
[0069] Step 105: Optimize the load prediction calculation method according to the modified value gain value, and predict the load prediction of the several microservices respectively using the optimized load prediction calculation method to obtain the second load prediction value corresponding to the several microservices respectively.
[0070] In this embodiment, the step specifically includes: updating the network prediction parameters included in the load prediction calculation method according to the modified value gain value, so as to obtain the optimized load prediction calculation method.
[0071] In this embodiment of the invention, the network prediction parameters in the load prediction calculation method are updated using the corrected value gain value. The higher the corrected value gain, the better the network prediction parameters, and the more accurate the predicted microservice load, thereby improving the accuracy of the microservice load prediction.
[0072] On the other hand, embodiments of the present invention also provide a microservice load prediction system based on microservice embedded containers. For the specific structure of this system, please refer to... Figure 2 It mainly includes an information module 201, a construction module 202, an embedding module 203, a processing module 204, and a prediction module 205.
[0073] The information module 201 is used to collect container deployment information and microservice information within the distribution area, and to process the microservice information through a preset load prediction calculation method to obtain a first load prediction value corresponding to the microservice information; the container deployment information includes a number of containers; the microservice information includes a number of microservices.
[0074] The construction module 202 is used to obtain the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices based on the first load prediction value, the container deployment information and the microservice information, respectively through a preset value gain calculation method and a value gain variance calculation method. Based on the value gain value, it constructs a first preference list of the plurality of microservices to the plurality of containers and a second preference list of the plurality of containers to the plurality of microservices.
[0075] The embedding module 203 is used to perform bidirectional selection based on the first preference list and the second preference list, through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded into the plurality of containers one by one, thereby obtaining a plurality of microservice embedding containers.
[0076] The processing module 204 is used to process the value gain value and value gain uncertainty value in the plurality of microservice embedded containers respectively through a preset modified value gain calculation method, so as to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively.
[0077] The prediction module 205 is used to optimize the load prediction calculation method according to the modified value gain value, and to predict the load prediction calculation method for the plurality of microservices respectively, so as to obtain the second load prediction value corresponding to the plurality of microservices respectively.
[0078] In this embodiment, the information module 201 includes a deployment information unit and a microservice information unit.
[0079] The deployment information unit is used to collect information on available storage and computing resources within the transformer area gateway, and to use this information to group and deploy the storage and computing resources within the transformer area gateway into several containers, thereby obtaining the container deployment information.
[0080] The microservice information unit is used to collect work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices and register them according to the work task information to obtain the microservice information.
[0081] In this embodiment, the construction module 202 includes a calculation unit and a list unit.
[0082] The calculation unit is used to calculate the revenue value of the container processing the first load prediction value and the adaptability of the container to the microservice based on the first load prediction value, so as to obtain the value gain value of the microservice to the container based on the revenue value, the adaptability and the preset revenue coefficient and the weight coefficient of the adaptability; and to obtain the value gain uncertainty value of the container to the microservice by calculating the variance of the value gain value.
[0083] The list unit is used to sort the containers in descending order according to the value gain value of the microservice to the container to obtain a first preference list of the microservice to the container; and to sort the microservices in ascending order according to the value gain uncertainty value of the container to the microservice to obtain a second preference list of the container to the microservice.
[0084] In this embodiment, the embedding module 203 includes a request unit and a selection unit.
[0085] The request unit is used to send an embedding request to the container with the highest sort order in the first preference list, according to the first preference list.
[0086] The selection unit is used for the container to receive several embedding requests sent by the several microservices, and select the embedding request with the highest sorting order among the several embedding requests according to the sorting order of the second preference list, and complete the embedding of the microservice with the container according to the embedding request with the highest sorting order.
[0087] This invention discloses a microservice load prediction method and system based on microservice embedded containers. First, it acquires container deployment information and microservice information within a distribution area. The container deployment information includes several containers, and the microservice information includes several microservices. The computing resources and tasks within the distribution area are divided into several containers and several microservices using the microservice information and deployment information, improving the efficiency of each microservice. Next, a first load prediction value is calculated for each microservice contained in the microservice information package using a preset load prediction method. Considering the value gain of the distribution area gateway's load processing and the uncertainty of the load received by the microservices, the value gain value of each microservice to the several containers and the value gain uncertainty value of each container to the several microservices are obtained using preset value gain calculation methods and value gain uncertainty calculation methods, respectively. Finally, a two-way preference list is established. This invention enables the bidirectional selection and embedding of microservices and containers based on the preference list, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. To improve the accuracy of microservice load prediction after a microservice is embedded in a container, this invention calculates the corrected value gain for different microservices embedded in containers, optimizes the load prediction calculation method based on the corrected value gain, and performs load prediction based on the optimized load prediction calculation method, thereby improving the accuracy of microservice load prediction. This invention establishes a preference list by calculating the value gain and uncertainty of microservices to containers, and completes the embedding of microservices and containers based on the preference list, solving the problems of poor performance and low resource utilization efficiency of microservices embedded in containers. Simultaneously, collecting microservice information and container deployment information can support microservice embedding in containers, complete the prediction of load for all microservices, and improve the adaptability of gateway resources and services.
[0088] Example 2
[0089] This invention provides another microservice load prediction system based on microservice embedded containers. Please refer to the schematic diagram of this system. Figure 3 It mainly includes a power module 301, a container deployment module 302, a microservice registration module 303, a first load prediction module 304, a preference list construction module 305, a microservice embedded container module 306, and a second load prediction module 307.
[0090] In this embodiment, the power module 301 is responsible for supplying power to each module of the microservice load prediction system based on microservice embedded containers provided in this embodiment of the invention.
[0091] The container deployment module 302 is used to collect information on available storage and computing resources within the transformer area gateway, and to use the available storage and computing resource information to group and deploy the storage and computing resources within the transformer area gateway into several containers, thereby obtaining the container deployment information.
[0092] In this embodiment, the container deployment module 302 collects information on available storage and computing resources within the distribution area, groups and deploys the storage and computing resources of the distribution area gateway into M containers based on the available information, and sends the container deployment plan to the first load prediction module 304.
[0093] The microservice registration module 303 is used to collect the work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices according to the work task information and register them to obtain the microservice information.
[0094] In this embodiment, the microservice registration module 303 collects work task information within the distribution area and divides the work tasks within the distribution area into categories based on the task information. Each microservice registers and sends the microservice information to the first load prediction module 304 and the preference list construction module 305.
[0095] The first load prediction module 304 is used to collect container deployment information and microservice information within the distribution area, and process the microservice information through a preset load prediction calculation method to obtain the first load prediction value corresponding to the microservice information.
[0096] In this embodiment, the first load prediction module 304 receives microservice information from the microservice registration module 303, and performs load prediction on the I microservices according to the received microservice information using a preset load prediction calculation method to obtain the first load prediction value of the I microservices. In this embodiment, the load prediction calculation method is as follows:
[0097]
[0098] In this embodiment, the For the first The load of a microservice Indicates the first Predicted load values for microservices in a time slot Indicates the first The actual load value of a microservice in a time slot. Indicates the first Load prediction error value for microservices in a time slot Indicates the first The first time slot The load prediction parameters for each microservice are as follows: the smaller the load prediction error and the higher the load prediction parameter for the microservice, the more accurate the predicted load of the microservice.
[0099] In this embodiment, the first load prediction module 304 uses the above-mentioned load calculation formula to obtain the first load prediction value of the I microservices.
[0100] The preference list construction module 305 is used to obtain the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices based on the first load prediction value, the container deployment information and the microservice information, respectively, through a preset value gain calculation method and a value gain variance calculation method. Based on the value gain value, it constructs a first preference list of the plurality of microservices to the plurality of containers and a second preference list of the plurality of containers to the plurality of microservices.
[0101] In this embodiment, the preference list construction module 305 receives container deployment information sent by the container deployment module 302, microservice information sent by the microservice registration module 303, and a first load prediction value corresponding to the microservice information sent by the first load prediction module 304. Based on the received information, it calculates the value gain value and value gain uncertainty value of the microservice embedded in the container and constructs a preference list. The preference list construction module 305 calculates the value gain value of the microservice to the container using a preset value gain calculation method based on the first load prediction value corresponding to the I microservices sent by the first load prediction module 304 and the compatibility between the microservice and the container. It also calculates the value gain uncertainty value of the container to the microservice using a value gain variance calculation method. In this embodiment, the value gain value calculation method is as follows:
[0102] Definition of the first The first time slot, the first The microservice for the first Value gain of each container , can be represented as
[0103]
[0104] in, Indicates the first Each time-slot container handles microservice load. The benefits brought about; Indicates the profit coefficient; Indicates the first The first time slot The microservice for the first The compatibility of each container; The weighted parameters representing adaptability are used to measure the importance of adaptability. In particular, the greater the load the container handles on the microservices and the higher the adaptability between the container and the microservices, the greater the value gain the microservices bring to the container.
[0105] In this embodiment, the preset value gain variance calculation method is as follows:
[0106] Definition of the first The uncertainty of the value gain of each time slot is up to the [number]th time slot. The variance of the value gain in the time slot is then determined according to the _th_ time slot. The first time slot, the first The container pairs the first The preference of each microservice is computational gain uncertainty. , can be represented as
[0107]
[0108] in, Indicates the first The first time slot, the first The microservice for the first The value gain of each container, and has ; Indicates up to the number The first time slot, the first The first microservice selection The number of times a container is embedded. This uncertainty is caused by factors such as rapid changes in microservice load. When the... The larger the variance of the value gain of each time slot, the greater the value gain of the first time slot. The value gain of each time slot and up to the [number]th time slot The greater the difference in the average value gain of each time slot, the greater the uncertainty in the value gain of the container to the microservice.
[0109] In this embodiment, the I microservices sort the M containers in descending order according to the value gain of the microservices to the containers to obtain a first preference list of microservices to containers. Then, all microservices are sorted in ascending order according to the value gain uncertainty of the containers to the microservices to obtain a second preference list of containers to microservices, thus realizing the construction of the preference list.
[0110] The microservice embedding container module 306 is used to perform bidirectional selection based on the first preference list and the second preference list, through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded into the plurality of containers one by one, thereby obtaining a plurality of microservice embedding containers. Then, the value gain value and value gain uncertainty value in the plurality of microservice embedding containers are processed by a preset modified value gain calculation method to obtain the modified value gain value corresponding to the plurality of microservice embedding containers respectively.
[0111] In this embodiment, the microservice embedding container module 306, based on the first preference list and the second preference list, sends embedding requests from all microservices that have not yet completed embedding to the container with the highest order in their preference list. If a container receives multiple embedding requests, it needs to select the request with the highest preference value from the multiple embedding requests according to its own preference list, then reject other microservice embedding requests, and complete the embedding process. All rejected microservices send embedding requests to the container with the second highest order in their preference list. The container repeats the above operation until all microservices are embedded in the container, or there are no available containers, at which point the embedding process ends. Based on the result of the microservices embedding into the container, the corresponding value gain is calculated. and value gain uncertainty Calculate the corrected value gain , can be represented as:
[0112]
[0113] in, and These represent the weighting parameters for value gain and value gain uncertainty, respectively, and are used to measure the importance of value gain and value gain uncertainty.
[0114] The second load prediction module 307 is used to optimize the load prediction calculation method according to the modified value gain value, and to predict the load prediction of the plurality of microservices respectively through the optimized load prediction calculation method, so as to obtain the second load prediction value corresponding to the plurality of microservices respectively.
[0115] In this embodiment, after receiving the corrected value gain from the microservice embedded container module 306, the second load prediction module 307 updates the network prediction parameters, which can be expressed as follows:
[0116]
[0117] in, Indicates the first The first time slot Network prediction parameters for each microservice; The weighting parameter represents the correction value gain, used to measure the importance of the correction value gain. In particular, the higher the correction value gain, the better the network prediction parameters and the more accurate the predicted microservice load.
[0118] The second load prediction module 307 optimizes the preset load prediction calculation method in the first load prediction module 304 according to the corrected network prediction parameters to obtain an optimized load prediction calculation method, and processes the microservice information using the optimized load prediction calculation method to obtain the second load prediction value corresponding to the microservice information.
[0119] This embodiment discloses a microservice load prediction system based on microservice embedded in containers. It proposes a regional gateway with a container and microservice architecture that supports microservice embedded in containers. The system completes the grouped deployment of the regional gateway's storage and computing resources, divides the regional gateway's tasks into multiple microservices for registration, improves the efficiency of each microservice, and completes the prediction of the load for all microservices. It realizes the embedding of microservices into containers, supports microservice embedded in containers, improves the adaptability of regional gateway resources and services, and fully considers the value gain of the regional gateway's load processing and the uncertainty of the load received by microservices. A preference list is established by calculating the value gain and uncertainty of microservices to containers, and the embedding of microservices into containers is completed based on the preference list. This solves the problems of poor performance and low container resource utilization efficiency in microservice embedded in containers.
[0120] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A microservice load prediction method based on microservice embedded containers, characterized in that, include: Collect container deployment information and microservice information within the distribution area, and process the microservice information using a preset load prediction calculation method to obtain a first load prediction value corresponding to the microservice information; the container deployment information includes several containers; the microservice information includes several microservices; Based on the first load prediction value, the container deployment information, and the microservice information, the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices are obtained by using a preset value gain calculation method and a value gain variance calculation method, respectively. A first preference list of the plurality of microservices to the plurality of containers is constructed based on the value gain value, and a second preference list of the plurality of containers to the plurality of microservices is constructed based on the value gain uncertainty value. Based on the first preference list and the second preference list, a two-way selection is performed through the several microservices and several containers so that the several microservices are embedded into the several containers one by one, thereby obtaining several microservice embedded containers; The value gain value and value gain uncertainty value in the plurality of microservice embedded containers are processed by a preset modified value gain calculation method to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively. The load prediction calculation method is optimized according to the modified value gain value, and the optimized load prediction calculation method is used to predict the load of each of the microservices to obtain the second load prediction value corresponding to each of the microservices.
2. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The collection of container deployment information and microservice information within the collection area specifically includes: Collect available storage and computing resource information within the transformer area gateway, and use the available storage and computing resource information to group and deploy the storage and computing resources within the transformer area gateway into several containers, and obtain the container deployment information; Collect the work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices based on the work task information and register them to obtain the microservice information.
3. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The process of obtaining the value gain values of the plurality of microservices to the plurality of containers and the value gain uncertainty values of the plurality of containers to the plurality of microservices through preset value gain calculation methods and value gain variance calculation methods, specifically includes: Based on the first load prediction value, calculate the revenue value of the container processing the first load prediction value and the compatibility between the container and the microservice, so as to obtain the value gain value of the microservice to the container based on the revenue value, the compatibility and the preset revenue coefficient and the weight coefficient of the compatibility. The value gain uncertainty of the container to the microservice is obtained by calculating the variance of the value gain value.
4. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The step of constructing a first preference list of the plurality of microservices for the plurality of containers based on the value gain value and constructing a second preference list of the plurality of containers for the plurality of microservices based on the value gain uncertainty value specifically includes: Based on the value gain of the microservice to the container, the containers are sorted in descending order to obtain the first preference list of the microservice for the container; The microservices are sorted in ascending order based on the uncertainty of the value gain of the container on the microservice, to obtain a second preference list of the container for the microservice.
5. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The step of performing a two-way selection based on the first preference list and the second preference list, through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded one by one into the plurality of containers, specifically includes: According to the first preference list, the microservice sends an embedding request to the container with the highest sort order in the first preference list in sequence; The container receives several embedding requests sent by the several microservices, selects the embedding request with the highest sorting order from the several embedding requests according to the sorting order of the second preference list, and completes the embedding of the microservices with the container according to the embedding request with the highest sorting order.
6. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The process of handling the value gain value and value gain uncertainty value in the plurality of microservice embedded containers through a preset modified value gain calculation method specifically includes: Based on the preset first weighting function of the value gain value and the second function of the value gain uncertainty value, the first value gain value and the first value gain uncertainty value are obtained by multiplying them by the value gain value and the value gain uncertainty value respectively. The corrected value gain is obtained by adding the first value gain value and the first value gain uncertainty value.
7. The microservice load prediction method based on microservice embedded containers as described in claim 1, characterized in that, The optimization of the load prediction calculation method based on the modified value gain specifically includes: The network prediction parameters included in the load prediction calculation method are updated according to the corrected value gain value to obtain the optimized load prediction calculation method.
8. A microservice load prediction system based on microservice embedded containers, characterized in that, It includes an information module, a construction module, an embedding module, a processing module, and a prediction module; The information module is used to collect container deployment information and microservice information within the distribution area, and to process the microservice information through a preset load prediction calculation method to obtain a first load prediction value corresponding to the microservice information; the container deployment information includes several containers; the microservice information includes several microservices; The construction module is used to obtain the value gain value of the plurality of microservices to the plurality of containers and the value gain uncertainty value of the plurality of containers to the plurality of microservices based on the first load prediction value, the container deployment information and the microservice information, respectively through a preset value gain calculation method and a value gain variance calculation method. Based on the value gain value, it constructs a first preference list of the plurality of microservices to the plurality of containers and a second preference list of the plurality of containers to the plurality of microservices. The embedding module is used to perform bidirectional selection based on the first preference list and the second preference list through the plurality of microservices and the plurality of containers, so that the plurality of microservices are embedded one by one into the plurality of containers, thereby obtaining a plurality of microservice embedding containers. The processing module is used to process the value gain value and value gain uncertainty value in the plurality of microservice embedded containers respectively through a preset modified value gain calculation method, so as to obtain the modified value gain value corresponding to the plurality of microservice embedded containers respectively. The prediction module is used to optimize the load prediction calculation method according to the modified value gain value, and to predict the load prediction calculation method for the plurality of microservices respectively, so as to obtain the second load prediction value corresponding to the plurality of microservices respectively.
9. A microservice load prediction system based on microservice embedded containers as described in claim 8, characterized in that, The information module includes a deployment information unit and a microservice information unit; The deployment information unit is used to collect available storage and computing resource information within the transformer area gateway, and to use the available storage and computing resource information to group and deploy the storage and computing resources within the transformer area gateway into several containers, thereby obtaining the container deployment information. The microservice information unit is used to collect work task information within the transformer area gateway, and divide the work tasks within the transformer area gateway into several microservices and register them according to the work task information to obtain the microservice information.
10. A microservice load prediction system based on a microservice embedded container as described in claim 8, characterized in that, The construction module includes a calculation unit and a list unit; The calculation unit is used to calculate the revenue value of the container processing the first load prediction value and the adaptability of the container to the microservice based on the first load prediction value, so as to obtain the value gain value of the microservice to the container based on the revenue value, the adaptability and the preset revenue coefficient and the weight coefficient of the adaptability. By calculating the variance of the value gain value, the uncertainty value of the value gain of the container to the microservice is obtained; The list unit is used to sort the containers in descending order according to the value gain value of the microservice to the container, and obtain the first preference list of the microservice to the container; The microservices are sorted in ascending order based on the uncertainty of the value gain of the container on the microservice, to obtain a second preference list of the container for the microservice.