Control method and device, computer device and storage medium

By monitoring the metrics of parallel tasks and adjusting the number of tasks using preset strategies, the problem of improper resource allocation in cloud computing is solved, achieving elastic scaling of resources and maximizing task efficiency.

CN115391030BActive Publication Date: 2026-03-24GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-08
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In cloud computing, improper allocation of resources required by tasks can lead to resource waste or low task execution efficiency.

Method used

By monitoring the metrics of current parallel tasks, determining the target number of parallel tasks using a preset scaling strategy, and scheduling resources to adjust the number of tasks, elastic scaling of resources is achieved.

Benefits of technology

To prevent resource waste, maximize task execution efficiency, and achieve a match between resources and task requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391030B_ABST
    Figure CN115391030B_ABST
Patent Text Reader

Abstract

The application provides a control method, a control device, computer equipment and a nonvolatile computer readable storage medium. The method comprises: acquiring different index information of a current parallel task; determining a target parallel quantity according to the index information and a preset scaling strategy; and scheduling resources according to the target parallel quantity to adjust the quantity of the current parallel task. By monitoring different index information of the current parallel task, and determining whether to need to expand (expand resource usage to increase the quantity of the current parallel task) or to contract (reduce resource usage to reduce the quantity of the current parallel task) based on the index information and the preset scaling strategy, and determining the target parallel quantity after expansion or contraction, finally, resources are scheduled in real time according to the target parallel quantity to adjust the quantity of the current parallel task, so that the scheduled resources are always matched with the resources required by the tasks to be executed, resource waste is prevented, and the execution efficiency of the tasks is maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of path planning technology, and in particular to a control method, control device, computer equipment, and non-volatile computer-readable storage medium. Background Technology

[0002] Currently, in cloud computing, fixed resources are allocated to multiple tasks to ensure their proper execution. However, the resources required by a task may vary continuously; allocating too many resources leads to waste, while allocating too few resources results in low task execution efficiency. Summary of the Invention

[0003] This application provides a control method, a control device, a computer equipment, and a non-volatile computer-readable storage medium.

[0004] The control method of this application includes acquiring different indicator information of currently parallel tasks; determining a target number of parallel tasks based on the indicator information and a preset scaling strategy; and scheduling resources based on the target number of parallel tasks to adjust the number of currently parallel tasks.

[0005] The control device according to the embodiments of this application includes an acquisition module, a first determination module, and an adjustment module. The acquisition module is used to acquire different indicator information of currently parallel tasks; the first determination module is used to determine a target number of parallel tasks based on the indicator information and a preset scaling strategy; and the adjustment module is used to schedule resources according to the target number of parallel tasks to adjust the number of currently parallel tasks.

[0006] The computer device according to embodiments of this application includes a processor, which is configured to execute a control method. The control method includes acquiring different indicator information of currently parallel tasks; determining a target number of parallel tasks based on the indicator information and a preset scaling strategy; and scheduling resources according to the target number of parallel tasks to adjust the number of currently parallel tasks.

[0007] This application provides a non-volatile computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a control method. The control method includes acquiring different indicator information of currently parallel tasks; determining a target number of parallel tasks based on the indicator information and a preset scaling strategy; and scheduling resources according to the target number of parallel tasks to adjust the number of currently parallel tasks.

[0008] The control method, control device, computer equipment, and non-volatile computer-readable storage medium of this application monitor different indicator information of currently parallel tasks, and determine whether it is necessary to expand (increase resource usage to increase the number of currently parallel tasks) or shrink (reduce resource usage to decrease the number of currently parallel tasks) based on the indicator information and preset scaling strategy, and determine the target number of parallel tasks after expansion or shrinkage, and finally schedule resources in real time according to the target number of parallel tasks to adjust the number of currently parallel tasks, so that the scheduled resources always match the resources required by the currently executed tasks, preventing resource waste while maximizing the execution efficiency of tasks.

[0009] Additional aspects and advantages of the embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0010] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:

[0011] Figure 1 This is a flowchart illustrating the control method of certain embodiments of this application;

[0012] Figure 2 This is a schematic diagram of the architecture of the control method in some embodiments of this application;

[0013] Figure 3 This is a flowchart illustrating the control method of certain embodiments of this application;

[0014] Figure 4 This is a flowchart illustrating the control method of certain embodiments of this application;

[0015] Figure 5 This is a schematic diagram of the architecture of the control method in some embodiments of this application;

[0016] Figure 6 This is a schematic diagram of the control device according to certain embodiments of this application;

[0017] Figure 7 This is a plan view of a computer device according to certain embodiments of this application; and

[0018] Figure 8 This is a schematic diagram illustrating the interaction between a non-volatile computer-readable storage medium and a processor in certain embodiments of this application. Detailed Implementation

[0019] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of this application, and should not be construed as limiting the embodiments of this application.

[0020] The following is a brief explanation of the terms used in this application:

[0021] Flink is an open-source computing platform for distributed stream and batch data processing, supporting both streaming and batch processing applications. Currently, Flink manages computing resources through an internal automatic allocation and release mechanism. However, data traffic often fluctuates, and computing resources cannot adapt to these fluctuations. Initially setting too many or too few resources can easily lead to resource waste or insufficient resources, resulting in job delays.

[0022] Cloud-native: It is a set of cloud technology products built on distributed cloud based on distributed deployment and unified operation and management, and based on technologies such as containers and microservices.

[0023] Kubernetes (K8s) is an open-source container orchestration technology for automating the deployment, scaling, and management of containerized applications. K8s simplifies the deployment and management of microservice architecture applications. It achieves this by forming an abstraction layer on top of the cluster, allowing development teams to deploy applications smoothly.

[0024] Please see Figure 1 The control method of this application includes:

[0025] Step 011: Obtain different metric information for the currently parallel tasks.

[0026] Specifically, this application will obtain different metric information of the currently parallel tasks reported by the Flink cluster through the cloud monitoring platform. The metric information may include the number of currently parallel tasks, average CPU utilization, average memory utilization, current time, etc. By obtaining various metric information reported by the Flink cluster in real time, it is convenient to make subsequent diagnosis based on the metric information to determine whether it is necessary to expand or shrink the scale.

[0027] Step 012: Determine the target number of parallel operations based on the indicator information and the preset scaling strategy.

[0028] Specifically, after receiving the indicator information, which is typically quite extensive, it's necessary to first categorize the received indicator information (e.g., based on its tag information) to facilitate subsequent diagnostics, thus forming different categories of indicator information. Then, preset categories of indicator information can be obtained, such as the current number of parallel tasks, average CPU utilization, average memory utilization, and the current time. Using these preset categories of indicator information, scaling up or down can be performed, and the target number of parallel tasks after scaling up or down can be determined.

[0029] Optionally, the target number of parallel processes can be determined based on the difference between the average CPU (central processing unit) utilization and the preset CPU utilization; and / or based on the average memory utilization and the preset memory utilization; and / or, if the current time is a preset time, the target number of parallel processes can be determined as the preset number of parallel processes corresponding to the preset time.

[0030] For example, preset CPU utilization typically includes an upper and lower limit. When determining the target number of parallel tasks based on the difference between the average CPU utilization and the preset CPU utilization, if the average CPU utilization exceeds the upper limit (e.g., 80%), it's understandable that excessively high CPU utilization can lead to anomalies, causing task execution efficiency to decrease instead of increase. In this case, the average CPU utilization needs to be reduced. To reduce the average CPU utilization, expansion is required to increase resource usage, thereby increasing the number of currently parallel tasks. The increased number of currently parallel tasks (i.e., the target number of parallel tasks) can be determined based on the difference between the average CPU utilization and the upper limit of the preset CPU utilization; the larger the difference, the larger the target number of parallel tasks. After increasing the number of currently parallel tasks, the CPU utilization of individual tasks can be reduced, thereby reducing the average CPU utilization of all tasks. This ensures that the average CPU utilization is reduced below the upper limit of the preset CPU utilization, guaranteeing that the average CPU utilization is not too high while each task has sufficient CPU resources for computation, thus improving task execution efficiency. Alternatively, when determining the target number of parallel tasks based on the difference between the average CPU utilization and the preset CPU utilization, if the average CPU utilization is less than the preset lower limit (e.g., 30%), it can be understood that the low CPU utilization results in a significant waste of resources allocated to tasks. In this case, the average CPU utilization needs to be increased. To increase the average CPU utilization, scaling down is necessary to reduce resource usage, thereby reducing the number of currently parallel tasks. The reduced number of currently parallel tasks (i.e., the target number of parallel tasks) can be determined based on the difference between the preset lower limit of CPU utilization and the average CPU utilization; the larger the difference, the smaller the target number of parallel tasks. After reducing the number of currently parallel tasks, the CPU utilization of individual tasks can be increased, thereby increasing the average CPU utilization of all tasks. This ensures that the average CPU utilization rises above the preset lower limit, preventing the average CPU utilization from becoming too low and thus avoiding resource waste.

[0031] For example, preset memory usage typically includes an upper and lower limit. When determining the target number of parallel tasks based on the difference between the average memory usage and the preset memory usage, if the average memory usage exceeds the upper limit (e.g., 90%), it's understandable that excessively high memory usage can lead to anomalies, causing task execution efficiency to decrease instead of increase. In this case, the average memory usage needs to be reduced. To reduce the average memory usage, expansion is required to increase resource usage, thereby increasing the number of currently parallel tasks. The increased number of currently parallel tasks (i.e., the target number of parallel tasks) can be determined based on the difference between the average memory usage and the upper limit of the preset memory usage; the larger the difference, the larger the target number of parallel tasks. Increasing the number of currently parallel tasks can reduce the memory usage of individual tasks, thereby reducing the average memory usage of all tasks. This ensures that the average memory usage falls below the upper limit of the preset memory usage, guaranteeing that the average memory usage is not too high while each task has sufficient memory resources for computation, thus improving task execution efficiency. Alternatively, when determining the target number of parallel tasks based on the difference between the average memory utilization and the preset memory utilization, if the average memory utilization is less than the preset lower limit (e.g., 20%), it can be understood that the low memory utilization results in a significant waste of resources allocated to tasks. In this case, the average memory utilization needs to be increased. To increase the average memory utilization, scaling down is necessary to reduce resource usage, thereby reducing the number of currently parallel tasks. The reduced number of currently parallel tasks (i.e., the target number of parallel tasks) can be determined based on the difference between the preset lower limit of memory utilization and the average memory utilization; the larger the difference, the smaller the target number of parallel tasks. After reducing the number of currently parallel tasks, the memory utilization of individual tasks can be increased, thereby increasing the average memory utilization of all tasks. This ensures that the average memory utilization rises above the preset lower limit, preventing the average memory utilization from becoming too low and thus avoiding resource waste.

[0032] For example, given that some tasks exhibit patterns in resource usage across different time periods under specific scenarios, resource usage can be periodically expanded or reduced. For instance, if a task's resource usage is lower during odd-numbered hours and higher during even-numbered hours, expansion or reduction can be performed every hour. If the current time is a preset time (e.g., if the first expansion time is 12:00, then every hour is a preset time), a preset number of parallel tasks can be determined first. For example, if the preset time is an even-numbered hour, the preset number of parallel tasks is 16; if the preset time is an odd-numbered hour, the preset number of parallel tasks is 12. Then, the target number of parallel tasks is determined based on the preset number of parallel tasks corresponding to the preset time, thus causing the number of currently running tasks to change periodically.

[0033] Step 013: Schedule resources according to the target number of parallel tasks to adjust the number of currently parallel tasks.

[0034] Specifically, after determining the target number of parallel tasks, resources can be scheduled accordingly. For example, if the current number of parallel tasks is 10 and the target number is 16, then resources sufficient to run 6 more tasks (such as 6 pre-defined CPU and memory resources) need to be scheduled. This redeploys the 16 tasks to utilize 16 separate portions of resources. For instance, the computational tasks originally required by the 10 tasks can be further split into 16 tasks, each executed by a separate portion of resources. In this way, resource elasticity is achieved through monitoring metrics, preventing resource waste while ensuring task execution efficiency.

[0035] The architecture implemented in this application for elastic scaling is as follows: Figure 2 As shown, the Flink cluster reports various metrics to the cloud monitoring platform 22 in real time. The cloud monitoring platform 22 forwards the metrics to the metrics diagnosis module 23. The metrics diagnosis module 23 first classifies the metrics and then, based on its preset scaling strategy and metrics diagnosis, determines whether scaling up or down is needed, and determines the target parallel quantity after scaling up or down. It then forwards this information to the backend control platform 24. The control platform 24 then retrieves the preset scaling strategy and metrics from the metrics diagnosis module 23 and performs another diagnosis to determine the final target parallel quantity to be adjusted and saves it in the database. Furthermore, to ensure that tasks can resume processing from the point of interruption when redeploying after resource adjustments, the already computed parts of the tasks need to be saved before redeploying resources and tasks to adjust the current number of parallel tasks. Therefore, resources and tasks can be redeployed after saving the information of the currently parallel tasks to adjust the current number of parallel tasks. This allows tasks to resume processing based on the saved task information during redeployment, eliminating the need for repeated calculations of tasks and computed parts, thus improving task execution efficiency.

[0036] In this system, the Flink cluster 21 typically saves the information of currently parallel tasks every preset time interval. Therefore, the time difference between the current moment and the last save can be determined, and combined with the preset time interval, the required waiting period can be calculated. After the specified waiting period (when the information of the currently parallel tasks has been saved), resources and tasks are redeployed to adjust the number of currently parallel tasks. This utilizes the Flink cluster 21's own saving mechanism to prevent duplicate computation of already computed parts of the tasks, thus improving task execution efficiency. Alternatively, the control platform 24 can directly notify the Flink cluster 21 to immediately save the information of the currently parallel tasks before redeploying resources and tasks to adjust the number of currently parallel tasks. This eliminates the need to wait for the Flink cluster 21 to automatically save, further improving task deployment efficiency while avoiding duplicate computation of already computed parts of the tasks.

[0037] Furthermore, when redeploying a task, it can be deployed on a server that stores the task's information, allowing the server to obtain the task information locally without needing to retrieve it from other servers via data transfer, thus further improving the efficiency of task deployment.

[0038] The control method of this application monitors different indicator information of currently parallel tasks, such as calculating various indicator information by monitoring the actual data flow used by the tasks, to determine the resources used by the tasks in real time. Based on the indicator information and a preset scaling strategy, it determines whether to expand (increase resource usage to increase the number of currently parallel tasks) or shrink (reduce resource usage to decrease the number of currently parallel tasks), and determines the target number of parallel tasks after expansion or shrinking. Finally, it schedules resources in real time according to the target number of parallel tasks to adjust the number of currently parallel tasks, so that the scheduled resources always match the resources required by the currently executing tasks, preventing resource waste while maximizing the execution efficiency of the tasks.

[0039] Please see Figure 3 Optionally, each task has a maximum and a minimum resource requirement, and the actual resource usage of a task can fluctuate between the maximum and minimum resource requirements. The control method further includes:

[0040] Step 014: Determine the actual amount of resources used by the task based on the indicator information;

[0041] Step 015: If the actual resource quantity is between the maximum and minimum resource quantity, execute the task based on the actual resource quantity.

[0042] Specifically, when allocating resources for each task, a maximum and minimum resource amount are set for the task, such as the minimum resource amount being 40% of the maximum resource amount. When obtaining indicator information, the current indicator information of each task can be obtained, such as the current CPU utilization and memory utilization. Based on the current indicator information of each task, the actual amount of resources used by the task can be determined. If the actual amount of resources used is between the pre-configured maximum and minimum resource amounts, the task can be executed according to the actual resource amount. Compared with always executing tasks with the maximum resource amount, which would cause resource waste, by setting the range of resources that each task can actually use (i.e., from the minimum resource amount to the maximum resource amount) and making the actual amount of resources used by the task fluctuate within the resource amount range, resource waste can be prevented.

[0043] Please see Figure 4 Optionally, the control method further includes:

[0044] Step 016: Based on the preset container orchestration algorithm, create a task container for each task and a job container to manage all tasks.

[0045] Step 013: Schedule resources according to the target number of parallel tasks to adjust the number of currently parallel tasks, including:

[0046] Step 0131: Adjust the number of task containers according to the target number of parallel operations;

[0047] Step 0132: Request resources from the job container based on the adjusted number of task containers;

[0048] Step 0133: Monitor the number of parallel tasks corresponding to the resource;

[0049] Step 0134: If the number of parallel tasks matches the adjusted number of task containers, redeploy all tasks to adjust the number of currently parallel tasks.

[0050] Specifically, please combine Figure 2 and Figure 5 In Flink cluster 21, each task is actively managed by the Job Manager (JM). Figure 2 In a task manager (e.g., TM1, TM2, etc.), the resources for each task are provided by the server where each task is deployed. Each server maintains a communication connection with the task manager (JM) via a heartbeat mechanism. For example, each task sends a heartbeat signal every minute to connect to the JM. Therefore, the JM needs to detect changes in tasks, such as changes in the number of tasks or the actual resources used by the tasks, every minute. This makes it difficult to respond quickly after task changes occur.

[0051] This application utilizes the container mechanism of the Kubernetes architecture and, based on a pre-defined container orchestration algorithm, establishes task containers (such as...) for each task in a Flink cluster 21. Figure 5 Task container 1 in the middle is Figure 2 The task container for TM1, and task container 2 are... Figure 2 The Flink cluster 21 uses TM2 as its task container and creates a job container 25 for the job manager JM that manages all tasks. By controlling the number of task containers, the number of currently parallel tasks can be adjusted. In this way, the control logic inside the Flink cluster 21 can be transferred to the external Kubernetes architecture for control.

[0052] After adjusting the number of task containers according to the target parallelism count, the number of task containers becomes the target parallelism count. At this point, the task containers will request resources from job container 25 based on the adjusted count. Compared to the job controller JM actively obtaining the number of tasks based on the heartbeat mechanism, the proactive resource request from task containers to job container 25 after the change in the number of task containers is obviously faster. After receiving the resource request based on the adjusted number of task containers, job container 25 will perform resource scheduling. It is understood that the scheduled resources are not immediately determined. Therefore, it is necessary to monitor the currently scheduled resources in real time to determine the number of parallel tasks that the resources can support. When the number of parallel tasks matches the adjusted number of task containers (e.g., the number of parallel tasks is greater than or equal to the adjusted number of task containers), it means that resource scheduling is complete. At this time, all tasks can be redeployed according to the scheduled resources to adjust the number of currently parallel tasks so that the number of currently parallel tasks is greater than or equal to the target parallelism count, thereby achieving elastic scaling of resources.

[0053] This application transforms the control of the Flink cluster 21 to a Kubernetes (K8s) architecture, as follows: Figure 5As shown, after obtaining the target number of parallel tasks, the main controller 26 can adjust the number of task replicas accordingly. The main controller can also connect to the Kubernetes client 27 and adjust resources by receiving input from the client. Task replicas request resources from the job replica 25 based on the adjusted number. The job replica 25 includes a job controller 251, a resource manager 252, and a resource monitor 253. The job controller 251 requests resources based on the required number of task replicas, the resource manager 252 manages the requested resources, and the resource monitor 253 monitors changes in the requested resources. Based on the monitored requested resources, the resource monitor 253 calculates the corresponding number of parallel tasks. When the number of parallel tasks matches the adjusted number of task containers, the job controller 25 can redeploy tasks according to the requested resources, thereby adjusting the number of currently parallel tasks. By scheduling resources according to the target number of parallel tasks, the adjusted number of currently parallel tasks ultimately reaches the target number. In this way, by actively requesting resources through task replicas, rapid resource scheduling can be achieved. The requested resources can be monitored in real time through resource monitor 253. There is no need to wait for the communication timeout of the server providing resources for the task. The changes in resources can be detected in real time. Then, after the resource scheduling is completed, the task deployment is executed immediately, and the elastic scaling of resources can be achieved quickly.

[0054] Optionally, each task container may include one or more available slots, and the number of available slots in a task container represents the number of threads that the task container can run in parallel simultaneously. Matching the number of parallel tasks with the adjusted number of task containers can be achieved by: the number of parallel tasks equals the adjusted number of task containers multiplied by the number of available slots in each task container.

[0055] To facilitate resource management, the resource monitor 253 can display the requested resource information and the number of parallel tasks that the current resources can support in real time as resource usage information, such as on the World Wide Web (web) front-end 28.

[0056] Currently, Flink's history server is used to view the historical execution status of jobs. Statistics on completed jobs can be queried after the corresponding Flink cluster (21) has been shut down. The history server is primarily used for batch processing tasks, requiring queries on the running status of batch tasks and their corresponding logs. Due to the large volume of batch tasks, a high-performance history server is needed for these query requirements.

[0057] This application stores the information after each task runs in other high-performance storage devices, such as a preset database like a MySQL database. Administrators can then perform efficient queries from this preset database. Furthermore, resource scheduling information can also be used to generate runtime logs, which are also stored in the preset database. This not only facilitates queries by backend administrators but also allows access to the cloud platform, enabling users to quickly query resource scheduling runtime logs on the cloud platform.

[0058] This application's Kubernetes-based architecture enables one-click cloud-native deployment and automatically calculates the initial resource information for each task. It also allows for the management of requested resources through a resource manager, facilitating real-time monitoring of changes in requested resources by the resource monitor. This facilitates rapid resource scheduling and enables quick elastic scaling of resources.

[0059] To facilitate better implementation of the control method of the embodiments of this application, the embodiments of this application also provide a control device 10. Please refer to... Figure 6 The control device 10 may include:

[0060] Module 11 is used to acquire different indicator information of the currently parallel tasks;

[0061] The first determining module 12 is used to determine the target number of parallel operations based on indicator information and a preset scaling strategy; and

[0062] Adjustment module 13 is used to adjust the number of currently parallel tasks according to the target number of parallel tasks.

[0063] The first determining module 12 is specifically used for:

[0064] The target number of parallel operations is determined based on the difference between the average CPU utilization and the preset CPU utilization; and / or

[0065] Determine the target number of parallel processes based on average memory utilization and preset memory utilization; and / or

[0066] If the current time is a preset time, the target number of parallel operations is determined to be the preset number of parallel operations corresponding to the preset time.

[0067] The control device 10 also includes:

[0068] The second determining module 14 is used to determine the actual amount of resources used by the task based on the indicator information;

[0069] Execution module 15 is used to execute tasks based on the actual resource quantity when the actual resource quantity is between the maximum and minimum resource quantity.

[0070] The control device 10 also includes:

[0071] Module 16 is used to create a task container for each task and a job container to manage all tasks based on a preset container orchestration algorithm.

[0072] Adjustment module 13 is specifically used for:

[0073] Adjust the number of task containers based on the target number of parallel operations;

[0074] Request resources from the job container based on the adjusted number of task containers;

[0075] The number of parallel tasks corresponding to the monitored resource;

[0076] If the number of parallel tasks matches the adjusted number of task containers, redeploy all tasks to adjust the number of currently parallel tasks.

[0077] The control device 10 also includes:

[0078] Display module 17 is used to display resource usage information based on the number of parallel tasks.

[0079] Specifically, adjustment module 13 is also used to redeploy each task on the server that stores information about each task.

[0080] The adjustment module 13 is also used to adjust the number of currently parallel tasks by scheduling resources according to the target number of parallel tasks after saving the information of the currently parallel tasks.

[0081] The control device 10 also includes:

[0082] The storage module 18 is used to record information about each resource scheduling to generate an operation log and save the operation log in a preset database.

[0083] Each module in the control device 10 described above can be implemented entirely or partially through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor 20 in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor 20 can call and execute the operations corresponding to each module.

[0084] Please see Figure 7 The computer device 100 of this application includes a processor 20. The processor 20 is used to execute the control method of any of the above embodiments, which will not be described in detail here for the sake of brevity.

[0085] Computer device 100 can be a mobile terminal, server (such as a cloud server), tablet computer, desktop computer, etc.

[0086] Please see Figure 8This application also provides a computer-readable storage medium 300 storing a computer program 310. When the computer program 310 is executed by the processor 20, it implements the steps of the control method of any of the above embodiments. For the sake of brevity, these steps will not be repeated here.

[0087] It is understood that a computer program 310 includes computer program code. Computer program code can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable storage media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, external hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), and software distribution media, etc.

[0088] In the description of this specification, the terms "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with an embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0089] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0090] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A control method, characterized in that, include: Obtain different indicator information of the currently parallel tasks, wherein each task has a maximum resource amount and a minimum resource amount; The target number of parallel operations is determined based on the aforementioned indicator information and the preset scaling strategy; Based on a preset container orchestration algorithm, a task container is created for each task and a job container is created to manage all the tasks. Adjust the number of task containers according to the target number of parallel operations; Request resources from the job container based on the adjusted number of task containers; Monitor the number of parallel tasks corresponding to the resource; If the number of tasks running in parallel is equal to the adjusted number of task containers multiplied by the number of available slots in each task container, all tasks are redeployed to adjust the number of tasks currently running in parallel. Based on the aforementioned indicator information, determine the actual amount of resources used by the task; If the actual resource quantity is between the maximum and minimum resource quantity, the task is executed based on the actual resource quantity.

2. The control method according to claim 1, characterized in that, The metric information includes average CPU utilization, average memory utilization, and / or the current time. Determining the target number of parallel connections based on the metric information and a preset scaling strategy includes: The target number of parallel operations is determined based on the difference between the average CPU utilization and the preset CPU utilization; and / or The target number of parallel processes is determined based on the average memory utilization rate and the preset memory utilization rate; and / or If the current time is a preset time, the target number of parallel processes is determined to be the preset number of parallel processes corresponding to the preset time.

3. The control method according to claim 1, characterized in that, Also includes: Resource usage information is displayed based on the number of parallel tasks.

4. The control method according to claim 1, characterized in that, The redeployment of all the aforementioned tasks includes: Each task is redeployed on the server that stores information about each task.

5. The control method according to claim 1, characterized in that, After determining the target number of parallel operations based on the indicator information and the preset scaling strategy, the method further includes: After saving the information of the currently parallel tasks, proceed to the step of adjusting the number of task containers according to the target number of parallel tasks.

6. The control method according to claim 1, characterized in that, Also includes: Record information about each resource scheduling to generate an operation log, and save the operation log in a preset database.

7. A control device, characterized in that, include: The acquisition module is used to acquire different indicator information of the currently parallel tasks, wherein each task has a maximum resource amount and a minimum resource amount; The first determining module is used to determine the target number of parallel operations based on the indicator information and a preset scaling strategy; and An adjustment module is used to determine a target number of parallel tasks based on the metric information and a preset scaling strategy; create a task container for each task and a job container to manage all tasks based on a preset container orchestration algorithm; adjust the number of task containers according to the target number of parallel tasks; request resources from the job container based on the adjusted number of task containers; monitor the number of parallel tasks corresponding to the resources; redeploy all tasks to adjust the number of currently parallel tasks if the number of parallel tasks is equal to the adjusted number of task containers multiplied by the number of available slots in each task container; determine the actual amount of resources used by the task based on the metric information; and execute the task according to the actual amount of resources if the actual amount of resources is between the maximum and minimum amount of resources.

8. A computer device, characterized in that, Includes a processor for executing the control method according to any one of claims 1-6.

9. A non-volatile computer-readable storage medium, characterized in that, The system includes a computer program that, when executed by one or more processors, implements the control method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Distributed data stream processing method and system

    CN103595651A

  • Resource allocation method of calculating system, calculating system, medium and server

    CN107844376A

  • Method and device for adjusting service container

    CN109960579A