CN113282402B - Test task scheduling method oriented to complex resource constraint - Google Patents

Test task scheduling method oriented to complex resource constraint Download PDF

Info

Publication number
CN113282402B
CN113282402B CN202110830206.7A CN202110830206A CN113282402B CN 113282402 B CN113282402 B CN 113282402B CN 202110830206 A CN202110830206 A CN 202110830206A CN 113282402 B CN113282402 B CN 113282402B
Authority
CN
China
Prior art keywords
test
test task
resource
target
task node
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.)
Active
Application number
CN202110830206.7A
Other languages
Chinese (zh)
Other versions
CN113282402A (en
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.)
Space Cqc Associate Software Testing And Evaluating Technology Beijing Co ltd
Original Assignee
Space Cqc Associate Software Testing And Evaluating Technology Beijing 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 Space Cqc Associate Software Testing And Evaluating Technology Beijing Co ltd filed Critical Space Cqc Associate Software Testing And Evaluating Technology Beijing Co ltd
Priority to CN202110830206.7A priority Critical patent/CN113282402B/en
Publication of CN113282402A publication Critical patent/CN113282402A/en
Application granted granted Critical
Publication of CN113282402B publication Critical patent/CN113282402B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

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

Abstract

The utility model relates to a test task scheduling method facing to complex resource constraint, which relates to the field of automatic test, wherein, the method comprises the following steps: connecting test task nodes of a target system according to a preset test task dependency relationship to obtain a target directed acyclic graph of a plurality of test task nodes; acquiring at least one test task path according to the target directed acyclic graph, and determining the node sequence of each test task node in the corresponding test task path; and sequentially determining the reference test resources of each test task node in at least one test task path according to the test resource constraint conditions and the node sequence, and executing the corresponding test script according to the reference test resources. Therefore, the test task is executed based on the target directed acyclic graph, the parallel execution of the test task can be realized, the test efficiency and the utilization rate of the test resources are improved, the test resources are matched based on the test resource constraint condition, and the selection reliability and efficiency of the test resources are improved.

Description

Test task scheduling method oriented to complex resource constraint
Technical Field
The disclosure relates to the technical field of automated testing, in particular to a complex resource constraint-oriented test task scheduling method.
Background
With the development of computer technology, cluster resource scheduling based on a cloud environment becomes common. Various resources are combined together as a test resource through a cloud platform technology to form a flexible test environment, and a uniform environment and tools can be provided for software testing and the like.
In the related art, the method for scheduling test resources to meet the test requirements is as follows: the test tasks are typically queued according to priority, and test resources are allocated and tested using a first-come-first-serve or round-robin time-sharing scheme.
However, the above test method causes the test task to wait too long and the test resource usage rate to be too low. With the increasing test requirements, the limitation of the test modes such as polling time sharing and the like is high in both the efficient utilization of test resources and the test efficiency.
Disclosure of Invention
In order to solve the technical problems or at least partially solve the technical problems, a complex resource constraint-oriented test task scheduling method is provided, the test task is executed based on a target directed acyclic graph, the parallel execution of the test task can be realized, the test efficiency and the utilization rate of the test resources are improved, the test resources are matched based on the test resource constraint conditions, and the selection reliability and the selection efficiency of the test resources are improved.
The embodiment of the first aspect of the disclosure provides a complex resource constraint-oriented test task scheduling method, which includes the following steps:
obtaining description information of a plurality of test task nodes of a target system, wherein the description information comprises a test script and a test resource constraint condition; connecting corresponding test task nodes according to a preset test task dependency relationship to obtain a target directed acyclic graph of the plurality of test task nodes; acquiring at least one test task path according to the target directed acyclic graph, and determining the node sequence of each test task node in the corresponding test task path; and in a plurality of test resources of the target system, sequentially determining a reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node sequence, and executing a test script of the corresponding test task node according to the reference test resource.
In an optional embodiment of the present disclosure, before the connecting the corresponding test task node according to the preset test task dependency relationship, the method includes: acquiring an input interface type and an output interface type of a test script of each test task node; if at least one first test task node with the input interface type as a data type and at least one second test task node with the output interface type as the data type are obtained, determining input data information of each first test task node and output data information of each second test task node; and determining a target first test task node and a target second test task node which are consistent with the input data information and the output data information, wherein the target first test task node is different from the target second test task node, and setting a front-back test task dependency relationship between the target second test task node and the target first test task node.
In an optional embodiment of the present disclosure, further comprising: if at least one third test task node with the input interface type as the control type and at least one fourth test task node with the output interface type as the control type are obtained, determining input signal information of each third test task node and output signal information of each fourth test task node; and determining a target third test task node and a target fourth test task node which are consistent with the input signal information and the output signal information, wherein the target third test task node is different from the target fourth test task node, and setting a front-back test task dependency relationship of the target third test task node and the target fourth test task node.
In an optional embodiment of the present disclosure, the sequentially determining, according to the test resource constraint condition and the node order, a reference test resource of each test task node in the at least one test task path includes: determining the test resource type and the test resource capacity of each test task node according to the test resource constraint condition; determining at least one candidate test resource satisfying the test resource type and test resource capacity among a plurality of test resources of the target system; and determining a reference test resource of the corresponding test task node in the at least one candidate test resource.
In an optional embodiment of the present disclosure, the determining a reference test resource of a corresponding test task node in the at least one candidate test resource includes: and randomly determining one candidate test resource as a reference test resource of the corresponding test task node in the at least one candidate test resource.
In an optional embodiment of the present disclosure, the executing a test script of a corresponding test task node according to the reference test resource includes: if a target test resource in the reference test resources currently comprises a plurality of fifth test task nodes to be executed, determining the execution priority of each fifth test task node according to the test resource constraint condition; and sequencing the fifth test task nodes according to the execution priority to obtain a sequencing result, and executing the test scripts of the fifth test task nodes according to the sequencing result and the target test resource.
In an optional embodiment of the present disclosure, before the sorting the fifth test task nodes according to the execution priority to obtain a sorting result, the method further includes: acquiring the test resource capacity of each fifth test task node; and correcting the sequencing result of the fifth test task nodes according to the test resource capacity.
In an optional embodiment of the present disclosure, when the executing the test script of the fifth test task nodes according to the sorting result and the target test resource, the method further includes: determining a current test script currently executed in the target test resources, and acquiring an execution limit duration according to a test resource constraint condition of a sixth test task node corresponding to the current test script; acquiring the actual execution duration of the current test script; judging whether the actual execution time length is greater than or equal to the execution limit time length of the sixth test task node or not; and if the execution time limit is greater than or equal to the execution limit time, interrupting the execution of the test script of the sixth test task node and executing the next test script according to the sequencing result.
An embodiment of a second aspect of the present disclosure provides a complex resource constraint-oriented test task scheduling device, including: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring description information of a plurality of test task nodes of a target system, and the description information comprises a test script and a test resource constraint condition; the second acquisition module is used for connecting corresponding test task nodes according to a preset test task dependency relationship so as to acquire a target directed acyclic graph of the plurality of test task nodes; the determining module is used for acquiring at least one test task path according to the target directed acyclic graph and determining the node sequence of each test task node in the corresponding test task path; and the test module is used for sequentially determining the reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node sequence in the plurality of test resources of the target system, and executing the test script of the corresponding test task node according to the reference test resource.
In an optional embodiment of the present disclosure, further comprising: a dependency establishment module to: acquiring an input interface type and an output interface type of a test script of each test task node; if at least one first test task node with the input interface type as a data type and at least one second test task node with the output interface type as the data type are obtained, determining input data information of each first test task node and output data information of each second test task node; and determining a target first test task node and a target second test task node which are consistent with the input data information and the output data information, wherein the target first test task node is different from the target second test task node, and setting a front-back test task dependency relationship between the target second test task node and the target first test task node.
In an optional embodiment of the present disclosure, further comprising: the dependency relationship establishing module is further configured to: if at least one third test task node with the input interface type as the control type and at least one fourth test task node with the output interface type as the control type are obtained, determining input signal information of each third test task node and output signal information of each fourth test task node; and determining a target third test task node and a target fourth test task node which are consistent with the input signal information and the output signal information, wherein the target third test task node is different from the target fourth test task node, and setting a front-back test task dependency relationship of the target third test task node and the target fourth test task node.
In an optional embodiment of the present disclosure, the test module is specifically configured to: determining the test resource type and the test resource capacity of each test task node according to the test resource constraint condition; determining at least one candidate test resource matching the test resource type and test resource capacity among a plurality of test resources of the target system; and determining a reference test resource of the corresponding test task node in the at least one candidate test resource.
In an optional embodiment of the present disclosure, the test module is specifically configured to: and randomly determining one candidate test resource as a reference test resource of the corresponding test task node in the at least one candidate test resource.
In an optional embodiment of the present disclosure, the test module is specifically configured to: if a target test resource in the reference test resources currently comprises a plurality of fifth test task nodes to be executed, determining the execution priority of each fifth test task node according to the test resource constraint condition; and sequencing the fifth test task nodes according to the execution priority to obtain a sequencing result, and executing the test scripts of the fifth test task nodes according to the sequencing result and the target test resource.
In an optional embodiment of the present disclosure, further comprising: the correction module is used for acquiring the test resource capacity of each fifth test task node; and correcting the sequencing result of the fifth test task nodes according to the test resource capacity.
In an optional embodiment of the present disclosure, further comprising: a duration control module to:
determining a current test script currently executed in the target test resources, and acquiring an execution limit duration according to a test resource constraint condition of a sixth test task node corresponding to the current test script; acquiring the actual execution duration of the current test script; judging whether the actual execution time length is greater than or equal to the execution limit time length of the sixth test task node or not; and if the execution time limit is greater than or equal to the execution limit time, interrupting the execution of the test script of the sixth test task node and executing the next test script according to the sequencing result.
An embodiment of a third aspect of the present disclosure provides an electronic device, including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instruction from the memory, and execute the instruction to implement the complex resource constraint-oriented test task scheduling method described in the foregoing first aspect embodiment.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
the method comprises the steps of obtaining description information of a plurality of test task nodes of a target system, wherein the description information comprises a test script and a test resource constraint condition, connecting the corresponding test task nodes according to a preset test task dependency relationship to obtain a target directed acyclic graph of the plurality of test task nodes, further obtaining at least one test task path according to the target directed acyclic graph, determining a node sequence of each test task node in the corresponding test task path, finally, sequentially determining a reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node sequence in the plurality of test resources of the target system, and executing the test script of the corresponding test task node according to the reference test resource. Therefore, the test task is executed based on the target directed acyclic graph, the parallel execution of the test task can be realized, the test efficiency and the utilization rate of the test resources are improved, the test resources are matched based on the test resource constraint condition, and the selection reliability and efficiency of the test resources are improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a flowchart of a complex resource constraint-oriented test task scheduling method according to an embodiment of the present disclosure;
FIG. 2 is a schematic view of a directed acyclic graph of an embodiment of the present disclosure;
FIG. 3 is a flowchart of another complex resource constraint-oriented test task scheduling method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart of another method for scheduling a test task oriented to complex resource constraints according to an embodiment of the present disclosure;
FIG. 5 is a flowchart of another method for scheduling a test task oriented to complex resource constraints according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a test task scheduling scenario for complex resource constraints according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a test task scheduling device for complex resource constraint according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
Based on the above background art, the current testing requirements may include testing of a complex system in addition to a single web page test, the testing amount of the complex system is large, the required testing resources include testing tools and the like in addition to computing, storage and communication resources, and in addition, the testing requirements of the complex system include simultaneous testing of multiple users, simultaneous execution of multiple types of tests and the like.
However, the capacity of the test resource is restrictive, and it is difficult to simultaneously satisfy the parallel execution of all the test tasks facing the requirement of a large number of parallel test tasks. In the embodiment of the disclosure, an appropriate test task arrangement and test execution scheduling algorithm is provided, a test task is reasonably arranged according to a certain target, a specific test execution activity is scheduled to a required resource in the execution process, and the resource is released in time after the execution is completed.
The complex resource constraint-oriented test task scheduling method according to the embodiment of the present application is described below with reference to the accompanying drawings, where an execution subject of the complex resource constraint-oriented test task scheduling method may be a test cloud platform or the like. Fig. 1 is a flowchart of a complex resource constraint-oriented test task scheduling method according to an embodiment of the present disclosure, and as shown in fig. 1, the method includes:
step 101, obtaining description information of a plurality of test task nodes of a target system, wherein the description information comprises a test script and a test resource constraint condition.
In this embodiment, the plurality of test task nodes may be understood as all or part of the test tasks of the target system, and each test task may be understood as a basic unit for testing the target system, in this embodiment, corresponding description information is obtained for the test task, wherein, the description information can be calibrated in XML document in advance by developer, or can be obtained by summarizing according to deep learning technique, etc., the description information can include test script, test resource constraint condition, wherein, the test script can be a test code for executing a corresponding test task, in order to improve the utilization rate of the code, the test script may be a parameter-free logic code, and in an embodiment of the present disclosure, to improve the efficiency of test script generation, and generating a corresponding test script according to the test case in advance according to the test case of one or more functional modules corresponding to the test task.
In addition, the test resource constraint condition in the description information is used to define one or more of a type of a test resource, a capacity size of the test resource, a task identifier of the test, a corresponding test script identifier, and the like required when the test task is executed, and in some possible embodiments, the code of the test resource constraint condition is as follows, where "test task 1" is a test task identifier corresponding to the test resource constraint condition, "Tools = IOZone" is a test resource type required by the test task, and "Memory = 500M" is a test resource capacity required by the test task:
<Constraint>
< Name > test task 1</Name >
<Tools>Tools=IOZone</Tools>
<Memory>Memory =500M</Memory>
</Constraint>
And 102, connecting corresponding test task nodes according to a preset test task dependency relationship to obtain a target directed acyclic graph of a plurality of test task nodes.
In order to express the relation, the preset test task dependency relation is obtained to determine the connection relation among the test task nodes, and a target directed acyclic graph of a plurality of test task nodes is constructed according to the connection relation, wherein the test task dependency relation is one of important bases for scheduling the test tasks, and for one test task node, the dependency relation among the test task nodes, namely the execution of one test task node, may influence the execution of another test task node; the output result of one test task node may become the input of another test task node. In order to efficiently describe this dependency and to develop task scheduling, the dependencies between test task nodes are described as a directed acyclic graph.
For example, as shown in fig. 2, when the plurality of test task nodes are 1 to 10, the constructed target directed acyclic graph can intuitively learn the dependency of each test task node according to the preset test task dependency, for example, the test task nodes 1, 5, and 7 may be executed in parallel, the three have no dependency, the test task nodes 2 and 3 depend on the execution of the test task node 1, and may not be executed in parallel with the test task node 1, and the like.
Step 103, obtaining at least one test task path according to the target directed acyclic graph, and determining a node sequence of each test task node in the corresponding test task path.
In this embodiment, the connection relationship between the test task nodes is constructed in the target directed acyclic graph, because at least one test task path is constructed from the beginning to the end according to the connection relationship, after the test task path is constructed, the node sequence of each test task node in the corresponding test task path can be known, where each test task path may include one or more test task nodes.
For example, when the target directed acyclic graph includes the test task nodes 1 to 6, the test task paths constructed from the beginning to the end of the nodes include "1-2-4", "1-3", and "5-6", where the node sequence of the test task nodes 1 and 5 is "1", the node sequence of the test task nodes 2, 3, and 6 is "2", the node sequence of the test task nodes 1 and 5 is "3", the corresponding test task paths are limited, and the test task nodes 2 and 3 need to be executed after the test task node 1 is executed.
And step 104, in the plurality of test resources of the target system, sequentially determining a reference test resource of each test task node in at least one test task path according to the test resource constraint condition and the node sequence, and executing a test script corresponding to the test task node according to the reference test resource.
The plurality of test resources of the target system comprise cluster test resources on a cloud test platform, and comprise network test resources of a computer and tool resources of test tools (including camera tools and the like).
In this embodiment, since the test resource constraint condition constrains the capacity of the test resource and the type of the test resource required by each test task node, the reference test resource satisfying the condition may be determined according to the test resource constraint condition.
In an embodiment of the present disclosure, as shown in fig. 3, sequentially determining a reference test resource of each test task node in at least one test task path according to the test resource constraint condition and the node order, includes:
step 301, determining the test resource type and the test resource capacity of each test task node according to the test resource constraint condition.
The test resource capacity represents a memory occupation value, or network speed occupation amount, or duration of occupying a test tool, etc. of the required test resource.
For example, if the test resource type is a network resource, the corresponding test resource capacity is occupied network traffic; for example, if the test resource type is a memory resource, the corresponding test resource capacity is a memory occupancy value.
Step 302, among a plurality of test resources of the target system, at least one candidate test resource matching the test resource type and the test resource capacity is determined.
In this embodiment, the test resource type of each test resource is determined, after the matched test resource is determined based on the test resource type of each test task node, further, a difference between the free resource of each test resource satisfying the test resource type and the test resource capacity of each test task node is calculated, and if the difference is greater than a certain value, the corresponding test resource is determined to be a candidate test resource.
Step 303, determining a reference test resource of the corresponding test task node in the at least one candidate test resource.
It should be noted that, in different application scenarios, the reference test resource of the corresponding test task node is determined in different manners in at least one candidate test resource, which is exemplified as follows:
in one embodiment of the present disclosure, one candidate test resource may be randomly determined as a reference test resource of a corresponding test task node among the at least one candidate test resource.
In another embodiment of the present disclosure, the idle resources of each candidate test resource may be arranged in a descending order, and the test resources in the first order are allocated to the corresponding test task node according to the arrangement result.
It should be emphasized that, when determining the reference test resource of each test task node, all test task paths may be selected in parallel, for example, the determination of the reference test resources of the test task nodes 1 and 5 may be determined in parallel, because the reference test resource of each test task node in the test task path is selected and executed according to the node sequence, only after the last test task node with dependency executes the script, the test resource selection and execution of the next test task node is entered, thereby ensuring smooth execution of the test task and full utilization of the test resource.
Furthermore, after the corresponding reference test resources are determined, the test scripts of the corresponding test task nodes are executed according to the reference test resources, so that on one hand, the reference test resources of each test task node in at least one test task path are sequentially determined and executed according to the node sequence, the dependency relationship among the test task nodes is considered, the execution reliability of the test tasks is ensured, on the other hand, when the execution is controlled according to the node sequence, the nodes of different test task paths can be executed in parallel, the execution efficiency of the test tasks is greatly improved, and the full utilization of the test resources is ensured.
In the actual execution process, in order to improve the reuse rate of the test script, when the test script is not written with specific parameters, the corresponding parameters of the corresponding test script can be modified according to the output parameters of the previous test task node and then executed. Or, the codes of all the test scripts in the test task path may be combined and spliced, and after the whole test script is generated by integration, the execution result of the test task node is used as the input parameter of the whole test script for execution, and the like. In an embodiment of the present disclosure, in order to further improve the testing efficiency, a testing result in the distributed testing resources may be collected based on a cloud testing platform, and the like, so as to perform testing analysis.
In summary, the test task scheduling method for complex resource constraints according to the embodiments of the present disclosure obtains description information of a plurality of test task nodes of a target system, wherein the description information comprises a test script and a test resource constraint condition, corresponding test task nodes are connected according to a preset test task dependency relationship to obtain a target directed acyclic graph of a plurality of test task nodes, and further, obtaining at least one test task path according to the target directed acyclic graph, determining the node sequence of each test task node in the corresponding test task path, and finally, and in a plurality of test resources of the target system, sequentially determining a reference test resource of each test task node in at least one test task path according to the test resource constraint condition and the node sequence, and executing a test script corresponding to the test task node according to the reference test resource. Therefore, the test task is executed based on the target directed acyclic graph, the parallel execution of the test task can be realized, the test efficiency and the utilization rate of the test resources are improved, the test resources are matched based on the test resource constraint condition, and the selection reliability and efficiency of the test resources are improved.
It should be noted that, in different application scenarios, the preset test task dependency relationship is determined in different ways, which is exemplified as follows:
in an embodiment of the present disclosure, the test resource constraint condition in this embodiment further includes a test task identifier of a test task node on which the current test task node depends, for example, if the test resource constraint condition of the test task node 1 describes the dependent test task node 2, the execution of the test task node 1 depends on the execution of the test task node 2. Thus, the determination of the test task relationships may be made based on the dependent test task identifications.
In another embodiment of the present disclosure, the determination of the dependency relationship of the test tasks may be performed according to the input and output of the test script, considering that the output result of one test task node may become the input of another test task node.
In this embodiment, as shown in fig. 4, before connecting corresponding test task nodes according to a preset test task dependency relationship, the method includes:
step 401, obtaining an input interface type and an output interface type of a test script of each test task node.
In this embodiment, the test script of each test task node may be actually regarded as a piece of code for executing a certain task function, and the code includes an input interface type and an output interface type, where the input interface corresponds to the output of the input parameter, and the output interface corresponds to the output of the execution result of the input parameter.
Step 402, if at least one first test task node with an input interface type as a data type and at least one second test task node with an output interface type as a data type are obtained, determining input data information of each first test task node and output data information of each second test task node.
The data type may be understood as that the input parameters received by the input interface are specific data, for example, when a test script corresponding to the test task node is used to perform "add a special effect to a face region", the corresponding input interface of the test task node is used to receive data "position coordinates of the face region", and the like.
Step 403, determining a target first test task node and a target second test task node, where the input data information and the output data information are consistent, where the target first test task node is different from the target second test task node, and setting a dependency relationship between the target second test task node and the target first test task node between the former test task node and the latter test task node.
In this embodiment, if at least one first test task node whose input interface type is a data type and at least one second test task node whose output interface type is a data type are acquired, input data information of each first test task node and output data information of each second test task node are determined, where the input data information and the output data information include data types (floating point type, integer type, and the like) and data contents (age data, height data, and the like) of input or data, and since outputs and outputs of test scripts having a dependency relationship with each other are necessarily consistent, a target first test task node and a target second test task node, where the target first test task node and the target second test task node are different, are set, and a preceding test task dependency relationship between the target second test task node and the target first test task node and a following test task dependency relationship between the target second test task node and the target first test task node are set Is described.
Continuing with the above embodiment as an example, when the test script corresponding to the target second test task node is used to perform "position recognition on the face region", the corresponding output interface of the test task node is used to output data "position coordinates of the face region", and the test script corresponding to the target first test task node is used to perform "special effect addition on the face region", and the corresponding input interface of the test task node is used to receive data "position coordinates of the face region", so that a dependency relationship between the target second test task node and the target first test task node between the previous and subsequent test task nodes can be set.
Further, in an embodiment of the present disclosure, as shown in fig. 4, the method further includes:
in step 404, if at least one third test task node with the input interface type of the control type and at least one fourth test task node with the output interface type of the control type are obtained, input signal information of each third test task node and output signal information of each fourth test task node are determined.
For example, when a test code user of a test task node executes a "smile face photo", the corresponding input interface is used to receive a "face detected" signal, and thus, the input interface type corresponding to the test script is determined to be the control type.
Step 405, determining a target third test task node and a target fourth test task node, where the input signal information and the output signal information are consistent, where the target third test task node and the target fourth test task node are different, and setting a dependency relationship between the target third test task node and the target fourth test task node between the previous test task node and the next test task node.
In this embodiment, if at least one third test task node whose input interface type is the control type and at least one fourth test task node whose output interface type is the control type are acquired, the input signal information of each third test task node and the output signal information of each fourth test task node are determined. The input signal information and the output signal information include signal contents of the input or output signal, and the like.
And further determining a target third test task node and a target fourth test task node, wherein the input signal information and the output signal information are consistent, the target third test task node and the target fourth test task node are different, and the dependency relationship between the target third test task node and the target fourth test task node in the previous and next test tasks is set.
For example, if the output signal information of the test function corresponding to the test script of the target fourth test task node is "face detection" or "no face detection", the test task corresponding to the test script of the target third test task node is "face smile photographing", and the corresponding input signal information is "face detection" and photographing is performed in response to the input signal. Therefore, the corresponding target fourth test task node and the target third test task node have a test service dependency relationship.
In summary, according to the test task scheduling method for complex resource constraints in the embodiments of the present disclosure, a test task dependency relationship is constructed according to service logic between test task nodes, so that reliability of a target directed acyclic graph constructed based on the test task dependency relationship is improved, and technical support is provided for arrangement of a scheduling sequence of test tasks.
Based on the embodiment, when the test scripts of the corresponding test task nodes are executed based on the reference test resources, queues can be established for the test task nodes with the same reference test resources, and the corresponding test scripts are scheduled in the form of the queues, so that the reliability of automatic execution of system tests is further ensured.
In an embodiment of the present disclosure, as shown in fig. 5, executing a test script corresponding to a test task node according to a reference test resource includes:
step 501, if the target test resource in the reference test resources currently includes a plurality of fifth test task nodes to be executed, determining the execution priority of each fifth test task node according to the test resource constraint condition.
It is easy to understand that, when the test task nodes of different test task paths allocate corresponding test resources, the test resources are allocated according to respective node sequences, so that different test task nodes may be allocated to the same reference test resource, and in order to perform scheduling coordination on such reference test resources, if a target test resource in the reference test resource currently includes a plurality of fifth test task nodes to be executed, the execution Priority of each fifth test task node is determined according to a test resource constraint condition, for example, the execution Priority of the corresponding test task node is represented by "Priority = 10",
the execution priority represents the task urgency of the corresponding test task node, and can be generally calibrated according to experience data and the like.
Step 502, sequencing the plurality of fifth test task nodes according to the execution priority to obtain a sequencing result, and executing the test scripts of the plurality of fifth test task nodes according to the sequencing result and the target test resource.
In this embodiment, the plurality of fifth test task nodes are sorted according to the execution priority to obtain the sorting result, for example, the plurality of fifth test task nodes are executed in the order from high to low in the execution priority. Therefore, when the plurality of fifth test task nodes share the same target test resource, the test task nodes are sequenced according to the execution priority, and the test task of the important test task node is ensured to be executed preferentially.
However, in some possible embodiments, if the test resource capacity required for executing the fifth test task node with a higher priority is higher, the time length that the test task node with a higher priority occupies the target test resource may be longer, and the waiting time length of other fifth test task nodes in the target test resource may be too long.
In this embodiment, the sum of the capacities of the test resource capacities of all the fifth test task nodes in the current target test resource may be calculated, the ratio between the test resource capacity of each fifth test task node and the sum of the capacities of the fifth test task nodes is calculated, the fifth test task nodes are sorted according to the sequence from small to large according to the ratio, the sorting results of the fifth test task nodes are corrected according to the test resource capacity, the sorting results may be directly replaced with the sorting results sorted according to the sequence from small to large according to the ratio, the fifth sorting sequence number of each fifth test task node, which is sorted according to the sequence from small to large according to the ratio, and the sixth sorting sequence number, which is sorted according to the execution priority, are determined to be the fifth sorting sequence number if the difference between the fifth sorting sequence number and the sixth sorting sequence number is greater than a certain value, and modifying the sequence adaptability of other test task nodes.
In this embodiment, considering that in some scenarios, the execution duration of the test script may be longer due to an execution error of the test script, and so on, and in order to avoid affecting the execution of other test scripts, in an embodiment of the present disclosure, the test resource constraint bar further includes an execution limit duration of the corresponding test script, for example, if the test task node a includes "< Tools > timeout =10minutes </Tools >" in the test resource constraint condition, it indicates that the execution limit duration of the corresponding test script is 10 minutes.
In this embodiment, a current test script currently executed in a target test resource is determined, an execution limit duration is obtained according to a test resource constraint condition of a sixth test task node corresponding to the current test script, an actual execution duration of the current test script is obtained, whether the actual execution duration is greater than or equal to the execution limit duration of the sixth test task node is judged, if the actual execution duration is greater than or equal to the execution limit duration, execution of the test script of the sixth test task node is interrupted, and a next test script is executed according to a sequencing result.
In this embodiment, the test script of the sixth test task node may also be placed at the tail of the queue of the target test resource for execution, and if the execution duration is interrupted for a preset number of times due to timeout, an alarm is issued to notify a technician about the processing.
In order to make it more clear to those skilled in the art to understand, a method for scheduling a test task facing complex resource constraints according to an embodiment of the present disclosure is described below with reference to a specific embodiment, where a target directed acyclic graph in this embodiment is shown in fig. 6 and includes test task nodes 1 to 10, where a test task path includes: 1-2-4, 1-3, 5-6, 7-8-9, and 7-8-10, if the reference test resources corresponding to the test task nodes 1, 5, and 7 are all computer resources a, then the ratio of the test resource capacity of the test task node 1 to the computer resources a is calculated as resource utilization rate t1, and similarly, resource utilization rate t5 of the test task node 5 and resource utilization rate t7 of the test task node 7 are calculated, if t1 and t5 are equal, but the execution priority of the test task node 1 is greater than the execution priority of the test task node 5, if the execution priority of the test task node 7 is greater than the execution priorities of the test task nodes 1 and 5, and if t7 of the test resource utilization rate of the test task node 7 is less than t1 and t5, then the test task node 1, b, c, 5. The 7 queue arrangement result is a test task node 7-a test task node 1-a test task node 5.
In this embodiment, after the test task node 7 finishes executing, the test task node 8 starts to be triggered to execute according to the execution result of the test node 7, then after the test task node 1 finishes executing, the test task nodes 2 and 3 start to be triggered to execute according to the execution result of the test node 1, and after the test task node 5 finishes executing, the test task node 6 starts to be triggered to execute according to the execution result of the test node 5.
If part or all of the test task nodes 2, 3, 6, and 8 correspond to the same target test resource, the corresponding test task nodes may be sorted according to the method in combination with the test resource capacity and the execution priority, and if the reference test resources corresponding to the test task nodes 2, 3, 6, and 8 are different, after the execution of the test task nodes that depend on the test task nodes is completed, the test scripts of the corresponding test task nodes are executed under the corresponding reference test resources according to the execution results, thereby implementing the parallel execution of the test task nodes.
Further, after the test task node 3 finishes executing, the test tasks corresponding to the test task paths "1-3" are all executed, if the test task node 2 finishes executing, the test node 4 is further scheduled and executed for the reference resources, and so on, and the execution sequence of the test tasks and so on are arranged based on the static target directed acyclic graph, and the test resources are flexibly scheduled based on the execution priority, the test resource capacity and so on.
In summary, in the test task scheduling method for complex resource constraints according to the embodiments of the present disclosure, the influence of the three factors, i.e., the execution priority, the waiting time, and the capacity of the test resource, on the sorting result and the selection result of the test task nodes in the queue is comprehensively considered, so as to schedule the test resource, and by using a dual-layer test scheduling method based on static task scheduling and dynamic test task scheduling, the flexible allocation of the test resource is realized.
In order to implement the above embodiments, the present disclosure further provides a test task scheduling device facing complex resource constraints. Fig. 7 is a schematic structural diagram of a complex resource constraint-oriented test task scheduling apparatus according to an embodiment of the present disclosure, and as shown in fig. 7, the complex resource constraint-oriented test task scheduling apparatus further includes: a first acquisition module 710, a second acquisition module 720, a determination module 730, and a test module 740, wherein,
a first obtaining module 710, configured to obtain description information of multiple test task nodes of a target system, where the description information includes a test script and a test resource constraint condition;
a second obtaining module 720, configured to connect corresponding test task nodes according to a preset test task dependency relationship, so as to obtain a target directed acyclic graph of the plurality of test task nodes;
a determining module 730, configured to obtain at least one test task path according to the target directed acyclic graph, and determine a node sequence of each test task node in a corresponding test task path;
the testing module 740 is configured to, in the multiple testing resources of the target system, sequentially determine, according to the testing resource constraint condition and the node sequence, a reference testing resource of each testing task node in the at least one testing task path, and execute a testing script of a corresponding testing task node according to the reference testing resource.
It should be noted that, the foregoing explanation of the test task scheduling method facing complex resource constraint is also applicable to the test task scheduling apparatus facing complex resource constraint according to the embodiment of the present disclosure, and the implementation principle and the technical effect are similar, and are not described herein again.
In order to implement the above embodiment, the present disclosure further provides an electronic device, including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instruction from the memory, and execute the instruction to implement the complex resource constraint-oriented test task scheduling method described in the foregoing embodiment.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be 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.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (7)

1. A test task scheduling method facing complex resource constraint is characterized by comprising the following steps:
obtaining description information of a plurality of test task nodes of a target system, wherein the description information comprises a test script and a test resource constraint condition;
connecting corresponding test task nodes according to a preset test task dependency relationship to obtain a target directed acyclic graph of the plurality of test task nodes;
acquiring at least one test task path according to the target directed acyclic graph, and determining the node sequence of each test task node in the corresponding test task path;
in a plurality of test resources of the target system, sequentially determining a reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node sequence, and executing a test script of the corresponding test task node according to the reference test resource; the executing of the test script corresponding to the test task node according to the reference test resource includes:
if a target test resource in the reference test resources currently comprises a plurality of fifth test task nodes to be executed, determining the execution priority of each fifth test task node according to the test resource constraint condition;
sequencing the plurality of fifth test task nodes according to the execution priority to obtain an initial sequencing result, and obtaining the test resource capacity of each fifth test task node;
calculating the sum of the capacity of the test resource capacity of all the fifth test task nodes in the current target test resource;
calculating the ratio of the testing resource capacity of each fifth testing task node to the sum of the capacities, and sequencing according to the sequence of the ratio from small to large to obtain a ratio sequencing result;
acquiring a fifth sorting serial number of each fifth test task node in the ratio sorting result and a sixth sorting serial number of each fifth test task node in the initial sorting result;
replacing the sixth sequencing serial number of each fifth test task node with the fifth sequencing serial number to correct the initial sequencing result according to the test resource capacity to obtain a target sequencing result;
executing the test scripts of the fifth test task nodes according to the target sequencing result and the target test resource;
determining a current test script currently executed in the target test resources, and acquiring an execution limit duration according to a test resource constraint condition of a sixth test task node corresponding to the current test script;
acquiring the actual execution duration of the current test script;
judging whether the actual execution time length is greater than or equal to the execution limit time length of the sixth test task node or not;
and if the execution time limit is greater than or equal to the execution limit time, interrupting the execution of the test script of the sixth test task node and executing the next test script according to the target sequencing result.
2. The complex resource constraint-oriented test task scheduling method according to claim 1, wherein before connecting corresponding test task nodes according to a preset test task dependency relationship, the method comprises:
acquiring an input interface type and an output interface type of a test script of each test task node;
if at least one first test task node with the input interface type as a data type and at least one second test task node with the output interface type as the data type are obtained, determining input data information of each first test task node and output data information of each second test task node;
and determining a target first test task node and a target second test task node which are consistent with the input data information and the output data information, wherein the target first test task node is different from the target second test task node, and setting a front-back test task dependency relationship between the target second test task node and the target first test task node.
3. The complex resource constraint-oriented test task scheduling method of claim 2, further comprising:
if at least one third test task node with the input interface type as the control type and at least one fourth test task node with the output interface type as the control type are obtained, determining input signal information of each third test task node and output signal information of each fourth test task node;
and determining a target third test task node and a target fourth test task node which are consistent with the input signal information and the output signal information, wherein the target third test task node is different from the target fourth test task node, and setting a front-back test task dependency relationship of the target third test task node and the target fourth test task node.
4. The complex resource constraint-oriented test task scheduling method of claim 1, wherein the sequentially determining the reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node order comprises:
determining the test resource type and the test resource capacity of each test task node according to the test resource constraint condition;
determining at least one candidate test resource matching the test resource type and test resource capacity among a plurality of test resources of the target system;
and determining a reference test resource of the corresponding test task node in the at least one candidate test resource.
5. The complex resource constraint-oriented test task scheduling method of claim 4, wherein the determining a reference test resource of a corresponding test task node among the at least one candidate test resource comprises:
and randomly determining one candidate test resource as a reference test resource of the corresponding test task node in the at least one candidate test resource.
6. A test task scheduling device facing complex resource constraint is characterized by comprising:
the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring description information of a plurality of test task nodes of a target system, and the description information comprises a test script and a test resource constraint condition;
the second acquisition module is used for connecting corresponding test task nodes according to a preset test task dependency relationship so as to acquire a target directed acyclic graph of the plurality of test task nodes;
the determining module is used for acquiring at least one test task path according to the target directed acyclic graph and determining the node sequence of each test task node in the corresponding test task path;
the test module is used for sequentially determining a reference test resource of each test task node in the at least one test task path according to the test resource constraint condition and the node sequence in a plurality of test resources of the target system and executing a test script of the corresponding test task node according to the reference test resource;
the test module is specifically configured to: if the target test resource in the reference test resources currently comprises a plurality of fifth test task nodes to be executed, determining the execution priority of each fifth test task node according to the test resource constraint condition,
sequencing the plurality of fifth test task nodes according to the execution priority to obtain an initial sequencing result, obtaining the test resource capacity of each fifth test task node,
calculating the sum of the capacities of the test resource capacities of all the fifth test task nodes in the current target test resource,
calculating the ratio of the testing resource capacity of each fifth testing task node to the sum of the capacities, sorting according to the sequence of the ratio from small to large to obtain a ratio sorting result,
acquiring a fifth sorting serial number in the ratio sorting result and a sixth sorting serial number in the initial sorting result of each fifth test task node,
replacing the sixth sequencing serial number of each fifth test task node with the fifth sequencing serial number to achieve correction of the initial sequencing result according to the test resource capacity to obtain a target sequencing result,
executing the test scripts of the fifth test task nodes according to the target sequencing result and the target test resource,
determining a current test script currently executed in the target test resources, acquiring an execution limit duration according to a test resource constraint condition of a sixth test task node corresponding to the current test script,
acquiring the actual execution duration of the current test script;
judging whether the actual execution time length is greater than or equal to the execution limit time length of the sixth test task node or not,
and when the execution time is longer than or equal to the execution limit time, interrupting the execution of the test script of the sixth test task node and executing the next test script according to the target sequencing result.
7. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the complex resource constraint-oriented test task scheduling method according to any one of claims 1 to 5.
CN202110830206.7A 2021-07-22 2021-07-22 Test task scheduling method oriented to complex resource constraint Active CN113282402B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110830206.7A CN113282402B (en) 2021-07-22 2021-07-22 Test task scheduling method oriented to complex resource constraint

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110830206.7A CN113282402B (en) 2021-07-22 2021-07-22 Test task scheduling method oriented to complex resource constraint

Publications (2)

Publication Number Publication Date
CN113282402A CN113282402A (en) 2021-08-20
CN113282402B true CN113282402B (en) 2021-11-05

Family

ID=77287166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110830206.7A Active CN113282402B (en) 2021-07-22 2021-07-22 Test task scheduling method oriented to complex resource constraint

Country Status (1)

Country Link
CN (1) CN113282402B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115378999B (en) * 2022-10-26 2023-03-24 小米汽车科技有限公司 Service capacity adjusting method and device
CN116069471B (en) * 2023-01-12 2024-03-19 苏州畅行智驾汽车科技有限公司 Deterministic scheduling method and device for tasks and electronic equipment
CN116501503B (en) * 2023-06-27 2023-09-15 上海燧原科技有限公司 Architecture mapping method and device for load task, computer equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239213A (en) * 2014-09-29 2014-12-24 北京航空航天大学 Two-stage scheduling method of parallel test tasks facing spacecraft automation test
CN104410543A (en) * 2014-11-19 2015-03-11 中国联合网络通信集团有限公司 An automatic testing method and system based on cloud resource
CN110210789A (en) * 2019-06-17 2019-09-06 广东电网有限责任公司 Resource distribution dispatching method, the device, equipment of power grid test business
CN110554909A (en) * 2019-09-06 2019-12-10 腾讯科技(深圳)有限公司 task scheduling processing method and device and computer equipment
CN110689262A (en) * 2019-09-25 2020-01-14 中国人民解放军战略支援部队航天工程大学 Space-based information system task scheduling method and device and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291548B (en) * 2016-03-31 2021-04-13 阿里巴巴集团控股有限公司 Task resource scheduling method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104239213A (en) * 2014-09-29 2014-12-24 北京航空航天大学 Two-stage scheduling method of parallel test tasks facing spacecraft automation test
CN104410543A (en) * 2014-11-19 2015-03-11 中国联合网络通信集团有限公司 An automatic testing method and system based on cloud resource
CN110210789A (en) * 2019-06-17 2019-09-06 广东电网有限责任公司 Resource distribution dispatching method, the device, equipment of power grid test business
CN110554909A (en) * 2019-09-06 2019-12-10 腾讯科技(深圳)有限公司 task scheduling processing method and device and computer equipment
CN110689262A (en) * 2019-09-25 2020-01-14 中国人民解放军战略支援部队航天工程大学 Space-based information system task scheduling method and device and electronic equipment

Also Published As

Publication number Publication date
CN113282402A (en) 2021-08-20

Similar Documents

Publication Publication Date Title
CN113282402B (en) Test task scheduling method oriented to complex resource constraint
US20190332523A1 (en) Data-Driven Scheduling of Automated Software Program Test Suites
CN113535367B (en) Task scheduling method and related device
CN111768006A (en) Artificial intelligence model training method, device, equipment and storage medium
US20110016452A1 (en) Method and system for identifying regression test cases for a software
CN102868573B (en) Method and device for Web service load cloud test
CN112363913B (en) Parallel test task scheduling optimizing method, device and computing equipment
CN113672500B (en) Deep learning algorithm testing method and device, electronic device and storage medium
CN111258726B (en) Task scheduling method and device
CN113254331A (en) Model test method, device, storage medium and program product
CN106775975B (en) Process scheduling method and device
CN107634978B (en) Resource scheduling method and device
CN111831408A (en) Asynchronous task processing method and device, electronic equipment and medium
CN116069500A (en) Model training task processing method and device, electronic equipment and readable medium
CN111147541A (en) Node processing method, device and equipment based on parameter server and storage medium
CN110764911A (en) Resource scheduling method, device and control system based on order
CN110874319A (en) Automated testing method, automated testing platform, automated testing equipment and computer-readable storage medium
CN111309475B (en) Detection task execution method and equipment
CN115495239A (en) Test resource multiplexing method and device, storage medium and computer equipment
CN115220887A (en) Processing method of scheduling information, task processing system, processor and electronic equipment
CN112559148A (en) Execution method, execution device and execution system of ordered tasks
CN114327673A (en) Task starting method and device, electronic equipment and storage medium
CN112486502A (en) Distributed task deployment method and device, computer equipment and storage medium
CN113225269A (en) Container-based workflow scheduling method, device and system and storage medium
CN112817744A (en) Task processing method and device

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
GR01 Patent grant
GR01 Patent grant