Intelligent test task planning method

Through an agent combining graph neural network and reinforcement learning algorithm, dynamic optimization and rescheduling of test resources are achieved, solving the problem of inefficiency of traditional test task planning methods and improving the execution efficiency and flexibility of test tasks.

CN119201395AActive Publication Date: 2024-12-27BEIJING JIAOTONG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411309327.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2024-12-27
Estimated Expiration
2044-09-19

AI Technical Summary

Technical Problem

Traditional test task planning methods are inefficient in the face of dynamic changes and multi-system collaborative testing, and cannot achieve dynamic reconstruction, resulting in a long test cycle and cannot meet the requirements of rapid demand changes.

Method used

An agent combining graph neural network and reinforcement learning algorithm is adopted to realize dynamic optimization and rescheduling of test resources through hierarchical collaborative scheduling and multi-threaded parallel simulation, supporting real-time reconstruction of test sequences.

Benefits of technology

It improves the execution efficiency of test tasks, can realize intelligent generation and dynamic reconstruction in complex environments, and improves the testing efficiency of 300%-500% compared with traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201395A_ABST
    Figure CN119201395A_ABST
Patent Text Reader

Abstract

The invention discloses a test task intelligent planning method, and belongs to the technical field of process planning. Analyzing a scheduling problem, dividing a test process into a workpiece layer and a test item layer, abstracting all test items as nodes of a disjunction graph, and respectively using a time sequence constraint relationship and a resource occupation constraint between the test items as two types of directed edges for connecting the nodes; the mode of combining reinforcement learning and the graph neural network is used, and the generalization ability is high; the two PPO models are used for hierarchical collaborative scheduling and rescheduling, and the problem that the output dimension of a single model cannot meet the high-dimensional scheduling requirement is solved; a non-fair lock and real-time simulation excitation technology is used for performing multi-thread parallel test simulation, so that the waiting time of a high-priority thread is shortened, and the response speed and robustness of the system are improved; according to the method, test task scheduling and parallel execution are carried out, and compared with a traditional serial test method, the test efficiency can be improved by 300%-500%.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of process planning, and in particular to a test task intelligent planning method. Background Art

[0002] With the rapid development of electronic information technology in the field of weapons and equipment, the scale of weapons and equipment testing is becoming larger and larger, and the testing tasks are becoming more and more onerous. However, the traditional serial testing method has a long test cycle for a single system. The order of test station occupancy between systems, resource conflicts (occupied or idle) of test items, and timing constraint processing between test items have become bottlenecks that restrict test efficiency. Especially when it comes to scheduling activities that require layering and data interaction between multiple test items, traditional test task planning methods often cannot achieve dynamic reconstruction of the test process. During the test process, if the test requirements change, it is often necessary to re-plan or the rescheduling time is too long to meet the use requirements, which seriously affects the test efficiency. Summary of the invention

[0003] The purpose of the present invention is to provide a test task intelligent planning method, facing the actual engineering needs of efficient execution and dynamic scheduling of test tasks, hierarchical collaborative scheduling of workpieces and internal test items, and constructing a real-time dynamic planning test technology with high robustness for dynamic disturbances and failure conditions that may occur during the test process. It supports test resource interruptions, increase and decrease of test items during the execution of the test sequence, and automatically optimizes the execution sequence according to actual conditions, and finally realizes complete rescheduling of the test process. It can adapt to intelligent test task planning in various modes, generate and edit task sequences, so that test tasks can be intelligently generated, efficiently executed and dynamically reconstructed in complex environments.

[0004] To achieve the above object, the present invention provides a test task intelligent planning method, comprising the following steps:

[0005] S1: Get a test file, which includes several test item lists and test resource lists;

[0006] The test item list includes the test item name, identification code, test time, test item resource usage list, timing constraints between test items and the corresponding artifacts;

[0007] The test resource list includes resource name, resource type, identification code and resource upper limit;

[0008] The resource types include test stations and test equipment;

[0009] S2: Divide the test file into the artifact layer and the test item layer, and create a test item scheduling simulation environment and an artifact scheduling simulation environment respectively;

[0010] The two scheduling simulation environments are expressed in the form of disjunctive graphs. Each artifact is a subgraph, the test items in the subgraph are nodes of the graph, the test information is node attributes, and the timing constraints and resource occupancy constraints between test items are two types of directed edges. The test item relationship matrix, test item status matrix, artifact relationship matrix and artifact status matrix at the initial scheduling time are obtained.

[0011] Among them, the test item state matrix and the test item relationship matrix at the initial scheduling time are obtained from the test item scheduling simulation environment, the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment, and the test item state matrix and the artifact state matrix are updated with the scheduling time;

[0012] S3: Test process planning based on graph neural network and reinforcement learning algorithm. Two scheduling agents are created by combining graph neural network and reinforcement learning algorithm, including PPO1 agent and PPO2 agent.

[0013] The PPO1 agent interacts with the current test item scheduling environment, and the output of the PPO1 agent is the selection probability of all test items; the PPO2 agent interacts with the current workpiece scheduling environment, and the output of the PPO2 agent is the selection probability of all workpieces; during the interaction process, when the number of interactions reaches the preset condition, the network parameters of the PPO1 agent and the PPO2 agent are updated;

[0014] S4: The interaction process in step S3 is as follows: planning is performed based on discrete time. When an idle test station appears, the PPO2 agent performs station scheduling until there is no idle test station;

[0015] S5: When all test stations are occupied, the PPO1 agent schedules the test items in sequence until an idle test station appears, and then the station scheduling is performed;

[0016] S6: Repeat the above steps S4-S5 in a loop until all test items of all workpieces are completed, and the test plan is recorded and saved;

[0017] S7: Design and implement test simulation of the test plan based on multi-threaded programming technology, load the obtained test plan to simulate the test process, use unfair lock technology to improve the real-time performance of the test simulation, and use real-time simulation incentives to change test requirements and trigger rescheduling.

[0018] Preferably, the specific process in step S2 is as follows:

[0019] The process of creating a test item scheduling simulation environment is as follows: initialization operations are performed on the simulation environment according to the test item list and test resource information in the test file, including creating a test item table, creating a resource margin list, creating a test item scheduling completion list and a remaining test item list, using the test item state matrix as the state space of the test item scheduling simulation environment, and all test items in the remaining test item list at the current scheduling moment that meet the timing constraints and resource occupancy constraints as the action space of the test item scheduling process;

[0020] The creation process of the workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a workpiece scheduling completion list, and a remaining workpiece list, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the remaining workpiece list at the current scheduling time as the action space of the workpiece scheduling process;

[0021] The process of obtaining the test item relationship matrix, artifact relationship matrix, test status matrix, and artifact status matrix is ​​as follows:

[0022] The formula for the test item relationship matrix is ​​as follows:

[0023] T=TR+RE

[0024] Among them, a model TR for representing the timing constraint relationship between test items and a resource occupancy relationship model RE for describing the test resource occupancy are established. The formula is as follows:

[0025]

[0026] In the above formula, tr ij 1 means that test item i has test item j as a prerequisite, otherwise there is no timing constraint relationship, the test item itself is self-connected, and the diagonal elements are all 1; re ij 0 means that there is no resource conflict between test item i and test item j. ij 1 means that the two occupy the same resource, where re ij The value of represents the occupancy rate of the resource by test item j;

[0027] The workpiece relationship matrix is ​​represented by the unit matrix;

[0028] The process of establishing the test item status matrix is ​​as follows: Each row of the test item status matrix represents the attributes of a test item node, including test time, test resource usage, belonging workpiece, start test time, end test time, current test status, and remaining test time;

[0029] Each row of the artifact state matrix represents the attribute of an artifact node, which is represented by the average sum of the attributes of all test items contained in the artifact.

[0030] Preferably, the specific process of step S3 is as follows:

[0031] The process of building PPO1 and PPO2 agents is as follows:

[0032] Both the PPO1 agent and the PPO2 agent are composed of two parts: a graph neural network and a reinforcement learning algorithm. The number of input nodes, the number of test items, and the number of output nodes of the graph neural network are consistent. The graph neural network adopts a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, which is represented by the PPO algorithm. The graph neural network converts the test item state matrix and the workpiece state matrix into corresponding embedding vector representations. The corresponding embedding vectors are used as the input of the proximal policy optimization algorithm, and the node selection probability is output according to the node information.

[0033] The proximal policy optimization algorithm consists of an Actor network and a Critic network. The Actor network is used to fit the scheduling policy, and the Critic network is used to evaluate the policy.

[0034] The parameter update process of PPO1 agent and PPO2 agent is as follows:

[0035] The update threshold is set, and the two agents interact with their respective environments and accumulate experience. The experience is stored in the experience pool, which is a structure that stores interaction information. The two agents use the data in their respective experience pools to calculate the loss function and gradient respectively to achieve the parameter update of the agents.

[0036] Preferably, the process of workpiece scheduling in step S4 is specifically as follows:

[0037] For the agent PPO2, a workpiece mask is created. The workpiece mask records whether the workpiece can be scheduled at the current moment. The workpiece state matrix is ​​converted into the embedding vector of the workpiece. The conversion process is as follows:

[0038] The embedding vector of the artifact is obtained according to the following steps:

[0039] S41: The disjunctive graph composed of all test items is divided into several subgraphs according to the artifacts to which they belong. Each subgraph represents a test item set belonging to the artifact. The divided test item sets are average pooled in turn. The average pooling formula is as follows:

[0040] Among them, h Gi It represents the result of pooling all the test items in artifact i. represents the embedding vector of the test item j after the Kth update of the graph neural network, P represents the pooling function, V i Represents the set of test items contained in artifact i;

[0041] S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the embedding vector of the workpiece. The formula is as follows:

[0042]

[0043] s I represents the final embedding vector representation of artifact I, is a nonlinear function implemented by a fully connected network;

[0044] The embedding vectors of all workpieces and the corresponding workpiece masks are used as the input of the PPO algorithm, and the intelligent agent PPO2 outputs the selection probability of all workpieces; the workpiece with the largest probability value is selected from all workpieces for scheduling, and the workpiece is placed in the current idle workstation. Then the workpiece is removed from the list of remaining workpieces, added to the workpiece scheduling completion list and the scheduling workpiece simulation scheduling environment information is updated to obtain the workpiece state matrix, workpiece relationship matrix and workpiece mask at the next moment, and then the overall test time is used as the reward function to calculate the reward value.

[0045] Preferably, in step S5, the process of PPO1 performing test item scheduling is as follows:

[0046] Create a test item mask, which records whether the test item at the current moment can be scheduled. Use a graph neural network to convert the test item relationship matrix into an embedding vector of the test item. The formula is as follows:

[0047]

[0048] represents the test item embedding vector obtained after the k-th update of test item j. The information used in the update process includes the k-1-th attribute of test item j and the k-th attributes of all related test items. The cumulative sum of (k) is a parameter that can be updated by the network, ξ j (j) represents all other test items related to test item j, is the original attribute of the test item j input into the graph neural network at the current scheduling time, Represents a nonlinear transformation of the input vector, implemented by a fully connected neural network;

[0049] Then calculate the overall information of all test item nodes and use the average pooling method to get

[0050]

[0051] Among them, V represents the set of all test item nodes, P represents the pooling function, It means adding the attributes of all test items after the kth update and multiplying them by 1 / |V| to calculate their average value;

[0052] Finally, the attribute information, overall information and resource margin information of each node are concatenated to obtain the embedded vector representation of each test item:

[0053]

[0054] s j represents the embedding vector representation of test item j, is a nonlinear function implemented by a neural network, R free Represents the set of all resource margin information at the current scheduling time, h G is the overall information of all test item nodes obtained in the previous step, || means concatenating vectors to form a new vector;

[0055] The test item relationship matrix, the embedding vector of the test item node and the corresponding test item mask are used as the input of the reinforcement learning algorithm, and the selection probability of all test items is output. The test item with the largest probability value is selected from all test items for scheduling, the scheduling environment information is updated and the test item state matrix at the next moment is obtained. Then, the overall test time is used as the reward function to calculate the reward value.

[0056] Preferably, in step S7, the rescheduling triggering conditions during the test process include reduction of test equipment, addition or deletion of test items, addition or deletion of workpieces, and the specific rescheduling process is as follows:

[0057] Step 71: Record the current scheduling time and test progress information;

[0058] Step 72: Reset the workpiece scheduling environment and the test item scheduling environment according to the latest test process file;

[0059] Step 73: Load the scheduled information according to the test progress information recorded in step 71 to obtain the rescheduling status;

[0060] Step 74: Based on the rescheduling state obtained in 73 and the rescheduling time recorded in 71, use PPO1 and PPO2 agents to completely reschedule the unscheduled nodes. Except for the different starting conditions, the complete rescheduling process is consistent with the general scheduling process.

[0061] Preferably, in step S7, multi-threaded programming technology is adopted to create a thread for each workstation for simulation testing, and unfair lock technology is used. Based on real-time simulation incentive technology, test requirement changes are realized through user interface operations, including simulation test resource reduction, test items and workpiece increase and decrease, as rescheduling trigger conditions.

[0062] Therefore, the present invention adopts the above-mentioned test task intelligent planning method, which has the following advantages:

[0063] (1) In the present invention, the combination of reinforcement learning and graph neural network can give play to the advantages of strong information extraction ability of graph neural network and online decision-making of reinforcement learning, and has strong generalization ability; two PPO models are used for hierarchical collaborative scheduling and rescheduling, which solves the problem that the output dimension of a single model cannot meet the requirements of high-dimensional scheduling; unfair locks and real-time simulation incentive technology are used for multi-threaded parallel test simulation, which reduces the waiting time of high-priority threads and improves the system response speed and robustness; the method described in this application is used for test task scheduling and parallel execution, which can improve the test efficiency by 300%-500% compared with the traditional serial test method.

[0064] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] Figure 1 It is a schematic diagram of the overall process of the present invention;

[0066] Figure 2 It is a schematic diagram of the test process composition of this application;

[0067] Figure 3 is a schematic diagram of the modeling method of the present invention;

[0068] Figure 4 It is a schematic diagram of the composition of the test task intelligent planning algorithm of the present invention;

[0069] Figure 5 is a flowchart of hierarchical collaborative scheduling and complete rescheduling of the present invention;

[0070] Figure 6 This is a method based on unfair locks and real-time simulation incentives adopted in an embodiment of the present invention. DETAILED DESCRIPTION

[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, 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 part of the embodiments of the present invention, not all of the embodiments. The components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations. The specific model specifications need to be selected and determined according to the actual specifications of the device, and the specific selection calculation method adopts the existing technology in the field, so it will not be described in detail.

[0072] Example

[0073] like Figure 1 As shown, the present invention provides a test task intelligent planning method, comprising the following steps:

[0074] S1: Get a test file, which includes several test item lists and test resource lists;

[0075] The test item list includes the test item name, identification code, test time, test item resource usage list, timing constraints between test items and the corresponding artifacts;

[0076] The test resource list includes resource name, resource type, identification code and resource upper limit;

[0077] The resource types include test stations and test equipment;

[0078] S2: Divide the test file into the artifact layer and the test item layer, and create a test item scheduling simulation environment and an artifact scheduling simulation environment respectively;

[0079] The two scheduling simulation environments are expressed in the form of disjunctive graphs. Each artifact is a subgraph, the test items in the subgraph are nodes of the graph, the test information is node attributes, and the timing constraints and resource occupancy constraints between test items are two types of directed edges. The test item relationship matrix, test item status matrix, artifact relationship matrix and artifact status matrix at the initial scheduling time are obtained.

[0080] Among them, the test item state matrix and the test item relationship matrix at the initial scheduling time are obtained from the test item scheduling simulation environment, the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment, and the test item state matrix and the artifact state matrix are updated with the scheduling time;

[0081] The specific process in step S2 is as follows:

[0082] The process of creating a test item scheduling simulation environment is as follows: initialization operations are performed on the simulation environment according to the test item list and test resource information in the test file, including creating a test item table, creating a resource margin list, creating a test item scheduling completion list and a remaining test item list, using the test item state matrix as the state space of the test item scheduling simulation environment, and all test items in the remaining test item list at the current scheduling moment that meet the timing constraints and resource occupancy constraints as the action space of the test item scheduling process;

[0083] The creation process of the workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a workpiece scheduling completion list, and a remaining workpiece list, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the remaining workpiece list at the current scheduling time as the action space of the workpiece scheduling process;

[0084] The process of obtaining the test item relationship matrix, artifact relationship matrix, test status matrix, and artifact status matrix is ​​as follows:

[0085] The formula for the test item relationship matrix is ​​as follows:

[0086] T=TR+RE

[0087] Among them, a model TR for representing the timing constraint relationship between test items and a resource occupancy relationship model RE for describing the test resource occupancy are established. The formula is as follows:

[0088]

[0089] In the above formula, tr ij 1 means that test item i has test item j as a prerequisite, otherwise there is no timing constraint relationship, the test item itself is self-connected, and the diagonal elements are all 1; re ij 0 means that there is no resource conflict between test item i and test item j. ij 1 means that the two occupy the same resource, where re ij The value of represents the occupancy rate of the resource by test item j;

[0090] The workpiece relationship matrix is ​​represented by the unit matrix;

[0091] The process of establishing the test item status matrix is ​​as follows: Each row of the test item status matrix represents the attributes of a test item node, including test time, test resource usage, belonging workpiece, start test time, end test time, current test status, and remaining test time;

[0092] Each row of the artifact state matrix represents the attribute of an artifact node, which is represented by the average sum of the attributes of all test items contained in the artifact;

[0093] S3: Test process planning based on graph neural network and reinforcement learning algorithm. Two scheduling agents are created by combining graph neural network and reinforcement learning algorithm, including PPO1 agent and PPO2 agent.

[0094] The process of building PPO1 and PPO2 agents is as follows:

[0095] Both the PPO1 agent and the PPO2 agent are composed of two parts: a graph neural network and a reinforcement learning algorithm. The number of input nodes, the number of test items, and the number of output nodes of the graph neural network are consistent. The graph neural network adopts a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, which is represented by the PPO algorithm. The graph neural network converts the test item state matrix and the workpiece state matrix into corresponding embedding vector representations. The corresponding embedding vectors are used as the input of the proximal policy optimization algorithm, and the node selection probability is output according to the node information.

[0096] The proximal policy optimization algorithm consists of an Actor network and a Critic network. The Actor network is used to fit the scheduling policy, and the Critic network is used to evaluate the policy.

[0097] The PPO1 agent interacts with the current test item scheduling environment, and the output of the PPO1 agent is the selection probability of all test items; the PPO2 agent interacts with the current workpiece scheduling environment, and the output of the PPO2 agent is the selection probability of all workpieces; during the interaction process, when the number of interactions reaches the preset condition, the process of updating the network parameters of the PPO1 agent and the PPO2 agent is as follows:

[0098] The update threshold is set, and the two agents interact with their respective environments and accumulate experience. The experience is stored in the experience pool, which is a structure that stores interaction information. The two agents use the data in their respective experience pools to calculate the loss function and gradient respectively to achieve the parameter update of the agents.

[0099] S4: The interaction process in step S3 is as follows: Planning is performed based on discrete time. When an idle test station appears, the PPO2 agent performs station scheduling until there is no idle test station. The scheduling process is as follows:

[0100] For the agent PPO2, a workpiece mask is created. The workpiece mask records whether the workpiece can be scheduled at the current moment. The workpiece state matrix is ​​converted into the embedding vector of the workpiece. The conversion process is as follows:

[0101] The embedding vector of the artifact is obtained according to the following steps:

[0102] S41: The disjunctive graph composed of all test items is divided into several subgraphs according to the artifacts to which they belong. Each subgraph represents a test item set belonging to the artifact. The divided test item sets are average pooled in turn. The average pooling formula is as follows:

[0103] Among them, h Gi It represents the result of pooling all the test items in artifact i. represents the embedding vector of the test item j after the Kth update of the graph neural network, P represents the pooling function, V i Represents the set of test items contained in artifact i;

[0104] S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the embedding vector of the workpiece. The formula is as follows:

[0105]

[0106] s I represents the final embedding vector representation of artifact I, is a nonlinear function implemented by a fully connected network;

[0107] The embedding vectors of all workpieces and the corresponding workpiece masks are used as the input of the PPO algorithm, and the agent PPO2 outputs the selection probability of all workpieces; the workpiece with the largest probability value is selected from all workpieces for scheduling, and the workpiece is placed in the current idle workstation, and then the workpiece is removed from the remaining workpiece list, added to the workpiece scheduling completion list and the scheduling workpiece simulation scheduling environment information is updated to obtain the workpiece state matrix, workpiece relationship matrix and workpiece mask at the next moment, and then the overall test time is used as the reward function to calculate the reward value;

[0108] S5: When all test stations are occupied, the PPO1 agent schedules the test items in sequence until an idle test station appears, and then schedules the station; the scheduling process of the test items is as follows:

[0109] The process of scheduling test items is as follows:

[0110] Create a test item mask, which records whether the test item at the current moment can be scheduled. Use a graph neural network to convert the test item relationship matrix into an embedding vector of the test item. The formula is as follows:

[0111]

[0112] represents the test item embedding vector obtained after the k-th update of test item j. The information used in the update process includes the k-1-th attribute of test item j and the k-th attributes of all related test items. The cumulative sum of (k) is a parameter that can be updated by the network, ξ j (j) represents all other test items related to test item j, is the original attribute of the test item j input into the graph neural network at the current scheduling time, Represents a nonlinear transformation of the input vector, implemented by a fully connected neural network;

[0113] Then calculate the overall information of all test item nodes and use the average pooling method to get

[0114]

[0115] Among them, V represents the set of all test item nodes, P represents the pooling function, It means adding the attributes of all test items after the kth update and multiplying them by 1 / |V| to calculate their average value;

[0116] Finally, the attribute information, overall information and resource margin information of each node are concatenated to obtain the embedded vector representation of each test item:

[0117]

[0118] s j represents the embedding vector representation of test item j, is a nonlinear function implemented by a neural network, R free Represents the set of all resource margin information at the current scheduling time, h G is the overall information of all test item nodes obtained in the previous step, || means concatenating vectors to form a new vector;

[0119] The test item relationship matrix, the embedding vector of the test item node and the corresponding test item mask are used as the input of the reinforcement learning algorithm, and the selection probability of all test items is output. The test item with the largest probability value is selected from all test items for scheduling, the scheduling environment information is updated and the test item state matrix at the next moment is obtained. Then, the overall test time is used as the reward function to calculate the reward value.

[0120] S6: Repeat the above steps S4-S5 in a loop until all test items of all workpieces are completed, and the test plan is recorded and saved;

[0121] S7: Design and implement test simulation of the test plan based on multi-threaded programming technology, load the obtained test plan to simulate the test process, use unfair lock technology to improve the real-time performance of the test simulation, and use real-time simulation incentives to change test requirements and trigger rescheduling.

[0122] The rescheduling trigger conditions during the test process include the reduction of test equipment, the addition or deletion of test items, and the addition or deletion of artifacts. The specific rescheduling process is as follows:

[0123] Step 71: Record the current scheduling time and test progress information;

[0124] Step 72: Reset the workpiece scheduling environment and the test item scheduling environment according to the latest test process file;

[0125] Step 73: Load the scheduled information according to the test progress information recorded in step 71 to obtain the rescheduling status;

[0126] Step 74: Based on the rescheduling state obtained in 73 and the rescheduling time recorded in 71, use PPO1 and PPO2 agents to completely reschedule the unscheduled nodes. Except for the different starting conditions, the complete rescheduling process is consistent with the general scheduling process.

[0127] In step S7, multi-threaded programming technology is adopted to create a thread for each workstation for simulation testing. Unfair lock technology is used. Based on real-time simulation incentive technology, test requirement changes are realized through user interface operations, including simulation test resource reduction, test items and workpiece increase and decrease, as rescheduling trigger conditions.

[0128] In the specific scheduling process, multi-threaded programming technology is adopted, the test artifact is set as an aircraft, a thread is created for each workstation for simulation testing, and unfair lock technology is used. Based on real-time simulation incentive technology, test requirement changes are realized through user interface operations, including simulation test resource reduction, increase and decrease of test items and artifacts, as rescheduling trigger conditions.

[0129] The specific usage process is as follows: Figure 2 For a test process consisting of multiple aircraft, each aircraft needs to occupy a test station. Each test item inside the aircraft needs to use test resources such as test equipment, power supply, crane, etc. There is an upper limit for test resources, and the occupancy of each test item for test resources must not exceed the upper limit of the test resources. There are timing constraints between test items, that is, test item B can only be tested after test item A is completed.

[0130] Each test process is saved in a json file, which includes two parts: one is the test item list and the other is the test resource list.

[0131] The test item list stores all the test items of the test process. Each test item includes the test item name, identification code, test time, resource usage list, prerequisite test items and the corresponding artifacts.

[0132] The test resource list includes resource name, resource type, identification code and resource upper limit;

[0133] The resource types include test stations and test equipment;

[0134] refer to Figure 3 , the test items within each aircraft need to meet the test sequence. At the same time, each test item occupies a part of a specific test resource, and there may be resource occupation conflicts between different test items. Based on the disjunctive graph, the test process is modeled and a test process is divided into the artifact layer and the test item layer. The test station is used as an aircraft layer resource, and other types of test resources are occupied by test items. Each test item is a node of the graph, and there are two types of edge connection relationships. The first is to connect through the front and back timing constraints. The direction of the edge is from the parent node to the child node, and the weight is 1; the second is to use the proportion of the resource occupied by the other node between the test items occupying the same test resource as the weight of the directed edge.

[0135] A model TR for representing the timing constraint relationship between test items and a resource occupancy relationship model RE for describing the test resource occupancy are established. Assuming that there are currently 4 test items, the matrix is ​​represented as follows.

[0136]

[0137] where tr ij 1 means that test item i has test item j as a prerequisite, otherwise there is no timing constraint relationship. The test item itself has self-connection, so the diagonal elements are all 1. ij If it is 0, it means that there is no resource conflict between test item i and test item j. Otherwise, it means that the two items occupy the same resource. ij The value of represents the occupancy rate of the resource by test item j. The test item relationship matrix T is represented by TR+RE.

[0138] refer to Figure 4 The test task intelligent planning algorithm as a whole is composed of reinforcement learning algorithm and graph neural network. The input of the graph neural network is the attribute information of each test item and the test resource surplus information. The test item attribute information includes static information (test time, pre-test items, resource usage, and belonging workpieces) and dynamic information (start test time, end test time, current test status, and remaining test time). The nodes in the graph neural network include the currently completed scheduling nodes ( Figure 4 Nodes with a median value of 1), unschedulable nodes that do not meet the test resource occupancy and timing constraints ( Figure 4 Nodes with a median value of 0), and schedulable nodes that satisfy the constraints ( Figure 4 The remaining nodes in the

[0139] The graph node update formula is:

[0140] The full-image pooling formula is:

[0141]

[0142]

[0143] The sub-graph pooling formula is:

[0144]

[0145] The node information, resource information and full graph information are concatenated as the input of the test item layer scheduling network:

[0146]

[0147] Use all sub-graph pooling results as input to the artifact layer scheduling network

[0148]

[0149] The reinforcement learning hierarchical scheduling strategy takes the embedding vector output by the graph neural network as input and uses two PPO algorithm networks to respectively implement the binding decision of the workpiece-test station pair and the test item selection decision.

[0150] refer to Figure 5 ,The hierarchical collaborative scheduling and complete rescheduling of the test process are ,implemented by two PPO models. The test file input algorithm ,completes the initialization of the test process by parsing the ,test process data, and establishes the simulation scheduling environment of ,workpieces and test items respectively.

[0151] For the calculation process at the simulation level, the details are as follows. Both simulation scheduling environments include the following functions: reset function, reward function, and step function;

[0152] For the test item, the reset function resets the simulation scheduling environment, and the reward function is used to calculate the reward value obtained by the current action. The calculation method of the reward function is the negative of the overall test time. The step function is designed to realize the interaction between the PPO1 agent and the test item environment. The input of the step function is the test item selected by the PPO1 agent. According to the current scheduling time and the test item time, the start test time and the end test time of the test item are calculated. Then enter the next scheduling time and update the information at the corresponding position in the state space. Then, update the resource surplus list, remove the test item from the remaining test item list, and add it to the scheduling completion list. Finally, return the updated test item state matrix, reward function, test item relationship matrix and test item mask.

[0153] For workpieces, the reset function and reward function have the same function. The input of the step function is the workpiece selected by the PPO2 agent, and the workpiece is placed in the current idle station. Then the workpiece is removed from the remaining workpiece list, added to the workpiece scheduling completion list, and the workpiece state matrix is ​​updated. Finally, the updated workpiece state matrix, reward function, workpiece relationship matrix, and workpiece mask are returned.

[0154] The PPO2 model is called to select workpieces and place them at the corresponding stations according to the scheduling status information. When all stations have been placed with workpieces, the PPO1 model is called to perform mixed scheduling of the test items of each workpiece tested at all stations. Then, idle stations, rescheduling, and test completion judgments are performed in sequence. If there are idle stations, the PPO2 model is called to select workpieces from the remaining workpieces and place them at idle stations until there are no idle stations.

[0155] If there is a situation where resources are interrupted, test items are added or deleted, etc. and rescheduling is required, the artifact and test item scheduling environment will be reinitialized according to the current test process information, but the scheduling information before the rescheduling time needs to be retained; if the remaining set to be tested is empty, it means that the test process scheduling is completed and this scheduling is ended.

[0156] Therefore, the present invention adopts a test task intelligent planning method, which uses a combination of reinforcement learning and graph neural network, can give full play to the advantages of strong information extraction ability of graph neural network and online decision-making of reinforcement learning, and has strong generalization ability; uses two PPO models for hierarchical collaborative scheduling and rescheduling, which solves the problem that the output dimension of a single model cannot meet the requirements of high-dimensional scheduling; uses unfair locks and real-time simulation incentive technology to perform multi-threaded parallel test simulation, reduces the waiting time of high-priority threads, and improves the system response speed and robustness; uses the method described in this application to schedule and execute test tasks in parallel, which can improve the test efficiency by 300%-500% compared with traditional serial testing methods.

[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.

Claims

1. A test task intelligent planning method, characterized in that: The following steps are involved: S1: Get a test file, which includes several test item lists and test resource lists; The test item list includes the test item name, identification code, test time, test item resource usage list, timing constraints between test items and the corresponding artifacts; The test resource list includes resource name, resource type, identification code and resource upper limit; The resource types include test stations and test equipment; S2: Divide the test file into the artifact layer and the test item layer, and create a test item scheduling simulation environment and an artifact scheduling simulation environment respectively; The two scheduling simulation environments are expressed in the form of disjunctive graphs. Each artifact is a subgraph, the test items in the subgraph are nodes of the graph, the test information is node attributes, and the timing constraints and resource occupancy constraints between test items are two types of directed edges. The test item relationship matrix, test item status matrix, artifact relationship matrix and artifact status matrix at the initial scheduling time are obtained. Among them, the test item state matrix and the test item relationship matrix at the initial scheduling time are obtained from the test item scheduling simulation environment, the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment, and the test item state matrix and the artifact state matrix are updated with the scheduling time; S3: Test process planning based on graph neural network and reinforcement learning algorithm. Two scheduling agents are created by combining graph neural network and reinforcement learning algorithm, including PPO1 agent and PPO2 agent. The PPO1 agent interacts with the current test item scheduling environment, and the output of the PPO1 agent is the selection probability of all test items; the PPO2 agent interacts with the current workpiece scheduling environment, and the output of the PPO2 agent is the selection probability of all workpieces; during the interaction process, when the number of interactions reaches the preset condition, the network parameters of the PPO1 agent and the PPO2 agent are updated; S4: The interaction process in step S3 is as follows: planning is performed based on discrete time. When an idle test station appears, the PPO2 agent performs station scheduling until there is no idle test station; S5: When all test stations are occupied, the PPO1 agent schedules the test items in sequence until an idle test station appears, and then the station scheduling is performed; S6: Repeat the above steps S4-S5 in a loop until all test items of all workpieces are completed, and the test plan is recorded and saved; S7: Design and implement test simulation of the test plan based on multi-threaded programming technology, load the obtained test plan to simulate the test process, use unfair lock technology to improve the real-time performance of the test simulation, and use real-time simulation incentives to change test requirements and trigger rescheduling.

2. A test task intelligent planning method according to claim 1, characterized in that: The specific process in step S2 is as follows: The process of creating a test item scheduling simulation environment is as follows: initialization operations are performed on the simulation environment according to the test item list and test resource information in the test file, including creating a test item table, creating a resource margin list, creating a test item scheduling completion list and a remaining test item list, using the test item state matrix as the state space of the test item scheduling simulation environment, and all test items in the remaining test item list at the current scheduling moment that meet the timing constraints and resource occupancy constraints as the action space of the test item scheduling process; The creation process of the workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a workpiece scheduling completion list, and a remaining workpiece list, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the remaining workpiece list at the current scheduling time as the action space of the workpiece scheduling process; The process of obtaining the test item relationship matrix, artifact relationship matrix, test status matrix, and artifact status matrix is ​​as follows: The formula for the test item relationship matrix is ​​as follows: T=TR+RE Among them, a model TR for representing the timing constraint relationship between test items and a resource occupancy relationship model RE for describing the test resource occupancy are established. The formula is as follows: In the above formula, tr ij 1 means that test item i has test item j as a prerequisite, otherwise there is no timing constraint relationship, the test item itself is self-connected, and the diagonal elements are all 1; re ij 0 means that there is no resource conflict between test item i and test item j. ij 1 means that the two occupy the same resource, where re ij The value of represents the occupancy rate of the resource by test item j; The workpiece relationship matrix is ​​represented by the unit matrix; The process of establishing the test item status matrix is ​​as follows: Each row of the test item status matrix represents the attributes of a test item node, including test time, test resource usage, belonging workpiece, start test time, end test time, current test status, and remaining test time; Each row of the artifact state matrix represents the attribute of an artifact node, which is represented by the average sum of the attributes of all test items contained in the artifact.

3. A test task intelligent planning method according to claim 2, characterized in that: The specific process of step S3 is as follows: The process of building PPO1 and PPO2 agents is as follows: Both the PPO1 agent and the PPO2 agent are composed of two parts: a graph neural network and a reinforcement learning algorithm. The number of input nodes, the number of test items, and the number of output nodes of the graph neural network are consistent. The graph neural network adopts a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, which is represented by the PPO algorithm. The graph neural network converts the test item state matrix and the workpiece state matrix into corresponding embedding vector representations. The corresponding embedding vectors are used as the input of the proximal policy optimization algorithm, and the node selection probability is output according to the node information. The proximal policy optimization algorithm consists of an Actor network and a Critic network. The Actor network is used to fit the scheduling policy, and the Critic network is used to evaluate the policy. The parameter update process of PPO1 agent and PPO2 agent is as follows: The update threshold is set, and the two agents interact with their respective environments and accumulate experience. The experience is stored in the experience pool, which is a structure that stores interaction information. The two agents use the data in their respective experience pools to calculate the loss function and gradient respectively to achieve the parameter update of the agents.

4. A test task intelligent planning method according to claim 3, characterized in that: The process of workpiece scheduling in step S4 is specifically as follows: For the agent PPO2, a workpiece mask is created. The workpiece mask records whether the workpiece can be scheduled at the current moment. The workpiece state matrix is ​​converted into the embedding vector of the workpiece. The conversion process is as follows: The embedding vector of the artifact is obtained according to the following steps: S41: The disjunctive graph composed of all test items is divided into several subgraphs according to the artifacts to which they belong. Each subgraph represents a test item set belonging to the artifact. The divided test item sets are average pooled in turn. The average pooling formula is as follows: Among them, h Gi It represents the result of pooling all the test items in artifact i. represents the embedding vector of the test item j after the Kth update of the graph neural network, P represents the pooling function, V i Represents the set of test items contained in artifact i; S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the embedding vector of the workpiece. The formula is as follows: s I represents the final embedding vector representation of artifact I, is a nonlinear function implemented by a fully connected network; The embedding vectors of all workpieces and the corresponding workpiece masks are used as the input of the PPO algorithm, and the intelligent agent PPO2 outputs the selection probability of all workpieces; the workpiece with the largest probability value is selected from all workpieces for scheduling, and the workpiece is placed in the current idle workstation. Then the workpiece is removed from the list of remaining workpieces, added to the workpiece scheduling completion list and the scheduling workpiece simulation scheduling environment information is updated to obtain the workpiece state matrix, workpiece relationship matrix and workpiece mask at the next moment, and then the overall test time is used as the reward function to calculate the reward value.

5. A test task intelligent planning method according to claim 4, characterized in that: In step S5, the process of PPO1 performing test item scheduling is as follows: Create a test item mask, which records whether the test item at the current moment can be scheduled. Use a graph neural network to convert the test item relationship matrix into an embedding vector of the test item. The formula is as follows: represents the test item embedding vector obtained after the k-th update of test item j. The information used in the update process includes the k-1-th attribute of test item j and the k-th attributes of all related test items. The cumulative sum of (k) is a parameter that can be updated by the network, ξ j (j) represents all other test items related to test item j, is the original attribute of the test item j input into the graph neural network at the current scheduling time, Represents a nonlinear transformation of the input vector, implemented by a fully connected neural network; Then calculate the overall information of all test item nodes and use the average pooling method to get Among them, V represents the set of all test item nodes, P represents the pooling function, It means adding the attributes of all test items after the kth update and multiplying them by 1 / |V| to calculate their average value; Finally, the attribute information, overall information and resource margin information of each node are concatenated to obtain the embedded vector representation of each test item: s j represents the embedding vector representation of test item j, is a nonlinear function implemented by a neural network, R free Represents the set of all resource margin information at the current scheduling time, h G is the overall information of all test item nodes obtained in the previous step, || means concatenating vectors to form a new vector; The test item relationship matrix, the embedding vector of the test item node and the corresponding test item mask are used as the input of the reinforcement learning algorithm, and the selection probability of all test items is output. The test item with the largest probability value is selected from all test items for scheduling, the scheduling environment information is updated and the test item state matrix at the next moment is obtained. Then, the overall test time is used as the reward function to calculate the reward value.

6. A test task intelligent planning method according to claim 5, characterized in that: In step S7, the rescheduling triggering conditions during the test process include the reduction of test equipment, the addition or deletion of test items, and the addition or deletion of workpieces. The specific rescheduling process is as follows: Step 71: Record the current scheduling time and test progress information; Step 72: Reset the workpiece scheduling environment and the test item scheduling environment according to the latest test process file; Step 73: Load the scheduled information according to the test progress information recorded in step 71 to obtain the rescheduling status; Step 74: Based on the rescheduling state obtained in 73 and the rescheduling time recorded in 71, use PPO1 and PPO2 agents to completely reschedule the unscheduled nodes. Except for the different starting conditions, the complete rescheduling process is consistent with the general scheduling process.

7. A test task intelligent planning method according to claim 6, characterized in that: In step S7, multi-threaded programming technology is adopted to create a thread for each workstation for simulation testing. Unfair lock technology is used. Based on real-time simulation incentive technology, test requirement changes are realized through user interface operations, including simulation test resource reduction, test items and workpiece increase and decrease, as rescheduling trigger conditions.

Citation Information

Patent Citations

  • Flexible job shop scheduling method based on multilayer deep reinforcement learning

    CN114912826A

  • Intelligent planning method for combat resource cross-domain allocation problem

    CN116187787A

  • Method for solving job shop scheduling problem based on generative adversarial imitation learning

    CN116796964A

  • DAG task scheduling method and apparatus, device, and storage medium

    WO2023241000A1