Intelligent resource scheduling and load balancing method based on interconnected cloud services
By collecting and analyzing various influencing factors in the future time period in cloud computing, combining machine learning models to predict the number of cloud service visits, calculate the number of demands of virtual machines and containers, and performing dynamic resource scheduling and allocation, the problem of insufficient resource scheduling flexibility and scalability in the existing technology is solved, and more efficient resource use and lower operating costs are achieved.
Patent Information
- Application Number
- CN202411081439.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-08-07
AI Technical Summary
When predicting and scheduling resource demand in cloud computing, the existing technology fails to fully consider various influencing factors in the future time, resulting in insufficient flexibility and scalability of resource scheduling and unable to adapt to complex and changeable actual needs.
By collecting and analyzing the time intervals in the future unit time, cloud server resource utilization and access data, combining machine learning models to predict cloud service access, calculate the number of demands of virtual machines and containers, and perform dynamic resource scheduling and allocation.
It improves the prediction accuracy of cloud service visits, optimizes resource usage, avoids over-configuration and idle resource resources, meets the needs of different time periods, reduces operating costs, and improves the efficiency and availability of cloud services.
Smart Images

Figure CN119088546B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of interconnected cloud services, and more specifically, to an intelligent resource scheduling and load balancing method based on interconnected cloud services. Background Art
[0002] With the development of cloud computing technology, the scheduling and load balancing of cloud server resources have become particularly important. Effective resource scheduling and load balancing can improve the availability, response speed and cost-effectiveness of cloud services.
[0003] In order to effectively predict resource demand and schedule resources, and realize optimal scheduling and matching between user demand and resources, the existing patent application with publication number CN111913780A proposes a resource prediction and scheduling method in cloud computing, the method comprising: S10: predicting the resource demand of at least one virtual machine at the next moment based on historical resource demand data; S20: dynamically scheduling the resources configured for the virtual machine on the server based on the predicted value of the resource demand.
[0004] Although the above method can meet most scenarios, research and practical application of the above method and existing technology have found that the above method and existing technology have at least the following defects:
[0005] Existing technologies only rely on historical resource demand data to predict resource demand, without considering various influencing factors in the future, such as whether it is a weekday, time period, and time interval, etc., and the flexibility and scalability of resource scheduling are insufficient, and mixed scheduling of virtual machines and containers is not supported, resulting in the inability to adapt to complex and changeable actual needs.
[0006] In view of this, the present invention proposes an intelligent resource scheduling and load balancing method based on interconnected cloud services to solve the above problems. Summary of the invention
[0007] In order to overcome the above-mentioned defects of the prior art and to achieve the above-mentioned purpose, the present invention provides the following technical solution: an intelligent resource scheduling and load balancing method based on interconnected cloud services, comprising:
[0008] Collect the first maximum number of requests and the second maximum number of requests, where the first maximum number of requests is the maximum number of requests processed per second by a single container without overloading CPU resources and memory resources, and the second maximum number of requests is the maximum number of requests processed per second by a single virtual machine without overloading CPU resources and memory resources;
[0009] Collect the time interval within the future unit time;
[0010] Collect the CPU usage, memory usage, disk usage, network delay time and cloud service access volume of the cloud server per unit time;
[0011] Analyze and process the time interval to obtain the date attribute label and time period value;
[0012] The CPU usage, memory usage, disk usage, network delay time and cloud service access volume are preprocessed to obtain the average CPU usage, memory usage, disk usage, network delay and access volume.
[0013] Input the access prediction data into the pre-trained access prediction model to obtain the predicted cloud service access volume; the access prediction data includes the average CPU usage, the average memory usage, the average disk usage, the average network delay, the average access volume, the date attribute label and the time period value;
[0014] According to the predicted cloud service access volume, combined with the first maximum request number and the second maximum request number, the required number of virtual machines and the required number of containers are calculated respectively, and resources of the virtual machines and containers of the cloud service are scheduled and allocated according to the required number of virtual machines and the required number of containers.
[0015] Furthermore, the method for obtaining the date attribute tag includes:
[0016] S101: Determine whether the start date and end date of the time interval are consistent; if not, execute S102; if consistent, execute S103;
[0017] S102: If the start point date is a working day and the end point date is a non-working day, the date attribute label is marked as A1; if the start point date is a non-working day and the end point date is a working day, the date attribute label is marked as A2;
[0018] S103: If the start point date and the end point date are both working days, the date attribute label is marked as A3; if the start point date and the end point date are both non-working days, the date attribute label is marked as A4.
[0019] Furthermore, the method for obtaining the time period value includes:
[0020] S111: Pre-constructing a time period value table; the time period value table includes time periods and time period values corresponding to the time periods, and the time periods do not include year, month, and day.
[0021] S112: Remove the year, month, and day from the time interval to obtain a time period of a future unit time; the time period length in the time period value table is greater than or equal to the time period length of the future unit time.
[0022] S113: If the time period of the future unit time is within the time period in the time period value table, the time period value of the future unit time is the corresponding time period value in the time period value table;
[0023] S114: If the time period of the future unit time does not match any time period in the time period value table, that is, the time period of the future unit time is not completely included in any time period in the time period value table, then calculate the proportion of the time period of the future unit time in each time period in the time period value table, and take the time period value corresponding to the time period with the largest proportion as the time period value of the future unit time.
[0024] Furthermore, the method for obtaining the CPU usage average includes:
[0025] The CPU usage in a unit time is used to establish a CPU analysis set, where the CPU analysis set includes the CPU usage in H time periods, and the average CPU usage in the CPU analysis set is calculated;
[0026] The method for obtaining the mean value of the memory usage rate includes:
[0027] The memory usage rate in a unit time is used to establish a memory analysis set, wherein the memory analysis set includes the memory usage rates in H time periods, and the mean value of the memory usage rates in the memory analysis set is calculated;
[0028] The method for obtaining the disk usage average value includes:
[0029] The disk usage in a unit time is used to establish a disk analysis set, where the disk analysis set includes disk usage in H time periods, and the average disk usage in the disk analysis set is calculated.
[0030] Furthermore, the method for obtaining the mean value of network delay includes:
[0031] Establish a delay analysis set based on the network delay time in unit time, where the delay analysis set includes the network delay time in H time periods, and calculate the mean value of the network delay time in the delay analysis set;
[0032] The method for obtaining the average value of the page views includes:
[0033] The cloud service visits in a unit time are used to establish a visit volume analysis set, where the visit volume analysis set includes the cloud service visits in H time periods, and the mean value of the cloud service visits in the visit volume analysis set is calculated.
[0034] Furthermore, the training method of the access prediction model includes:
[0035] Collect an access prediction data set in advance, wherein the access prediction data set includes access prediction data and cloud service visits corresponding to the access prediction data; divide the access prediction data set into a training set and a test set, build a classifier, use the access prediction data in the training set as the input of the access prediction model, and use the cloud service visits in the training set as the output of the access prediction model, so as to minimize the sum of the prediction accuracies of all predicted cloud service visits as the training goal; stop training when the sum of the prediction accuracies reaches convergence; the access prediction model is a gradient boosting tree model or a long short-term memory network model.
[0036] Furthermore, the method for scheduling and allocating resources for virtual machines and containers of cloud services includes:
[0037] S121: Calculate the predicted number of visits per second according to the predicted number of visits to the cloud service;
[0038] S122: Obtain the ratio of deployed virtual machines to containers, and mark it as the deployment ratio;
[0039] S123: convert the deployment ratio into a virtual machine ratio and a container ratio;
[0040] S124: Calculate the required number of virtual machines according to the predicted number of visits per second and the proportion of virtual machines;
[0041] S125: Calculate the required number of containers according to the predicted number of visits per second and the container ratio;
[0042] S126: Using a virtual machine management tool to automatically adjust and deploy a number of virtual machines equal to the required number of virtual machines in a future unit time; using a container management tool to automatically adjust and deploy a number of containers equal to the required number of containers in a future unit time;
[0043] S127: Use the cloud service load balancer to automatically distribute access requests to containers and virtual machines.
[0044] Furthermore, the method for calculating the predicted number of visits per second includes:
[0045] Convert the future unit time into seconds, marked as TM; substitute TM into the calculation formula for predicting the number of visits per second to obtain the predicted number of visits per second; the calculation formula for predicting the number of visits per second is:
[0046]
[0047] SFW is the predicted number of visits per second, FWL all The number of visits to the cloud service;
[0048] The method for obtaining the virtual machine ratio is as follows:
[0049]
[0050] XNJ is the virtual machine ratio, XNJF is the number of virtual machine shares, and RQF is the number of container shares;
[0051] The method for obtaining the container proportion is as follows:
[0052] RQ = 1-XNJ;
[0053] RQ is the container ratio.
[0054] Furthermore, the method for calculating the required number of virtual machines according to the predicted access volume per second and the proportion of virtual machines includes:
[0055] S1241: Calculate the number of requests that the virtual machine should process, and mark it as the number of requests processed by the virtual machine;
[0056] The calculation method of the virtual machine processing quantity is:
[0057] XNCL = SFW × XNJ;
[0058] XNCL is the number of virtual machine processing, SFW is the predicted number of visits per second, and XNJ is the proportion of virtual machines;
[0059] S1242: Calculate the initial demand for virtual machines, where the initial demand for virtual machines is the quotient of the number of virtual machine processing and the second maximum number of requests;
[0060] The calculation method of the preliminary requirements of the virtual machine is:
[0061]
[0062] XNXQ is the initial requirement for the virtual machine, DE max is the second largest number of requests;
[0063] S1243: If XNXQ is an integer, then XNXQ is the required number of virtual machines; if XNXQ is not an integer, determine whether the decimal part of XNXQ is greater than or equal to 0.5. If the decimal part of XNXQ is greater than or equal to 0.5, then is the number of virtual machines required. If the decimal part of XNXQ is less than 0.5, then The virtual machine required quantity is marked as XNSL.
[0064] Furthermore, the method for calculating the required number of containers according to the predicted number of visits per second and the container ratio includes:
[0065] S1251: Calculate the amount of unprocessed data processed by the virtual machine, and mark the amount of unprocessed data as WCL;
[0066] The calculation method of the amount of unprocessed data is:
[0067] If XNSL×DE max -XNCL is greater than or equal to 0, then the value of WCL is 0; if XNSL×DE max - If XNCL is less than 0, the value of WCL is XNCL-XNSL×DE max ;
[0068] S1252: Calculate the data that the container should process and mark it as container processing data;
[0069] The calculation method of the container processing data is:
[0070] RQCL=SFW×RQ+WCL;
[0071] RQCL is the container processing data, SFW is the predicted number of visits per second, and RQ is the container ratio;
[0072] S1253: Calculate the required number of containers;
[0073] The calculation method of the required number of containers is:
[0074]
[0075] RQSL is the required number of containers, DY max The first maximum number of requests.
[0076] The technical effects and advantages of the intelligent resource scheduling and load balancing method based on interconnected cloud services of the present invention are as follows: the time interval within a future unit time is collected, and the date attribute label and time period value are obtained through analysis and processing, the GPU utilization rate, memory utilization rate, disk utilization rate, network delay time and cloud service access volume of the cloud server within a unit time are collected, and the GPU utilization rate, memory utilization rate, disk utilization rate, network delay time and cloud service access volume are pre-processed respectively to obtain the CPU utilization rate mean, memory utilization rate mean, disk utilization rate mean, network delay mean and access volume mean, and the cloud service access volume is predicted by a machine learning model, which improves the prediction accuracy of the future cloud service access volume and lays a foundation for allocating and adjusting resources in advance. The maximum number of requests that can be processed by the container and the virtual machine per second is obtained through stress testing, and the ability of the container and the virtual machine to process access requests is accurately evaluated. According to the predicted cloud service access volume and the processing capacity of the container and the virtual machine, the required number of resources is calculated and allocated to avoid over-configuration and resource idleness, thereby optimizing resource use and meeting the needs of different time periods. The present invention introduces multiple influencing factors of the future time, uses machine learning models to predict cloud service access volume, and combines the hybrid deployment and dynamic scheduling of virtual machines and containers to overcome the shortcomings of existing technologies in resource prediction, scheduling flexibility and resource utilization. Through precise resource management and optimization, the operating costs of cloud service providers are reduced, the benefits and availability of cloud services are improved, and load balancing is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a schematic diagram of an intelligent resource scheduling and load balancing system based on interconnected cloud services according to Embodiment 1 of the present invention;
[0078] Figure 2 This is a flow chart of an intelligent resource scheduling and load balancing method based on interconnected cloud services according to Embodiment 2 of the present invention;
[0079] Figure 3 This is a schematic diagram of an electronic device according to Embodiment 3 of the present invention;
[0080] Figure 4 This is a schematic diagram of a storage medium according to Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0081] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0082] Example 1
[0083] See also Figure 1 As shown, the intelligent resource scheduling and load balancing system based on interconnected cloud services described in this embodiment includes a first acquisition module, a second acquisition module, a third acquisition module, a first processing module, a second processing module, an access prediction module and a resource scheduling module; each module realizes data transmission through wired and / or wireless connections.
[0084] The first collection module is used to collect a first maximum number of requests and a second maximum number of requests; the first maximum number of requests is the maximum number of requests that can be processed per second by a single container without overloading CPU resources and memory resources, and the second maximum number of requests is the maximum number of requests that can be processed per second by a single virtual machine without overloading CPU resources and memory resources.
[0085] The first maximum number of requests and the second maximum number of requests are both obtained through stress testing.
[0086] It should be noted that the results of the stress test include the maximum number of requests that can be processed per second. Cloud services can be deployed on multiple containers or multiple virtual machines, or on containers and virtual machines at the same time.
[0087] The second acquisition module is used to acquire the time interval within a unit time in the future;
[0088] The time interval is a continuous time period from a future unit time starting point to a future unit time ending point, and the time interval includes year, month, and day.
[0089] For example, the starting point of the future unit time is 12:01 on July 20, 2024, and the ending point of the future unit time is 13:00 on July 20, 2024. The time interval is from 12:01 on July 20, 2024 to 13:00 on July 20, 2024.
[0090] The third collection module is used to collect the CPU usage, memory usage, disk usage, network delay time and cloud service access volume of the cloud server within a unit time.
[0091] The CPU usage, memory usage, disk usage, network latency and cloud service access volume are obtained through cloud service monitoring and management tools, including AWS CloudWatch, Azure Monitor and Google Cloud Monitoring.
[0092] It should be noted that an increase in cloud service visits will increase CPU usage, disk usage, and disk usage. If the resources of virtual machines and containers are insufficient, it will cause network congestion and increase the response time of the system. The longer the response time, the lower the frequency of people's use of cloud servers, affecting customer usage and experience. Cloud service visits are the basic data for predicting the number of cloud service visits per unit time in the next stage.
[0093] The first processing module is used to analyze and process the time interval to obtain a date attribute label and a time period value.
[0094] The method for obtaining the date attribute tag includes:
[0095] S101: Determine whether the start date and end date of the time interval are consistent; if not, execute S102; if consistent, execute S103;
[0096] S102: If the start point date is a working day and the end point date is a non-working day, the date attribute label is marked as A1; if the start point date is a non-working day and the end point date is a working day, the date attribute label is marked as A2;
[0097] S103: If the start point date and the end point date are both working days, the date attribute label is marked as A3; if the start point date and the end point date are both non-working days, the date attribute label is marked as A4.
[0098] It should be noted that by distinguishing the start point date and the end point date of the time interval and marking them, the prediction accuracy of the cloud service access volume is improved. For example, from Friday night to Saturday morning, it is from working day to non-working day, and the corresponding date attribute label is marked as A1. People do not go to work, and the cloud service access volume during this period is usually higher than that during working days; for example, from Sunday night to Monday morning, it is from non-working day to working day, and the corresponding date attribute label is marked as A2. People need to go to work on Monday, and the cloud service access volume during this period is usually lower than that during non-working days; for example, from Friday afternoon 2 to Friday afternoon 5, the start point date and the end point date are both working days, and the corresponding date attribute label is marked as A3; for example, from Saturday afternoon 2 to Saturday afternoon 5, the start point date and the end point date are both non-working days, and the corresponding date attribute label is marked as A4; the cloud service access volume for non-working purposes is usually higher than that for working days.
[0099] The method for obtaining the time period value includes:
[0100] S111: Pre-constructing a time period value table; the time period value table includes time periods and time period values corresponding to the time periods, and the time periods do not include year, month, and day;
[0101] For example, the value of the time period from 12:01 to 13:00 is marked as 1, the value of the time period from 13:01 to 14:00 is marked as 2, and so on.
[0102] S112: removing the year, month, and day from the time interval to obtain a time period of a future unit time; the time period length in the time period value table is greater than or equal to the time period length of the future unit time;
[0103] S113: If the time period of the future unit time is within the time period in the time period value table, the time period value of the future unit time is the corresponding time period value in the time period value table;
[0104] For example, if the time period of the future unit time is 12:01 to 13:00, the time period 12:01 to 13:00 exists in the time period value table, and the time period value mark is 1, then the time period value of the future unit time is 1.
[0105] S114: If the time period of the future unit time does not match any time period in the time period value table, that is, the time period of the future unit time is not completely included in any time period in the time period value table, then calculate the proportion of the time period of the future unit time in each time period in the time period value table, and take the time period value corresponding to the time period with the largest proportion as the time period value of the future unit time.
[0106] For example, if the time period of the future unit time is 12:41 to 13:40, and the time period value table contains the time period 12:01 to 13:00, the time period value is marked as 1, and the time period 13:01 to 14:00, the time period value is marked as 2, then 20 minutes is in the time period 12:01 to 13:00, and the proportion is 40 minutes in the time period from 13:01 to 14:00, accounting for That is, the time period value of the future unit time is 2.
[0107] It should be noted that by dividing the time periods and obtaining the time period values, the prediction accuracy of the cloud service access volume can be further improved. For example, in the morning of weekdays, people go to work, and the cloud service access volume during this period is usually lower than that of non-working days; for example, from 7 to 9 pm, the cloud service access volume is usually higher, while in the early morning, the cloud service access volume is usually lower.
[0108] By analyzing date attribute labels and time period values, it helps to identify the peak and trough periods of cloud service access, thereby improving the prediction accuracy of cloud service access.
[0109] The second processing module is used to pre-process the CPU usage, memory usage, disk usage, network delay time and cloud service access volume respectively to obtain the average CPU usage, average memory usage, average disk usage, average network delay and average access volume.
[0110] The method for obtaining the average CPU usage rate includes:
[0111] The CPU usage in a unit time is used to establish a CPU analysis set, where the CPU analysis set includes the CPU usage in H time periods, and the average CPU usage in the CPU analysis set is calculated;
[0112] The calculation method of the CPU usage average is as follows:
[0113]
[0114] Among them, CPU is the average CPU usage, CPU h CPU usage in the hth time period in the CPU analysis set.
[0115] The method for obtaining the average CPU usage rate is used to obtain the average memory usage rate, the average disk usage rate, the average network delay and the average access volume.
[0116] The access prediction module is used to input the access prediction data into the pre-trained access prediction model to obtain the predicted cloud service access volume; the access prediction data includes the average CPU usage, the average memory usage, the average disk usage, the average network delay, the average access volume, the date attribute label and the time period value.
[0117] The training method of the access prediction model includes:
[0118] Collect an access prediction data set in advance, wherein the access prediction data set includes access prediction data and cloud service visits corresponding to the access prediction data; divide the access prediction data set into a training set and a test set, build a classifier, use the access prediction data in the training set as the input of the access prediction model, and use the cloud service visits in the training set as the output of the access prediction model, so as to minimize the sum of the prediction accuracies of all predicted cloud service visits as the training goal; stop training when the sum of the prediction accuracies reaches convergence; the access prediction model is a gradient boosting tree model or a long short-term memory network model.
[0119] The calculation formula for prediction accuracy is: ZQD n =(YC n -SJ n ) 2 , where ZQD n For prediction accuracy, YC nis the predicted cloud service access volume corresponding to the nth group of access prediction data, and SJn is the actual cloud service access volume corresponding to the nth group of access prediction data.
[0120] It should be noted that cloud service providers usually provide services for multiple applications on a shared infrastructure, that is, multiple applications share the same hardware, network and storage resources. Therefore, access volume prediction and scheduling management are required to optimize resource utilization and performance.
[0121] The resource scheduling module is used to calculate the required number of virtual machines and the required number of containers based on the predicted cloud service access volume, combined with the first maximum request number and the second maximum request number, and schedule and allocate resources for the virtual machines and containers of the cloud service based on the required number of virtual machines and the required number of containers.
[0122] The method for scheduling and allocating resources for virtual machines and containers of cloud services includes:
[0123] S121: Calculate the predicted number of visits per second based on the predicted number of visits to the cloud service.
[0124] The method for calculating the predicted number of visits per second includes:
[0125] Convert the future unit time into seconds and mark it as TM; substitute TM into the calculation formula for predicting the number of visits per second to obtain the predicted number of visits per second;
[0126] The calculation formula for predicting the number of visits per second is:
[0127]
[0128] Among them, SFW is the predicted number of visits per second, FWL all The number of visits to the cloud service.
[0129] S122: Obtain the ratio of deployed virtual machines to containers, marked as the deployment ratio. The deployment ratio is a ratio set by a person skilled in the art to adapt to the operation of cloud services; for example, the deployment ratio is 1:2, which means that the quantity relationship between virtual machines and containers is 1 virtual machine corresponds to 2 containers.
[0130] S123: convert the deployment ratio into a virtual machine ratio and a container ratio;
[0131] The method for obtaining the virtual machine ratio is as follows:
[0132]
[0133] Among them, XNJ is the virtual machine ratio, XNJF is the number of virtual machine shares, and RQF is the number of container shares. For example, if the number of virtual machine shares is 1 and the number of container shares is 2, the virtual machine ratio is The container ratio is
[0134] The method for obtaining the container proportion is as follows:
[0135] RQ = 1-XNJ;
[0136] Among them, RQ is the container ratio.
[0137] S124: Calculate the required number of virtual machines according to the predicted number of visits per second and the proportion of virtual machines.
[0138] S125: Calculate the required number of containers according to the predicted number of visits per second and the container ratio.
[0139] S126: Use a virtual machine management tool to automatically adjust and deploy a number of virtual machines equal to the number of virtual machine requirements in a future unit time; use a container management tool to automatically adjust and deploy a number of containers equal to the number of containers required in a future unit time. The virtual machine management tool includes AWS EC2 Auto Scaling and Azure VM Scale Sets, etc., and the container management tool includes Kubernetes (K8s) and Docker Swarm, etc.
[0140] S127: Use a cloud service load balancer to automatically distribute access requests to containers and virtual machines. The cloud service load balancer includes AWS ELB, Azure Load Balancer, Google Cloud Load Balancer, etc.
[0141] The method for calculating the required number of virtual machines according to the predicted access volume per second and the proportion of virtual machines includes:
[0142] S1241: Calculate the number of requests that the virtual machine should process, and mark it as the virtual machine processing number.
[0143] The calculation method of the virtual machine processing quantity is:
[0144] XNCL = SFW × XNJ;
[0145] Among them, XNCL is the number of virtual machine processing, SFW is the predicted number of visits per second, and XNJ is the proportion of virtual machines.
[0146] S1242: Calculate the initial demand for the virtual machine, where the initial demand for the virtual machine is the quotient of the number of virtual machine processing and the second maximum number of requests.
[0147] The calculation method of the preliminary requirements of the virtual machine is:
[0148]
[0149] Among them, XNXQ is the initial requirement of the virtual machine, DE max The second largest number of requests.
[0150] S1243: If XNXQ is an integer, then XNXQ is the required number of virtual machines; if XNXQ is not an integer, determine whether the decimal part of XNXQ is greater than or equal to 0.5. If the decimal part of XNXQ is greater than or equal to 0.5, then is the number of virtual machines required. If the decimal part of XNXQ is less than 0.5, then The virtual machine required quantity is marked as XNSL. Indicates rounding up. Indicates rounding down.
[0151] It should be noted that virtual machines are suitable for long-term large-scale concurrent requests, and they are slow to start and stop, and are not suitable for frequent deployment. The decimal part of XNXQ is less than 0.5, which means that the data that the virtual machine needs to process is less than half of the maximum number of requests that the virtual machine can process. Therefore, it is not suitable to deploy another virtual machine for a small amount of data that needs to be processed. It is more appropriate to hand over the remaining data to containers with high flexibility and rapid deployment for processing. For example, the number of requests that a virtual machine should process is 1300 / s, and the maximum number of requests that a virtual machine can process is 1000 / s. The initial demand for virtual machines is 1.3 virtual machines, and the decimal part is less than 0.5, so the number of virtual machines required is 1. No new virtual machines are deployed for the remaining 300 data. The remaining data is handed over to containers for processing, which can avoid waste of virtual machine resources, reduce overall operating costs, and be able to quickly scale according to demand, quickly respond to changes in load, and provide better service quality.
[0152] The method for calculating the required number of containers according to the predicted number of visits per second and the container ratio includes:
[0153] S1251: Calculate the amount of unprocessed data relative to the amount of data processed by the virtual machine, and mark the amount of unprocessed data as WCL.
[0154] The calculation method of the amount of unprocessed data is:
[0155] If XNSL×DE max -XNCL is greater than or equal to 0, then the value of WCL is 0; if XNSL×DE max - If XNCL is less than 0, the value of WCL is XNCL-XNSL×DE max .
[0156] S1252: Calculate the data that the container should process and mark it as container processing data.
[0157] The calculation method of the container processing data is:
[0158] RQCL=SFW×RQ+WCL;
[0159] Among them, RQCL is the container processing data, SFW is the predicted number of visits per second, and RQ is the container ratio.
[0160] S1253: Calculate the required number of containers.
[0161] The calculation method of the required number of containers is:
[0162]
[0163] Among them, RQSL is the required number of containers, DY max is the first maximum number of requests, It should be noted that the number of containers plus 1 is to reserve service space for cloud services to cope with sudden demands and avoid service crashes caused by sudden traffic increases.
[0164] Example 2
[0165] See also Figure 2 As shown, this embodiment provides an intelligent resource scheduling and load balancing method based on interconnected cloud services, and also includes:
[0166] Collect a first maximum number of requests and a second maximum number of requests, where the first maximum number of requests is the maximum number of requests that a single container can process per second without overloading CPU resources and memory resources, and the second maximum number of requests is the maximum number of requests that a single virtual machine can process per second without overloading CPU resources and memory resources;
[0167] Collect the time interval within the future unit time;
[0168] Collect the CPU usage, memory usage, disk usage, network delay time and cloud service access volume of the cloud server per unit time;
[0169] Analyze and process the time interval to obtain the date attribute label and time period value;
[0170] The CPU usage, memory usage, disk usage, network delay time and cloud service access volume are preprocessed to obtain the average CPU usage, memory usage, disk usage, network delay and access volume.
[0171] Input the access prediction data into the pre-trained access prediction model to obtain the predicted cloud service access volume; the access prediction data includes the average CPU usage, the average memory usage, the average disk usage, the average network delay, the average access volume, the date attribute label and the time period value;
[0172] According to the predicted cloud service access volume, combined with the first maximum request number and the second maximum request number, the required number of virtual machines and the required number of containers are calculated respectively, and resources of the virtual machines and containers of the cloud service are scheduled and allocated according to the required number of virtual machines and the required number of containers.
[0173] Example 3
[0174] See also Figure 3 As shown, the present application also provides an electronic device 500. The electronic device 500 may include one or more processors and one or more memories. The memory stores a computer-readable code, and when the computer-readable code is executed by one or more processors, the intelligent resource scheduling and load balancing method based on the interconnected cloud service as described above can be executed.
[0175] The method or system according to the embodiment of the present application can also be used Figure 3 The electronic device architecture shown in FIG. Figure 3 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, ROM 503, RAM 504, a communication port 505 connected to a network, an input / output 506, a hard disk 507, etc. The storage device in the electronic device 500, such as ROM 503 or hard disk 507, may store the intelligent resource scheduling and load balancing method based on the interconnected cloud service provided by the present application. Furthermore, the electronic device 500 may also include a user interface 508. Of course, Figure 3 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 3 One or more components of an electronic device are shown.
[0176] Example 4
[0177] See also Figure 4 As shown, the present application also provides a computer-readable storage medium 600. Computer-readable instructions are stored on the computer-readable storage medium 600. When the computer-readable instructions are executed by the processor, the intelligent resource scheduling and load balancing method based on the interconnected cloud service according to the embodiment of the present application described with reference to the above figures can be executed. The storage medium 600 includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache). Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0178] In addition, according to the implementation of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the present application provides a non-transitory machine-readable storage medium, which stores machine-readable instructions, and the machine-readable instructions can be executed by a processor to execute instructions corresponding to the method steps provided by the present application, for example: intelligent resource scheduling and load balancing method based on interconnected cloud services. When the computer program is executed by a central processing unit (CPU), the above functions defined in the method of the present application are executed.
[0179] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0180] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An intelligent resource scheduling and load balancing method based on interconnected cloud services, characterized in that: include: Collect the first maximum number of requests and the second maximum number of requests, where the first maximum number of requests is the maximum number of requests processed per second by a single container without overloading CPU resources and memory resources, and the second maximum number of requests is the maximum number of requests processed per second by a single virtual machine without overloading CPU resources and memory resources; Collect the time interval within the future unit time; Collect the CPU usage, memory usage, disk usage, network delay time and cloud service access volume of the cloud server per unit time; Analyze and process the time interval to obtain the date attribute label and time period value; The method for obtaining the date attribute tag includes: S101: Determine whether the start date and end date of the time interval are consistent; if not, execute S102; if consistent, execute S103; S102: If the start date is a working day and the end date is a non-working day, the date attribute label is marked as ; If the start date is a non-working day and the end date is a working day, the date attribute label is marked as ; S103: If the start point date and the end point date are both working days, the date attribute label is marked as ; If both the start point date and the end point date are non-working days, the date attribute label is marked as ; The method for obtaining the time period value includes: S111: Pre-constructing a time period value table; the time period value table includes time periods and time period values corresponding to the time periods, and the time periods do not include year, month, and day; S112: removing the year, month, and day from the time interval to obtain a time period of a future unit time; the time period length in the time period value table is greater than or equal to the time period length of the future unit time; S113: If the time period of the future unit time is within the time period in the time period value table, the time period value of the future unit time is the corresponding time period value in the time period value table; S114: If the time period of the future unit time does not match any time period in the time period value table, that is, the time period of the future unit time is not completely included in any time period in the time period value table, then the proportion of the time period of the future unit time in each time period in the time period value table is calculated, and the time period value corresponding to the time period with the largest proportion is taken as the time period value of the future unit time; The CPU usage, memory usage, disk usage, network delay time and cloud service access volume are preprocessed to obtain the average CPU usage, memory usage, disk usage, network delay and access volume. Input the access prediction data into the pre-trained access prediction model to obtain the predicted cloud service access volume; the access prediction data includes the average CPU usage, the average memory usage, the average disk usage, the average network delay, the average access volume, the date attribute label and the time period value; The training method of the access prediction model includes: Collect an access prediction data set in advance, the access prediction data set includes access prediction data and cloud service visits corresponding to the access prediction data; divide the access prediction data set into a training set and a test set, build a classifier, use the access prediction data in the training set as the input of the access prediction model, use the cloud service visits in the training set as the output of the access prediction model, and minimize the sum of the prediction accuracies of all predicted cloud service visits as the training goal; stop training when the sum of the prediction accuracies reaches convergence; the access prediction model is a gradient boosting tree model or a long short-term memory network model; According to the predicted cloud service access volume, combined with the first maximum request number and the second maximum request number, the required number of virtual machines and the required number of containers are calculated respectively, and resources of the virtual machines and containers of the cloud service are scheduled and allocated according to the required number of virtual machines and the required number of containers.
2. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 1 is characterized in that: The method for obtaining the average CPU usage rate includes: The CPU usage in a unit time is used to establish a CPU analysis set, where the CPU analysis set includes the CPU usage in H time periods, and the average CPU usage in the CPU analysis set is calculated; The method for obtaining the mean value of the memory usage rate includes: The memory usage rate in a unit time is used to establish a memory analysis set, wherein the memory analysis set includes the memory usage rates in H time periods, and the mean value of the memory usage rates in the memory analysis set is calculated; The method for obtaining the disk usage average value includes: The disk usage in a unit time is used to establish a disk analysis set, where the disk analysis set includes the disk usage in H time periods, and the average disk usage in the disk analysis set is calculated.
3. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 2 is characterized in that: The method for obtaining the network delay mean value includes: Establish a delay analysis set based on the network delay time in unit time, where the delay analysis set includes the network delay time in H time periods, and calculate the mean value of the network delay time in the delay analysis set; The method for obtaining the average value of the page views includes: The cloud service visits in a unit time are used to establish a visit volume analysis set, where the visit volume analysis set includes the cloud service visits in H time periods, and the mean value of the cloud service visits in the visit volume analysis set is calculated.
4. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 3 is characterized in that: The method for scheduling and allocating resources for virtual machines and containers of cloud services includes: S121: Calculate the predicted number of visits per second according to the predicted number of visits to the cloud service; S122: Obtain the ratio of deployed virtual machines to containers, and mark it as the deployment ratio; S123: convert the deployment ratio into a virtual machine ratio and a container ratio; S124: Calculate the required number of virtual machines according to the predicted number of visits per second and the proportion of virtual machines; S125: Calculate the required number of containers according to the predicted number of visits per second and the container ratio; S126: Using a virtual machine management tool to automatically adjust and deploy a number of virtual machines equal to the required number of virtual machines in a future unit time; using a container management tool to automatically adjust and deploy a number of containers equal to the required number of containers in a future unit time; S127: Use the cloud service load balancer to automatically distribute access requests to containers and virtual machines.
5. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 4 is characterized in that: The method for calculating the predicted number of visits per second includes: Convert the future time unit into seconds, marked as ;Will Substitute the predicted number of visits per second into the calculation formula to obtain the predicted number of visits per second; the calculation formula for the predicted number of visits per second is: ; To predict the number of visits per second, The number of visits to the cloud service; The method for obtaining the virtual machine ratio is as follows: ; is the proportion of virtual machines, is the number of copies of the virtual machine, is the number of servings of the container; The method for obtaining the container proportion is as follows: ; is the container ratio.
6. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 5, characterized in that: The method for calculating the required number of virtual machines according to the predicted access volume per second and the proportion of virtual machines includes: S1241: Calculate the number of requests that the virtual machine should process, and mark it as the number of requests processed by the virtual machine; The calculation method of the virtual machine processing quantity is: ; Processing quantity for virtual machines; S1242: Calculate the initial demand for virtual machines, where the initial demand for virtual machines is the quotient of the number of virtual machine processing and the second maximum number of requests; The calculation method of the preliminary requirements of the virtual machine is: ; Initial requirements for virtual machines, is the second largest number of requests; S1243: If is an integer, then is the number of virtual machines required; if Not an integer, judge Is the decimal part of greater than or equal to 0.5? If the decimal part of is greater than or equal to 0.5, then is the number of virtual machines required, if If the decimal part of is less than 0.5, then The number of virtual machines required is marked as .
7. The intelligent resource scheduling and load balancing method based on interconnected cloud services according to claim 6, characterized in that: The method for calculating the required number of containers according to the predicted number of visits per second and the container ratio includes: S1251: Calculate the amount of unprocessed data processed by the virtual machine, and mark the amount of unprocessed data as ; The calculation method of the amount of unprocessed data is: like Greater than or equal to 0, then The value of is 0; if Less than 0, then The value of ; S1252: Calculate the data that the container should process and mark it as container processing data; The calculation method of the container processing data is: ; Process data for containers; S1253: Calculate the required number of containers; The calculation method of the required number of containers is: ; is the required number of containers, The first maximum number of requests.
Citation Information
Patent Citations
Resource prediction and scheduling method in cloud computing
CN111913780A
Method for evaluating service quality of cloud computing resources
CN104038392A
Cloud game resource scheduling method and device
CN112685187A