Scheduling and processing method of virtual teaching and training platform based on Docker container
Through the analysis of historical data of the virtual teaching and training platform and real-time resource monitoring, resource allocation is dynamically adjusted, the lag caused by unreasonable container allocation is solved, the real-time and stability of the platform are improved, and resource utilization is optimized.
Patent Information
- Application Number
- CN202210573880.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2042-05-24
AI Technical Summary
The existing virtual teaching and training platform cannot be corrected in time when the container is unreasonable, resulting in problems such as lag in the experimental environment and waste of resources.
By conducting statistical analysis of the course historical CPU and memory usage data of each course, predict the next usage, and combining real-time data analysis of cloud server nodes, resource allocation is dynamically adjusted to form a reasonable resource queue to optimize container deployment.
It effectively improves the real-time and stability of the virtual teaching and training platform, avoids lag in the experimental environment, and optimizes resource utilization.
Smart Images

Figure CN114840311B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a simulation teaching technology, in particular to a scheduling and processing method for a virtual teaching and training platform based on a Docker container. Background Art
[0002] At present, computer network knowledge teaching in colleges and universities usually builds a virtual teaching training platform for virtual training teaching. The virtual teaching training platform is generally based on cloud servers, cloud hosts and container technologies. It usually deploys Docker to the cloud host and pulls a designated Docker training environment for each student. Students perform training operations through the Docker training environment on the cloud host, which is convenient to operate and can improve learning efficiency.
[0003] Docker has operating requirements for CPU and memory resources, generally including the minimum required operating resource amount and the maximum required operating resource amount. When deploying Docker to a cloud host, the CPU, memory resources, bandwidth effective utilization rate, etc. of each cloud host are not exactly the same. Users usually have high instantaneity when applying the virtual teaching and training platform. When multiple users (multiple students in the same class or students in multiple classes) conduct high-resource experiments at the same time, it will cause a part of the cloud host resources that are not reasonably deployed with Docker to be seriously overloaded, resulting in students experiencing a freeze in the virtual teaching and training platform during the experiment. At this time, it is very likely that other cloud hosts have excess idle resources that are not fully utilized. The existing virtual teaching and training platform lacks corrective measures in container allocation, and cannot be corrected in a timely manner when the container allocation is unreasonable. The freeze of the virtual teaching and training platform affects its promotion and application. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of lag caused by unreasonable container allocation and failure to correct it in time in the existing virtual teaching and training platform, and provide a scheduling and processing method for a virtual teaching and training platform based on Docker container, which can correct it in time when the container allocation is unreasonable, and avoid the phenomenon of lag in the experimental environment.
[0005] The purpose of the present invention is mainly achieved through the following technical solutions:
[0006] The scheduling and processing method of the virtual teaching and training platform based on the Docker container includes the following steps:
[0007] S1. The user logs in to the platform and selects a course;
[0008] S2, determine whether the current memory unblocked queue of the cloud server node provided by the platform is empty, if it is empty, go to step S3; if it is not empty, remove the CPU congestion item and the CPU severe congestion item from the current unblocked queue to form a first queue, and go to step S4;
[0009] S3, determine whether the memory congestion queue is empty, if it is empty, go to step S2; if it is not empty, remove the CPU congestion items and the CPU severe congestion items from the current memory congestion queue to form a first queue, and go to step S4;
[0010] S4, determine whether the first queue is empty, if it is empty, go to step S5; if it is not empty, convert the first queue to the third queue, then read the CPU occupancy prediction values of the classes to be taught in the current period, sort them in descending order, calculate the occupancy ratio of the class that selects the course, and go to step S6;
[0011] S5, remove the CPU serious congestion items in the first queue to form a second queue, determine whether the second queue is empty, if it is empty, go to step S2; if it is not empty, convert the second queue to the third queue, then read the CPU occupancy prediction values of the classes to be opened in the current period, sort them in descending order, calculate the occupancy ratio of the class that selects the course, and go to step S6;
[0012] S6, sort the third queue in descending order according to the CPU availability, select the corresponding node in the new sequence and new queue after sorting according to the occupancy ratio value calculated in step S4 or step S5, and go to step S7;
[0013] S7, determine whether the bandwidth of the selected node is congested, if it is congested, go to step S8, if not, go to step S9;
[0014] S8, traverse the front queue nodes at the third queue split point in step S6, select a node and then go to step S7; if the condition is not met, traverse the remaining back queue nodes at the third queue split point in step S6, select a node and then go to step S7; if all nodes are traversed and no node with uncongested bandwidth is found, go to step S2, otherwise go to step S9;
[0015] S9. Allocate a Docker container to the applicant according to the node confirmed in step S7 or step S8;
[0016] S10. Load into the course and start the course.
[0017] When the present invention is applied, after the user just logs in to the platform, the platform provides a cloud server node to allocate containers, and screening begins from a new queue of the newly selected server node until the final cloud server node is determined in the last step.
[0018] Furthermore, obtaining the predicted value of CPU usage includes the following steps:
[0019] Collect the CPU usage of the Docker container at set time intervals;
[0020] Sort the CPU usage of all the allocated Docker containers of the current course and the current class in descending order according to the highest and lowest values, and then obtain the average value of the CPU usage collection of the set middle length in the sorting queue as the CPU usage collection of the current course and the current class. If the average value of the three consecutive CPU usage collections is greater than the stored CPU usage prediction value, then use the currently calculated average value of the three consecutive CPU usage collections to update the CPU usage prediction value of the current course and the current class.
[0021] Repeat the above steps to obtain the CPU usage prediction values of all currently opened classes.
[0022] Furthermore, the calculation formula for averaging the CPU usage collected each time is:
[0023]
[0024] Among them, C CPU采 (c,k) is the average value of CPU usage, C CPU (i) is the CPU usage collection value of the container with sequence number i after sorting the course and class, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
[0025] Furthermore, the cloud server node is provided with a first memory occupancy rate threshold and a second memory occupancy rate threshold, the second memory occupancy rate threshold is greater than the first memory occupancy rate threshold, and the cloud server node divides the memory usage into three levels: smooth, congested and severely congested according to the memory occupancy rates of all currently opened courses and classes. When the calculated memory occupancy rate is less than the first memory occupancy rate threshold, the level is smooth; when the calculated memory occupancy rate is greater than or equal to the first memory occupancy rate threshold and less than or equal to the second memory occupancy rate threshold, the level is congested; when the calculated memory occupancy rate is greater than the second memory occupancy rate threshold, the level is severely congested; the memory with the level of smooth enters the memory smooth queue, the memory with the level of congested enters the memory congested queue, and the memory with the level of severely congested enters the memory severely congested queue; the memory smooth queue, memory congested queue and memory severely congested queue of the cloud server node are updated by the calculated memory occupancy rate.
[0026] Furthermore, the calculation formula of the memory occupancy rate is:
[0027]
[0028] Among them, C M-pre (c,m) is the predicted value of the memory usage of the container with container number m on node n, R M It is the memory usage of each node of the cloud server.
[0029] Furthermore, obtaining the predicted value of memory usage includes the following steps:
[0030] Collect the memory usage of Docker containers at set time intervals;
[0031] Sort the memory usage of all allocated Docker containers of the current course and class in descending order according to the highest and lowest values, and then obtain the average value of the memory usage collection amount of the set middle length in the sorting queue as the first memory usage collection amount of the current course and class. If the average value of three consecutive memory usage collection amounts is greater than the stored memory usage prediction value, then use the average value of three consecutive memory usage collection amounts currently calculated to update the memory usage prediction value of the current course and class.
[0032] Repeat the above steps to obtain the predicted values of memory usage of all currently opened classes.
[0033] Furthermore, the calculation formula for averaging the amount of memory usage collected each time is:
[0034]
[0035] Among them, C M采 (c,k) is the average value of memory usage, C M (i) is the memory usage collection value of the container with serial number i after the course and class are sorted, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
[0036] Furthermore, the cloud server node is provided with a first CPU occupancy rate threshold and a second CPU occupancy rate threshold, the second CPU occupancy rate threshold is greater than the first CPU occupancy rate threshold, and the cloud server node divides the CPU usage into three levels according to the CPU occupancy rate: smooth, congested and severely congested. When the CPU occupancy rate is less than the first CPU occupancy rate threshold, the level is smooth, when the CPU occupancy rate is greater than or equal to the first CPU occupancy rate threshold and less than or equal to the second CPU occupancy rate threshold, the level is congested, and when the CPU occupancy rate is greater than the second CPU occupancy rate threshold, the level is severely congested; the CPU with the level of smooth enters the CPU smooth queue, the CPU with the level of congested enters the CPU congested queue, and the CPU with the level of severely congested enters the CPU severely congested queue. The CPU occupancy rates of all currently opened courses of the cloud server are used to update the CPU smooth queue, the CPU congested queue and the CPU severely congested queue of the cloud server node.
[0037] Furthermore, the cloud server node is provided with a bandwidth occupancy rate threshold. The cloud server node divides bandwidth usage into two levels, namely, smooth and severely congested, according to the bandwidth occupancy rate. When the bandwidth occupancy rate is less than or equal to the bandwidth occupancy rate threshold, the level is smooth; when the bandwidth occupancy rate is greater than the bandwidth occupancy rate threshold, the level is severely congested. The bandwidth of the smooth level enters the bandwidth smooth queue, and the bandwidth of the severely congested level enters the bandwidth severely congested queue. The cloud server updates the bandwidth smooth queue and the bandwidth severely congested queue of the cloud server node according to the node bandwidth occupancy rates of all currently opened courses.
[0038] The existing virtual teaching and training platform based on Docker container fails to fully consider the high instantaneousness and concurrency of memory, CPU and bandwidth contention during the user's operation of Docker container for experiment, and the fault tolerance correction is not timely, which leads to the phenomenon of experimental environment freezing and resource waste. The present invention statistically analyzes the historical CPU usage data, historical memory usage data and historical bandwidth usage data collected by the teaching class of each course and predicts the possible CPU and memory usage of the class in the next course, and then finds a suitable node as the deployment node of the container by analyzing the usage data and predicted data of each node of the cloud server collected at a time, and at the same time, corrects and updates the predicted usage of CPU and memory of each class of each course by statistically analyzing the timed collection value, and timely updates the resource status queue of each node by using the corrected predicted usage and the timed collection amount of broadband, so as to solve the problem of unreasonable resource allocation in the container deployment process.
[0039] In summary, the present invention has the following beneficial effects compared with the prior art:
[0040] The present invention can effectively improve the real-time performance, rationality and stability of the virtual teaching and training platform, provide stable support for users when using the virtual teaching and training platform, and avoid the phenomenon of freezing of the experimental environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:
[0042] Figure 1 The flowchart of a specific embodiment of the present invention is shown in FIG. DETAILED DESCRIPTION
[0043] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.
[0044] Example:
[0045] like Figure 1 As shown, the scheduling and processing method of the virtual teaching and training platform based on Docker container includes the following steps: S1, the user logs in to the platform and selects a course; S2, determines whether the current memory unblocked queue of the cloud server node provided by the platform is empty, if it is empty, go to step S3; if it is not empty, remove the CPU congestion item and the CPU severe congestion item from the current unblocked queue to form a first queue, and go to step S4; S3, determines whether the memory congestion queue is empty, if it is empty, go to step S2; if it is not empty, remove the CPU congestion item and the CPU severe congestion item from the current memory congestion queue to form a first queue, and go to step S4; S3, determines whether the memory congestion queue is empty, if it is empty, go to step S2; if it is not empty, remove the CPU congestion item from the current memory congestion queue Remove CPU congestion items and CPU severe congestion items from the queue to form a first queue, and go to step S4; S4, determine whether the first queue is empty, if it is empty, go to step S5; if it is not empty, convert the first queue to the third queue, then read the CPU occupancy prediction values of the classes to be opened in the current period, sort them in descending order, calculate the occupancy ratio of the class that chooses the course, and go to step S6; S5, remove the CPU severe congestion items in the first queue to form a second queue, determine whether the second queue is empty, if it is empty, go to step S2; if it is not empty, the second queue is converted to the third queue, and then the predicted CPU occupancy values of the classes to be taught in the current period are read and sorted in descending order to calculate the occupancy ratio of the class that selects the course, and then go to step S6; S6, sort the third queue in descending order according to the CPU availability, select the corresponding node in the new sequence and queue after sorting according to the occupancy ratio calculated in step S4 or step S5, and go to step S7; S7, determine whether the bandwidth of the selected node is congested, if it is congested, go to step S8, if not, go to step S9; S8, traverse the front queue nodes in the third queue split point in step S6, select a node and go to step S7; if the condition is not met, traverse the remaining back queue nodes in the third queue split point in step S6, select a node and go to step S7; if all nodes are traversed and no node with uncongested bandwidth is found, go to step S2, otherwise go to step S9; S9, according to the node confirmed in step S7 or step S8, allocate a Docker container to the applicant; S10, load into the course and start the course. Among them, the occupancy ratio refers to the position of the course in the descending order after the CPU occupancy prediction value of the class to be opened in the current period is sorted in descending order, as a measure of the current course and the current class's preference for the CPU resource, and then judge whether the CPU resource is high energy consumption or low energy consumption. The split point is the node located by the point ratio. The split point divides a node queue into two parts, the front half is the front queue node, and the back half is the back queue node.
[0046] Insufficient memory will directly cause containers on the entire node to jam and be difficult to schedule. Therefore, this embodiment uses memory usage as the primary factor in node selection. The use of CPU has high instantaneous characteristics, which will also directly cause containers on the entire node to jam and be difficult to schedule. Therefore, this embodiment uses CPU usage as the second factor in node selection. The use of bandwidth has a relatively small impact on the overall cluster performance. Therefore, this embodiment uses bandwidth usage as the third factor in node selection. This embodiment gives priority to memory usage data, followed by CPU usage data, and finally bandwidth usage data, and performs hierarchical processing according to a preset algorithm, so that the container allocation strategy is closer to the ideal state.
[0047] The acquisition of the CPU occupancy prediction value in this embodiment includes the following steps: collecting the CPU occupancy of the Docker container at a set time interval; sorting the CPU occupancy of all the allocated Docker containers of the current course and the current class in descending order according to the value, and then obtaining the average value of the CPU occupancy collection amount of the set middle length in the sorting queue as the CPU occupancy collection amount of the current course and the current class for the current course. If the average value of the CPU occupancy collection amount for three consecutive times is greater than the stored CPU occupancy prediction value, the average value of the three consecutive CPU occupancy collection amounts currently calculated is used to update the CPU occupancy prediction value of the current course and the current class; repeat the above steps to obtain the CPU occupancy prediction value of all classes that have currently opened courses. When collecting CPU occupancy in this embodiment, it can be collected synchronously with memory occupancy, and the time interval, that is, the collection cycle, is set to 2 minutes.
[0048] In this embodiment, the calculation formula for averaging the CPU usage in each CPU collection is:
[0049]
[0050] Among them, C CPU采 (c,k) is the average value of CPU usage, C CPU (i) is the CPU usage collection value of the container with sequence number i after sorting the course and class, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
[0051] The cloud server node of this embodiment is provided with a first memory occupancy rate threshold and a second memory occupancy rate threshold, the second memory occupancy rate threshold is greater than the first memory occupancy rate threshold, and the cloud server node divides the memory usage into three levels: smooth, congested and severely congested according to the memory occupancy rates of all currently opened courses and classes. When the calculated memory occupancy rate is less than the first memory occupancy rate threshold, the level is smooth, when the calculated memory occupancy rate is greater than or equal to the first memory occupancy rate threshold and less than or equal to the second memory occupancy rate threshold, the level is congested, and when the calculated memory occupancy rate is greater than the second memory occupancy rate threshold, the level is severely congested; the memory with the level of smooth enters the memory smooth queue, the memory with the level of congested enters the memory congestion queue, and the memory with the level of severely congested enters the memory severely congested queue. The memory smooth queue, memory congestion queue and memory severely congested queue of the cloud server node are updated by the calculated memory occupancy rate. The memory severely congested queue of this embodiment is not included in the screening category in the scheduling process. The purpose of setting the memory severely congested queue is to solve the problem of instantaneous data peak. Each node server needs to reserve a certain proportion of the expansion value, so it cannot be fully used. In this embodiment, the first memory occupancy rate threshold is set to 70%, and the second memory occupancy rate threshold is set to 96%.
[0052] The calculation formula of the memory usage rate in this embodiment is:
[0053]
[0054] Among them, C M-pre (c,m) is the predicted value of the memory usage of the container with container number m on node n, R M It is the memory usage of each node of the cloud server.
[0055] The acquisition of the memory usage prediction value of this embodiment includes the following steps: collecting the memory usage of the Docker container at a set time interval; sorting the memory usage of all the allocated Docker containers of the current course and the current class in descending order according to the value, and then obtaining the average value of the memory usage collection amount of the set middle length in the sorting queue as the memory usage collection amount of the current course and the current class in this course. If the average value of the memory usage collection amount of three consecutive times is greater than the stored memory usage prediction value, the average value of the memory usage collection amount of three consecutive times calculated is used to update the memory usage prediction value of the current course and the current class; repeat the above steps to obtain the memory usage prediction value of all classes that have been opened. When implementing this embodiment, the time interval, that is, the collection cycle, is set to 2 minutes. In this way, this embodiment starts to update at the 6th minute, and after 6 minutes, it is updated every 2 minutes when the collection condition is met for three consecutive times, which can solve the suddenness of the actual value in time. In this embodiment, the memory usage collection amount of the middle set length can remove the abnormal highest value and some containers that have not been tested. When implementing this embodiment, the middle set length is preferably the middle 1 / 2 of the sorting queue after each collection.
[0056] In this embodiment, the calculation formula for averaging the memory usage in each memory collection is:
[0057]
[0058] Among them, C M采 (c,k) is the average value of memory usage, C M (i) is the memory usage collection value of the container with serial number i after the course and class are sorted, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
[0059] The cloud server node of this embodiment is provided with a first CPU occupancy rate threshold and a second CPU occupancy rate threshold, the second CPU occupancy rate threshold is greater than the first CPU occupancy rate threshold, and the cloud server node divides the CPU usage into three levels according to the CPU occupancy rate: smooth, congested and severely congested. When the CPU occupancy rate is less than the first CPU occupancy rate threshold, the level is smooth, when the CPU occupancy rate is greater than or equal to the first CPU occupancy rate threshold and less than or equal to the second CPU occupancy rate threshold, the level is congested, and when the CPU occupancy rate is greater than the second CPU occupancy rate threshold, the level is severely congested; the CPU with the level of smooth enters the CPU smooth queue, the CPU with the level of congested enters the CPU congested queue, and the CPU with the level of severely congested enters the CPU severely congested queue. The CPU occupancy rate of all currently opened courses and classes of the cloud server is updated to update the CPU smooth queue, CPU congested queue and CPU severely congested queue of the cloud server node. The CPU severely congested queue of this embodiment is not included in the screening category in the scheduling process. The purpose of setting the CPU severely congested queue is to solve the problem of instantaneous data peak. Each node server needs to reserve a certain proportion of the expansion value, so it cannot be fully used. In this embodiment, the first CPU occupancy rate threshold is set to 70%, and the second CPU occupancy rate threshold is set to 96%.
[0060] In this embodiment, the free-flowing items, congested items and severe congested items of memory and CPU are used as a status of the current node server resources and are used as judgment values when eliminating. The node servers with free-flowing items and congested items can still allocate containers, while the severely congested items cannot allocate containers. New containers can only be allocated after the node server status changes.
[0061] The cloud server node of this embodiment is provided with a bandwidth occupancy rate threshold. The cloud server node divides the bandwidth usage into two levels: smooth and severely congested according to the bandwidth occupancy rate. When the bandwidth occupancy rate is less than or equal to the bandwidth occupancy rate threshold, the level is smooth, and when the bandwidth occupancy rate is greater than the bandwidth occupancy rate threshold, the level is severely congested. The bandwidth with the smooth level enters the bandwidth smooth queue, and the bandwidth with the severely congested level enters the bandwidth severely congested queue. The cloud server updates the bandwidth smooth queue and the bandwidth severely congested queue of the cloud server node according to the node bandwidth occupancy rates of all currently opened courses.
[0062] This embodiment uses the Swarm container cluster management system developed by Docker to manage and collect cloud server node data. When Swarm manages servers, each node corresponds to a server. Swarm is a platform for managing docker clusters launched by Docker, which is almost entirely developed in GO language. It turns a group of Docker hosts into a single virtual host. Swarm uses the standard Docker API interface as its front-end access entry. In other words, various forms of Docker clients (compose, docker-py, etc.) can communicate directly with Swarm, and even Docker itself can be easily integrated with Swarm, which greatly facilitates users to transplant the original single-node system to Swarm. At the same time, Swarm has built-in support for Docker network plug-ins, and users can also easily deploy cross-host container cluster services. The data collection and algorithm processing process of this embodiment forms an API interface. If the interface needs to collect data, it communicates with Swarm for collection, and if database data is needed, it interacts with the database. After completing the node selection in this embodiment, it requests Swarm to allocate a docker on a selected node (i.e., server) to the user. This embodiment processes the three major resources of memory, CPU and bandwidth in sequence according to the priority that affects the degree of use, and divides the memory and CPU into three levels of unblocked, congested and severely congested according to the occupancy rate, that is, forming three state queues; the bandwidth is divided into two levels of unblocked and severely congested according to the occupancy rate, that is, forming two state queues. Each type of resource state queue is dynamically converted according to the timed collection data and the corresponding processing method. In order to better provide users with a stable and unblocked virtual experimental environment, this embodiment uses the quantitative statistical analysis results of the memory and CPU usage of the Docker container allocated to the designated course and the designated class user as the predicted usage of the next user as the decision-making basis for resource allocation, so as to make resource allocation more reasonable. At the same time, the memory and CPU usage data collected regularly and the corresponding algorithm are used to timely correct the predicted value to avoid severe congestion. This embodiment takes the collection sequence of the designated course and the designated class as the analysis object, obtains the predicted value through the statistical analysis algorithm, and uses the real-time collection value to timely correct the predicted value.
[0063] This embodiment uses memory usage data, CPU usage data, bandwidth usage data, etc., and introduces course and class history usage data, which together constitute key data describing the user's use of the virtual experiment environment, thereby more comprehensively considering the important factors that affect the user's use of the virtual experiment environment, making container resource allocation more accurate.
[0064] This embodiment uses statistical algorithm analysis to analyze the memory usage and CPU usage of the Docker container allocated to the user's course and class, so that the obtained prediction data can more accurately reflect the resource usage of the course, class, and experiment. At the same time, regular data collection and analysis are performed to correct abnormalities in the prediction data, making the algorithm more fault-tolerant and the container allocation strategy more reasonable.
[0065] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A scheduling and processing method for a virtual teaching and training platform based on a Docker container, characterized in that: The following steps are involved: S1. The user logs in to the platform and selects a course; S2, determine whether the current memory unblocked queue of the cloud server node provided by the platform is empty, if it is empty, go to step S3; if it is not empty, remove the CPU congestion item and the CPU severe congestion item from the current unblocked queue to form a first queue, and go to step S4; S3, determine whether the memory congestion queue is empty, if it is empty, go to step S2; if it is not empty, remove the CPU congestion items and the CPU severe congestion items from the current memory congestion queue to form a first queue, and go to step S4; S4, determine whether the first queue is empty, if it is empty, go to step S5; if it is not empty, convert the first queue to the third queue, then read the CPU occupancy prediction values of the classes to be taught in the current period, sort them in descending order, calculate the occupancy ratio of the class that selects the course, and go to step S6; S5, remove the CPU serious congestion items in the first queue to form a second queue, determine whether the second queue is empty, if it is empty, go to step S2; if it is not empty, convert the second queue to the third queue, then read the CPU occupancy prediction values of the classes to be opened in the current period, sort them in descending order, calculate the occupancy ratio of the class that selects the course, and go to step S6; S6, sort the third queue in descending order according to the CPU availability, select the corresponding node in the new sequence and new queue after sorting according to the occupancy ratio value calculated in step S4 or step S5, and go to step S7; S7, determine whether the bandwidth of the selected node is congested, if it is congested, go to step S8, if not, go to step S9; S8, traverse the front queue nodes at the third queue split point in step S6, select a node and then go to step S7; if the condition is not met, traverse the remaining back queue nodes at the third queue split point in step S6, select a node and then go to step S7; if all nodes are traversed and no node with uncongested bandwidth is found, go to step S2, otherwise go to step S9; S9. Allocate a Docker container to the applicant according to the node confirmed in step S7 or step S8; S10. Load into the course and start the course.
2. According to the scheduling and processing method of the virtual teaching and training platform based on the Docker container according to claim 1, it is characterized in that: The acquisition of the CPU occupancy prediction value comprises the following steps: Collect the CPU usage of the Docker container at set time intervals; Sort the CPU usage of all the allocated Docker containers of the current course and the current class in descending order according to the highest and lowest values, and then obtain the average value of the CPU usage collection of the set middle length in the sorting queue as the CPU usage collection of the current course and the current class. If the average value of the three consecutive CPU usage collections is greater than the stored CPU usage prediction value, then use the currently calculated average value of the three consecutive CPU usage collections to update the CPU usage prediction value of the current course and the current class. Repeat the above steps to obtain the CPU usage prediction values of all currently opened classes.
3. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 2 is characterized in that: The calculation formula for averaging the CPU usage collected each time is: Among them, C CPU采 (c,k) is the average value of CPU usage, C CPU (i) is the CPU usage collection value of the container with sequence number i after sorting the course and class, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
4. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 1 is characterized in that: The cloud server node is provided with a first memory occupancy rate threshold and a second memory occupancy rate threshold, the second memory occupancy rate threshold is greater than the first memory occupancy rate threshold, the cloud server node divides the memory usage into three levels: smooth, congested and severely congested according to the memory occupancy rates of all currently opened courses and classes, when the calculated memory occupancy rate is less than the first memory occupancy rate threshold, the level is smooth, when the calculated memory occupancy rate is greater than or equal to the first memory occupancy rate threshold and less than or equal to the second memory occupancy rate threshold, the level is congested, when the calculated memory occupancy rate is greater than the second memory occupancy rate threshold, the level is severely congested; the memory with the level of smooth enters the memory smooth queue, the memory with the level of congested enters the memory congestion queue, and the memory with the level of severely congested enters the memory severely congested queue, and the memory smooth queue, memory congestion queue and memory severely congested queue of the cloud server node are updated by the calculated memory occupancy rate.
5. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 4 is characterized in that: The calculation formula of the memory occupancy rate is: Among them, C M-pre (c,m) is the predicted value of the memory usage of the container with container number m on node n, R M It is the memory usage of each node of the cloud server.
6. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 5 is characterized in that: The acquisition of the predicted value of memory usage includes the following steps: Collect the memory usage of Docker containers at set time intervals; Sort the memory usage of all allocated Docker containers of the current course and class in descending order according to the highest and lowest values, and then obtain the average value of the memory usage collection amount of the set middle length in the sorting queue as the first memory usage collection amount of the current course and class. If the average value of three consecutive memory usage collection amounts is greater than the stored memory usage prediction value, then use the average value of three consecutive memory usage collection amounts currently calculated to update the memory usage prediction value of the current course and class. Repeat the above steps to obtain the predicted values of memory usage of all currently opened classes.
7. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 6 is characterized in that: The calculation formula for averaging the amount of memory usage collected each time is: Among them, C M采 (c,k) is the average value of memory usage, C M (i) is the memory usage collection value of the container with serial number i after the course and class are sorted, j is the number of containers currently allocated to the course and class, c is the class number, and k is the number of times.
8. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to claim 1 is characterized in that: The cloud server node is provided with a first CPU occupancy rate threshold and a second CPU occupancy rate threshold, the second CPU occupancy rate threshold is greater than the first CPU occupancy rate threshold, the cloud server node divides the CPU usage into three levels according to the CPU occupancy rate: smooth, congested and severely congested, when the CPU occupancy rate is less than the first CPU occupancy rate threshold, the level is smooth, when the CPU occupancy rate is greater than or equal to the first CPU occupancy rate threshold and less than or equal to the second CPU occupancy rate threshold, the level is congested, when the CPU occupancy rate is greater than the second CPU occupancy rate threshold, the level is severely congested; the CPU with the level of smooth enters the CPU smooth queue, the CPU with the level of congested enters the CPU congested queue, and the CPU with the level of severely congested enters the CPU severely congested queue, the CPU occupancy rate of all currently opened courses of the cloud server is used to update the CPU smooth queue, the CPU congested queue and the CPU severely congested queue of the cloud server node.
9. The scheduling and processing method for a virtual teaching and training platform based on a Docker container according to any one of claims 1 to 8, characterized in that: The cloud server node is provided with a bandwidth occupancy rate threshold. The cloud server node divides bandwidth usage into two levels: smooth and severely congested according to the bandwidth occupancy rate. When the bandwidth occupancy rate is less than or equal to the bandwidth occupancy rate threshold, the level is smooth, and when the bandwidth occupancy rate is greater than the bandwidth occupancy rate threshold, the level is severely congested. The bandwidth of the smooth level enters the bandwidth smooth queue, and the bandwidth of the severely congested level enters the bandwidth severely congested queue. The cloud server updates the bandwidth smooth queue and the bandwidth severely congested queue of the cloud server node according to the node bandwidth occupancy rates of all currently opened courses.
Citation Information
Patent Citations
Docker cloud platform based dynamic-priority-queue-feedback load-balanced resource scheduling method
CN106790726A
Container cluster scheduling method and platform for education desktop cloud application
CN110750331A
Cluster node load state prediction-based job scheduling method
WO2020206705A1