CN114995981A - Parallel task scheduling method, system, storage medium and terminal - Google Patents

Parallel task scheduling method, system, storage medium and terminal Download PDF

Info

Publication number
CN114995981A
CN114995981A CN202210681507.2A CN202210681507A CN114995981A CN 114995981 A CN114995981 A CN 114995981A CN 202210681507 A CN202210681507 A CN 202210681507A CN 114995981 A CN114995981 A CN 114995981A
Authority
CN
China
Prior art keywords
test
task
executed
queue
tasks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210681507.2A
Other languages
Chinese (zh)
Inventor
林之舜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN202210681507.2A priority Critical patent/CN114995981A/en
Publication of CN114995981A publication Critical patent/CN114995981A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application provides a parallel task scheduling method, which comprises the following steps: acquiring a task to be executed, and determining the number of test environments of the task to be executed; the time consumption of task execution of each task to be executed is known; taking each test environment as a test queue, and determining the initial sequencing among the test queues; sequentially acquiring a current task to be executed with the longest time consumption by each test queue according to initial sequencing, determining current sequencing according to the sequence of the task execution time consumption corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest time consumption according to the current sequencing; and executing each task to be executed by utilizing the test queue. The method and the device can ensure that the total consumption of the tasks to be executed by each test queue is relatively balanced, ensure the resource utilization rate in the test process, reduce the time consumption of task execution and improve the task execution efficiency. The application also provides a parallel task scheduling system, a computer readable storage medium and a terminal, which have the beneficial effects.

Description

Parallel task scheduling method, system, storage medium and terminal
Technical Field
The present application relates to the field of network security, and in particular, to a method, a system, a storage medium, and a terminal for scheduling parallel tasks.
Background
The current mainstream automatic test framework lacks scheduling strategy support related to optimizing concurrent execution efficiency, concurrent case execution usually reduces case execution time consumption by increasing more test environments, but case execution without scheduling strategy planning easily has the following problem that if a case for executing a case execution process is pushed once from the outside, case convoy effect on a single test environment causes global computing resource waste, namely, a part of test environments face a task-free executable state due to tasks which are allocated in advance, but actually, from the global, cases still have not been executed.
Therefore, how to improve the resource utilization rate in task scheduling is an urgent technical problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a parallel task scheduling method, a parallel task scheduling system, a computer readable storage medium and a terminal, which can reduce the waste of computing resources and reduce the time consumption of concurrent execution.
In order to solve the technical problem, the application provides a parallel task scheduling method, which has the following specific technical scheme:
acquiring a task to be executed, and determining the number of test environments of the task to be executed; the time consumption of task execution of each task to be executed is known;
taking each test environment as a test queue, and determining the initial sequencing among the test queues;
sequentially acquiring a current task to be executed with the longest consumed time by each test queue according to the initial sequence, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and executing each task to be executed by using the test queue.
Optionally, the executing each task to be executed by using the test queue includes:
determining test backgrounds corresponding to the test queues respectively;
and configuring a test environment according to the test background, and executing the tasks to be executed contained in the corresponding test queues in the test environment.
Optionally, determining the test backgrounds corresponding to the test queues respectively includes:
and when the number of the tasks to be executed meets a threshold value, extracting the general configuration information of the tasks to be executed to obtain the test background.
Optionally, the method further includes:
if a first test task and a second test task have a task dependency relationship, the first test task corresponds to a first execution time consumption, the second test task corresponds to a second execution time consumption, and the first test task and the second test task are combined to be used as a target task to be executed; and the task execution time consumption of the target task to be executed is the sum of the first execution time consumption and the second execution time consumption.
Optionally, if an unknown task to be executed with unknown task execution time consumption is received, the method further includes:
if the number of the unknown tasks to be executed is larger than a number threshold, the unknown tasks to be executed are equally distributed to each test queue according to the number of the tasks;
and if the number of the unknown tasks to be executed is less than the number threshold, adding the unknown tasks to be executed to the tail of the test queue with the shortest total time consumption for executing the current task.
Optionally, if the task to be executed includes a plurality of different test scenarios, the method further includes:
in each test scenario, selecting a task to be executed which is suitable for the test scenario to execute the parallel task scheduling method according to claim 1, and obtaining a plurality of test queues in each test scenario; the number of the test queues in each test scene is the same;
sequencing the test queues in each test scene according to task execution time consumption, and sequentially obtaining the test queue with the shortest total time consumption for task execution after combination in the next test scene according to the sequencing of the time consumption from long to short to obtain a combined queue;
taking the combined queue as the test queue, and re-executing the step of sequentially obtaining the test queue with the shortest total time consumption of the tasks after being combined in the next test scene according to the time consumption sequence from long to short, until the test queues of all the test scenes are combined to obtain a scheduling queue;
and sequentially executing the tasks to be executed according to the scheduling queue.
The present application further provides a parallel task scheduling system, including:
the task acquisition module is used for acquiring tasks to be executed and determining the number of test environments of the tasks to be executed; the time consumption of task execution of each task to be executed is known;
the test queue generating module is used for taking each test environment as a test queue and determining the initial sequencing among the test queues;
the task scheduling module is used for sequentially acquiring a current task to be executed with the longest consumed time according to the initial sequence by each test queue, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and the task processing module is used for executing each task to be executed by utilizing the test queue.
Optionally, the task processing module includes:
the background determining unit is used for determining the test backgrounds corresponding to the test queues respectively;
and the environment configuration unit is used for configuring a test environment according to the test background and executing the tasks to be executed contained in the corresponding test queues in the test environment.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method as set forth above.
The present application further provides a terminal, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method when calling the computer program in the memory.
The application provides a parallel task scheduling method, which comprises the following steps: acquiring a task to be executed, and determining the number of test environments of the task to be executed; the time consumption of task execution of each task to be executed is known; taking each test environment as a test queue, and determining the initial sequencing among the test queues; sequentially acquiring a current task to be executed with the longest consumed time by each test queue according to the initial sequence, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence; and executing each task to be executed by using the test queue.
According to the method and the device, the test queues are configured, so that the test queues are sequentially acquired according to the total task execution consumption of the test queues when the tasks to be executed are acquired, the relative balance of the total consumption of the tasks to be executed by each test queue is ensured, the resource utilization rate in the test process is ensured, the time consumed by task execution is reduced, and the task execution efficiency is improved.
The application also provides a parallel task scheduling system, a computer readable storage medium and a terminal, which have the beneficial effects described above and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a parallel task scheduling method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a parallel task scheduling result provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a parallel task scheduling delay result provided in the embodiment of the present application;
fig. 4 is a schematic structural diagram of a dual-test scenario three-test environment provided in the embodiment of the present application:
fig. 5 is a schematic diagram illustrating generation of a scheduling queue obtained by combining the test queues corresponding to fig. 4 according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a parallel task scheduling system according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a parallel task scheduling method provided in an embodiment of the present application, where the method includes:
s101: acquiring a task to be executed, and determining the number of test environments of the task to be executed;
the steps aim to obtain the tasks to be executed, and the time consumption of the task execution of each task to be executed is known. Generally, for a task that is executed once, it is known that the next time the task is executed, the task is executed. The task is executed at a relative reference time, not necessarily the exact time at which the task to be executed is actually executed. Considering that the execution environments are different during the execution of the tasks, certain time consumption differences of the execution of the tasks may exist in different task execution environments for the same task to be executed.
In addition, this step also needs to determine the number of test environments for executing tasks, which is usually determined by the performance of the test equipment itself, and those skilled in the art can determine the number of test environments for executing tasks according to the equipment parameters of the test equipment. The automatic test process has the problem of case convoy, namely, in a test environment, a case with less resource consumption has to wait because a case with larger resource consumption is executing, and the automatic test execution is non-preemptive, and a plurality of test cases are not simultaneously executed in the test environment, so the case convoy effect can occur when a series of case execution is statically distributed in the test environment. Therefore, for the task to be executed which is more expensive, the corresponding test environment should be prioritized.
As a preferred execution method, when a task is actually executed, two or more tasks including task dependency relationship often exist. If the task is pushed from the outside when being executed, the task with the task dependency relationship is easily pushed to different processes and environments for execution, so that a test result has a large error. Therefore, if the first test task and the second test task have a task dependency relationship and the task execution time consumption of the first test task and the second test task is known, for example, the first test task corresponds to the first execution time consumption and the second test task corresponds to the second execution time consumption, the first test task and the second test task may be merged to be used as a target task to be executed, and the task execution time consumption of the target task to be executed is the sum of the first execution time consumption and the second execution time consumption. In other words, for tasks with task dependencies, all tasks with task dependencies may be regarded as one task to be executed as long as the execution time of each task is known. It should be noted that, if the task execution time of any test task is unknown, although it may still be merged or regarded as a to-be-executed task, the to-be-executed task should be regarded as a to-be-executed task whose task execution time is unknown.
S102: taking each test environment as a test queue, and determining the initial sequencing among the test queues;
in this step, each test environment is used as a test queue, and tasks to be executed in the test queue are executed in sequence. In order to facilitate the execution of the subsequent steps, the step needs to determine the sequence between the test queues for the subsequent steps to acquire the tasks to be executed.
S103: sequentially acquiring a current task to be executed with the longest consumed time by each test queue according to the initial sequence, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
in this step, each test queue needs to sequentially acquire tasks to be executed. Specifically, firstly, according to the sequence determined in the previous step, a current task to be executed with the longest consumed time is sequentially obtained, after each test queue obtains the task to be executed once, the current sequence is determined according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and a current task to be executed with the longest consumed time is sequentially obtained according to the current sequence. And the analogy can be repeated until all the tasks to be executed are obtained. Therefore, the total task execution time consumption of the tasks to be executed, which is currently acquired by the test queues, is longer, and the task execution time consumption of the next acquired task to be executed is shorter, so that the total task execution time consumption among the test queues is relatively average, and the resource waste caused by the fact that a part of the test queues are executed first is avoided.
S104: and executing each task to be executed by utilizing the test queue.
After the tasks to be executed in the test queue are determined, each task to be executed can be executed. It should be noted that, step S103 is a description of a task obtaining manner, and in the process of actually executing a task, the task may be executed while executing the task, or each time a task is executed, a task to be executed that is executed next may be obtained according to the above-mentioned manner.
It should be noted that, because various accidents may occur in the process of executing the task to be executed, the task execution time consumption exceeds the known task execution time consumption, and at this time, if each task to be executed is completed, the task to be executed which has the longest task execution time consumption at present is obtained, so that the problem of resource utilization rate reduction caused by task execution abnormity can be effectively reduced.
As a preferred execution manner of this step, when executing the to-be-executed task, the test contexts corresponding to the test queues may be determined first, so as to configure the test environment according to the test contexts, and execute the to-be-executed task included in the corresponding test queue in the test environment. Different test queues may have a difference in test environment, and in order to reduce the influence of the task execution environment on the task execution time consumption in the task execution process, a corresponding test environment may be configured for the test queues when this step is executed. The determination of the test context of the test queue is not limited, and when the number of the tasks to be executed satisfies a threshold, the general configuration information of the tasks to be executed may be extracted as the test context. The threshold is not limited herein, and may be three, five or more, and may be set by a person skilled in the art.
Referring to fig. 2, fig. 2 is a schematic diagram of a scheduling result of a parallel task provided in the embodiment of the present application, where 12 different tasks execute time-consuming tasks to be executed, and according to the manner described in the embodiment, the tasks to be executed may be divided into four test queues, which are denoted as test queue 1, test queue 2, test queue 3, and test queue 4 in sequence, and the task to be executed that consumes the longest time for executing the current task is obtained in sequence, and then corresponding to the task to be executed that consumes the longest time for executing the current task is obtained 37 (indicating the task execution time, which is synonymous to be described below), 31, 25, and 21, at this time, the task to be executed that consumes the longest time for executing the current task is obtained preferentially from the test queue 4 that consumes the shortest total time for executing the current task, that is the corresponding task to be executed 17, and after the second round of obtaining task is finished, the test queue 4 remains as the shortest time-consuming total time for executing the current test queue task, therefore, the task to be executed with the largest time consumption for executing the current task, that is, the task to be executed corresponding to 7 is obtained, and thus it can be seen that the execution time lengths of the test queue 1, the test queue 2, the test queue 3 and the test queue 4 are 46, 44, 41 and 45 respectively, so that the relative balance of the execution time lengths among the test queues is realized, and the resource utilization is relatively balanced.
In the task execution process, if one task to be executed is completed, the task to be executed with the longest time consumption for executing the current task is obtained, and even if the time consumption for executing the actual task is prolonged due to abnormal task execution, the task scheduling balance can be realized. Referring to fig. 3, fig. 3 is a schematic diagram of a parallel task scheduling delay result provided in the embodiment of the present application, where if the actual task execution time consumption of the second to-be-executed task in the test queue 3 is changed to 16, the actual task execution time consumption of the second to-be-executed task in the test queue 3 is changed from the original second to 3 rd according to the short-to-long order, and when the task is obtained next time, only the to-be-executed task with the task execution time consumption of 4 can be obtained, and at this time, the execution time lengths of the test queue 1, the test queue 2, the test queue 3, and the test queue 4 are respectively 46, 45, and 45, which does not affect the implementation of task scheduling balance.
According to the embodiment of the application, the test queues are configured, so that the test queues are sequentially acquired according to the total consumption of the self-existing task execution when the task to be executed is acquired each time, the relative balance of the total consumption of the task to be executed by each test queue is ensured, the resource utilization rate in the test process is ensured, the time consumed by task execution is reduced, and the task execution efficiency is improved.
Based on the above embodiment, as a preferred embodiment, the embodiment deals with an unknown task to be executed, which consumes unknown time for task execution, and the specific scheme may include the following steps:
if the number of the unknown tasks to be executed is larger than the number threshold, equally distributing the unknown tasks to be executed to each test queue according to the number of the tasks;
and if the number of the unknown tasks to be executed is less than the number threshold, adding the unknown tasks to be executed to the tail of the test queue with the shortest total time consumption for executing the current task.
In this embodiment, corresponding handling needs to be performed because the number of tasks to be executed is unknown, and if the number of tasks is smaller than the number threshold, the tasks may be directly added to the end of the test queue with the shortest total time consumption for executing the current task. If the number of the test queues is larger than the number threshold, the test queues are divided to the tail of each test queue according to the relative average number of the test queues. The number threshold is not limited herein, and may be specifically set by a person skilled in the art according to the total number of tasks to be performed required to perform the test and the number of unknown tasks to be performed.
In the above embodiment, each task to be executed is regarded as being based on the same or similar test scenario, that is, the test scenario for the task to be executed requires to be similar or the same, as a preferred embodiment, if the task to be executed includes at least two different test scenarios, the method further includes:
s201: in each test scenario, selecting a task to be executed which is suitable for the test scenario to execute the parallel task scheduling method according to claim 1, and obtaining a plurality of test queues in each test scenario; the number of the test queues in each test scene is the same;
s202: sequencing the test queues in each test scene according to task execution time consumption, and sequentially obtaining the test queue with the shortest total time consumption for task execution after combination in the next test scene according to the sequencing of the time consumption from long to short to obtain a combined queue;
s203: taking the combined queue as the test queue, and re-executing the step of sequentially obtaining the test queue with the shortest total time consumption of the tasks after being combined in the next test scene according to the time consumption sequence from long to short, until the test queues of all the test scenes are combined to obtain a scheduling queue;
s204: and sequentially executing the tasks to be executed according to the scheduling queue.
Although there are different test scenarios for the task to be executed, since the applied test devices are all the same, i.e. the task to be executed is handled with the same devices, in each test scenario its number of test queues is the same.
According to the process of the embodiment, the test queues are generated for each test scene, so that a plurality of test queues under different test scenes can be obtained, and then the test queues under different test scenes are combined or connected. The specific combination mode is determined according to the sequencing mode of the test queues in the first test scene according to the total time consumed for task execution, if the test queues in the first test scene are combined in the sequence from long to short time consumed for execution, the test queue with the shortest total time consumed for task execution after combination is selected when the test queues in the next test scene are combined. And if the test queues in the first test scene are combined in the order from short to long in execution time consumption, selecting the test queue with the longest total time consumption for task execution after combination when the test queues in the next test scene are combined. And obtaining a scheduling queue after all the test scenes are combined.
It should be noted that the test scenario in this embodiment is not identical to the test environment in the above embodiment, and the test environment in the above embodiment may be regarded as different processes in the same test scenario, and may implement automated execution of the task to be executed in parallel.
According to the embodiment, when the task to be executed is scheduled by different test scenes, the use balance of the global resources can be realized. A preferred execution mode can configure a dedicated test service in each test queue, the test service acquires the task to be executed which takes the longest time from the service for managing the test task to execute, the execution of the test task is a single-queue multiprocessor model, and the load balance on each test environment can be ensured according to the longest task priority strategy under the model, so that the maximum resource utilization is realized.
Referring to fig. 4 and 5, fig. 4 is a schematic structural diagram of a dual-test scenario and three-test environment provided in the embodiment of the present application, fig. 5 is a schematic diagram of a scheduling queue generated by combining test queues corresponding to fig. 4 by applying the embodiment of the present application, fig. 4 includes two test scenarios, that is, a test scenario 1 and a test scenario 2, including 6 tasks to be executed, three test queues may be obtained according to the steps of the embodiment, similarly, the test scenario 2 may also obtain three test queues, and the test queues 1-1, 1-2, and 1-3 are in order from short to long in task execution time consumption, so that the test queue 1-1 should combine the test queue with the longest task execution time consumption in the test scenario 2, that is, the test queue 2-1, to satisfy the longest total time consumption of task execution after combination. Finally, the three scheduling queues shown in fig. 5 can be obtained, and the time consumption of each scheduling queue is 29, so that the maximum utilization of global resources is realized.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a parallel task scheduling system provided in the present embodiment, where the parallel task scheduling system disclosed in the present embodiment and the parallel task scheduling method described above may be referred to and compared with each other, and the present application also provides a parallel task scheduling system, including:
the task acquisition module is used for acquiring tasks to be executed and determining the number of test environments of the tasks to be executed; the time consumption of task execution of each task to be executed is known;
the test queue generating module is used for taking each test environment as a test queue and determining the initial sequencing among the test queues;
the task scheduling module is used for sequentially acquiring a current task to be executed with the longest consumed time according to the initial sequence by each test queue, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and the task processing module is used for executing each task to be executed by utilizing the test queue.
Based on the above embodiment, as a preferred embodiment, the task processing module includes:
the background determining unit is used for determining the test backgrounds corresponding to the test queues respectively;
and the environment configuration unit is used for configuring a test environment according to the test background and executing the tasks to be executed contained in the corresponding test queues in the test environment.
Based on the above embodiment, as a preferred embodiment, the background determining unit is a unit configured to extract the general configuration information of the tasks to be executed when the number of the tasks to be executed satisfies a threshold value, so as to obtain the test background.
Based on the above embodiment, as a preferred embodiment, the method further includes:
the task merging module is used for merging a first test task and a second test task to be used as target tasks to be executed if the first test task and the second test task have a task dependency relationship, the first test task corresponds to first execution time consumption, the second test task corresponds to second execution time consumption; and the task execution time consumption of the target task to be executed is the sum of the first execution time consumption and the second execution time consumption.
Based on the above embodiment, as a preferred embodiment, the method further includes:
the unknown task scheduling module is used for uniformly distributing the unknown tasks to be executed to each test queue according to the number of the tasks when the unknown tasks to be executed with unknown time consumption are received and the number of the unknown tasks to be executed is larger than a number threshold;
and if the number of the unknown tasks to be executed is smaller than the number threshold, adding the unknown tasks to be executed to the tail of the test queue with the shortest total time consumption for executing the current task.
Based on the above embodiment, as a preferred embodiment, the method further includes:
a global scheduling module for performing the steps of:
if the task to be executed comprises a plurality of different test scenes, selecting the task to be executed which is suitable for the test scenes in each test scene to execute the parallel task scheduling method, and obtaining a plurality of test queues in each test scene; the number of the test queues in each test scene is the same;
sequencing the test queues in each test scene according to task execution time consumption, and sequentially obtaining the test queue with the shortest total time consumption for task execution after combination in the next test scene according to the sequencing of the time consumption from long to short to obtain a combined queue;
taking the combined queue as the test queue, and re-executing the step of sequentially obtaining the test queue with the shortest total time consumption of the tasks after being combined in the next test scene according to the time consumption sequence from long to short, until the test queues of all the test scenes are combined to obtain a scheduling queue;
and sequentially executing the tasks to be executed according to the scheduling queue.
The present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed, may implement the steps of the method provided by the above-described embodiments. The storage medium may include: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The present application further provides a terminal, which may include a memory and a processor, where the memory stores a computer program, and when the processor calls the computer program in the memory, the steps of the method provided in the foregoing embodiment may be implemented. Of course, the terminal may also include various network interfaces, power supplies, and the like. Referring to fig. 7, fig. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application, where the terminal according to the embodiment may include: a processor 2101 and a memory 2102.
Optionally, the terminal may further comprise a communication interface 2103, an input unit 2104 and a display 2105 and a communication bus 2106.
The processor 2101, the memory 2102, the communication interface 2103, the input unit 2104, the display 2105, and the like communicate with each other via the communication bus 2106.
In the embodiment of the present application, the processor 2101 may be a Central Processing Unit (CPU), an application specific integrated circuit (asic), a digital signal processor, an off-the-shelf programmable gate array (fpga) or other programmable logic device.
The processor may call a program stored in the memory 2102. In particular, the processor may perform the operations performed by the terminal in the above embodiments.
The memory 2102 stores one or more programs, which may include program code including computer operating instructions, and in this embodiment, at least one program for implementing the following functions is stored in the memory:
acquiring a task to be executed, and determining the number of test environments of the task to be executed; the task execution time of each task to be executed is known;
taking each test environment as a test queue, and determining the initial sequencing among the test queues;
sequentially acquiring a current task to be executed with the longest consumed time by each test queue according to the initial sequence, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and executing each task to be executed by using the test queue.
In one possible implementation, the memory 2102 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the computer.
Further, the memory 2102 may include high speed random access memory, and may also include non-volatile memory, such as at least one disk storage device or other volatile solid state storage device.
The communication interface 2103 may be an interface of a communication module, such as an interface of a GSM module.
The present application may also include a display 2105 and an input unit 2104, among others.
The structure of the terminal shown in fig. 7 does not constitute a limitation of the terminal in the embodiments of the present application, and in practical applications, the terminal may include more or less components than those shown in fig. 7, or some components in combination.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system provided by the embodiment, the description is relatively simple because the system corresponds to the method provided by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A parallel task scheduling method is characterized by comprising the following steps:
acquiring a task to be executed, and determining the number of test environments of the task to be executed; the time consumption of task execution of each task to be executed is known;
taking each test environment as a test queue, and determining the initial sequencing among the test queues;
sequentially acquiring a current task to be executed with the longest consumed time by each test queue according to the initial sequence, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and executing each task to be executed by using the test queue.
2. The method according to claim 1, wherein executing each of the tasks to be executed using the test queue comprises:
determining test backgrounds corresponding to the test queues respectively;
and configuring a test environment according to the test background, and executing the tasks to be executed contained in the corresponding test queues in the test environment.
3. The method according to claim 2, wherein determining the test contexts corresponding to the test queues respectively comprises:
and when the number of the tasks to be executed meets a threshold value, extracting the general configuration information of the tasks to be executed to obtain the test background.
4. The method for parallel task scheduling according to claim 1, further comprising:
if a first test task and a second test task have a task dependency relationship, the first test task corresponds to a first execution time consumption, the second test task corresponds to a second execution time consumption, and the first test task and the second test task are combined to be used as a target task to be executed; and the task execution time consumption of the target task to be executed is the sum of the first execution time consumption and the second execution time consumption.
5. The method for scheduling parallel tasks according to claim 1, wherein if an unknown task to be executed is received, the task execution time consumption of which is unknown, the method further comprises:
if the number of the unknown tasks to be executed is larger than a number threshold, the unknown tasks to be executed are equally distributed to each test queue according to the number of the tasks;
and if the number of the unknown tasks to be executed is less than the number threshold, adding the unknown tasks to be executed to the tail of the test queue with the shortest total time consumption for executing the current task.
6. The method according to claim 2 or 3, wherein if the task to be executed includes a plurality of different test scenarios, the method further comprises:
in each test scenario, selecting a task to be executed which is suitable for the test scenario to execute the parallel task scheduling method according to claim 1, and obtaining a plurality of test queues in each test scenario; the number of the test queues in each test scene is the same;
sequencing the test queues in each test scene according to task execution time consumption, and sequentially obtaining the test queue with the shortest total time consumption for task execution after combination in the next test scene according to the sequencing of the time consumption from long to short to obtain a combined queue;
taking the combined queue as the test queue, and re-executing the step of sequentially obtaining the test queue with the shortest total time consumption of the tasks after being combined in the next test scene according to the time consumption sequence from long to short, until the test queues of all the test scenes are combined to obtain a scheduling queue;
and sequentially executing the tasks to be executed according to the scheduling queue.
7. A parallel task scheduling system, comprising:
the task acquisition module is used for acquiring tasks to be executed and determining the number of test environments of the tasks to be executed; the time consumption of task execution of each task to be executed is known;
the test queue generating module is used for taking each test environment as a test queue and determining the initial sequencing among the test queues;
the task scheduling module is used for sequentially acquiring a current task to be executed with the longest consumed time according to the initial sequence by each test queue, determining the current sequence according to the sequence of the task execution consumed time corresponding to each current test queue from short to long, and sequentially acquiring a current task to be executed with the longest consumed time according to the current sequence;
and the task processing module is used for executing each task to be executed by utilizing the test queue.
8. The parallel task scheduling system of claim 7 wherein the task processing module comprises:
the background determining unit is used for determining the test backgrounds corresponding to the test queues respectively;
and the environment configuration unit is used for configuring a test environment according to the test background and executing the tasks to be executed contained in the corresponding test queues in the test environment.
9. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the parallel task scheduling method according to any one of claims 1 to 6.
10. A terminal, characterized in that it comprises a memory in which a computer program is stored and a processor which, when calling the computer program in the memory, implements the steps of the parallel task scheduling method according to any one of claims 1-6.
CN202210681507.2A 2022-06-16 2022-06-16 Parallel task scheduling method, system, storage medium and terminal Pending CN114995981A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210681507.2A CN114995981A (en) 2022-06-16 2022-06-16 Parallel task scheduling method, system, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210681507.2A CN114995981A (en) 2022-06-16 2022-06-16 Parallel task scheduling method, system, storage medium and terminal

Publications (1)

Publication Number Publication Date
CN114995981A true CN114995981A (en) 2022-09-02

Family

ID=83034369

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210681507.2A Pending CN114995981A (en) 2022-06-16 2022-06-16 Parallel task scheduling method, system, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN114995981A (en)

Similar Documents

Publication Publication Date Title
CN113535367B (en) Task scheduling method and related device
CN111768006A (en) Artificial intelligence model training method, device, equipment and storage medium
US9430283B2 (en) Information processing apparatus and job scheduling method
CN110781145B (en) File system task scheduling method, device, equipment and readable storage medium
CN111104227B (en) Resource control method and device of K8s platform and related components
CN111596927B (en) Service deployment method and device and electronic equipment
CN113835865A (en) Task deployment method and device, electronic equipment and storage medium
CN113282402B (en) Test task scheduling method oriented to complex resource constraint
CN110659137A (en) Processing resource allocation method and system for offline tasks
CN112748993A (en) Task execution method and device, storage medium and electronic equipment
CN113886069A (en) Resource allocation method and device, electronic equipment and storage medium
CN110489242B (en) Distributed data computing method, device, terminal equipment and storage medium
CN114629960B (en) Resource scheduling method, device, system, equipment, medium and program product
CN111953503B (en) NFV resource deployment arrangement method and network function virtualization orchestrator
CN106775975B (en) Process scheduling method and device
CN111143063B (en) Task resource reservation method and device
CN116880986A (en) Task scheduling method and device, vehicle-mounted controller, electronic equipment and storage medium
CN114995981A (en) Parallel task scheduling method, system, storage medium and terminal
CN112685158B (en) Task scheduling method and device, electronic equipment and storage medium
CN115981808A (en) Scheduling method, scheduling device, computer equipment and storage medium
CN111309475B (en) Detection task execution method and equipment
CN115220887A (en) Processing method of scheduling information, task processing system, processor and electronic equipment
CN110825528B (en) Resource management method, device and equipment
CN113806055A (en) Lightweight task scheduling method, system, device and storage medium
CN112579305A (en) Task processing method and device, nonvolatile storage medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination