Dynamic resource allocation method and device based on container cloud and storage medium

Through the fusion of multiple prediction models and weight adjustment methods, container resources are dynamically allocated, which solves the performance problems caused by improper resource allocation in the existing technology, and improves the resource utilization rate and system performance of the container cloud platform.

CN119292789APending Publication Date: 2025-01-10KYLIN CORP
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411803636.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The method of allocating resources to containers in the prior art causes resources to be idle when low loads, waste resources, and fixed resource allocation at high loads cannot meet the needs, resulting in performance degradation or system crashes, making it difficult to cope with complex and changing load situations. Impact system performance.

Method used

By obtaining preprocessed container operation data, using multiple prediction models (LSTM, random forest, statistical rules) to make predictions, fuse the prediction results and adjust the weight values ​​according to different scenarios, and dynamically allocate resources to the container.

Benefits of technology

It realizes fast and accurate dynamic allocation of resources, improves resource utilization and system performance, avoids resource waste and insufficient resources, and enhances the robustness and stability of the container.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292789A_ABST
    Figure CN119292789A_ABST
Patent Text Reader

Abstract

Embodiments of the invention disclose a container cloud-based dynamic resource allocation method and apparatus, and a storage medium. The method comprises the steps of obtaining preprocessed container operation data; respectively inputting the container operation data into a first prediction model, a second prediction model and a third prediction model, and fusing the first prediction result, the second prediction result and the third prediction result by using the first prediction result, the second prediction result, the third prediction result and the respective corresponding weight values to obtain a fusion result, the sum of the corresponding weight values is 1, the corresponding weight values change according to different scenes, and the different scenes are determined according to parameters in the preprocessing process; and generating a resource calculation result according to the fusion result, and dynamically allocating resources to the container according to the resource calculation result. The resource of the container can be quickly and accurately dynamically allocated, and the resource utilization rate and the system performance are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of container cloud technology, and in particular to a container cloud-based dynamic resource allocation method, device and storage medium. Background Art

[0002] Container technology is a lightweight virtualization technology that enables rapid deployment and operation of applications by isolating resources at the operating system level. Compared with traditional virtual machines, containers have the advantages of fast startup, low resource overhead, and easy migration. The container cloud platform uses container technology to achieve the flexibility and scalability of cloud computing and provide users with efficient and reliable computing resources.

[0003] In the container cloud platform, the resource allocation strategy directly affects the resource utilization and performance of the system. In the prior art, the method of pre-allocating fixed resources for containers is usually adopted, that is, the corresponding resources are allocated before the container is loaded. However, this method causes idle resources under low load, which wastes resources. At the same time, under high load, the fixed resource allocation cannot meet the demand, resulting in performance degradation or even system crash. It is difficult to cope with complex and changeable load conditions, resulting in waste or insufficient resources, affecting system performance. Summary of the invention

[0004] The embodiments of the present invention provide a container cloud-based dynamic resource allocation method, device and storage medium to solve the technical problem in the prior art that resource allocation to containers generates waste or insufficiency, thereby affecting system performance.

[0005] In a first aspect, an embodiment of the present invention provides a dynamic resource allocation method based on a container cloud, comprising: Obtain preprocessed container operation data; Inputting the container operation data into a first prediction model, wherein the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; Inputting the container operation data into a second prediction model, the second prediction model adjusting the prediction result according to the input importance variable, and outputting a second prediction result; Inputting the container operation data into a third prediction model, wherein the third prediction model performs prediction according to a statistical rule of the container operation data and outputs a third prediction result; The first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​are used to fuse the first prediction result, the second prediction result and the third prediction result to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to parameters in the preprocessing process; A resource calculation result is generated according to the fusion result, and resources are dynamically allocated to the container according to the resource calculation result.

[0006] In a second aspect, an embodiment of the present invention further provides a dynamic resource allocation device based on a container cloud, comprising: An acquisition module is used to obtain pre-processed container operation data; A first output module, configured to input the container operation data into a first prediction model, wherein the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; A second output module, configured to input the container operation data into a second prediction model, wherein the second prediction model adjusts the prediction result according to the input importance variable and outputs a second prediction result; A third output module, configured to input the container operation data into a third prediction model, wherein the third prediction model performs prediction according to a statistical rule of the container operation data and outputs a third prediction result; A fusion module, used to fuse the first prediction result, the second prediction result and the third prediction result using the first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to parameters in a preprocessing process; The allocation module is used to generate a resource calculation result according to the fusion result, and dynamically allocate resources to the container according to the resource calculation result.

[0007] In a third aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the container cloud-based dynamic resource allocation method provided in the above embodiment.

[0008] The dynamic resource allocation method, device and storage medium based on container cloud provided by the embodiment of the present invention obtain preprocessed container operation data; input the container operation data into a first prediction model, the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; input the container operation data into a second prediction model, the second prediction model adjusts the prediction result according to the input importance variable, and outputs a second prediction result; input the container operation data into a third prediction model, the third prediction model predicts according to the statistical rule of the container operation data, and outputs a third prediction result; the first prediction result, the second prediction result and the third prediction result are fused by using the first prediction result, the second prediction result and the third prediction result and the corresponding weight values ​​respectively, and the fusion result is obtained, the sum of the corresponding weight values ​​is 1, and the corresponding weight value changes according to different scenarios, and the different scenarios are determined according to the parameters in the preprocessing process; the resource calculation result is generated according to the fusion result, and the resources are dynamically allocated to the container according to the resource calculation result. Three different types of models can be used for prediction respectively, and the three prediction results are fused, and the fusion result is optimized based on different scenarios, so that a more accurate prediction result can be obtained, and resources are dynamically allocated to the container based on the prediction result. It is conducive to the dynamic allocation of container resources quickly and accurately, improving resource utilization and system performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings: Figure 1 It is a flowchart of a dynamic resource allocation method based on container cloud provided in Embodiment 1 of the present invention; Figure 2 It is a flowchart of a dynamic resource allocation method based on container cloud provided in Embodiment 2 of the present invention; Figure 3 It is a structural diagram of a dynamic resource allocation device based on container cloud provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0010] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0011] Embodiment 1 Figure 1This is a flow chart of a dynamic resource allocation method based on a container cloud provided in the first embodiment of the present invention. This embodiment is applicable to the case of dynamically allocating resources to containers in a container cloud platform. The method can be executed by a dynamic resource allocation device based on a container cloud, and specifically includes the following steps: Step 110, obtaining preprocessed container operation data.

[0012] In this embodiment, the operation data of the container is first obtained, including CPU usage, memory usage, I / O, etc. These data include operation data information over a period of time in the past.

[0013] Exemplarily, the CPU utilization, memory utilization or IO utilization is the percentage of the corresponding container's utilization of the total CPU resources in the container cloud. For example, if the total CPU in the container cloud is 100 cores and the utilization of the container is 10%, then the number of CPU cores required for the container is 100*10%=10 cores.

[0014] After obtaining the operation data of the container, it can also be preprocessed to obtain the container operation data that is convenient for post-processing. Optionally, the preprocessing may include: interpolation processing to make up for missing data, denoising processing to remove noise data, and smoothing processing, etc.

[0015] Step 120: input the container operation data into a first prediction model, and the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data.

[0016] Exemplarily, the first prediction model can be an LSTM model, which can be trained using existing container operation data. During the training process, the input is a preprocessed resource training data set, and the output is dynamic resource training result information. LSTM, through its special design structure, can process and predict important events with very long intervals and delays in time series. By introducing a gating mechanism, the gradient vanishing and explosion problems in traditional RNNs are effectively solved, so that the model can better learn long-term dependencies. Because it can capture important dependencies in a sequence. It is particularly suitable for predicting container operation data.

[0017] The LSTM model can be trained using a loss function, where the loss function can be expressed as: ; Among them, Loss is the loss function value, is the result information of the i1th sample in the dynamic resource training result information, is the true result information of the preset i1th sample, Q1 is the number of samples in the training result information, and PCXS is the deviation coefficient.

[0018] It should be noted that the deviation coefficient may be set by a user or obtained based on historical data, which is not specifically described in the embodiment of the present invention.

[0019] When the loss function value is greater than a preset threshold, the accuracy of the first prediction model can be improved by iteratively optimizing the parameters in the model.

[0020] It should be noted that the preset threshold value ranges from [0.01, 0.1], and the present invention does not make any specific limitation.

[0021] Step 130: input the container operation data into a second prediction model, the second prediction model adjusts the prediction result according to the input importance variable, and outputs a second prediction result.

[0022] Optionally, the second prediction model can be a random forest model, which is a classic bagging model. The core idea is to improve the prediction accuracy and stability of the model by integrating multiple decision trees. Random forest makes predictions by integrating multiple decision trees, each of which is trained based on random samples and random features. This randomness reduces the risk of overfitting of a single decision tree, thereby improving the generalization ability of the model. Random forest is able to handle data sets with a large number of features and can evaluate the importance of features. This makes it perform well when processing high-dimensional data. Exemplarily, the historical operation data information after cleaning can first be normalized to obtain normalized historical operation data information. Optionally, the above normalization is implemented using the Min-Max normalization method.

[0023] The random forest model allows users to select important variables as discriminant conditions and make continuous adjustments, which can produce more accurate results based on user needs.

[0024] Furthermore, the random forest model may use the optimization model to evaluate the prediction performance of the second prediction model to improve the prediction accuracy of the second prediction model; The optimization model is implemented in the following way: ; Wherein, PGJ is the evaluation result value, SJ is the preset actual result information, and YC is the training result information, is the j1th actual result value in the actual result information, is the j1th training result value in the training result information, is the mean of all the actual result values ​​in the actual result information, and P is the number of the training result values ​​in the training result information.

[0025] It should be noted that the preset actual result information is obtained after the user sets it according to the training scenario; the training result information is the output information obtained by inputting the normalized historical operation data information into the second prediction model.

[0026] Using the above method, during the training process, it can be determined whether the training results of the random forest can meet the requirements. Optionally, the judgment evaluation result value can be set to whether it is less than a preset accuracy threshold. The preset accuracy threshold value ranges from [0.02, 0.08]. When the requirements are not met, the parameters are continuously optimized until they meet the prediction accuracy requirements.

[0027] Step 140: input the container operation data into a third prediction model, the third prediction model performs prediction according to a statistical rule of the container operation data, and outputs a third prediction result.

[0028] Usually, the tasks executed by the container have a certain time continuity. Therefore, in this embodiment, a third prediction model may be provided. The third prediction model may use statistical principles, that is, predict the container operation data according to statistical results.

[0029] Exemplarily, the third prediction model performs prediction based on the mean value and standard deviation of the container operation data in the following manner: ; Among them, DS3 is the third prediction result, is the i2th running resource value in the container running data, is the standard deviation of all running resource values ​​in the container running data, M is the number of running resource values ​​in the container running data, and are the first weight parameter and the second weight parameter.

[0030] It should be noted that the first weight parameter and the second weight parameter may also be set by the user, or may be obtained based on historical data, which is not specifically described in the embodiment of the present invention.

[0031] Step 150, using the first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​to fuse the first prediction result, the second prediction result and the third prediction result to obtain a fusion result, the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to the parameters in the preprocessing process.

[0032] Since each single prediction model has its own advantages, the prediction accuracy may be low in some scenarios. Therefore, in this embodiment, the three prediction results need to be fused. Optionally, the fusion can be performed in the following way: ; ; Wherein, DS4 is the fusion result, DS1, DS2 and DS3 are the first prediction result, the second prediction result and the third prediction result respectively. , and They are the first weight value, the second weight value and the third weight value respectively.

[0033] In this embodiment, the weight value can be flexibly adjusted according to the scenario to make the prediction result more accurate. Exemplarily, the scenario can be based on the parameters in the preprocessing process, such as adjusting the threshold to determine the current application scenario, and then adjusting the weight value of each prediction result.

[0034] Step 160: Generate a resource calculation result according to the fusion result, and dynamically allocate resources to the container according to the resource calculation result.

[0035] For example, the resource calculation result can be directly generated according to the fusion result. Furthermore, the fusion result can be calculated by constants to improve the robustness and stability of container operation.

[0036] Exemplarily, this can be achieved in the following ways: ; In the formula, MB is the resource calculation result, DQ is the current resource information, DS4 is the fusion result, is the fourth adjustment coefficient, and μ is a preset constant coefficient.

[0037] It should be noted that the current resource information is obtained by the user, and the preset constant coefficient has a value range of [0.9, 1.2]. By default, the value is 1.1.

[0038] It should be noted that the fourth adjustment coefficient may be set by a user or obtained based on historical data, which is not limited in the embodiment of the present invention.

[0039] By using the above method, the robustness and stability of container operation can be improved by setting the constant coefficient. For example, when the resources allocated to the container are 10%, if the container is exactly 10% at the current moment, in the subsequent time, if the container needs more operating resources, the current allocated resources will be insufficient, resulting in container operation errors or performance degradation, thereby affecting stable operation. After increasing the constant coefficient, the resource information allocated to the container is 10%*μ, and by default, 10%*1.1=11%, thereby improving the robustness and stability of container operation. The method provided in this embodiment can also predict the resource usage of the container cloud and give corresponding prompts.

[0040] This embodiment obtains preprocessed container operation data; inputs the container operation data into a first prediction model, and the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; inputs the container operation data into a second prediction model, and the second prediction model adjusts the prediction result according to the input importance variable and outputs a second prediction result; inputs the container operation data into a third prediction model, and the third prediction model predicts according to the statistical rules of the container operation data and outputs a third prediction result; uses the first prediction result, the second prediction result, and the third prediction result and the corresponding weight values ​​to fuse the first prediction result, the second prediction result, and the third prediction result to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to the parameters in the preprocessing process; generates a resource calculation result according to the fusion result, and dynamically allocates resources to the container according to the resource calculation result. Three different types of models can be used to make predictions respectively, and the three prediction results are fused, and the fusion results are optimized based on different scenarios, so that more accurate prediction results can be obtained, and resources can be dynamically allocated to the container based on the prediction results. It is conducive to the dynamic allocation of container resources quickly and accurately, improving resource utilization and system performance.

[0041] Embodiment 2 Figure 2It is a flow chart of the dynamic resource allocation method based on container cloud provided by the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. Before obtaining the preprocessed container operation data, the method can also add the following steps: collect container operation data and perform interpolation calculation on the container operation data; calculate the adjustment threshold according to the average value and median value of the data after interpolation calculation, and use the adjustment threshold as a preprocessing process parameter. Correspondingly, the method can also add the following steps: when the difference between the adjustment threshold and the mean is less than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is evenly distributed on both sides of the mean timeline, adjust the third weight value; when the difference between the adjustment threshold and the mean is greater than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is unevenly distributed on both sides of the mean timeline, adjust the first weight value.

[0042] It should be noted that the preset difference threshold is set by the user, or is obtained based on historical data, and the embodiment of the present invention does not limit this.

[0043] See also Figure 2 , the container cloud-based dynamic resource allocation method comprises: Step 210, collecting container operation data, and performing interpolation calculation on the container operation data; and calculating an adjustment threshold value according to the average value and median value of the data after the interpolation calculation.

[0044] In this embodiment, interpolation calculation is first performed on the collected container operation data to fill the missing values ​​therein. The adjusted threshold is calculated using the average value and the median value of the filled container operation data, and the abnormal values ​​in the container operation data are replaced by the adjusted threshold.

[0045] Exemplarily, the adjustment threshold may be obtained by averaging the first N operating resource values ​​in the container operating data, because the first N operating resource information values ​​are closer to the current moment, and a more accurate average value at the current moment may be obtained.

[0046] Furthermore, a calculation may be performed based on the mean value and all the container operation data, and a corresponding first threshold value may be obtained using a pre-acquired ratio threshold value.

[0047] When the first threshold is obtained, the adjustment threshold can be obtained by fusing the mean value and the first threshold. For example, the weight value can still be used to fuse them.

[0048] Step 220: Obtain preprocessed container operation data.

[0049] Step 230: input the container operation data into a first prediction model, and the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data.

[0050] Step 240: input the container operation data into a second prediction model, the second prediction model adjusts the prediction result according to the input importance variable, and outputs a second prediction result.

[0051] Step 250: input the container operation data into a third prediction model, the third prediction model performs prediction according to a statistical rule of the container operation data, and outputs a third prediction result.

[0052] Step 260: When the difference between the adjustment threshold and the mean is greater than the preset difference threshold, and the deviation values ​​of the container operation data after interpolation calculation are unevenly distributed on both sides of the mean timeline, adjust the first weight value; when the difference between the adjustment threshold and the mean is less than the preset difference threshold, and the deviation values ​​of the container operation data after interpolation calculation are evenly distributed on both sides of the mean timeline, adjust the third weight value.

[0053] By adjusting the weight value as described above, the stability of traditional resource allocation is retained, and the intelligent prediction capability of machine learning is utilized to improve the overall efficiency and robustness of the system. When the difference between the adjustment threshold and the mean is greater than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is unevenly distributed on both sides of the mean timeline, it can be determined that the resources required by the current container vary greatly. Therefore, it is necessary to increase the first weight value to fully utilize the LSTM model's accurate prediction capability for scenes with large changes. Correspondingly, when the difference between the adjustment threshold and the mean is less than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is evenly distributed on both sides of the mean timeline, it can be determined that the resource demand in the container cloud is very stable, and the value of the third weight value can be increased, thereby simplifying management and monitoring and avoiding the overhead of dynamic adjustment; on the premise of ensuring the accuracy of resource allocation, the robustness of the container cloud can also be increased.

[0054] Step 270, using the first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​to fuse the first prediction result, the second prediction result and the third prediction result to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1.

[0055] Step 280: Generate a resource calculation result according to the fusion result, and dynamically allocate resources to the container according to the resource calculation result.

[0056] This embodiment can also add the following steps: collecting container operation data, and performing interpolation calculation on the container operation data; calculating the adjustment threshold according to the average value and median value of the data after interpolation calculation, and using the adjustment threshold as a preprocessing process parameter. Correspondingly, the method can also add the following steps: when the difference between the adjustment threshold and the mean is less than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is evenly distributed on both sides of the mean timeline, adjust the third weight value; when the difference between the adjustment threshold and the mean is greater than the preset difference threshold, and the deviation value of the container operation data after interpolation calculation is unevenly distributed on both sides of the mean timeline, adjust the first weight value. The robustness of the container cloud can be increased while ensuring the accuracy of resource allocation.

[0057] Embodiment 3 Figure 3 is a schematic diagram of the structure of a dynamic resource allocation device based on container cloud provided in Embodiment 3 of the present invention, see Figure 3 , the container cloud-based dynamic resource allocation device comprises: An acquisition module 310 is used to acquire pre-processed container operation data; A first output module 320, configured to input the container operation data into a first prediction model, wherein the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; A second output module 330, configured to input the container operation data into a second prediction model, wherein the second prediction model adjusts the prediction result according to the input importance variable and outputs a second prediction result; A third output module 340, configured to input the container operation data into a third prediction model, wherein the third prediction model performs prediction according to a statistical rule of the container operation data and outputs a third prediction result; A fusion module 350 is used to fuse the first prediction result, the second prediction result and the third prediction result using the first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to parameters in the preprocessing process; The allocation module 360 ​​is used to generate a resource calculation result according to the fusion result, and dynamically allocate resources to the container according to the resource calculation result.

[0058] The dynamic resource allocation device based on container cloud provided in this embodiment obtains preprocessed container operation data; inputs the container operation data into a first prediction model, and the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; inputs the container operation data into a second prediction model, and the second prediction model adjusts the prediction result according to the input importance variable and outputs a second prediction result; inputs the container operation data into a third prediction model, and the third prediction model predicts according to the statistical rule of the container operation data and outputs a third prediction result; uses the first prediction result, the second prediction result and the third prediction result and the corresponding weight values ​​to fuse the first prediction result, the second prediction result and the third prediction result to obtain a fusion result, the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​change according to different scenarios, and the different scenarios are determined according to the parameters in the preprocessing process; generates a resource calculation result according to the fusion result, and dynamically allocates resources to the container according to the resource calculation result. Three different types of models can be used to make predictions respectively, and the three prediction results are fused, and the fusion results are optimized based on different scenarios, so that a more accurate prediction result can be obtained, and resources are dynamically allocated to the container based on the prediction result. It is conducive to the dynamic allocation of container resources quickly and accurately, improving resource utilization and system performance.

[0059] Based on the above embodiments, the third prediction model performs prediction according to the average value and standard deviation of the container operation data, which is implemented in the following manner: ; Among them, DS3 is the third prediction result, is the i2th running resource value in the container running data, is the standard deviation of all running resource values ​​in the container running data, M is the number of running resource values ​​in the container running data, and are the first weight parameter and the second weight parameter.

[0060] Based on the above embodiments, the allocation module includes: The optimization unit is used to perform constant optimization on the fusion result, which is achieved by: ; Among them, the MB is the resource calculation result, DQ is the current resource information, DS4 is the fusion result, is the fourth adjustment coefficient, is the preset constant coefficient.

[0061] Based on the above embodiments, the device further includes: A collection module, used for collecting container operation data and performing interpolation calculation on the container operation data; The adjustment threshold calculation module is used to calculate the adjustment threshold according to the average value and median value of the data after interpolation calculation, and use the adjustment threshold as a preprocessing process parameter.

[0062] Based on the above embodiments, the device further includes: The first weight value adjustment module is used to adjust the first weight value when the difference between the adjustment threshold and the mean is greater than a preset difference threshold and the deviation values ​​of the container operation data after interpolation calculation are unevenly distributed on both sides of the mean timeline.

[0063] Based on the above embodiments, the device further includes: The third weight value adjustment module adjusts the third weight value when the difference between the adjustment threshold and the mean is less than a preset difference threshold, and the deviation values ​​of the container operation data after interpolation calculation are evenly distributed on both sides of the mean timeline.

[0064] Based on the above embodiments, the device further includes: An evaluation module, used to evaluate the prediction performance of the second prediction model using the optimization model to improve the prediction accuracy of the second prediction model; The optimization model is implemented in the following way: ; Wherein, PGJ is the evaluation result value, SJ is the preset actual result information, and YC is the training result information. is the j1th actual result value in the actual result information, is the j1th training result value in the training result information, is the mean of all the actual result values ​​in the actual result information, and P is the number of the training result values ​​in the training result information.

[0065] The container cloud-based dynamic resource allocation device provided in an embodiment of the present invention can execute the container cloud-based dynamic resource allocation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0066] Embodiment 4 Embodiment 4 of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the container cloud-based dynamic resource allocation method as described in any one of the above embodiments.

[0067] The computer storage medium of the embodiment of the present invention may adopt any combination of one or more computer-readable media. The computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.

[0068] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0069] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0070] Computer program code for performing the operation of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or device. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0071] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A dynamic resource allocation method based on container cloud, characterized in that: include: Obtain preprocessed container operation data; Inputting the container operation data into a first prediction model, wherein the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; Inputting the container operation data into a second prediction model, the second prediction model adjusting the prediction result according to the input importance variable, and outputting a second prediction result; Inputting the container operation data into a third prediction model, wherein the third prediction model performs prediction according to a statistical rule of the container operation data and outputs a third prediction result; The first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​are used to fuse the first prediction result, the second prediction result and the third prediction result to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to parameters in the preprocessing process; A resource calculation result is generated according to the fusion result, and resources are dynamically allocated to the container according to the resource calculation result.

2. The method according to claim 1, characterized in that The third prediction model performs prediction based on the average value and standard deviation of the container operation data, and is implemented in the following manner: ; Among them, DS3 is the third prediction result, is the i2th running resource value in the container running data, is the standard deviation of all running resource values ​​in the container running data, M is the number of running resource values ​​in the container running data, and are the first weight parameter and the second weight parameter.

3. The method according to claim 1, characterized in that: The generating of resource calculation results according to the fusion results includes: The fusion result is optimized by constants in the following ways: ; Among them, the MB is the resource calculation result, DQ is the current resource information, DS4 is the fusion result, is the fourth adjustment coefficient, is the preset constant coefficient.

4. The method according to claim 1, characterized in that Before obtaining the preprocessed container operation data, the method further includes: Collecting container operation data, and performing interpolation calculation on the container operation data; The adjustment threshold is calculated according to the mean value and median value of the data after the interpolation calculation, and the adjustment threshold is used as a preprocessing process parameter.

5. The method according to claim 4, characterized in that The method further comprises: When the difference between the adjustment threshold and the mean is greater than a preset difference threshold, and the deviation values ​​of the container operation data after interpolation calculation are unevenly distributed on both sides of the mean timeline, the first weight value is adjusted.

6. The method according to claim 4, characterized in that The method further comprises: When the difference between the adjustment threshold and the mean is less than the preset difference threshold, and the deviation values ​​of the container operation data after interpolation calculation are evenly distributed on both sides of the mean timeline, the third weight value is adjusted.

7. The method according to claim 1, characterized in that The method further comprises: Using the optimization model to evaluate the prediction performance of the second prediction model to improve the prediction accuracy of the second prediction model; The optimization model is implemented in the following way: ; Among them, PGJ is the evaluation result value, SJ is the preset actual result information, and YC is the training result information. is the j1th actual result value in the actual result information, is the j1th training result value in the training result information, is the mean of all the actual result values ​​in the actual result information, and P is the number of the training result values ​​in the training result information.

8. A dynamic resource allocation device based on container cloud, characterized in that: include: An acquisition module is used to obtain preprocessed container operation data; A first output module, configured to input the container operation data into a first prediction model, wherein the first prediction model outputs a first prediction result according to the captured long-term dependency of the container operation data; A second output module, configured to input the container operation data into a second prediction model, wherein the second prediction model adjusts the prediction result according to the input importance variable and outputs a second prediction result; A third output module, configured to input the container operation data into a third prediction model, wherein the third prediction model performs prediction according to a statistical rule of the container operation data and outputs a third prediction result; A fusion module, used to fuse the first prediction result, the second prediction result and the third prediction result using the first prediction result, the second prediction result and the third prediction result and their corresponding weight values ​​to obtain a fusion result, wherein the sum of the corresponding weight values ​​is 1, and the corresponding weight values ​​vary according to different scenarios, and the different scenarios are determined according to parameters in a preprocessing process; The allocation module is used to generate a resource calculation result according to the fusion result, and dynamically allocate resources to the container according to the resource calculation result.

9. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to execute the container cloud-based dynamic resource allocation method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Network resource dynamic optimization method and device

    CN113487091A

  • Video frame insertion method and device, equipment and storage medium

    CN115942045A

  • Method and device for guaranteeing safe and reliable operation of application software

    CN116680146A

  • Resource quota adjustment method and system, electronic equipment and storage medium

    CN117724842A

  • Container elastic expansion and contraction method and device in cloud computing scene

    CN117971479A