Calculation service scheduling method and system
By dynamically allocating computing resources and supporting multiple allocation rules, the problems of uneven resource allocation and inefficient utilization in traditional computing service scheduling are solved, efficient utilization of computing resources and efficient execution of tasks are achieved, and the adaptability of the system is improved. stability.
Patent Information
- Application Number
- CN202411517977.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-01-10
AI Technical Summary
Traditional computing service scheduling methods cannot effectively manage and allocate computing resources, resulting in uneven resource allocation, inefficient utilization efficiency, lack of flexibility and overload risk, and cannot optimize resource use in multi-tasking and multi-resource environments.
By obtaining container calculation task requirements, reading description parameters, joining waiting execution queues, obtaining real-time resource situations and allocation rules, generating execution plans, dynamic allocation of resources, supporting timing priority and maximizing resource utilization allocation rules, ensuring that tasks are in the resources Use within the upper limit to execute.
It realizes efficient utilization of computing resources and efficient execution of tasks, solves the problems of idle resources and low efficiency in use, provides flexible resource scheduling strategies, improves the adaptability and scalability of the system, and ensures the stability and effectiveness of resources. use.
Smart Images

Figure CN119292747A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the technical field of computer service scheduling, and in particular to a computing service scheduling method and system. Background Art
[0002] In traditional computing service scheduling, computing tasks are usually assigned to available computing resources, such as workstations or servers, but these systems often cannot effectively manage and limit computing resources in a fine-grained manner. This results in some computing tasks taking up too many resources, while other tasks may not be processed in a timely manner due to insufficient resources. Therefore, existing computing service scheduling methods are unable to cope with multi-task and multi-resource environments and cannot fully optimize resource utilization efficiency. Summary of the invention
[0003] The embodiments of the present invention provide a computing service scheduling method and system, which can customize the resource usage upper limit of each computing service and dynamically allocate computing resources, thereby achieving efficient utilization of computing resources on a workstation or server.
[0004] To achieve the above objectives, in a first aspect, the present invention provides a computing service scheduling method, comprising:
[0005] Obtain container computing task requirements;
[0006] Reading description parameters of the container computing task requirement, and adding the container computing task requirement to a queue waiting for execution;
[0007] Obtain the real-time available resource status and current allocation rules in the restricted resource pool and generate an execution plan;
[0008] Based on the execution plan, the scheduling task is executed.
[0009] In one embodiment of the present invention, the computing service scheduling method further includes:
[0010] Generate execution results based on execution scheduling tasks;
[0011] Based on the execution result, the execution result is issued through a notification service.
[0012] In one embodiment of the present invention, the obtaining of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generating of the execution plan comprises:
[0013] If the allocation rule is time priority, the next computing task will be executed sequentially if the available resources are sufficient;
[0014] If the allocation rule is time priority, and the available resources are not satisfied, the system will wait for the resources to be released and then execute the next task in the priority order.
[0015] In one embodiment of the present invention, the obtaining of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generating of the execution plan comprises:
[0016] If the allocation rule is to maximize resource utilization first, the next task will be executed in priority order if the available resources are sufficient;
[0017] If the allocation rule is to maximize resource utilization first, if the available resources are not met, it will be skipped and the next task that can be executed under the existing resource conditions will be found and executed first.
[0018] In a second aspect, the present invention provides a computing service scheduling system, comprising: an acquisition module, a joining module, a first generation module and an execution module. The acquisition module is used to obtain container computing task requirements. The joining module is used to read the description parameters of the container computing task requirements and add the container computing task requirements to a queue waiting for execution. The first generation module is used to obtain the real-time available resource status and current allocation rules in the restricted resource pool and generate an execution plan. And the execution module is used to execute the scheduling task based on the execution plan.
[0019] In one embodiment of the present invention, the computing service scheduling system further includes: a second generating module and an issuing module. The second generating module is used to generate an execution result based on the execution scheduling task. And the issuing module is used to issue the execution result through a notification service based on the execution result.
[0020] In one embodiment of the present invention, the first generation module includes: a first execution unit and a second execution unit. The first execution unit is used to execute the next computing task in sequence if the allocation rule is time priority and the available resources are satisfied. And the second execution unit is used to wait for the resources to be released and execute the next task in sequence if the allocation rule is time priority and the available resources are not satisfied.
[0021] In one embodiment of the present invention, the first generation module further includes: a third execution unit and a fourth execution unit. The third execution unit is used to prioritize the execution of the next task if the allocation rule is to prioritize the use of resources to the maximum extent and the available resources are satisfied. The fourth execution unit is used to skip the task if the allocation rule is to prioritize the use of resources to the maximum extent and the available resources are not satisfied, and to find the next task that can be executed under the existing resource conditions and execute it first.
[0022] In a third aspect, the present invention provides an electronic device, comprising:
[0023] at least one processor; and
[0024] a memory communicatively coupled to the at least one processor;
[0025] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the three-dimensional thermosphere and ionosphere parameter inversion method based on electron density as described above.
[0026] In a fourth aspect, the present invention provides a computer-readable storage medium, comprising a computer program and instructions, which, when executed on a computer, enables the computer to execute the three-dimensional thermosphere and ionosphere parameter inversion method based on electron density as described above.
[0027] Compared with the prior art, the computing service scheduling method and system according to the present invention can customize the resource usage upper limit of each computing service and dynamically allocate computing resources, thereby realizing efficient utilization of computing resources on a workstation or server. In this way, the present invention aims to solve the problem of idle computing resources and low utilization efficiency in the prior art by scheduling tasks and maximizing the speed limit of parallel computing tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a flowchart of a computing service scheduling method in Embodiment 1 of the present invention;
[0029] Figure 2 It is a structural diagram of a computing service scheduling system in Embodiment 2 of the present invention;
[0030] Figure 3 It is a structural schematic diagram of an electronic device in Embodiment 3 of the present invention.
[0031] Figure 4 It is a logical flow diagram of a computing service scheduling method in a specific embodiment of the present invention. DETAILED DESCRIPTION
[0032] The embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present invention, rather than to limit the embodiments of the present invention. It is also necessary to explain that, for ease of description, only parts related to the embodiments of the present invention are shown in the accompanying drawings, rather than all structures.
[0033] To facilitate understanding, the main implementation concepts of the embodiments of the present invention are first briefly described.
[0034] In traditional computing service scheduling environments, computing tasks are usually statically assigned to available computing resources, such as workstations, servers, or cloud computing nodes. However, these systems often lack the ability to manage computing resources in a fine-grained manner and dynamically allocate resources. Specifically, there are several key issues:
[0035] 1. Uneven resource allocation: Due to the lack of an effective resource management mechanism, some computing tasks may occupy too many resources, causing other tasks to fail to execute in time due to insufficient resources. This imbalance in resource allocation seriously affects the overall performance and efficiency of the system.
[0036] 2. Inefficient resource utilization: Traditional computing service scheduling methods often fail to dynamically adjust according to real-time resource conditions and task requirements, resulting in insufficient resource utilization. In some cases, even if resources are idle, they cannot be effectively allocated to required tasks, resulting in a waste of resources.
[0037] 3. Lack of flexibility: Traditional scheduling systems usually only support fixed resource allocation strategies and cannot be flexibly adjusted according to actual needs. This limits the adaptability and scalability of the system in different scenarios.
[0038] 4. Risk of resource overload: Without an effective resource usage upper limit control mechanism, computing tasks may occupy resources without limit, causing system overload or even crash. This not only affects the execution of the current task, but may also threaten the stability of the entire system.
[0039] The inventors have discovered the above-mentioned defects in the prior art and proposed a computing service scheduling method and system. By customizing the resource usage limit of each computing service and dynamically allocating computing resources, the present invention aims to achieve efficient utilization of computing resources and efficient execution of tasks. Specifically, the computing service scheduling method of the present invention includes the following steps:
[0040] 1. Obtain container computing task requirements: First, the system needs to obtain the demand information of the container computing task to be executed, including the required CPU, memory, storage and other resources and the priority of the task.
[0041] 2. Join the waiting execution queue: The system reads the description parameters of the container computing task requirements, and adds these tasks to the waiting execution queue according to priority or other rules, waiting for the scheduler to schedule them.
[0042] 3. Generate execution plan: The scheduler generates the optimal execution plan based on the real-time available resources in the restricted resource pool and the current allocation rules. This plan takes into account the resource requirements of the task, the availability of resources, and the constraints of the allocation rules.
[0043] 4. Execute the scheduled task: According to the generated execution plan, the scheduler assigns the task to the appropriate computing resources for execution. At the same time, the system monitors the resource usage in real time to ensure that the task is executed within the set resource usage limit.
[0044] In addition, the computing service scheduling method of the present invention also supports multiple allocation rules, such as time priority and maximizing resource utilization priority, etc. This provides users with more flexible resource scheduling strategy options to meet the needs of different scenarios.
[0045] Embodiment 1
[0046] Figure 1 is a flow chart of a computing service scheduling method in Embodiment 1 of the present invention, such as Figure 1 As shown, embodiment 1 provides a computing service scheduling method, including:
[0047] Step S100, obtaining container computing task requirements;
[0048] Specifically, the system needs to fully and accurately capture and understand the specific requirements of each container computing task. The requirements of container computing tasks cover multiple dimensions, including but not limited to key elements such as CPU resources, memory resources, storage resources, and task priorities. These requirements information is the core basis for subsequent resource allocation and task scheduling, so its accuracy and completeness are crucial. In the process of obtaining container computing task requirements, the system first needs to interact with the task submitter to clarify the specific requirements of the task. For example, it involves parsing the task description parameters, which are provided in the form of configuration files, command line parameters, or API requests. The system needs to be able to correctly parse these parameters to extract information such as the type and quantity of resources required for the task, the priority of the task, and any specific execution constraints. After obtaining the task requirements, the system needs to further verify and process this information. On the one hand, the system needs to ensure that the obtained task requirements are reasonable and achievable, that is, the required resources can theoretically be met in the current cluster or resource pool. On the other hand, the system also needs to classify and sort the tasks according to their priorities and execution constraints so that resources can be efficiently allocated according to established rules in the subsequent scheduling process.
[0049] In practical applications, the demand for computing tasks may change with time and environment. Therefore, the system needs to be able to capture changes in task requirements in real time and dynamically adjust resource allocation strategies and task scheduling plans based on these changes to ensure efficient use of computing resources and efficient execution of tasks.
[0050] Based on the above analysis, it can be seen that obtaining container computing task requirements is the basis and premise of the computing service scheduling method. By comprehensively and accurately obtaining and understanding the requirements of container computing tasks, the system can provide strong support for subsequent resource allocation and task scheduling, thereby achieving efficient utilization of computing resources and efficient execution of tasks. The accuracy and flexibility of this step have a crucial impact on the performance and efficiency of the entire computing service scheduling system.
[0051] Step S200, reading the description parameters of the container computing task requirement, and adding the container computing task requirement to a queue waiting for execution;
[0052] Specifically, the system can accurately read the description parameters of the container computing task requirements. These description parameters include, for example, the type and quantity of computing resources (such as CPU, memory, storage, etc.) required for the task, the priority of the task, the expected execution time, the required environment configuration (such as operating system, dependent libraries, etc.), and any specific execution constraints (such as must be executed at a specific time or under certain conditions). By parsing these description parameters, the system can fully understand the specific requirements of each container computing task, which is the basis for subsequent resource allocation and task scheduling. After reading the description parameters, the system adds these container computing task requirements to the waiting execution queue according to certain rules and strategies. This queue is the core data structure for the scheduler to manage and schedule tasks, which determines the order of task execution and the allocation method of resources. The process of joining the waiting execution queue is not a simple queuing, but requires comprehensive consideration of multiple factors such as the priority of the task, resource requirements, the current load of the system, and the scheduling strategy set by the user. For example, for tasks with higher priority, the system will put them at the front of the queue to ensure that these tasks can be executed as soon as possible. For tasks with larger resource requirements, the system needs to wait for sufficient resources to be released before arranging them for execution to avoid resource competition and system overload.
[0053] In addition, the waiting execution queue also supports dynamic adjustment. As the system status changes (such as the addition of new tasks, the completion of existing tasks, the release of resources, etc.), the order and status of tasks in the queue will also change accordingly. This dynamic adjustment capability enables the system to more flexibly respond to various complex computing scenarios and changes in demand.
[0054] Based on the above analysis, we can see that by reading the description parameters of the container computing task requirements and adding these task requirements to the waiting execution queue, it provides an important foundation and basis for subsequent resource allocation and task scheduling. The implementation of this step not only requires the system to have strong parsing capabilities and flexible queue management mechanisms, but also requires comprehensive consideration of multiple factors to ensure that computing tasks can be executed efficiently and orderly.
[0055] Step S300, obtaining the real-time available resource status and current allocation rules in the restricted resource pool, and generating an execution plan;
[0056] Specifically, step S300 is the core link in the computing service scheduling method, which involves obtaining the real-time available resource status in the restricted resource pool and understanding and applying the current allocation rules. The ultimate goal is to generate an efficient and feasible execution plan.
[0057] Obtaining real-time available resources in the restricted resource pool: In the computing service scheduling system, the restricted resource pool refers to a collection of computing resources with preset usage limits, such as CPU, memory, GPU, video memory, storage, and other types. The real-time available resource situation refers to how many of these resources can be used by new computing tasks at the current moment. The process of obtaining this information usually involves monitoring and statistics on resource usage status, which requires the system to have real-time and accurate data collection capabilities.
[0058] Get the current allocation rules: Allocation rules are the strategies used by the computing service scheduling system to decide how to allocate resources to different computing tasks. These rules can be based on a variety of factors, such as task priority, resource requirements, task execution time, etc. Different allocation rules will lead to different resource allocation results, which in turn affects the overall performance and efficiency of the system. Therefore, before generating an execution plan, the system needs to clarify the current allocation rules so that resources can be allocated reasonably according to these rules.
[0059] Generate execution plan: After obtaining the real-time available resource situation and current allocation rules, the system can start to generate execution plans. This process involves matching and optimizing the resource requirements of multiple computing tasks to ensure that the needs of all tasks can be met to the maximum extent possible under limited resources. Specifically, the system will sort tasks according to their priority and resource requirements, and then allocate resources to tasks one by one according to the allocation rules. If resources are not enough to meet the needs of all tasks, the system may need to adopt some strategies, such as waiting for resource release, adjusting task priorities, or looking for tasks that can be executed under existing resource conditions. When generating execution plans, the system also needs to consider the dynamic variability of resources. Since the execution of computing tasks and the use of resources are dynamic, the system has a certain degree of prediction and adaptation capabilities so that it can adjust the execution plan in time when the resource situation changes.
[0060] Optimization and adjustment of execution plans: After generating an execution plan, the system needs to optimize and adjust it. This includes checking whether the execution plan meets the resource requirements of all tasks, whether it will cause resource overload or waste, and whether the system performance can be improved by adjusting the task execution order or resource allocation strategy. Through continuous optimization and adjustment, the system can gradually find a more efficient and stable resource allocation plan, thereby achieving efficient use of computing resources.
[0061] Based on the above analysis, it can be seen that step S300 is a key link in the computing service scheduling method, which involves the understanding and application of real-time resource conditions and allocation rules, as well as the generation and optimization of execution plans. Through this step, the system can achieve fine-grained management and dynamic allocation of computing resources, thereby improving resource utilization efficiency and the overall performance of the system.
[0062] Step S400, executing the scheduling task based on the execution plan;
[0063] Specifically, the scheduler allocates computing tasks to specific computing resources, such as workstations, servers, or cloud computing nodes, according to the execution plan. This process involves considerations and operations in many aspects:
[0064] First, the scheduler looks at the task allocation specified in the execution plan to understand which tasks need to be executed and their respective resource requirements. Then, the scheduler checks the resource status in the current available resource pool to ensure that there are enough resources to meet the needs of these tasks. This includes availability checks for resources such as CPU, memory, and storage.
[0065] Next, the scheduler will arrange the execution order of tasks according to the priority or timing rules in the execution plan. If the allocation rule is timing priority, the scheduler will execute the tasks in the order in which they are added to the waiting queue. If the allocation rule is maximizing resource utilization first, the scheduler will try to find the task execution order that can maximize resource utilization.
[0066] During the execution of tasks, the scheduler monitors resource usage in real time to ensure that tasks are executed within the set resource usage limit. This is achieved through the resource manager, which can manage and limit the use of computing resources in a fine-grained manner. If a task exceeds its resource usage limit, the resource manager will promptly notify the scheduler, and the scheduler may take measures such as killing the process and rescheduling to ensure system stability and effective use of resources.
[0067] In addition, step S400 also involves interaction and communication with computing resources. The scheduler needs to communicate with computing resources through appropriate interfaces or protocols, assign tasks to them, and monitor their execution status.
[0068] Finally, when the task is completed, the scheduler will update the task status and remove it from the waiting queue. At the same time, the scheduler will optimize future scheduling strategies based on the task execution results and resource usage during the execution process to improve the overall performance and efficiency of the system.
[0069] Based on the above analysis, it can be seen that step S400 is a key link in actually executing the scheduling task based on the execution plan, which involves multiple aspects such as task allocation, resource monitoring, interaction and communication with computing resources, etc. Through refined management and dynamic allocation of computing resources, the present invention aims to achieve efficient utilization of computing resources and efficient execution of tasks.
[0070] In this embodiment, the computing service scheduling method further includes:
[0071] Step S500, generating an execution result based on executing the scheduled task;
[0072] Specifically, when a computing task is executed on a specified computing resource, the system monitors the execution status of the task in real time. This includes but is not limited to the execution progress of the task, resource usage, and whether there are any anomalies. The purpose of monitoring is to ensure that the task can be executed normally as expected, and to take corresponding measures, such as resource adjustment and task restart, to deal with possible anomalies when necessary. Once the task is executed, the system will collect the execution results. These results may include the output data of the computing task, log information during the execution process, and statistics on resource usage. The collected result data will be stored in a specified location for subsequent analysis and processing. After collecting the execution results, the system also needs to organize these results. The process of organization may include, for example, data cleaning, format unification, and outlier processing. Through organization, the execution results can be made clearer, easier to understand and analyze. At the same time, the organized results can also be used as a reference for subsequent task scheduling, helping the system optimize resource allocation strategies and improve resource utilization efficiency. Finally, the generated execution results will be delivered to the relevant caller or user. This can be achieved through notification services, such as sending emails, push messages, etc. The caller or user can evaluate the execution of the computing task based on these results and whether further operations or adjustments are required.
[0073] Based on the above analysis, it can be seen that step S500 plays a connecting role in the entire computing service scheduling method. It is not only a monitoring and summary of the task execution process, but also a key link that provides important reference for subsequent task scheduling and resource management. Through the implementation of this step, the efficient execution of computing tasks and the rational use of resources can be ensured, thereby improving the performance and efficiency of the entire computing service scheduling system.
[0074] Step S600, based on the execution result, issuing the execution result through a notification service;
[0075] Specifically, after executing the scheduled task, the system will generate an execution result, which includes key information such as the execution status, output data, error information (if any), etc. of the task. This information is very important for the caller or user, because they can use it to determine whether the task is successfully executed and whether further operations or processing are required. By sending the execution result through the notification service, various forms of notification can be implemented, such as email notification, SMS notification, WebHook notification, etc. In this way, no matter where the caller or user is, they can receive the execution result of the task in time and make corresponding responses. For example, if the task is successfully executed, the caller or user can perform subsequent analysis or processing based on the output data; if the task fails, the problem can be located based on the error information and corresponding repairs or adjustments can be made. In addition, the notification service can also provide real-time status update function. During the execution of the task, the system can use the notification service to provide real-time feedback to the caller or user on the execution progress, resource usage, and other information of the task. In this way, the caller or user can understand the execution status of the task at any time, so as to better control the entire computing process. Among them, the notification service needs to be closely integrated with the scheduling system to ensure that the execution results can be delivered to the notification service in a timely and accurate manner. Secondly, the notification service needs to have a high degree of reliability and stability to ensure that notifications can be sent stably when a large number of tasks are executed simultaneously. Finally, the notification service also needs to provide flexible configuration options to meet the notification needs of different callers or users.
[0076] Based on the above analysis, it can be seen that step S600 is an important part of the computing service scheduling method of the present invention. It not only ensures that the execution results of the computing task can be fed back to the relevant caller or user in a timely and accurate manner, but also provides multiple forms of notification methods and real-time status update functions, thereby greatly improving the availability of computing services and user experience.
[0077] In this embodiment, the acquisition of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generation of the execution plan includes:
[0078] If the allocation rule is time priority, the next computing task will be executed sequentially if the available resources are sufficient;
[0079] If the allocation rule is time priority, and the available resources are not satisfied, the next task will be executed in priority order after the resources are released;
[0080] Specifically, in the computing service scheduling system, efficient resource management and reasonable task scheduling are the key to ensuring system performance. The present invention achieves preliminary task management by obtaining the demand for container computing tasks and adding them to the waiting execution queue. However, the execution of tasks is not a simple first-in-first-out (FIFO) process, but needs to be dynamically determined based on the current resource status and allocation rules.
[0081] The system first needs to understand the available resources in the current resource pool, including but not limited to the remaining amount and usage status of CPU, memory, storage and other resources. This information changes dynamically, so the system needs to obtain it in real time to ensure the accuracy of scheduling decisions.
[0082] Next, the system will generate an execution plan based on the preset allocation rules. The allocation rules are the basis for scheduling decisions, which determine how to prioritize the execution of tasks when resources are limited. In the present invention, the allocation rule of "time priority" is provided.
[0083] The "time priority" rule means that tasks will be executed in the order in which they join the waiting execution queue. This rule ensures fairness among tasks, that is, the tasks that arrive first will be executed first. However, in the case of limited resources, simple time priority may lead to inefficient resource utilization, because some tasks may be in a waiting state for a long time because they are waiting for resources.
[0084] In order to solve this problem, the present invention further considers the availability of resources when calculating the execution plan. Specifically: if the allocation rule is time priority and the available resources meet the needs of the current task, the system will execute the next computing task in sequence. In this case, the system can make full use of resources while maintaining the execution order of tasks. If the allocation rule is time priority, but the available resources do not meet the needs of the current task, the system will wait for the resources to be released before giving priority to the next task in the sequence. This strategy avoids waste of resources while ensuring the sequential execution of tasks. During the waiting period, the system may execute other tasks with lower resource requirements to make full use of resources.
[0085] Through this dynamic resource management and task scheduling strategy, the present invention achieves the goal of efficiently scheduling and executing multiple tasks under limited resources, which not only improves the efficiency of resource utilization, but also ensures the timeliness and fairness of tasks.
[0086] Suppose in a computing resource scheduling system, there are three computing tasks that need to be executed, namely Task A, Task B, and Task C. The system currently has enough CPU and memory resources to execute these tasks, but based on the priority and submission time of the tasks, the system needs to decide their execution order. The system selects "timing priority" as the current allocation rule.
[0087] Task List
[0088] Task A: Submission time is 9:00 AM, requires 2 CPU cores and 4GB of memory, and is expected to take 1 hour to execute;
[0089] Task B: Submission time is 9:15 AM, requires 1 CPU core and 2GB of memory, and is expected to take 30 minutes to execute;
[0090] Task C: Submission time is 9:30 AM, requires 2 CPU cores and 4GB of memory, and has an estimated execution time of 2 hours.
[0091] Resource pool status
[0092] Currently available resources: 4 CPU cores, 8GB of memory.
[0093] Execution process
[0094] 1. Initial state: Tasks A, B, and C are all added to the waiting execution queue and arranged in the order of submission time;
[0095] 2. Task scheduling: Step 1: Check the task queue and find that Task A is the first task in the queue; Step 2: Evaluate the resource pool and find that there are currently 4 CPU cores and 8GB of memory available, which meets the resource requirements of Task A (2 CPU cores and 4GB of memory); Step 3: According to the "timing priority" rule, decide to execute Task A because it is the first task in the queue and the resources meet the requirements.
[0096] 3. Task A is executing: Task A starts executing, occupying 2 CPU cores and 4 GB of memory; remaining available resources: 2 CPU cores, 4 GB of memory.
[0097] 4. Continue scheduling: Step 1: After Task A is executed, check the task queue and find that Task B is the next task in the queue; Step 2: Evaluate the resource pool and find that there are currently 2 CPU cores and 4GB of memory available, which meets the resource requirements of Task B (1 CPU core and 2GB of memory); Step 3: According to the "timing priority" rule, decide to execute Task B because it is the next task in the queue and the resources meet the requirements.
[0098] 5. Task B is executing: Task B starts executing, occupying 1 CPU core and 2 GB of memory; remaining available resources: 1 CPU core, 2 GB of memory.
[0099] 6. Continue scheduling: After Task B is executed, check the task queue and find that Task C is the next task in the queue. Step 1: Evaluate the resource pool and find that only 1 CPU core and 2GB of memory are available, which does not meet the resource requirements of Task C (2 CPU cores and 4GB of memory); Step 2: According to the "timing priority" rule, since the resources are not met, the system will not execute Task C immediately, but will wait for the resources to be released.
[0100] 7. Task B completed: Task B is executed, releasing 1 CPU core and 2 GB of memory; updating the resource pool status: 2 CPU cores, 4 GB of memory.
[0101] 8. Execute Task C: The current resource pool meets the requirements of Task C, and Task C is the next task in the queue; decide to execute Task C because it is now the first task to be executed in the queue and the resources meet the requirements.
[0102] From the above examples, we can see that under the "time priority" allocation rule, the system strictly executes tasks in the order in which they are submitted. When resources meet the needs of the current task, the system will execute the task immediately. If resources do not meet the needs of the current task, the system will wait for the resources to be released before executing the task, thereby ensuring the sequential execution of tasks and the effective use of resources. This allocation rule ensures the fairness of tasks, that is, the tasks that arrive first will be executed first, while also avoiding the waste of resources and long waiting times for tasks.
[0103] Based on the above analysis, we can see that by combining real-time resource information and flexible allocation rules, efficient scheduling and execution of multiple tasks can be achieved. In particular, the specific operation of the "time priority" rule not only ensures the sequential execution of tasks, but also improves the efficiency of resource utilization, which is a major innovation in the field of computing service scheduling.
[0104] In this embodiment, the acquisition of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generation of the execution plan includes:
[0105] If the allocation rule is to maximize resource utilization first, the next task will be executed in priority order if the available resources are sufficient;
[0106] If the allocation rule is to maximize resource utilization first, if the available resources are not met, it will be skipped and the next task that can be executed under the existing resource conditions will be found and executed first;
[0107] Specifically, the allocation rule is a set of resource allocation strategies formulated by the system based on factors such as user needs, resource conditions, and business logic. In this embodiment, there are two main types of allocation rules: time priority and maximum resource utilization priority.
[0108] When time priority is used as the allocation rule, the system will schedule the execution according to the order in which the tasks are submitted. If the currently available resources meet the resource requirements of the task to be executed, the system will execute the next task in order. If the currently available resources do not meet the task requirements, the system will choose to wait until enough resources are released, and then execute the next task in order. This allocation rule ensures the execution order of tasks, but may reduce the efficiency of resource utilization to a certain extent.
[0109] When maximizing resource utilization priority is used as the allocation rule, the system will give priority to resource utilization efficiency. If the currently available resources meet the resource requirements of the task to be executed, the system will give priority to executing this task. If the currently available resources do not meet the task requirements, the system will not choose to wait, but will skip this task and look for the next task that can be executed under the existing resource conditions and execute it first. This allocation rule can make full use of existing resources and improve resource utilization efficiency, but it may cause the execution order of some tasks to be disrupted.
[0110] Under these two allocation rules, the system needs to continuously monitor resources and schedule tasks to ensure the rational use of resources and efficient execution of tasks. At the same time, the system also has a certain fault tolerance to deal with possible resource anomalies or task execution failures.
[0111] In this way, the computing service scheduling method of the embodiment of the present invention can customize the resource usage upper limit of each computing service, and dynamically allocate according to the real-time resource situation and allocation rules, so as to achieve efficient use of computing resources on the workstation or server. This not only solves the problems of uneven resource allocation and low resource utilization efficiency in traditional computing service scheduling, but also provides users with more flexible resource scheduling strategy options to meet the needs of different scenarios.
[0112] In addition, the computing service scheduling method of the embodiment of the present invention also supports a variety of containerization technologies, such as Docker, Kubernetes, etc., so that computing tasks can be more conveniently migrated and expanded between different computing resources. At the same time, through resource management tools such as the system-level self-developed VGPU library, the embodiment of the present invention can also achieve fine management of resources such as CPU, memory, GPU and video memory, further improving the utilization efficiency of resources and the execution efficiency of tasks.
[0113] Assume that on a cloud computing platform, there are multiple computing tasks that need to be executed, and these tasks have different resource requirements. The resource pool on the platform contains a certain amount of CPU, memory, and GPU resources. In order to maximize resource utilization efficiency, the platform administrator selects "maximum resource utilization priority" as the current allocation rule.
[0114] Task List
[0115] Task A: requires 2 CPU cores and 4GB of memory, and the estimated execution time is 1 hour;
[0116] Task B: requires 1 GPU and 8GB of memory, and the estimated execution time is 2 hours;
[0117] Task C: requires 1 CPU core and 2GB of memory, with an estimated execution time of 30 minutes;
[0118] Task D: requires 1 GPU and 4GB of memory, with an estimated execution time of 1.5 hours.
[0119] Resource pool status
[0120] Currently available resources: 2 CPU cores, 8GB memory, 1 GPU.
[0121] Execution process
[0122] Initial state: Tasks A, B, C, and D are all added to the queue waiting for execution;
[0123] Task scheduling: Step 1: Check the task queue and find that Task A is the first task in the queue; Step 2: Evaluate the resource pool and find that there are currently 2 CPU cores and 8GB of memory available, which meets the resource requirements of Task A (2 CPU cores and 4GB of memory); Step 3: According to the "maximize resource utilization priority" rule, decide to execute Task A because it can start execution immediately without waiting for other resources.
[0124] Task A is executing: Task A starts executing, occupying 2 CPU cores and 4 GB of memory; remaining available resources: 0 CPU cores, 4 GB of memory, 1 GPU.
[0125] Continue scheduling: Step 1: After Task A is executed, check the task queue and find that Task B is the next task in the queue; Step 2: Evaluate the resource pool and find that there are currently no available CPU cores (Task A is using 2), but there is 1 GPU and 4GB of memory available; Step 3: Since Task B requires 1 GPU and 8GB of memory, the current resources do not meet its needs (lack of 4GB of memory); Step 4: According to the "maximize resource utilization priority" rule, decide to skip Task B and look for the next task that can be executed under the existing resource conditions.
[0126] Select Task C: It is found that Task C requires 1 CPU core and 2 GB of memory, and there are enough resources in the current resource pool (0 CPU cores are available, but 2 will be released after Task A is completed; 4 GB of memory is also sufficient); it is decided to wait for Task A to complete before executing Task C, because it can start execution immediately after Task A releases resources, thereby maximizing resource utilization efficiency.
[0127] Task A completed: Task A is executed, releasing 2 CPU cores and 4 GB of memory; the resource pool status is updated: 2 CPU cores, 8 GB of memory, 1 GPU.
[0128] Execute Task C: The current resource pool meets the requirements of Task C, so Task C is executed immediately. Task C starts to execute, occupying 1 CPU core and 2 GB of memory. The remaining available resources are: 1 CPU core, 6 GB of memory, and 1 GPU.
[0129] Continue scheduling: After Task C is executed, check the task queue and find that Task B is still the next task in the queue. Evaluate the resource pool and find that there is currently 1 GPU and 6GB of memory available, which still does not meet Task B's 8GB memory requirement. Skip Task B again and look for the next task.
[0130] Select Task D: It is found that Task D requires 1 GPU and 4 GB of memory, and the current resource pool meets its requirements. It is decided to execute Task D after Task C is completed.
[0131] Task C completed: Task C is executed, releasing 1 CPU core and 2 GB of memory; updating the resource pool status: 2 CPU cores, 8 GB of memory, 1 GPU.
[0132] Execute Task D: The current resource pool meets the requirements of Task D, so Task D is executed immediately. Task D starts executing, occupying 1 GPU and 4 GB of memory.
[0133] Through the above examples, we can see that under the allocation rule of "maximizing resource utilization first", the system can dynamically evaluate the status of the resource pool and the needs of the task, and give priority to those tasks that can be started immediately and have high resource utilization. When the resources do not meet the needs of the current task, the system will skip the task and continue to look for the next task that can be executed under the existing resource conditions, thereby ensuring the maximum utilization of resources.
[0134] Based on the above analysis, it can be seen that the computing service scheduling method of the embodiment of the present invention achieves efficient utilization of computing resources and efficient execution of tasks by customizing resource usage upper limits, dynamically allocating computing resources, and supporting multiple allocation rules and containerization technologies, providing a new solution for the field of computer service scheduling technology.
[0135] Figure 4 It is a logical flow diagram of a computing service scheduling method in a specific embodiment of the present invention. In a specific embodiment of the present invention, the system of the present invention mainly obtains the current available status through the cyclic execution of the scheduler through the resourcer, and obtains the current queued task status by accessing the queue. After determining the optimal scheduling plan, the task is assigned to the corresponding executor for execution, and finally the corresponding caller is notified through the notification service. Specifically, the present invention uses the CPU, memory and storage management mechanism of containerization technology, plus the system-level self-developed VGPU library to implement the restricted use of resources such as CPU, memory, GPU and video memory, allowing users or administrators to set resource usage limits for each computing service, including CPU utilization, memory usage, GPU, video memory, disk I / O, etc.; these restrictions can be dynamically adjusted in the form of configuration parameters according to actual needs to adapt to different computing tasks and load conditions. When a computing task is submitted to the scheduling service, the resource scheduling system will read the resource requirement description parameters of the task and add the task to the queue waiting for execution; the resource scheduling system will obtain the real-time available resources in the restricted resource pool and obtain the current allocation rules; if the allocation rule is time priority, the next computing task will be executed in sequence if the available resources are met, and if the available resources are not met, the next task will be executed in sequence after the resources are released; if the allocation rule is maximizing resource utilization priority, the next task will be executed in sequence if the available resources are met, and if the resources are not met, it will be skipped and the next task that can be executed under the existing resource conditions will be found and executed first. The system monitors the resource usage of each computing service in real time; through the agreement of authorization before use, it maximizes the guarantee that each resource will not exceed the limit. Once a resource exceeds the set maximum threshold, the lowest priority occupying process will be killed, and the task will be put back into the queue, waiting for the next opportunity to meet the resource demand and execute again.
[0136] In another specific embodiment of the present invention, in order to achieve accurate prediction and efficient scheduling of computing resources, the present invention also provides a resource prediction algorithm and intelligent scheduling strategy. Specifically, the algorithm adopts a long short-term memory network (LSTM), which is a special recurrent neural network (RNN) that is good at processing time series data and has the ability to capture long-term dependencies. Therefore, it is very suitable for predicting resource usage. Time series data of key resource indicators such as CPU usage, memory occupancy, disk I / O, etc. are collected from historical data, and these data can come from monitoring systems, log files, or resource managers. The collected data is preprocessed by cleaning, normalization, and feature extraction to improve the accuracy of the prediction. The LSTM model is trained using the preprocessed data. During the training process, the model parameters can be adjusted by cross-validation and other methods to optimize the prediction performance. After the training is completed, the model is deployed in the production environment. The system regularly collects the latest resource usage data, inputs it into the LSTM model for prediction, and obtains the resource demand prediction results for a period of time in the future. According to the prediction results of the LSTM model, sufficient resources are reserved for the upcoming high-resource demand tasks, which can ensure that the tasks will not wait or fail due to insufficient resources when they are executed. According to the resource prediction results and the importance of the task, the priority of the task can be adjusted dynamically. For important tasks with high resource requirements, their priority can be increased to ensure that they can get resource support first. When it is predicted that resource demand will surge, more computing resources (such as virtual machines, containers, etc.) can be automatically started to meet the needs of task execution. When resource demand decreases, some resources can be released to reduce costs. The system monitors resource usage and task execution status in real time to ensure the effective execution of resource prediction and intelligent scheduling strategies. According to real-time monitoring results and new resource prediction data, strategies such as resource allocation and task priority are dynamically adjusted to adapt to changing resource needs and environment.
[0137] This example combines the LSTM-based resource prediction algorithm and intelligent scheduling strategy to achieve accurate prediction and efficient scheduling of computing resources. This not only improves the efficiency of resource utilization and task execution, but also reduces operating costs, providing a new solution for the computing service scheduling field.
[0138] Embodiment 2
[0139] Figure 2 is a schematic diagram of the structure of a computing service scheduling system in Embodiment 2 of the present invention. Figure 2As shown, embodiment 2 provides a computing service scheduling system, including: an acquisition module 201, a joining module 202, a first generation module 203 and an execution module 204. The acquisition module 201 is used to obtain container computing task requirements. The joining module 202 is used to read the description parameters of the container computing task requirements and add the container computing task requirements to the waiting execution queue. The first generation module 203 is used to obtain the real-time available resource status and current allocation rules in the restricted resource pool and generate an execution plan. And the execution module 204 is used to execute the scheduling task based on the execution plan.
[0140] In this embodiment, the computing service scheduling system further includes: a second generating module and an issuing module. The second generating module is used to generate an execution result based on the execution scheduling task. And the issuing module is used to issue the execution result through a notification service based on the execution result.
[0141] In this embodiment, the first generation module 203 includes: a first execution unit and a second execution unit. The first execution unit is used to execute the next computing task in sequence if the allocation rule is time priority and the available resources are satisfied. And the second execution unit is used to wait for the resources to be released and execute the next task in sequence if the allocation rule is time priority and the available resources are not satisfied.
[0142] In this embodiment, the first generation module 203 further includes: a third execution unit and a fourth execution unit. The third execution unit is used to prioritize the execution of the next task if the allocation rule is to prioritize the use of resources to the maximum extent and the available resources are satisfied. The fourth execution unit is used to skip the task if the allocation rule is to prioritize the use of resources to the maximum extent and the available resources are not satisfied, and to find the next task that can be executed under the existing resource conditions and execute it first.
[0143] The various variations and specific examples of the computing service scheduling method provided in Example 1 are also applicable to the computing service scheduling system provided in this embodiment. Through the above detailed description of a computing service scheduling method, those skilled in the art can clearly understand the implementation method of a computing service scheduling system in this embodiment, so for the sake of brevity of the specification, it will not be described in detail here.
[0144] Embodiment 3
[0145] Figure 3 is a schematic diagram of the structure of an electronic device in Embodiment 3 of the present invention, such as Figure 3 As shown, the third embodiment further provides an electronic device 300 , which may include: a processor 301 and a memory 302 .
[0146] The memory 302 is used to store programs; the memory 302 may include volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviated: RAM), such as static random-access memory (English: static random-access memory, abbreviated: SRAM), double data rate synchronous dynamic random access memory (English: Double Data Rate Synchronous Dynamic Random Access Memory, abbreviated: DDR SDRAM), etc.; the memory may also include non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory). The memory 302 is used to store computer programs (such as applications, functional modules, etc. that implement the above method), computer instructions, etc., and the above computer programs, computer instructions, etc. can be partitioned and stored in one or more memories 302. And the above computer programs, computer instructions, data, etc. can be called by the processor 301.
[0147] The above-mentioned computer programs, computer instructions, etc. may be stored in partitions in one or more memories 302 . And the above-mentioned computer programs, computer instructions, etc. may be called by the processor 301 .
[0148] The processor 301 is used to execute the computer program stored in the memory 302 to implement each step of the method involved in the above embodiment.
[0149] For details, please refer to the relevant description in the previous method embodiment.
[0150] The processor 301 and the memory 302 may be independent structures or integrated structures. When the processor 301 and the memory 302 are independent structures, the memory 302 and the processor 301 may be coupled and connected via a bus 303 .
[0151] The electronic device of this embodiment can execute the technical solution in the above method, and its specific implementation process and technical principle are the same, which will not be repeated here.
[0152] Embodiment 4
[0153] Embodiment 4 further provides a computer-readable storage medium, including a computer program and instructions. When the computer program or instructions are executed on a computer, the computer executes the computing service scheduling method of any embodiment of the present invention.
[0154] Computer-readable storage media include: USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks, and other media that can store program codes.
[0155] This embodiment also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0156] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the disclosure of the present invention can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.
[0157] In summary, the computing service scheduling method and system of the present invention have the following beneficial effects:
[0158] 1. The present invention allows users or administrators to set resource usage limits for each computing service, including CPU usage, memory usage, GPU, video memory, disk I / O, etc. This customization capability ensures that each task will not exceed its preset resource requirements during operation, thereby avoiding the risk of resource competition and system overload;
[0159] 2. By real-time monitoring of resource usage and task execution status, the present invention can dynamically adjust the allocation of computing resources, that is, the system can flexibly adjust the execution order of tasks and resource allocation according to the current resource status and task requirements, thereby maximizing the utilization efficiency of resources;
[0160] 3. By customizing resource usage limits and dynamically allocating computing resources, the present invention effectively solves the problems of uneven resource allocation and low resource utilization efficiency in traditional computing service scheduling, ensuring that computing resources can be efficiently utilized in a multi-task, multi-resource environment, thereby improving the performance and efficiency of the entire system;
[0161] 4. The present invention provides a variety of allocation rules, such as time priority and maximum resource utilization priority, etc. Users can select appropriate rules for resource scheduling according to actual needs; this flexibility enables the system to adapt to different computing scenarios and demand changes, and improves the applicability and scalability of the system;
[0162] 5. By real-time monitoring of resource usage and task execution status, the present invention can promptly detect and handle abnormal situations, such as resource overload, task execution failure, etc. This monitoring and early warning mechanism ensures the stability and reliability of the system and improves user satisfaction and trust;
[0163] 6. Through accurate prediction of resource demand and intelligent scheduling strategies, the present invention can avoid unnecessary waste of resources and cost expenditure. For example, when it is predicted that resource demand will surge, the system can automatically start more computing resources to meet the demand; and when resource demand decreases, some resources can be released to reduce costs.
[0164] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A computing service scheduling method, characterized in that: include: Obtain container computing task requirements; Reading description parameters of the container computing task requirement, and adding the container computing task requirement to a queue waiting for execution; Obtain the real-time available resource status and current allocation rules in the restricted resource pool and generate an execution plan; Based on the execution plan, the scheduling task is executed.
2. The computing service scheduling method according to claim 1, characterized in that: Also includes: Generate execution results based on execution scheduling tasks; Based on the execution result, the execution result is issued through a notification service.
3. The computing service scheduling method according to claim 1, characterized in that: The obtaining of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generation of the execution plan comprises: If the allocation rule is time priority, the next computing task will be executed sequentially if the available resources are sufficient; If the allocation rule is time priority, and the available resources are not satisfied, the system will wait for the resources to be released and then execute the next task in the priority order.
4. The computing service scheduling method according to claim 1, characterized in that: The obtaining of the real-time available resource situation and the current allocation rules in the restricted resource pool and the generation of the execution plan comprises: If the allocation rule is to maximize resource utilization first, the next task will be executed in priority order if the available resources are sufficient; If the allocation rule is to maximize resource utilization first, if the available resources are not met, it will be skipped and the next task that can be executed under the existing resource conditions will be found and executed first.
5. A computing service scheduling system, characterized in that: include: The acquisition module is used to obtain container computing task requirements; An adding module, used for reading the description parameters of the container computing task requirement and adding the container computing task requirement to a queue waiting for execution; The first generation module is used to obtain the real-time available resource status and current allocation rules in the restricted resource pool and generate an execution plan; as well as The execution module is used to execute the scheduling task based on the execution plan.
6. The computing service scheduling system according to claim 1, characterized in that: Also includes: A second generating module is used to generate an execution result based on the execution scheduling task; as well as The issuing module is used to issue the execution result through a notification service based on the execution result.
7. The computing service scheduling system according to claim 1, characterized in that: The first generation module comprises: A first execution unit is used to execute the next computing task in sequence if the allocation rule is time priority and the available resources are satisfied; and The second execution unit is used to wait for the resources to be released and then execute the next task in priority order if the allocation rule is time priority and the available resources are not satisfied.
8. The computing service scheduling system according to claim 1, characterized in that: The first generation module also includes: A third execution unit is used to execute the next task in priority order if the allocation rule is to maximize resource utilization first and the available resources are satisfied; and The fourth execution unit is used to skip the task if the allocation rule is to give priority to maximizing resource utilization and the available resources are not satisfied, and to find the next task that can be executed under the existing resource conditions and execute it with priority.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the computing service scheduling method described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The method comprises a computer program and instructions. When the computer program or the instructions are executed on a computer, the computer is enabled to execute the computing service scheduling method according to any one of claims 1 to 4.