Task scheduling method and device, electronic equipment and readable storage medium

Through the task storage queue and evaluation model, long tasks are dynamically determined and scheduled, which solves the stuck problem caused by fixed long task determination and low resource usage in the existing technology, and realizes adaptive scheduling and smooth operation of the storage system.

CN118567800APending Publication Date: 2024-08-30INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410533026.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-29
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

When the existing storage system schedules long tasks, low resource occupancy may cause lags or affect running tasks. Moreover, the judgment of long tasks is relatively fixed and cannot dynamically adapt to the needs of different scenarios.

Method used

Through the task storage queue and task evaluation model, it can dynamically determine whether the task is a long task, schedule it according to the task execution time and system resource occupancy, avoid resource allocation in the fixed thread pool method, and adaptively schedule long tasks to ensure system smoothness.

Benefits of technology

It realizes dynamic scheduling of long tasks based on different task parameters and system resource conditions, avoids lags caused by resource grabbing, improves the running fluency and ease of use of the storage system, and adapts to priority requirements in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118567800A
    Figure CN118567800A
Patent Text Reader

Abstract

Embodiments of the invention provide a task scheduling method and apparatus, an electronic device and a readable storage medium. The method comprises the steps of determining a task at a head node position in a task storage queue as a target task; inputting the target task into a task evaluation model, and predicting system resource data occupied when the target task runs; acquiring system resource data occupied when the storage system runs; and according to the system resource data occupied when the target task runs and the system resource data occupied when the storage system runs, determining whether to schedule and execute the target task from the task storage queue. According to the embodiment of the invention, the task execution time is used as a basis for judging the long task, so that the fixed limitation on the long task in the operation tasks is avoided, the CPU resource and IO read-write speed utilization rate of the current storage system is monitored, the execution of the long task is dynamically and adaptively scheduled, and the smooth operation of the current storage system is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the technical field of task scheduling in a storage system, and in particular to a task scheduling method, a task scheduling device, an electronic device, and a computer-readable storage medium. Background Art

[0002] A long task refers to a task that takes a long time to execute in a storage system. The current mainstream storage systems have a relatively fixed judgment on long tasks, and a certain type of task is fixedly designated as a long task. In addition, most of the long tasks are scheduled and executed using a thread pool scheduling method with a fixed number of threads. That is, the number of threads allowed to execute long tasks is specified when the system is initialized. As long as there are long tasks to be executed, threads can be allocated to the long tasks and executed if there are idle threads in the thread pool.

[0003] However, with the iterative development of storage products, more and more features and larger specifications are supported. For example, with the development of hard disk technology, the maximum size of the volume created by storage products in the past was 256TiB (Tebibyte, a binary unit of capacity), but now the iteration of storage systems can create a maximum volume size of 1PiB (Pebibyte, a binary unit of capacity), just like there are higher performance requirements for business operations. In some scenarios, it does not take too long to execute a certain operation alone, but the rules supported by some features are expanded, or multiple tasks are created at the same time, which leads to a longer execution time for the task. In other scenarios, the storage system is already running IO (Input / Output) business or other tasks that occupy more resources. At this time, the storage system CPU (Central Processing Unit) resources or memory resource availability is already low. At this time, if there is a long task to be executed, a thread is usually assigned to execute the task immediately. In this scenario, it may cause a stuck thread in the normal use of the storage system, or affect the tasks that are already running in the storage system. Summary of the invention

[0004] An embodiment of the present invention provides a task scheduling method, device, electronic device and computer-readable storage medium to solve the problem that the judgment of long tasks in the prior art is relatively fixed, and when the availability of CPU resources or memory resources of the storage system is low, the process of allocating threads for long tasks may cause threads in the storage system to become stuck or affect tasks running in the storage system.

[0005] The embodiment of the present invention discloses a method for scheduling a task, comprising:

[0006] Determine the task at the first node position in the task storage queue as the target task; the task storage queue is used to store tasks, and the task is a task whose execution time in the storage system exceeds a preset time threshold;

[0007] Acquire system resource data occupied by the storage system when it is running;

[0008] Inputting the target task into a task evaluation model to predict system resource data occupied by the target task when it is running;

[0009] According to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running, it is determined whether to schedule the target task from the task storage queue for execution.

[0010] Optionally, the task evaluation model includes the preset time threshold, and before determining the task at the first node position in the task storage queue as the target task, the scheduling method further includes:

[0011] Inputting the tasks to be executed in the storage system into the task evaluation model to predict the task execution time of the tasks to be executed;

[0012] Determine whether the task execution time of the task to be executed is greater than the preset time threshold;

[0013] If the task execution time of the to-be-executed task is greater than the preset time threshold, the to-be-executed task belongs to the task;

[0014] Compare the priority of the task to be executed with the priorities of the tasks in the task storage queue to determine the tasks with priorities adjacent to the priority of the task to be executed;

[0015] Inserting the to-be-executed task into the task storage queue at an adjacent node position of a task with an adjacent priority to the to-be-executed task;

[0016] The priority is determined according to the importance and / or urgency of the task.

[0017] Optionally, determining whether to schedule execution of the target task from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running includes:

[0018] If the system resource data occupied by the storage system during operation is greater than or equal to a preset system threshold, wait for secondary scheduling to execute the target task;

[0019] Or, if the system resource data occupied by the storage system when running is less than the preset system threshold, the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running are added to obtain the target system resource data;

[0020] If the target system resource data is less than the preset system threshold, the target task is scheduled for execution from the task storage queue and the task storage queue is updated; or, if the target system resource data is greater than or equal to the preset system threshold, the target task is waited for secondary scheduling to execute;

[0021] The preset system threshold is used to determine whether the storage system has sufficient system resource data to schedule the execution of the target task.

[0022] Optionally, the waiting for secondary scheduling to execute the target task includes:

[0023] Monitoring whether there is a task completion in the storage system;

[0024] When a task is completed in the storage system, the secondary system resource data occupied by the storage system during operation is obtained for the second time, and based on the system resource data occupied by the target task during operation and the secondary system resource data occupied by the storage system during operation, it is determined whether to schedule the target task for execution from the task storage queue, and the task storage queue is updated.

[0025] Optionally, the system resource data includes: central processing unit usage rate and input / output read / write speed; the preset system threshold includes a preset central processing unit usage rate threshold and a preset input / output read / write speed threshold.

[0026] Optionally, the task evaluation model includes a task execution time evaluation model, a CPU usage evaluation model, and an input / output read / write speed evaluation model. Before determining the task at the first node position in the task storage queue as the target task, the method further includes:

[0027] Identifying and parsing the operation log data of the storage system to obtain data related to the task as sample data;

[0028] The sample data is screened and segmented and generalized to obtain the indicator data corresponding to the task; the indicator data corresponding to the task is iterated to obtain N data sets; the N data sets contain X and Y of the dependency relationship;

[0029] Calculate the frequency and relationship of the N data sets;

[0030] The data set whose frequency corresponding to the N data sets is greater than a preset frequency threshold is determined as a first data set; the data set whose relationship corresponding to the first data set is greater than a preset relationship threshold is determined as a second data set; the second data set contains a strong dependency relationship of task execution time, a strong dependency relationship of CPU usage rate, and a strong dependency relationship of input / output read / write speed;

[0031] The strong dependency of the task execution time is used as the task execution time evaluation model, the strong dependency of the CPU usage rate is used as the CPU usage rate evaluation model, and the strong dependency of the input / output read / write speed is used as the input / output read / write speed evaluation model;

[0032] Wherein, N is the number of indicator data corresponding to the task, X is the leading data set in the N data sets, and Y is the subsequent data set in the N data sets.

[0033] Optionally, the data structure of the task storage queue is a chain storage data structure, the task storage queue contains nodes corresponding to the tasks, and the nodes contain node pointer fields; updating the task storage queue includes:

[0034] The node corresponding to the target task is removed from the task storage queue, and the node position stored in the node pointer field is updated.

[0035] The embodiment of the present invention further discloses a task scheduling device, comprising:

[0036] A target task module, used to determine the task at the first node position in the task storage queue as the target task; the task storage queue is used to store tasks, and the task is a task whose execution time in the storage system exceeds a preset time threshold;

[0037] A system resource data acquisition module, used to acquire system resource data occupied by the storage system when it is running;

[0038] A system resource data prediction module, used to input the target task into a task evaluation model to predict the system resource data occupied by the target task when it is running;

[0039] The target task scheduling module is used to determine whether to schedule the target task for execution from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running.

[0040] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0041] The memory is used to store computer programs;

[0042] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0043] The embodiment of the present invention further discloses a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the embodiment of the present invention.

[0044] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.

[0045] The embodiments of the present invention include the following advantages:

[0046] In an embodiment of the present invention, the task at the first node position in the task storage queue is determined as the target task; the task storage queue is used to store tasks, and the task is a task in the storage system whose task execution time exceeds a preset time threshold; the target task is input into the task evaluation model to predict the system resource data occupied by the target task when it is running; the system resource data occupied by the storage system when it is running is obtained; and according to the system resource data occupied by the target task when it is running and the system resource data occupied by the storage system when it is running, it is determined whether to schedule the target task for execution from the task storage queue. The embodiment of the present invention uses the task execution time as the basis for judging long tasks, and can dynamically judge whether a task is a long task according to different task parameter options, avoiding fixed restrictions on long tasks in operation tasks, monitoring the utilization rate of the current storage system CPU resources and IO read and write speeds, and adaptively scheduling the execution of long tasks, no longer limited to whether there are idle threads in the thread pool, ensuring that the current storage system runs smoothly, and will not cause jamming and other effects on the operation of established running functions due to resource grabbing. The entire dynamically adaptive long task scheduling system method can meet the priority of long task running in different scenarios of different customers. At the same time, it can adapt to the usage of system resources and dynamically call executable tasks to make the system run more smoothly, improve the system's usability, and provide a broader basis for the market promotion of products. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a schematic diagram of an application environment provided in an embodiment of the present invention;

[0048] Figure 2 is a flowchart of a method for scheduling tasks provided in an embodiment of the present invention;

[0049] Figure 3 is a schematic diagram of an algorithm of a task manager thread provided in an embodiment of the present invention;

[0050] Figure 4 Schematic diagram of an algorithm of a CPU / IO usage monitoring module provided in an embodiment of the present invention;

[0051] Figure 5 is a task update schematic diagram of a task storage queue provided in an embodiment of the present invention;

[0052] Figure 6 It is a schematic diagram of an overall process provided in an embodiment of the present invention;

[0053] Figure 7 is a structural block diagram of a task scheduling device provided in an embodiment of the present invention;

[0054] Figure 8 is a schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention;

[0055] Fig. 9 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0056] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0057] Reference Figure 1 , showing a schematic diagram of an application environment provided in an embodiment of the present invention, specifically, long tasks are judged for tasks in the storage system through a task evaluation model, and CPU resources and IO read and write speed utilization in the storage system are monitored to schedule and execute long tasks according to the CPU resources and IO read and write speed utilization.

[0058] Reference Figure 2 , shows a flowchart of a task scheduling method provided in an embodiment of the present invention, which may specifically include the following steps:

[0059] Step 201: determine the task at the first node position in the task storage queue as the target task; the task storage queue is used to store tasks, and the task is a task whose execution time in the storage system exceeds a preset time threshold;

[0060] In an embodiment of the present invention, a chain storage structure is set as the data structure of the task storage queue. In the task storage queue, a node represents a long task, the node data field contains the task's customized priority and the task object itself, and the node pointer field stores the memory address of the next node object.

[0061] The tasks in the task storage queue are stored in order of priority, so that the task with the highest priority can be quickly confirmed by the node position in the task storage queue, that is, the task at the first node position in the task storage queue is the task with the highest priority in the task storage queue. Therefore, in the embodiment of the present invention, it is necessary to first obtain the task at the first node position (that is, the target task) from the task storage queue, so that the target task with the highest priority can be scheduled and executed first. In this way, when resources are limited, tasks with higher priority can be given priority, thereby improving the overall performance and efficiency of the storage system.

[0062] Specifically, after determining the target task in the task storage queue, it is necessary to take out the node where the target task is located in the task storage queue, and use the task queue module to update the tasks in the task storage queue and modify the pointing of the adjacent node pointer field, that is, modify the memory address (in layman's terms, the position) stored in the adjacent node pointer field.

[0063] Furthermore, the task storage queue is used to store long tasks that need to be executed in the storage system. In the prior art, the specific execution time of the task is not considered, but a certain type of operation task is directly fixed as a long task. For example, the execution time of creating a volume is short, and the task is not a long task. It is no problem to directly allocate resources for execution. However, if 10,000 volumes are to be created in batches, the execution time will be approximately more than 2 hours. At this time, if the resource call is directly allocated, it will affect the competition for resources of the currently running tasks in the storage system, which may cause problems such as system usage jams or memory overflows. Therefore, in order to solve the problems existing in the prior art, in the embodiment of the present invention, the task execution time is used as the basis for judging long tasks, and whether the task is a long task can be dynamically judged according to different task parameter options, thereby avoiding fixed restrictions on long tasks in operation tasks and ignoring the influence of different parameter configurations on the execution time of tasks.

[0064] Step 202: Obtain system resource data occupied by the storage system during operation;

[0065] In an embodiment of the present invention, by setting a CPU / IO usage monitoring module, the system resources are monitored in real time in two dimensions: CPU resource occupancy rate and IO read / write rate. Not only computing tasks but also IO tasks are taken into account. By evaluating the resource usage of these two indicators, long tasks can be adaptively scheduled according to system resources, and the basis for task scheduling can be more accurately determined from two dimensions. Therefore, it is necessary to consider the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation. In order to more accurately determine the basis for task scheduling from two dimensions later, it is necessary to obtain the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation. System resource data includes CPU resource occupancy rate and IO read / write rate.

[0066] At the same time, the Map data structure is set in the form of {key: value} to store the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation, wherein the key is the obtained resource indicator and the value is the obtained resource indicator value.

[0067] Step 203: input the target task into a task evaluation model to predict the system resource data occupied by the target task when it is running;

[0068] In an embodiment of the present invention, the CPU / IO usage monitoring module not only needs to consider the CPU resource occupancy and IO read / write rate when the current storage system is running, but also needs to consider the CPU resource occupancy and IO read / write rate when the target task is running. Therefore, in order to make a more comprehensive judgment on the basis of task scheduling from two dimensions in the future, it is necessary to predict the CPU resource occupancy and IO read / write rate of the target task.

[0069] Here, the Map data structure is also set in the form of {key: value} to store the CPU resource occupancy and IO read and write rate corresponding to the target task, where the key is the corresponding predicted resource indicator and the value is the predicted resource indicator value.

[0070] The task evaluation model includes the dependency TimeModal of the task execution time, the dependency CPUModal of the CPU resource occupancy rate, and the dependency IOModal of the IO read / write rate, wherein the dependency CPUModal of the CPU resource occupancy rate and the dependency IOModal of the IO read / write rate are used in step 202 to predict the system resource data to be occupied when the target task is running. The system resource data includes the CPU resource occupancy rate and the IO read / write rate.

[0071] For example, the target task is input into the CPU resource utilization dependency CPUModal and the IO read / write rate dependency IOModal respectively. In actual application, if the predicted CPU resource utilization is 5% and the IO read / write rate is 1000, then the CPU resource utilization dependency CPUModal will output {CPU: 5%}, and the IO read / write rate dependency IOModal will output {IO: 1000}.

[0072] Step 204: Determine whether to schedule the target task for execution from the task storage queue based on the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running.

[0073] In an embodiment of the present invention, a CPU resource occupancy rate threshold and an IO read / write rate threshold are pre-set in the CPU / IO usage rate monitoring module. When scheduling the target task for execution, it is necessary to determine whether to schedule the target task for execution from the task storage queue based on the data between the CPU resource occupancy rate and IO read / write rate occupied when the target task is running and the CPU resource occupancy rate and IO read / write rate occupied when the current storage system is running. At this time, it is necessary to develop a task manager thread, which is mainly used to call tasks in the task storage queue. If the target task needs to be scheduled for execution from the task storage queue, the task manager thread is awakened by thread awakening to obtain the target task from the task storage queue.

[0074] Specifically, the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are compared with the CPU resource occupancy rate threshold and the IO read / write rate threshold respectively. If the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are both greater than the preset threshold, the task manager thread continues to wait until it is awakened for execution next time; otherwise, the CPU resource occupancy rate and IO read / write rate occupied by the target task during operation and the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are added together, and compared with the CPU resource occupancy rate threshold and the IO read / write rate threshold. If the added data does not exceed the preset threshold, indicating that the target task can be scheduled for execution, it is necessary to wake up the task manager thread by thread wake-up, and obtain the target task from the task storage queue for scheduling and execution.

[0075] When waking up the task manager thread, it is also necessary to update the pointing of the first pointer in the task storage queue. The first pointer points to the memory address of the first task in the task storage queue, that is, the position of the first task.

[0076] Reference Figure 3, shows a schematic diagram of an algorithm of a task manager thread provided in an embodiment of the present invention, and the specific process is as follows:

[0077] Step 301, the thread receiving the scheduled task wakes up;

[0078] Step 302: pre-acquire a target task from a task storage queue;

[0079] Step 303: Calculate the CPU resource occupancy rate and the IO read / write rate through the CPU / IO usage monitoring module to obtain the calculation result;

[0080] Step 304: determine whether to acquire the target task according to the calculation result;

[0081] Step 305: If the calculation result allows the target task to be scheduled for execution, the target task is obtained from the task storage queue, a new thread is opened to execute the target task, and the first node and pointer in the task storage queue are updated;

[0082] Step 306: If the calculation result does not allow the target task to be scheduled for execution, the task manager thread continues to wait until it is awakened for execution next time.

[0083] From the above process, it can be seen that in the embodiment of the present invention, by monitoring the utilization rate of the CPU resources and IO read and write speed of the current storage system, the execution of long tasks is adaptively scheduled, which is no longer limited to whether there are idle threads in the thread pool, thereby ensuring that the current storage system runs smoothly and will not cause lag and other effects on the operation of established running functions due to resource grabbing.

[0084] In an optional embodiment of the present invention, when the task manager thread is awakened by thread awakening, the task at the first node position in the task storage queue is pre-acquired by default in the task manager thread for scheduling and execution. However, it is also possible to decide which type of task to obtain for scheduling and execution based on the comparison between the CPU resource occupancy rate and IO read and write rate occupied by the current storage system during operation and the preset threshold.

[0085] Specifically, refer to Figure 4 , shows an algorithm diagram of a CPU / IO usage monitoring module provided in an embodiment of the present invention, and the monitoring process is as follows:

[0086] Step 401: Obtain the CPU resource occupancy rate and IO read / write rate currently used by the storage system during operation;

[0087] Step 402: Compare the CPU resource occupancy rate and IO read / write rate of the current storage system during operation with the preset system threshold, and the following four situations can be obtained:

[0088] Case 1: CPU resource usage is low and IO read and write rates are high;

[0089] Case 2: CPU resource usage is high and IO read and write rates are low;

[0090] Case 3: CPU resource usage is low and IO read and write rates are low;

[0091] Case 4: CPU resource usage is high and IO read and write rates are high;

[0092] Step 403: If the result is situation 1, a computing task is obtained from the task storage queue as a task to be executed;

[0093] Step 404: If the result is situation 2, an IO type task is obtained from the task storage queue as a task to be executed;

[0094] Step 405: If the result is situation 3, the task at the first node position is obtained from the task storage queue as the task to be executed;

[0095] Step 406: If the result is situation 4, execute step 409;

[0096] Step 407: predict the CPU resource occupancy rate and IO read / write rate when the task to be executed is running, and add the CPU resource occupancy rate and IO read / write rate when the task to be executed is running and the CPU resource occupancy rate and IO read / write rate when the current storage system is running to obtain the target system resource data;

[0097] Step 408: determine whether the target system resource data reaches a preset system threshold;

[0098] Step 409: If the time limit is not reached, the task manager thread continues to wait until it is awakened and executed next time;

[0099] Step 4010: If the time limit is reached, the task to be executed is obtained from the task storage queue.

[0100] According to the above monitoring process, the storage system can choose to obtain different types of tasks according to the different resource conditions at the current runtime. This can adapt to the usage of system resources, avoid resource waste and improve the overall performance of the system, dynamically call executable tasks, make the system run more smoothly, and improve the ease of use of the system.

[0101] In an embodiment of the present invention, the task at the first node position in the task storage queue is determined as the target task; the task storage queue is used to store tasks, and the task is a task in the storage system whose task execution time exceeds a preset time threshold; the target task is input into the task evaluation model to predict the system resource data occupied by the target task when it is running; the system resource data occupied by the storage system when it is running is obtained; and according to the system resource data occupied by the target task when it is running and the system resource data occupied by the storage system when it is running, it is determined whether to schedule the target task for execution from the task storage queue. The embodiment of the present invention uses the task execution time as the basis for judging long tasks, and can dynamically judge whether a task is a long task according to different task parameter options, avoiding fixed restrictions on long tasks in operation tasks, monitoring the utilization rate of the current storage system CPU resources and IO read and write speeds, and adaptively scheduling the execution of long tasks, no longer limited to whether there are idle threads in the thread pool, ensuring that the current storage system runs smoothly, and will not cause jamming and other effects on the operation of established running functions due to resource grabbing. The entire dynamically adaptive long task scheduling system method can meet the priority of long task running in different scenarios of different customers. At the same time, it can adapt to the usage of system resources and dynamically call executable tasks to make the system run more smoothly, improve the system's usability, and provide a broader basis for the market promotion of products.

[0102] In an embodiment of the present invention, the task evaluation model includes the preset time threshold, and before the step 201, in which the task at the first node position in the task storage queue is determined as the target task, the scheduling method further includes:

[0103] Inputting the tasks to be executed in the storage system into the task evaluation model to predict the task execution time of the tasks to be executed;

[0104] Determine whether the task execution time of the task to be executed is greater than the preset time threshold;

[0105] If the task execution time of the to-be-executed task is greater than the preset time threshold, the to-be-executed task belongs to the task;

[0106] Compare the priority of the task to be executed with the priorities of the tasks in the task storage queue to determine the tasks with priorities adjacent to the priority of the task to be executed;

[0107] Inserting the to-be-executed task into the task storage queue at an adjacent node position of a task with an adjacent priority to the to-be-executed task;

[0108] The priority is determined according to the importance and / or urgency of the task.

[0109] In an embodiment of the present invention, the task evaluation model includes the dependency relationship TimeModal of the task execution time, the dependency relationship CPUModal of the CPU resource occupancy rate, and the dependency relationship IOModal of the IO read and write rate, wherein the task to be executed in the storage system needs to be input into the dependency relationship TimeModal of the task execution time, and the preset time threshold TH is set in advance. The model can predict the task execution time T1 of the task to be executed, that is, the dependency relationship TimeModal of the task execution time will output the task execution time T1, compare the task execution time T1 with the preset time threshold TH, and store the task whose task execution time T1 is greater than the preset time threshold TH in the task storage queue as a long task. If the task whose task execution time T1 is greater than the preset time threshold TH is not a long task, it is not stored in the task storage queue, but is executed by the original logic of the storage system.

[0110] Different tasks have default priorities, and priorities can also be customized according to needs. For example, pool creation can be executed many times. The first time, the priority can be uncustomized (directly inserted at the end of the queue), and the second time, the priority can be specified (need to be inserted into the queue according to the priority size). Tasks with higher priorities can be customized according to different scenarios. For example, if you want to create a volume at this time, but it is urgent, you can specify a higher priority. If it is not urgent, you can use the default priority. In the embodiment of the present invention, the requirements of different operations are defined according to different scenarios to meet better scalability.

[0111] As an algorithm item, the preset time threshold TH can be adaptively adjusted according to different actual scenarios. In addition, in the process of determining whether a task is a long task, the time of multiple tasks can be estimated at the same time to improve the prediction efficiency, thereby improving the operation efficiency of the system.

[0112] The embodiment of the present invention uses the task execution time as the basis for judging long tasks. It can dynamically judge whether a task is a long task according to different task parameter options, without having to judge according to the task type. The dependency relationship TimeModal of the task execution time is used to judge the long task, thus avoiding the fixed restriction on long tasks in operation tasks.

[0113] Reference Figure 5 , shows a task update schematic diagram of a task storage queue provided in an embodiment of the present invention, and the update process is as follows:

[0114] Step 501, responding to the judgment of the task to be executed;

[0115] Step 502: determine whether the task to be executed is a long task;

[0116] Step 503: If the task to be executed is a long task, obtain the custom priority of the task to be inserted, traverse the nodes in the task storage queue, compare the priority of the first node in the task storage queue, and after comparing the task nodes with adjacent priorities, modify the pointer fields of the previous and next nodes;

[0117] Step 504: insert the task to be inserted into the specified position in the task storage queue;

[0118] Step 505: If the task to be executed is not a long task, the task to be executed is discarded, that is, it is not stored in the task storage queue.

[0119] In an embodiment of the present invention, the step 204, determining whether to schedule the target task for execution from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running, includes:

[0120] If the system resource data occupied by the storage system during operation is greater than or equal to a preset system threshold, wait for secondary scheduling to execute the target task;

[0121] Or, if the system resource data occupied by the storage system when running is less than the preset system threshold, the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running are added to obtain the target system resource data;

[0122] If the target system resource data is less than the preset system threshold, the target task is scheduled for execution from the task storage queue and the task storage queue is updated; or, if the target system resource data is greater than or equal to the preset system threshold, the target task is waited for secondary scheduling to execute;

[0123] The preset system threshold is used to determine whether the storage system has sufficient system resource data to schedule the execution of the target task.

[0124] In an embodiment of the present invention, the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are compared with the CPU resource occupancy rate threshold and the IO read / write rate threshold, respectively. If the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are both greater than the preset threshold, the task manager thread continues to wait until it is awakened for execution next time; otherwise, the CPU resource occupancy rate and IO read / write rate occupied by the target task during operation and the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are added together and compared with the CPU resource occupancy rate threshold and the IO read / write rate threshold. If the added data does not exceed the preset threshold at this time, indicating that the target task can be scheduled for execution, it is necessary to wake up the task manager thread by thread awakening, and obtain the target task from the task storage queue for scheduling and execution. While waking up the task manager thread, it is also necessary to update the direction of the first pointer in the task storage queue.

[0125] In the process of task scheduling and execution, the producer / consumer model is involved. The producer / consumer model is a well-known classic design pattern. Simply put, it consumes when there is something, and waits when there is nothing.

[0126] By monitoring the current storage system's CPU resources and IO read and write speed usage, the execution of long tasks can be adaptively scheduled, no longer limited to whether there are idle threads in the thread pool, ensuring that the current storage system runs smoothly and does not cause lags in the operation of established functions due to resource grabbing.

[0127] In an optional embodiment of the present invention, when the task manager thread is awakened by thread awakening, the task at the first node position in the task storage queue is pre-acquired by default in the task manager thread for scheduling and execution. However, it is also possible to decide which type of task to obtain for scheduling and execution based on the comparison between the CPU resource occupancy rate and IO read and write rate occupied by the current storage system during operation and a preset threshold. In this way, the storage system can choose to obtain different types of tasks based on different resource conditions during the current operation. This can adapt to the use of system resources, avoid resource waste and improve the overall performance of the system, dynamically call executable tasks, make the system run more smoothly, and improve the ease of use of the system.

[0128] In one embodiment of the present invention, the waiting for secondary scheduling to execute the target task includes:

[0129] Monitoring whether there is a task completion in the storage system;

[0130] When a task is completed in the storage system, the secondary system resource data occupied by the storage system during operation is obtained for the second time, and based on the system resource data occupied by the target task during operation and the secondary system resource data occupied by the storage system during operation, it is determined whether to schedule the target task for execution from the task storage queue, and the task storage queue is updated.

[0131] In an embodiment of the present invention, if the CPU resource occupancy rate and IO read / write rate occupied by the current storage system during operation are greater than the preset threshold value, the storage system needs to monitor and wait for the completion of the execution of existing tasks. After the execution of the existing tasks is completed, certain system resources will be released. At this time, the system resources can be monitored in real time again through the CPU / IO usage monitoring module. If the conditions are met, a series of subsequent task scheduling and task storage queue update actions can be performed.

[0132] By monitoring the current storage system's CPU resources and IO read and write speed usage, the execution of long tasks can be adaptively scheduled, no longer limited to whether there are idle threads in the thread pool, ensuring that the current storage system runs smoothly and does not cause lags in the operation of established functions due to resource grabbing.

[0133] In an embodiment of the present invention, the system resource data includes: CPU usage rate and input / output read / write speed; the preset system threshold includes a preset CPU usage rate threshold and a preset input / output read / write speed threshold.

[0134] In an embodiment of the present invention, a CPU / IO usage monitoring module is set up to monitor system resources in real time in two dimensions: CPU resource occupancy rate and IO read and write rate. Not only computing tasks but also IO tasks are taken into account. By evaluating the resource usage of these two indicators, long tasks can be adaptively scheduled according to system resources, and the basis for task scheduling can be judged more accurately from two dimensions.

[0135] In one embodiment of the present invention, the task evaluation model includes a task execution time evaluation model, a CPU usage evaluation model and an input / output read / write speed evaluation model. Before the step 201, in which the task at the first node position in the task storage queue is determined as the target task, the method further includes:

[0136] Identifying and parsing the operation log data of the storage system to obtain data related to the task as sample data;

[0137] The sample data is screened and segmented and generalized to obtain the indicator data corresponding to the task; the indicator data corresponding to the task is iterated to obtain N data sets; the N data sets contain X and Y of the dependency relationship;

[0138] Calculate the frequency and relationship of the N data sets;

[0139] The data set whose frequency corresponding to the N data sets is greater than a preset frequency threshold is determined as a first data set; the data set whose relationship corresponding to the first data set is greater than a preset relationship threshold is determined as a second data set; the second data set contains a strong dependency relationship of task execution time, a strong dependency relationship of CPU usage rate, and a strong dependency relationship of input / output read / write speed;

[0140] The strong dependency of the task execution time is used as the task execution time evaluation model, the strong dependency of the CPU usage rate is used as the CPU usage rate evaluation model, and the strong dependency of the input / output read / write speed is used as the input / output read / write speed evaluation model;

[0141] Wherein, N is the number of indicator data corresponding to the task, X is the leading data set in the N data sets, and Y is the subsequent data set in the N data sets.

[0142] In the embodiment of the present invention, the task evaluation model includes the dependency relationship TimeModal of the task execution time (i.e., the task execution time evaluation model), the dependency relationship CPUModal of the CPU resource occupancy rate (i.e., the central processing unit utilization rate evaluation model), and the dependency relationship IOModal of the IO read / write rate (i.e., the input / output read / write speed evaluation model). To obtain the task evaluation model, it is necessary to process the data and improve and optimize the algorithm, as described in detail as follows:

[0143] The operation logs in the storage system are obtained as sample data, and the data related to the operation tasks are identified and parsed, such as the operation type, task parameters, task execution time, CPU resource usage during task execution, IO read and write rate, and other indicators, as new sample data; operation tasks refer to tasks of different operation types, such as creating LUN (Logical Unit Number) and creating a pool, which can be understood as two operation tasks of different operation types.

[0144] Perform data preprocessing on new sample data, filter, identify and extract relevant indicators in each log, and perform normalization processing. For example, perform segmented generalization processing on indicators such as task execution time, CPU resource usage during task execution, and IO read and write rate, and the processed indicator items are recorded as one record.

[0145] In practical applications, if a pool creation operation is performed such as mkpool –name pool1 –size 1024, the extracted indicator attributes are {mkpool, 1G, 1, 300ms, 10%, 1000}, which represent the pool creation action, the created pool capacity, the number of created pools, the time to complete the execution, the CPU occupancy rate, and the IO read and write speed. The main indicator items are segmented and generalized, for example, the capacity of 1-10G is cap1, the number of created tasks 1-20 is set as c1, the task execution time of 100ms-1000ms is t1, the CPU occupancy rate within 5% is recorded as cpu1, and the IO read and write speed is recorded as io1. Finally, the above transaction items are obtained as {mkpool, cap1, c1, t1, cpu1, io1}.

[0146] Among them, the segmented generalization of the indicator items is to represent similar data with a generalized data, so that iteration can be performed according to different values. Otherwise, each data is different, and there will be no relationship between the data.

[0147] The normalized preprocessed indicator transaction item data is used as input, and a brief description of each task type is: Let I = {I1, I2, ..., I m} is a task operation record item set, m is the number of object identifiers of the operation, where I i Indicates the i-th object identifier, corresponding to each object identifier data, transaction T i represents a subset of I, used to represent the combination of object identifiers under different combinations, and transaction T i As a subset, there can be fewer items;

[0148] The dependency relationship is expressed in the form of X->Y, where X and Y are called the predecessor and successor of the dependency relationship respectively. The dependency rule XY has frequency and relationship, as follows:

[0149]

[0150]

[0151] Match the frequency and relationship of the task operation configuration parameters, combine them with the set frequency factor, and output a relationship model that is greater than the frequency factor to predict and evaluate the tasks to be executed.

[0152] Specifically, in view of the particularity of task execution in the storage system, the above algorithm is improved and optimized to reduce the number of traversals of frequent items and improve the efficiency of algorithm execution. iAs a sub-dataset (because different tasks are independent of each other), the potential relationship of each task data is mined and analyzed (the relationship model between different task configuration parameters and execution time, the relationship model between task configuration parameters and CPU resource usage, and the relationship model between task configuration parameters and IO read and write speed), and the frequency threshold PH and the relationship threshold RH are set; among them, the task configuration parameters of different tasks are different. For example, RAID (Redundant Array of Independent Disks) reconstruction is to operate on the member disk data of RAID, which does not involve task capacity.

[0153] The sample data contains all processed data, including execution time, CPU resource usage and other indicators. In the algorithm improvement, the execution time, CPU resource usage and other indicators are separated to prevent the evaluation indicators from affecting each other, reduce the judgment of candidates, and improve efficiency.

[0154] The specific optimization process is as follows:

[0155] Taking a type of task as an identifier, filter out a set of data items related to this task as the sub-sample data corresponding to the task, that is, filter out the sub-sample data I corresponding to the task in I using the identifier i i ; Take each seed sample data I i Assume that the number of index items obtained from the parameter configuration items of the task is (including at least the task name and the number of tasks, and the relationship model between the configuration items and resources is to be obtained), then start traversing the frequent item set T from the item set. i (i.e., various combinations of various task configuration parameters); obtain frequent item sets with a frequency greater than the frequency threshold PH; from the frequent item sets, obtain frequent item sets with a relationship greater than the relationship threshold RH, which are the strong dependency relationships output by the algorithm, including the dependency TimeModal of the task execution time, the dependency CPUModal of the CPU resource occupancy rate, and the dependency IOModal of the IO read and write rate. Among them, the frequency threshold PH and the relationship threshold RH are mainly used to exclude combinations with fewer occurrences, thereby ensuring the accuracy of the task evaluation model.

[0156] Take pool creation as an example {mkpool, cap1, c1, t1}, where X can be expressed as the combination of mkpool, cap1, c1, Y can be expressed as t1, which is the above-mentioned TimeModal, or cpu1, which is the above-mentioned CPUModal, and Y is the three indicators. The dependency relationship is the relationship between X and Y.

[0157] If the configuration parameters of the combination are not frequent items at all (commonly understood as appearing very few times), there is no practical reference value in evaluating the relationship model. The algorithm aims to find strong correlations between data, and data that appear less frequently can be considered abnormal or distorted data. Therefore, first obtain frequent item sets with a frequency greater than the frequency threshold, and then obtain frequent item sets with a relationship greater than the relationship threshold RH from the frequent item sets.

[0158] The existing algorithm requires configuration parameters to be combined and iterated one by one. In the embodiment of the present invention, the task name, number, time / CPU, etc. must be included, and different combinations of parameters are directly iterated from the set containing these combinations (so as to ensure that no scenario is missed), eliminating unnecessary ones. At the same time, the input data will be classified according to the evaluation index, which also reduces the number of iterations.

[0159] In the embodiment of the present invention, different indicator items are used to iteratively combine {mkpool, cap1, c1, t1, cpu1, io1}, such as:

[0160] {mkpool,cap1,t1}

[0161] {mkpool,cap1,cpu1}

[0162] {mkpool,cap1,io1}

[0163] {mkpool,c1,t1}

[0164] {mkpool,c1,cpu1}

[0165] {mkpool,c1,io1}

[0166] {mkpool,cap1,c1,cpu1}

[0167] {mkpool,cap1,c1,io1}

[0168] {mkpool,cap1,c1,t1}

[0169] {mkpool,cap1,c1,io1}

[0170] In the above optimization process, if the traversal needs to start from mkpool for combination, there will be many unnecessary combinations. However, through the optimization in the embodiment of the present invention, unnecessary iterations can be ignored, and improvements can be made by combining the particularity of the solution, and iterating from the target point directly reduces the candidate items for each iteration, thereby increasing the efficiency of iterative optimization.

[0171] In one embodiment of the present invention, the data structure of the task storage queue is a chain storage data structure, the task storage queue includes a node corresponding to the task, and the node includes a node pointer field; updating the task storage queue includes:

[0172] The node corresponding to the target task is removed from the task storage queue, and the node position stored in the node pointer field is updated.

[0173] The data structure of the current storage data queue is mainly divided into a chain storage data structure and a sequential storage data structure. In the embodiment of the present invention, because it is necessary to continuously insert or remove tasks in the task storage queue, the task storage queue needs to be updated in this process. The chain queue only needs to update the pointer position to achieve the update queue, and the sequential storage needs to move all the tasks after the task backward (so the efficiency is low) to achieve the update queue. Therefore, in order to improve the operating efficiency of the system, the data structure of the task storage queue is set to a chain storage data structure in the embodiment of the present invention.

[0174] Updating the task storage queue is specifically performed by updating the memory address stored in the node pointer field in the task storage queue.

[0175] In an embodiment of the present invention, the task at the first node position in the task storage queue is determined as the target task; the task storage queue is used to store tasks, and the task is a task in the storage system whose execution time exceeds a preset time threshold; the target task is input into the task evaluation model to predict the system resource data occupied by the target task when it is running; the system resource data occupied by the storage system when it is running is obtained; and according to the system resource data occupied by the target task when it is running and the system resource data occupied by the storage system when it is running, it is determined whether to schedule the target task for execution from the task storage queue. The embodiment of the present invention uses the task execution time as the basis for judging long tasks, and can dynamically judge whether a task is a long task according to different task parameter options, avoiding fixed restrictions on long tasks in operation tasks, monitoring the utilization rate of the current storage system CPU resources and IO read and write speeds, and adaptively scheduling the execution of long tasks, no longer limited to whether there are idle threads in the thread pool, ensuring that the current storage system runs smoothly, and will not cause lag and other effects on the operation of established running functions due to resource grabbing. The entire dynamically adaptive long task scheduling system method can meet the priority of long task running in different scenarios of different customers. At the same time, it can adapt to the usage of system resources and dynamically call executable tasks to make the system run more smoothly, improve the system's usability, and provide a broader basis for the market promotion of products.

[0176] Reference Figure 6, showing an overall flow diagram provided in an embodiment of the present invention, specifically including: inputting the tasks to be executed in the storage system into the task evaluation model to determine whether the tasks to be executed are long tasks; if the tasks to be executed are not long tasks, the original logic of the storage system is used to execute them; if the tasks to be executed are long tasks, the long tasks are stored in the task storage queue, and the task manager thread is awakened at this time, and the tasks are pre-acquired from the task storage queue, and then the system resources are calculated through the CPU / IO usage monitoring module, and it is determined according to the preset system threshold whether to schedule the pre-acquired tasks for execution or the task manager thread waits to be awakened again.

[0177] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0178] Reference Figure 7 , shows a structural block diagram of a task scheduling device provided in an embodiment of the present invention, which may specifically include the following modules:

[0179] The target task module 701 is used to determine the task at the first node position in the task storage queue as the target task; the task storage queue is used to store tasks, and the task is a task whose execution time in the storage system exceeds a preset time threshold;

[0180] A system resource data acquisition module 702, used to acquire system resource data occupied by the storage system when it is running;

[0181] The system resource data prediction module 703 is used to input the target task into the task evaluation model to predict the system resource data occupied by the target task when it is running;

[0182] The target task scheduling module 704 is used to determine whether to schedule the target task for execution from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running.

[0183] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0184] In addition, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the scheduling method embodiment of the above-mentioned task are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0185] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned scheduling method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0186] An embodiment of the present invention also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the scheduling method embodiment of the above-mentioned tasks, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0187] Figure 8 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.

[0188] The electronic device 800 includes but is not limited to: a radio frequency unit 801, a network module 802, an audio output unit 803, an input unit 804, a sensor 805, a display unit 806, a user input unit 807, an interface unit 808, a memory 809, a processor 810, and a power supply 811. Those skilled in the art will appreciate that Figure 8 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.

[0189] It should be understood that in the embodiment of the present invention, the radio frequency unit 801 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 810 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 801 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 801 can also communicate with the network and other devices through a wireless communication system.

[0190] The electronic device provides users with wireless broadband Internet access through the network module 802, such as helping users to send and receive emails, browse web pages, and access streaming media.

[0191] The audio output unit 803 can convert the audio data received by the RF unit 801 or the network module 802 or stored in the memory 809 into an audio signal and output it as sound. Moreover, the audio output unit 803 can also provide audio output related to a specific function performed by the electronic device 800 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 803 includes a speaker, a buzzer, a receiver, etc.

[0192] The input unit 804 is used to receive audio or video signals. The input unit 804 may include a graphics processor (GPU) 8041 and a microphone 8042, and the graphics processor 8041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 806. The image frame processed by the graphics processor 8041 can be stored in the memory 809 (or other storage medium) or sent via the radio frequency unit 801 or the network module 802. The microphone 8042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 801 in the case of a telephone call mode.

[0193] The electronic device 800 also includes at least one sensor 805, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 8061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 8061 and / or the backlight when the electronic device 800 is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 805 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.

[0194] The display unit 806 is used to display information input by the user or information provided to the user. The display unit 806 may include a display panel 8061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

[0195] The user input unit 807 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 807 includes a touch panel 8071 and other input devices 8072. The touch panel 8071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 8071 or near the touch panel 8071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 8071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 810, receives the command sent by the processor 810 and executes it. In addition, the touch panel 8071 can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 8071, the user input unit 807 may also include other input devices 8072. Specifically, other input devices 8072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.

[0196] Furthermore, the touch panel 8071 may be overlaid on the display panel 8061. When the touch panel 8071 detects a touch operation on or near it, it transmits the information to the processor 810 to determine the type of the touch event. Then, the processor 810 provides a corresponding visual output on the display panel 8061 according to the type of the touch event. Figure 8 In the figure, the touch panel 8071 and the display panel 8061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 8071 and the display panel 8061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.

[0197] The interface unit 808 is an interface for connecting an external device to the electronic device 800. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 808 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 800 or may be used to transmit data between the electronic device 800 and an external device.

[0198] The memory 809 can be used to store software programs and various data. The memory 809 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 809 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0199] The processor 810 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 809 and calling data stored in the memory 809, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 810 may include one or more processing units; preferably, the processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 810.

[0200] The electronic device 800 may also include a power supply 811 (such as a battery) for supplying power to each component. Preferably, the power supply 811 may be logically connected to the processor 810 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.

[0201] In addition, the electronic device 800 includes some functional modules not shown, which will not be described in detail here.

[0202] like Fig. 9As shown, in another embodiment provided by the present invention, a computer-readable storage medium 901 is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the scheduling method of the tasks described in the above embodiment.

[0203] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0204] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0205] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.

[0206] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0207] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0208] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0209] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0210] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0211] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0212] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A task scheduling method, characterized in that: include: Determine the task at the first node position in the task storage queue as the target task; The task storage queue is used to store tasks, wherein the tasks are tasks in the storage system where the task execution time exceeds a preset time threshold; Acquire system resource data occupied by the storage system when it is running; Inputting the target task into a task evaluation model to predict system resource data occupied by the target task when it is running; According to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running, it is determined whether to schedule the target task from the task storage queue for execution.

2. The method according to claim 1, characterized in that: The task evaluation model includes the preset time threshold, and before determining the task at the first node position in the task storage queue as the target task, the scheduling method further includes: Inputting the tasks to be executed in the storage system into the task evaluation model to predict the task execution time of the tasks to be executed; Determine whether the task execution time of the task to be executed is greater than the preset time threshold; If the task execution time of the to-be-executed task is greater than the preset time threshold, the to-be-executed task belongs to the task; Compare the priority of the task to be executed with the priorities of the tasks in the task storage queue to determine the tasks with priorities adjacent to the priority of the task to be executed; Inserting the to-be-executed task into the task storage queue at an adjacent node position of a task with an adjacent priority to the to-be-executed task; The priority is determined according to the importance and / or urgency of the task.

3. The method according to claim 1, characterized in that The step of determining whether to schedule execution of the target task from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running includes: If the system resource data occupied by the storage system during operation is greater than or equal to a preset system threshold, wait for secondary scheduling to execute the target task; Or, if the system resource data occupied by the storage system when running is less than the preset system threshold, the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running are added to obtain the target system resource data; If the target system resource data is less than the preset system threshold, the target task is scheduled for execution from the task storage queue and the task storage queue is updated; or, if the target system resource data is greater than or equal to the preset system threshold, the target task is waited for secondary scheduling to execute; The preset system threshold is used to determine whether the storage system has sufficient system resource data to schedule the execution of the target task.

4. The method according to claim 3, characterized in that The waiting for secondary scheduling to execute the target task includes: Monitoring whether there is a task completion in the storage system; When a task is completed in the storage system, the secondary system resource data occupied by the storage system during operation is obtained for the second time, and based on the system resource data occupied by the target task during operation and the secondary system resource data occupied by the storage system during operation, it is determined whether to schedule the target task for execution from the task storage queue, and the task storage queue is updated.

5. The method according to claim 4, characterized in that The system resource data includes: CPU usage rate and input / output read / write speed; the preset system threshold includes a preset CPU usage rate threshold and a preset input / output read / write speed threshold.

6. The method according to claim 2, characterized in that The task evaluation model includes a task execution time evaluation model, a CPU usage evaluation model and an input / output read / write speed evaluation model. Before determining the task at the first node position in the task storage queue as the target task, the method further includes: Identifying and parsing the operation log data of the storage system to obtain data related to the task as sample data; Screening and segmenting the sample data to obtain indicator data corresponding to the task; Iterate the indicator data corresponding to the task to obtain N data sets; the N data sets contain X and Y of the dependency relationship; Calculate the frequency and relationship of the N data sets; Determine a data set whose frequency corresponding to the N data sets is greater than a preset frequency threshold as a first data set; The relationship degree corresponding to the first data set is greater than a preset relationship degree threshold and is determined as a second data set; the second data set contains a strong dependency relationship of task execution time, a strong dependency relationship of CPU usage rate and a strong dependency relationship of input / output read / write speed; The strong dependency of the task execution time is used as the task execution time evaluation model, the strong dependency of the CPU usage rate is used as the CPU usage rate evaluation model, and the strong dependency of the input / output read / write speed is used as the input / output read / write speed evaluation model; Wherein, N is the number of indicator data corresponding to the task, X is the leading data set in the N data sets, and Y is the subsequent data set in the N data sets.

7. The method according to claim 4, characterized in that The data structure of the task storage queue is a chain storage data structure, the task storage queue contains the node corresponding to the task, and the node contains a node pointer field; updating the task storage queue includes: The node corresponding to the target task is removed from the task storage queue, and the node position stored in the node pointer field is updated.

8. A task scheduling device, characterized in that: include: A target task module, used to determine the task at the first node position in the task storage queue as the target task; The task storage queue is used to store tasks, wherein the tasks are tasks in the storage system where the task execution time exceeds a preset time threshold; A system resource data acquisition module, used to acquire system resource data occupied by the storage system when it is running; A system resource data prediction module, used to input the target task into a task evaluation model to predict the system resource data occupied by the target task when it is running; The target task scheduling module is used to determine whether to schedule the target task for execution from the task storage queue according to the system resource data occupied by the target task when running and the system resource data occupied by the storage system when running.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Process scheduling method and computer storage medium

    CN119248455A

  • Data transmission method, electronic equipment, storage medium and program product

    CN119729551A