A parallel test task scheduling method for a distributed test system of multi-target equipment
Through the parallel test task scheduling method of multi-objective equipment distributed testing system, the improved Gray Wolf Optimization Algorithm (MIGWO) is used to optimize the test time and resource utilization rate, which solves the problems of long test time and low resource utilization rate in traditional testing methods, and achieves the shortening of test time and the improvement of resource utilization rate.
Patent Information
- Application Number
- CN202510819953.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Traditional equipment testing methods have long testing time and low resource utilization, which cannot meet the needs of modern equipment testing systems.
The parallel test task scheduling method of multi-objective equipment distributed testing system is adopted, and parallel test task scheduling is described through mathematical models, combined with the improved Gray Wolf Optimization Algorithm (MIGWO) for solution, the fitness function is designed to optimize the test time and resource utilization, and the coding method and cross-operation are used to generate a scheduling scheme.
Significantly shorten the testing time, improve resource utilization, and improve testing efficiency.
Smart Images

Figure CN120336197B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a test task scheduling method, in particular to a parallel test task scheduling method for a multi-target equipment distributed test system, belonging to the technical field of scheduling methods. Background Art
[0002] With the continuous advancement of science and technology, various high-tech technologies are being continuously applied to modern equipment, placing higher demands on equipment test systems. With the rapid development of network technology, networked equipment test systems have become a development trend in equipment test systems. Among them, distributed equipment test systems are network-based systems that connect test equipment and test computers distributed across different nodes to achieve resource sharing, collaborative work, and centralized management. Distributed equipment test systems effectively address issues such as low versatility, poor scalability, and high resource usage in equipment test systems, and have become a current development trend in equipment test systems.
[0003] Distributed equipment test systems enable resource sharing over the network, significantly increasing the availability of instrument resources. Traditional serial testing involves completing test tasks one by one, requiring the next task to wait until the current one is complete. This significantly increases test time and significantly idles instrument resources, making it difficult to meet the needs of today's equipment test system development. Summary of the Invention
[0004] In view of the continuous increase in the number of equipment models, the number and complexity of equipment testing tasks have increased significantly. Traditional testing methods have not only long testing times but also low resource utilization, and cannot meet the current equipment testing needs. The present invention provides a parallel test task scheduling method for a multi-target equipment distributed test system, which can significantly shorten the test time and improve resource utilization.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A method for scheduling parallel test tasks in a distributed test system for multi-target equipment is characterized in that it includes the following steps:
[0007] Step 1: Use mathematical methods to describe the equipment parallel test task scheduling model;
[0008] Step 2: Determine the constraints between the test tasks in the parallel test task scheduling model in step 1 on test timing and resources, as well as the constraints between the test tasks and test resources.
[0009] Step 3: Determine the fitness function corresponding to the balance between test time and resource utilization, measure the importance of the two optimization goals, and design the overall fitness function;
[0010] Step 4: Solve the fitness function of step 3;
[0011] Furthermore, the equipment parallel test task scheduling model in step 1 includes a test task set, a test resource set, a task resource association matrix, a task constraint matrix, a task time set, a task solution set, and a task scheduling sequence;
[0012] The test task set is represented as follows: , Each test task represents a different type of equipment;
[0013] The collection of test resources is represented as: , Each test resource represents a different test instrument;
[0014] The task resource association matrix is expressed as: , yes Matrix, which represents the test resources required by different test tasks during testing. If the test task Existence of test scenarios , taking up test resources ,but If the resource is not occupied, ;
[0015] The task constraint matrix is expressed as: , is a Matrix, describes the time constraint relationship between different test tasks, and can reflect the execution order of test tasks. , indicating the test task Than test task Execute first, otherwise , indicating the test task and test tasks There is no time constraint between them;
[0016] The task time set is expressed as: , Represents a test task the time required to complete the test;
[0017] The task solution set is expressed as: , the task solution set represents the test task The options available;
[0018] Each test resource can test multiple tasks, and each test task can select different test resources to complete the test. Therefore, the scheduling scheme for parallel test tasks is not unique;
[0019] The task scheduling sequence is expressed as: , It is a test task In testing resources The way to express the scheduling plan on is a Matrix, rows represent different test resources, columns represent the steps of parallel testing, , Pick Between, indicating Step occupies test resources Test tasks ,if is 0, indicating the Step Testing Resources Not occupied, The test task of step 1 is The test task of the first step is executed first, and each element of the matrix represents the number of a test task at a certain time point;
[0020] Furthermore, some test tasks in step 2 have different constraints on test timing and resources. The constraints between test tasks are divided into the following three categories:
[0021] (1) Resource related: 、 There are two test tasks, and the resources required for testing are 、 If resources 、 There is no intersection between them, so it is called 、 Resource-independent, otherwise resource-dependent;
[0022] (2) Control related: Set 、 For two test tasks, if The test can determine If they are tested together, Control related to ; Otherwise, it is called control irrelevant;
[0023] (3) Data related: 、 For two test tasks, if 、 As input and output to each other, 、 Data related;
[0024] Furthermore, the following three constraints need to be met between the test tasks and test resources in step 2:
[0025] (1) The same test resource can only be occupied by one test task at a time;
[0026] (2) When the current test task is executed, the occupied resources will be occupied by the task until the test task is completed;
[0027] (3) The test plan selected for the test task at the same time is unique; further, step 3 includes the following steps:
[0028] Step 3.1: Determine the objective function based on the constraints in step 2:
[0029] Objective function: ,
[0030] Basic constraints:
[0031] The test tasks with higher task priority are tested first, i.e. , ;
[0032] The two test tasks tested simultaneously avoid resource conflicts, i.e. , ;
[0033] in, Indicates the total execution time of the test task. Indicates the average utilization of test resources; It is a task scheduling test solution. It is a test task In the test task scheduling scheme The sort number in ; It is a test task exist The test resources required under the sort number;
[0034] Step 3.2: Design the fitness function based on the total execution time of the test task in step 3.1 : ,
[0035] Where: Indicates the completion time of all task serial tests, fitness function The larger it is, the shorter the total execution time of the test task is;
[0036] Step 3.3: Design the fitness function based on the average utilization of the test resources in step 3.1 : ,
[0037] Where: Indicates that the test task is in the resource The total time spent on Indicates the minimum total time occupied by all resources, fitness function The larger it is, the more balanced the resource utilization is;
[0038] Step 3.4: According to the fitness function in step 3.2 and the fitness function in step 3.3 Designing the overall fitness function : ,
[0039] Where: 、 It is a constant and is set according to test experience or actual test requirements;
[0040] Furthermore, the step 4 is solved using the improved grey wolf optimization algorithm MIGWO;
[0041] Furthermore, the step 4 specifically includes the following steps:
[0042] Step 4.1, initial parameter setting: Initialize the population according to the task constraint matrix in step 1 , task resource association matrix , randomly generate a task scheduling sequence that meets the conditions ;
[0043] Step 4.2, initial population differentiation: the initial population in step 4.1 is divided into and The two fitness functions are divided into two initial sub-populations of equal size, and the two initial sub-populations are divided into two initial sub-populations according to the fitness function. and They each develop independently;
[0044] Step 4.3, update the individuals in the two initial sub-populations in step 4.2: calculate the fitness values of the two initial sub-populations in step 4.2 respectively, sort them according to the fitness values, and select the top three individuals in each sub-population as the fitness values. 、 、 Wolf, sort the remaining individuals according to their current fitness values and divide them into three intervals with roughly the same number of individuals;
[0045] Individuals in the interval with low fitness values are cross-linked with the individual with the highest fitness value; individuals in the interval with middle fitness values are cross-linked with the individual with the second highest fitness value; individuals in the interval with high fitness values are cross-linked with the individual with the third highest fitness value; the generated new individuals are checked, duplicate tasks are deleted, and untested tasks are reinserted into unoccupied resources to ensure that the new individuals meet the task scheduling sequence. Requirements: The top three individuals in fitness are regarded as elite individuals and retained in the next cycle;
[0046] Step 4.4, Field Search: Merge the updated individuals in the two populations in step 4.3. After merging, each individual in the new population generates a random number between [0,1] and The values are compared, The value is also a randomly generated number between [0,1]. If it is greater than The first type of neighborhood structure search is performed , if less than The second neighborhood structure search is performed , calculate the overall fitness value of the new individuals after performing neighborhood search and the original individuals in the population, retain the individuals with high overall fitness value, check whether the maximum number of cycles is reached, if so, jump to step 4.6, otherwise, jump to step 4.5;
[0047] Step 4.5, elite merging: After completing the neighborhood search, the population is divided into two new populations of equal size according to the two fitness functions. The two new population individuals are merged with the top 3 elite individuals with the fitness values retained in step 4.3, and then go to step 4.3 for the next cycle;
[0048] Step 4.6, determine the optimal result: stop the loop, calculate the overall fitness value of all individuals after the neighborhood search, select the individual with the highest overall fitness value as the final optimization result, record and save the fitness value and task scheduling sequence of the individual;
[0049] Furthermore, the task scheduling sequence in step 4.1 It is generated by encoding. The specific process is as follows:
[0050] Task scheduling sequence The first column generation method: in the resource set In accordance with arrive Select resources in the order of task resource association matrix , randomly select a task from the tasks occupying resources , confirm the task All occupied resources in the first column of the task scheduling sequence are filled with the task number in the corresponding row and position , the task All occupied resources are deleted from the resource set;
[0051] Schedule tasks into sequence The first column has selected tasks from the task set Delete it, regenerate the resource set with full resources, and then schedule the task sequence Generate the second column. The generation method of the second column and subsequent columns is the same as that of the first column. Therefore, the generation process of the first column is repeated until the task set is empty, which means that all test tasks have participated in the test. The remaining positions in the task scheduling sequence are filled with 0;
[0052] Task May include There are different test scenarios, each of which occupies different resources and time, but in executing the test task When ,only one test scheme can be selected.,In order to facilitate the solution, the method of generating task scheduling sequence remains basically unchanged, and the task association matrix and task set are improved to meet the requirements;
[0053] If in the test task, the task include Test scenarios, improved task sets for: , Represents a test task No. Test scheme, improved task correlation matrix for The matrix is as follows: ,
[0054] When generating a task scheduling sequence, if you start with occupied resources Tasks were randomly selected from the , tasks need to be centralized to Delete all and change the task resource association matrix to arrive All columns are set to 0, indicating a task It has been selected to avoid repeating the task in the future;
[0055] Furthermore, the PBX crossover in step 4.3 is specifically as follows:
[0056] Individuals with low fitness values and Wolf crossover, individual and fitness values Wolf crossover, individuals with high fitness values and Wolf crossover is used to improve the overall fitness value of the population and increase the diversity of the population. The specific crossover process is as follows: several positions of excellent individuals are selected, the selected positions are inherited to the same positions of the executing individuals, and the remaining unfinished tasks are inserted into the unoccupied resources in sequence starting from the first column according to the resource occupancy relationship until a new individual that meets the task scheduling requirements is generated;
[0057] Furthermore, the first neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of the two individuals to exchange, check the two new individuals after the exchange, delete the tasks that are repeated in the exchange column, and insert the missing tasks into the unoccupied resources starting from the first column to generate a new individual that meets the task scheduling requirements;
[0058] Furthermore, the second neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of one individual and insert it into the column before the column of the same position of the other individual, delete the last column of the inserted individual, perform the same operation on both individuals, check the two new individuals after insertion, delete the tasks that are repeated in the inserted column, and insert the missing tasks into the unoccupied resources in sequence starting from the first column to generate new individuals that meet the task scheduling requirements.
[0059] The proposed method for parallel test task scheduling of a multi-objective equipment distributed test system introduces a dual-objective optimization mechanism. With "total test task execution time" and "resource utilization balance" as optimization objectives, the initial population is divided into two sub-populations, which evolve independently based on different fitness functions, namely the speedup ratio and the average resource utilization rate. This solves the problem that traditional single-objective optimization algorithms cannot take into account resource balance. In view of the limitation that the traditional grey wolf optimization algorithm (GWO) is only applicable to continuous optimization problems, a discretization improvement method is proposed. Through coding method design, crossover operation and neighborhood search strategy, it is applied to the parallel test task scheduling problem. A matrix coding method is designed for parallel test task scheduling of equipment distributed test systems, and individual discrete updates are realized in combination with PBX crossover operation to ensure that the generated scheduling scheme meets the actual task constraints. The method significantly shortens the test time and improves resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 is a flow chart of the present invention;
[0061] Figure 2 This is the MIGWO algorithm flow chart;
[0062] Figure 3 This is a schematic diagram of the PBX crossover process;
[0063] Figure 4 The fitness of the new population 1 Convergence curve graph;
[0064] Figure 5 The fitness of the new population 2 Convergence curve graph;
[0065] Figure 6 The fitness of the three algorithms Maximum value comparison chart;
[0066] Figure 7 The fitness of the three algorithms Maximum value comparison chart;
[0067] Figure 8 The fitness of the three algorithms Maximum value comparison chart;
[0068] Figure 9 Gantt chart of the optimal scheduling sequence for the MIGWO algorithm;
[0069] Figure 10 Gantt chart of the optimal scheduling sequence for the GWO algorithm;
[0070] Figure 11 This is the Gantt chart of the optimal scheduling sequence of the GA algorithm. DETAILED DESCRIPTION
[0071] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] Example 1. A method for scheduling parallel test tasks in a multi-target equipment distributed test system. The specific process is as follows: Figure 1 As shown, the following steps are included:
[0073] Step 1: Use mathematical methods to describe the equipment parallel test task scheduling model;
[0074] Step 2: Determine the constraints between the test tasks in the parallel test task scheduling model in step 1 on test timing and resources, as well as the constraints between the test tasks and test resources.
[0075] Step 3: Determine the fitness function corresponding to the balance between test time and resource utilization, measure the importance of the two optimization goals, and design the overall fitness function;
[0076] Step 4: Solve the fitness function of step 3.
[0077] The equipment parallel test task scheduling model in step 1 includes a test task set, a test resource set, a task resource association matrix, a task constraint matrix, a task time set, a task solution set, and a task scheduling sequence;
[0078] The test task set is represented as follows: , Each test task represents a different type of equipment;
[0079] The collection of test resources is represented as: , Each test resource represents a different test instrument;
[0080] The task resource association matrix is expressed as: , yes Matrix, which represents the test resources required by different test tasks during testing. If the test task Existence of test scenarios , taking up test resources ,but If the resource is not occupied, ;
[0081] The task constraint matrix is expressed as: , is a Matrix, describes the time constraint relationship between different test tasks, and can reflect the execution order of test tasks. , indicating the test task Than test task Execute first, otherwise , indicating the test task and test tasks There is no time constraint between them;
[0082] The task time set is expressed as: , Represents a test task the time required to complete the test;
[0083] The task solution set is expressed as: , the task solution set represents the test task The options available;
[0084] Each test resource can test multiple tasks, and each test task can select different test resources to complete the test. Therefore, the scheduling scheme for parallel test tasks is not unique;
[0085] The task scheduling sequence is expressed as: , It is a test task In testing resources The way to express the scheduling plan on is a Matrix, rows represent different test resources, columns represent the steps of parallel testing, , Pick Between, indicating Step occupies test resources Test tasks ,if is 0, indicating the Step Testing Resources Not occupied, The test task of step 1 is The test task of the first step is executed first, and each element of the matrix represents the number of a test task at a certain time point.
[0086] In step 2, some test tasks have different constraints on test timing and resources. The constraints between test tasks are divided into the following three categories:
[0087] (1) Resource related: 、 There are two test tasks, and the resources required for testing are 、 If resources 、 There is no intersection between them, so it is called 、 Resource-independent, otherwise resource-dependent;
[0088] (2) Control related: Set 、 For two test tasks, if The test can determine If they are tested together, Control related to ; Otherwise, it is called control irrelevant;
[0089] (3) Data related: 、 For two test tasks, if 、 As input and output to each other, 、 Data related.
[0090] The following three constraints must be met between the test tasks and test resources in step 2:
[0091] (1) The same test resource can only be occupied by one test task at a time;
[0092] (2) When the current test task is executed, the occupied resources will be occupied by the task until the test task is completed;
[0093] (3) The test plan selected for the test task at the same time is unique.
[0094] Wherein, the step 3 includes the following steps:
[0095] Step 3.1: Determine the objective function based on the constraints in step 2:
[0096] Objective function: ,
[0097] Basic constraints:
[0098] The test tasks with higher task priority are tested first, i.e. , ;
[0099] The two test tasks tested simultaneously avoid resource conflicts, i.e. , ;
[0100] in, Indicates the total execution time of the test task. Indicates the average utilization of test resources; It is a task scheduling test solution. It is a test task In the test task scheduling scheme The sort number in ; It is a test task exist The test resources required under the sort number;
[0101] Step 3.2: Design the fitness function based on the total execution time of the test task in step 3.1 : ,
[0102] Where: Indicates the completion time of all task serial tests, fitness function The larger it is, the shorter the total execution time of the test task is;
[0103] Step 3.3: Design the fitness function based on the average utilization of the test resources in step 3.1 : ,
[0104] Where: Indicates that the test task is in the resource The total time spent on Indicates the minimum total time occupied by all resources, fitness function The larger it is, the more balanced the resource utilization is;
[0105] Step 3.4: According to the fitness function in step 3.2 and the fitness function in step 3.3 Designing the overall fitness function : ,
[0106] Where: 、 It is a constant and is set according to test experience or actual test requirements.
[0107] Wherein, the step 4 is solved using the improved grey wolf optimization algorithm MIGWO.
[0108] Among them, such as Figure 2 As shown, the step 4 specifically includes the following steps:
[0109] Step 4.1, initial parameter setting: Initialize the population according to the task constraint matrix in step 1 , task resource association matrix , randomly generate a task scheduling sequence that meets the conditions ;
[0110] Step 4.2, initial population differentiation: the initial population in step 4.1 is divided into and The two fitness functions are divided into two initial sub-populations of equal size, and the two initial sub-populations are divided into two initial sub-populations according to the fitness function. and They each develop independently;
[0111] Step 4.3, update the individuals in the two initial sub-populations in step 4.2: calculate the fitness values of the two initial sub-populations in step 4.2 respectively, sort them according to the fitness values, and select the top three individuals in each sub-population as the fitness values. 、 、 Wolf, sort the remaining individuals according to their current fitness values and divide them into three intervals with roughly the same number of individuals;
[0112] Individuals in the interval with low fitness values are cross-linked with the individual with the highest fitness value; individuals in the interval with middle fitness values are cross-linked with the individual with the second highest fitness value; individuals in the interval with high fitness values are cross-linked with the individual with the third highest fitness value; the generated new individuals are checked, duplicate tasks are deleted, and untested tasks are reinserted into unoccupied resources to ensure that the new individuals meet the task scheduling sequence. Requirements: The top three individuals in fitness are regarded as elite individuals and retained in the next cycle;
[0113] Step 4.4, Field Search: Merge the updated individuals in the two populations in step 4.3. After merging, each individual in the new population generates a random number between [0,1] and The values are compared, The value is also a randomly generated number between [0,1]. If it is greater than The first type of neighborhood structure search is performed , if less than The second neighborhood structure search is performed , calculate the overall fitness value of the new individuals after performing neighborhood search and the original individuals in the population, retain the individuals with high overall fitness value, check whether the maximum number of cycles is reached, if so, jump to step 4.6, otherwise, jump to step 4.5;
[0114] Step 4.5, elite merging: After completing the neighborhood search, the population is divided into two new populations of equal size according to the two fitness functions. The two new population individuals are merged with the top 3 elite individuals with the fitness values retained in step 4.3, and then go to step 4.3 for the next cycle;
[0115] Step 4.6, determine the optimal result: stop the loop, calculate the overall fitness value of all individuals after the neighborhood search, select the individual with the highest overall fitness value as the final optimization result, and record and save the fitness value and task scheduling sequence of the individual.
[0116] Among them, the task scheduling sequence in step 4.1 It is generated by encoding. The specific process is as follows:
[0117] Task scheduling sequence The first column generation method: in the resource set In accordance with arrive Select resources in the order of task resource association matrix , randomly select a task from the tasks occupying resources , confirm the task All occupied resources in the first column of the task scheduling sequence are filled with the task number in the corresponding row and position , the task All occupied resources are deleted from the resource set;
[0118] Schedule tasks into sequence The first column has selected tasks from the task set Delete it, regenerate the resource set with full resources, and then schedule the task sequence Generate the second column. The generation method of the second column and subsequent columns is the same as that of the first column. Therefore, the generation process of the first column is repeated until the task set is empty, which means that all test tasks have participated in the test. The remaining positions in the task scheduling sequence are filled with 0;
[0119] Task May include There are different test scenarios, each of which occupies different resources and time, but in executing the test task When ,only one test scheme can be selected.,In order to facilitate the solution, the method of generating task scheduling sequence remains basically unchanged, and the task association matrix and task set are improved to meet the requirements;
[0120] If in the test task, the task include Test scenarios, improved task sets for: , Represents a test task No. Test scheme, improved task correlation matrix for The matrix is as follows: ,
[0121] When generating a task scheduling sequence, if you start with occupied resources Tasks were randomly selected from the , tasks need to be centralized to Delete all and change the task resource association matrix to arrive All columns are set to 0, indicating a task It has been selected to avoid repeating the task later.
[0122] Among them, such as Figure 3 As shown, the PBX cross-connection in step 4.3 is specifically as follows:
[0123] Individuals with low fitness values and Wolf crossover, individual and fitness values Wolf crossover, individuals with high fitness values and Wolf crossover is used to improve the overall fitness value of the population and increase the diversity of the population. The specific crossover process is as follows: several positions of excellent individuals are selected, the selected positions are inherited to the same positions of the executing individuals, and the remaining unfinished tasks are inserted into the unoccupied resources in sequence starting from the first column according to the resource occupancy relationship until new individuals that meet the task scheduling requirements are generated.
[0124] Wherein, the first neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of the two individuals to exchange, check the two new individuals after the exchange, delete the tasks that are repeated in the exchange column, and insert the missing tasks into the unoccupied resources starting from the first column to generate a new individual that meets the task scheduling requirements;
[0125] Wherein, the second neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of one individual and insert it into the column before the column of the same position of the other individual, delete the last column of the inserted individual, perform the same operation on both individuals, check the two new individuals after insertion, delete the tasks that are repeated in the inserted column, and insert the missing tasks into the unoccupied resources in sequence starting from the first column to generate new individuals that meet the task scheduling requirements.
[0126] Example 2: Step 4 in Example 1 was verified using the improved grey wolf optimization algorithm MIGWO.
[0127] To verify the performance of the MIGWO algorithm, we compared the Grey Wolf Optimization Algorithm (GWO) and the Genetic Algorithm (GA) based on data processed from a typical equipment test experiment. The GWO algorithm here only modified its encoding method. The simulation environment configuration is shown in Table 1.
[0128] Table 1 Simulation environment configuration
[0129] ,
[0130] In this experiment, there are 28 test tasks, which are Indicates that if Represents a test task Prior to testing tasks Execute, then the constraints between tasks in this example are: , , ; There are 9 test resources in total, The test tasks, test plans, and test task durations are shown in Table 2, where each task has a maximum of three plans, represented by 1-3, and the unit of test time is seconds.
[0131] Table 2 Test tasks, plans, resources and time
[0132] ,
[0133] In the experiment, the population size of the MIGWO algorithm, GWO algorithm and GA algorithm is set to 200, the number of iterations is 50, among which the crossover probability of the GA algorithm is 0.7 and the mutation probability is 0.6.
[0134] According to the above experimental data, the simulation results of MIGWO algorithm, GWO algorithm and GA algorithm are as follows:
[0135] (1) Convergence curves of two populations in the MIGWO algorithm
[0136] The experimental conditions of two populations evolving according to different optimization objectives in the MIGWO algorithm are simulated respectively. Figure 4 Represents the fitness of the new population 1 in the MIGWO algorithm flowchart Convergence curve, The axis represents the number of iterations, The axis represents fitness The three curves in the figure represent the fitness of all individuals in the new population 1 of each generation. The maximum, median, and minimum values of .
[0137] from Figure 4 It can be seen that the fitness of all individuals in the new population 1 The value of finally converges to the maximum value, and the entire population converges quickly. Although it falls into a local optimal solution during the iteration process, it quickly jumps out of the local optimal solution.
[0138] Figure 5 Represents the fitness of the new population 2 in the MIGWO algorithm flowchart Convergence curve, The axis represents the number of iterations, The axis represents fitness The three curves in the figure represent the fitness of all individuals in the new population 2 of each generation. Maximum, median, and minimum values.
[0139] from Figure 5 It can be seen that the fitness of all individuals in the new population 2 The value of finally converges to the maximum value, and the entire population converges quickly, and has a strong ability to jump out of the local optimal solution.
[0140] Combining the convergence of the two populations, we can see that both populations converge quickly and have a strong ability to escape from the local optimal solution. As the number of iterations increases, the fitness values of all individuals in the two populations reach the maximum value, achieving the dual-objective optimization effect. The fitness of individuals in the new population 1 is Converges to 3.440, which translates to a total test execution time of 116 seconds. The fitness of the new population of 2 individuals is It converges to 0.9709, which means the average resource utilization reaches 97.09%.
[0141] (2) Comparison graph of three algorithms
[0142] Simulate the MIGWO algorithm, GWO algorithm and GA algorithm, and Maximum value, fitness Maximum value, overall fitness The maximum values are compared in three aspects, see Figure 6-Figure 8 Among them, the MIGWO algorithm calculates the new population 4 of all individuals in the MIGWO algorithm flow chart. 、 and , select all individuals 、 and Maximum value; Since GWO algorithm and GA algorithm can only optimize a single objective, they use the overall fitness To optimize the target, calculate the 、 and The value of , select all individuals 、 and Maximum value.
[0143] Figure 6 The fitness of the three algorithms The comparison curve of the maximum value as the number of iterations changes. It can be seen from the figure that the fitness of the MIGWO algorithm The final convergence result of the maximum value is better than that of the GWO algorithm and the GA algorithm, and the convergence speed and the ability to escape the local optimal solution of the MIGWO algorithm are better than those of the GWO algorithm and the GA algorithm.
[0144] Figure 7 The fitness of the three algorithms The comparison curve of the maximum value as the number of iterations changes. It can be seen from the figure that the MIGWO algorithm has almost found the fitness from the beginning of the iteration. The maximum value is obtained, and the speed of finding the optimal solution is significantly faster than that of GWO and GA algorithms, and there is no situation where GWO and GA algorithms fall into local optimality many times. From the final convergence results of the three algorithms, the fitness of MIGWO algorithm is better. The final convergence result of the maximum value is better than that of the GWO algorithm and the GA algorithm, which shows that under the same test conditions, the average resource utilization of the optimal scheduling sequence obtained by the MIGWO algorithm is higher than that of the GWO and GA algorithms.
[0145] Figure 8 The fitness of the three algorithms The comparison curve of the maximum value with the number of iterations shows that although the three algorithms can converge quickly with the increase of the number of iterations, the MIGWO algorithm converges faster and the fitness of the MIGWO algorithm is better. The final convergence result of the maximum value is better than that of the GWO and GA algorithms, which means that under the same test conditions, the overall effect of the optimal scheduling sequence obtained by the MIGWO algorithm is better than that obtained by the GWO and GA algorithms.
[0146] Combine Figure 6-Figure 8 Analysis shows that the MIGWO algorithm is superior to the GWO algorithm and the GA algorithm in terms of convergence speed, and its ability to jump out of the local optimal solution is significantly enhanced. , fitness and overall fitness The maximum value of MIGWO algorithm is better than GWO algorithm and GA algorithm. The reason why GWO algorithm and GA algorithm have the same fitness is that The maximum value curve fluctuates greatly, and the final optimization results of GWO and GA algorithms are not as good as those of MIGWO algorithm. This is because the overall fitness is the As the optimization target of GWO algorithm and GA algorithm, the overall fitness Medium fitness function The weight of is large, so the fitness and overall fitness Basically keep synchronous optimization, and fitness and fitness There is a certain contradiction between the two optimization objectives, and synchronous optimization cannot be guaranteed. Because the two optimization objectives influence each other during the optimization process, the breadth and freedom of the search cannot be guaranteed, and the probability of finding the optimal solution is reduced, resulting in the maximum values of the two fitness functions being lower than those of the MIGWO algorithm, which also results in the maximum value of the overall fitness value being lower than that of the MIGWO algorithm.
[0147] (3) Comparison of three algorithm scheduling schemes
[0148] Here, all three algorithms select the optimal scheduling sequence. The selection method is: MIGWO algorithm takes the total fitness of all individuals in the new population 4 after the iteration is completed. The individual corresponding to the maximum value is taken as the optimal task scheduling sequence. GWO algorithm and GA algorithm are based on the overall fitness function As the optimization goal, the overall fitness of all individuals in the population after the iteration is completed The individual corresponding to the maximum value is taken as the optimal task scheduling sequence.
[0149] The Gantt chart of the optimal task scheduling sequence of the MIGWO algorithm is as follows Figure 9 As shown, the horizontal axis of the Gantt chart represents time in seconds, the vertical axis represents resources, and each rectangle represents a test task.
[0150] The total execution time of the test tasks in the optimal scheduling sequence using the MIGWO algorithm was 116 seconds, with an average resource utilization rate of 97.09%. Under the same experimental conditions, and taking into account the existence of the solution set, the total execution time of the test tasks in the optimal scheduling sequence for serial testing was calculated as follows: each test task selected the test solution with the shortest test time, and the execution time of all test tasks was added together, resulting in a total execution time of 399 seconds for the serial test. Compared to serial testing, the total execution time of the test tasks using the MIGWO algorithm was reduced by 283 seconds, and test efficiency was improved by 70.9%. The test efficiency calculation formula is as follows: ,
[0151] Where, is the total execution time of the test tasks in the optimal scheduling sequence of serial testing, is the total execution time of the test tasks in the optimal scheduling sequence of the MIGWO algorithm.
[0152] The Gantt chart of the optimal task scheduling sequence of the GWO algorithm is as follows Figure 10 As shown:
[0153] The total execution time of the test tasks in the optimal scheduling sequence of the GWO algorithm is 119 seconds, and the average resource utilization is 86.86%. Compared with the MIGWO algorithm, the total execution time of the test tasks of the GWO algorithm increases by 3 seconds, and the average resource utilization decreases by 10.23%.
[0154] The Gantt chart of the optimal task scheduling sequence of the GA algorithm is as follows Figure 11 As shown:
[0155] The total execution time of the test tasks of the GA algorithm's optimal scheduling sequence is 118 seconds, and the average resource utilization is 88.69%. Compared with the MIGWO algorithm, the total execution time of the GA algorithm's test tasks increased by 2 seconds, and the average resource utilization decreased by 8.4%.
[0156] In summary, the MIGWO algorithm proposed in this application has certain advantages over the GWO algorithm and the GA algorithm in terms of convergence speed and the ability to escape from local optimal solutions; from the perspective of the optimal scheduling sequence, the MIGWO algorithm has obvious improvements over the traditional serial testing method in terms of both the total execution time of test tasks and the average resource utilization, and still has certain improvements compared to the GWO algorithm and the GA algorithm, which fully verifies that the MIGWO algorithm has good testing effects in parallel test task scheduling.
[0157] Compared with the GWO algorithm and genetic algorithm, the method proposed in this application has the following advantages:
[0158] (1) Significantly shortened test time: Experimental data shows that in a scenario with 28 test tasks and 9 test resources, the total test time for serial testing is 399 seconds, while the total time after optimization by the MIGWO algorithm is only 116 seconds, which is a 70.9% improvement in efficiency compared to the currently commonly used serial test. The MIGWO algorithm reduces the test time by 3 seconds and 2 seconds respectively compared to the GWO algorithm (119 seconds) and the genetic algorithm (118 seconds), verifying its advantage in time optimization.
[0159] (2) Improved resource utilization: Experimental data shows that the MIGWO algorithm increases the average resource utilization to 97.09%, while the GWO and GA algorithms are 86.86% and 88.69%, respectively. This improved resource balance reduces instrument idle time and lowers test costs.
[0160] (3) Enhanced convergence speed and robustness: Through dual population independent evolution and neighborhood search strategy, the MIGWO algorithm converges faster and can effectively escape local optimality. Figure 6 The fluctuation range of GWO and GA in . For example, the fitness function The speedup ratio converges to 3.440 in MIGWO, while GWO and GA only reach 3.387 and 3.395, indicating that its global optimization ability is stronger.
[0161] Finally, it should be noted that the above are only preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or make equivalent replacements for some of the technical features therein. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for scheduling parallel test tasks in a distributed test system for multi-target equipment, characterized by: The following steps are involved: Step 1: Use mathematical methods to describe the equipment parallel test task scheduling model; The equipment parallel test task scheduling model includes a test task set, a test resource set, a task resource association matrix, a task constraint matrix, a task time set, a task solution set, and a task scheduling sequence; Step 2: Determine the constraints between the test tasks in the parallel test task scheduling model in step 1 on test timing and resources, as well as the constraints between the test tasks and test resources. Step 3: Determine the fitness function corresponding to the balance between test time and resource utilization, measure the importance of the two optimization goals, and design the overall fitness function; Step 4: Solve the fitness function of step 3 using the improved grey wolf optimization algorithm MIGWO, which specifically includes the following steps: Step 4.1, initial parameter setting: Initialize the population according to the task constraint matrix in step 1 , task resource association matrix , randomly generate a task scheduling sequence that meets the conditions ; Step 4.2, initial population differentiation: the initial population in step 4.1 is divided into and The two fitness functions are divided into two initial sub-populations of equal size, and the two initial sub-populations are divided into two initial sub-populations according to the fitness function. and They each develop independently; Step 4.3, update the individuals in the two initial sub-populations in step 4.2: calculate the fitness values of the two initial sub-populations in step 4.2 respectively, sort them according to the fitness values, and select the top three individuals in each sub-population as the fitness values. 、 、 Wolf, sort the remaining individuals according to their current fitness values and divide them into three intervals with roughly the same number of individuals; Individuals in the interval with low fitness values are cross-linked with the individual with the highest fitness value; individuals in the interval with middle fitness values are cross-linked with the individual with the second highest fitness value; individuals in the interval with high fitness values are cross-linked with the individual with the third highest fitness value; the generated new individuals are checked, duplicate tasks are deleted, and untested tasks are reinserted into unoccupied resources to ensure that the new individuals meet the task scheduling sequence. Requirements: The top three individuals in fitness are regarded as elite individuals and retained in the next cycle; Step 4.4, Field Search: Merge the updated individuals in the two populations in step 4.
3. After merging, each individual in the new population generates a random number between [0,1] and The values are compared, The value is also a randomly generated number between [0,1]. If it is greater than The first type of neighborhood structure search is performed , if less than The second neighborhood structure search is performed , calculate the overall fitness value of the new individuals after performing neighborhood search and the original individuals in the population, retain the individuals with high overall fitness value, check whether the maximum number of cycles is reached, if so, jump to step 4.6, otherwise, jump to step 4.5; Step 4.5, elite merging: After completing the neighborhood search, the population is divided into two new populations of equal size according to the two fitness functions. The two new population individuals are merged with the top 3 elite individuals with the fitness values retained in step 4.3, and then go to step 4.3 for the next cycle; Step 4.6, determine the optimal result: stop the loop, calculate the overall fitness value of all individuals after the neighborhood search, select the individual with the highest overall fitness value as the final optimization result, and record and save the fitness value and task scheduling sequence of the individual.
2. The method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 1, characterized in that: The test task set in step 1 is represented as: , Each test task represents a different type of equipment; The collection of test resources is represented as: , Each test resource represents a different test instrument; The task resource association matrix is expressed as: , yes Matrix, which represents the test resources required by different test tasks during testing. If the test task Existence of test scenarios , taking up test resources ,but If the resource is not occupied, ; The task constraint matrix is expressed as: , is a Matrix, describes the time constraint relationship between different test tasks, and can reflect the execution order of test tasks. , indicating the test task Than test task Execute first, otherwise , indicating the test task and test tasks There is no time constraint between them; The task time set is expressed as: , Represents a test task the time required to complete the test; The task solution set is expressed as: , the task solution set represents the test task The options available; Each test resource can test multiple tasks, and each test task can select different test resources to complete the test. Therefore, the scheduling scheme for parallel test tasks is not unique; The task scheduling sequence is expressed as: , It is a test task In testing resources The way to express the scheduling plan on is a Matrix, rows represent different test resources, columns represent the steps of parallel testing, , Pick Between, indicating Step occupies test resources Test tasks ,if is 0, indicating the Step Testing Resources Not occupied, The test task of step 1 is The test task of the first step is executed first, and each element of the matrix represents the number of a test task at a certain time point.
3. A method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 1 or 2, characterized in that: In step 2, some test tasks have different constraints on test timing and resources. The constraints between test tasks are divided into the following three categories: (1) Resource related: 、 There are two test tasks, and the resources required for testing are 、 If resources 、 There is no intersection between them, so it is called 、 Resource-independent, otherwise resource-dependent; (2) Control related: Set 、 For two test tasks, if The test can determine If they are tested together, Control related to ; Otherwise, it is called control irrelevant; (3) Data related: 、 For two test tasks, if 、 As input and output to each other, 、 Data related; In step 2, the test tasks and test resources must meet the following three constraints: (1) The same test resource can only be occupied by one test task at a time; (2) When the current test task is executed, the occupied resources will be occupied by the task until the test task is completed; (3) The test plan selected for the test task at the same time is unique.
4. The method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 3, characterized in that: The step 3 comprises the following steps: Step 3.1: Determine the objective function based on the constraints in step 2: Objective function: , Basic constraints: The test tasks with higher task priority are tested first, i.e. , ; The two test tasks tested simultaneously avoid resource conflicts, i.e. , ; in, Indicates the total execution time of the test task. Indicates the average utilization of test resources; It is a task scheduling test solution. It is a test task In the test task scheduling scheme The sort number in ; It is a test task exist The test resources required under the sort number; Step 3.2: Design the fitness function based on the total execution time of the test task in step 3.1 : , Where: Indicates the completion time of all task serial tests, fitness function The larger it is, the shorter the total execution time of the test task is; Step 3.3: Design the fitness function based on the average utilization of the test resources in step 3.1 : , Where: Indicates that the test task is in the resource The total time spent on Indicates the minimum total time occupied by all resources, fitness function The larger it is, the more balanced the resource utilization is; Step 3.4: According to the fitness function in step 3.2 and the fitness function in step 3.3 Designing the overall fitness function : , Where: 、 It is a constant and is set according to test experience or actual test requirements.
5. The method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 4, characterized in that: Step 4.1 Task Scheduling Sequence Generate by coding, the specific process is as follows: Task scheduling sequence The first column generation method: in the resource set In accordance with arrive Select resources in the order of task resource association matrix , randomly select a task from the tasks occupying resources , confirm the task All occupied resources in the first column of the task scheduling sequence are filled with the task number in the corresponding row and position , the task All occupied resources are deleted from the resource set; Schedule tasks into sequence The first column has selected tasks from the task set Delete it, regenerate the resource set with full resources, and then schedule the task sequence Generate the second column. The generation method of the second column and subsequent columns is the same as that of the first column. Therefore, the generation process of the first column is repeated until the task set is empty, which means that all test tasks have participated in the test. The remaining positions in the task scheduling sequence are filled with 0; If in the test task, the task include Test scenarios, improved task sets for: , Represents a test task No. Test scheme, improved task correlation matrix for The matrix is as follows: , When generating a task scheduling sequence, if you start with occupied resources Tasks were randomly selected from the , tasks need to be centralized to Delete all and change the task resource association matrix to arrive All columns are set to 0, indicating a task It has been selected to avoid repeating the task later.
6. The method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 4, characterized in that: The PBX cross-connection in step 4.3 is specifically as follows: Individuals with low fitness values and Wolf crossover, individual and fitness values Wolf crossover, individuals with high fitness values and Wolf crossover is used to improve the overall fitness value of the population and increase the diversity of the population. The specific crossover process is as follows: several positions of excellent individuals are selected, the selected positions are inherited to the same positions of the executing individuals, and the remaining unfinished tasks are inserted into the unoccupied resources in sequence starting from the first column according to the resource occupancy relationship until new individuals that meet the task scheduling requirements are generated.
7. The method for scheduling parallel test tasks in a distributed test system for multi-target equipment according to claim 4, characterized in that: The first neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of the two individuals to exchange, check the two new individuals after the exchange, delete the tasks that are repeated in the exchange column, and insert the missing tasks into the unoccupied resources in sequence starting from the first column to generate new individuals that meet the task scheduling requirements.
8. The method for scheduling parallel test tasks in a multi-target equipment distributed test system according to claim 4, characterized in that: The second neighborhood structure search in step 4.4 The details are as follows: randomly select an individual from each population, randomly select a column of one individual and insert it into the column before the column of the same position of the other individual, delete the last column of the inserted individual, perform the same operation on both individuals, check the two new individuals after insertion, delete the tasks that are repeated in the inserted column, and insert the missing tasks into the unoccupied resources in sequence starting from the first column to generate new individuals that meet the task scheduling requirements.
Citation Information
Patent Citations
Test program set generation method and system
CN115390798A
Utilizing a genetic algorithm in applying objective functions to determine distribution times for electronic communications
US20200327419A1