A test task intelligent planning method

By combining graph neural networks and reinforcement learning algorithms, hierarchical collaborative scheduling and real-time dynamic planning are achieved, solving the problems of long testing cycles and resource conflicts in traditional testing methods, and improving testing efficiency and system response speed.

CN119201395BActive Publication Date: 2025-10-14BEIJING JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Traditional serial testing methods have the problems of long testing cycles, improper handling of resource conflicts and timing constraints in weapons and equipment testing, difficulty in achieving dynamic reconstruction, and affecting testing efficiency. In particular, they cannot meet the needs of rapid response when hierarchical scheduling and multiple test items interact.

Method used

The intelligent agents PPO1 and PPO2, which combine graph neural networks and reinforcement learning algorithms, are used for hierarchical collaborative scheduling. Disjunctive graphs are used to express the relationship between test items and artifacts. Multi-threaded programming and unfair locking technology are used to achieve real-time dynamic planning and rescheduling, supporting test resource interruptions and demand changes.

Benefits of technology

It improves test efficiency by 300%-500%, enhances the robustness and response speed of the system, and enables intelligent generation and dynamic reconstruction of test task planning in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201395B_ABST
    Figure CN119201395B_ABST
Patent Text Reader

Abstract

The application discloses a kind of test task intelligent planning method, belong to the technical field of process planning;The scheduling problem is analyzed, a test process is divided into workpiece layer and test item layer, all test items are abstracted as the node of disjunctive graph, respectively using the time sequence constraint relationship between test items and resource occupation constraint as the two kinds of directed edges connected nodes;Using the way of reinforcement learning and graph neural network combination, it has strong generalization ability;Two PPO models are used for hierarchical collaborative scheduling and rescheduling, solving the problem that single model output dimension cannot meet high-dimensional scheduling requirements;Non-fair lock and real-time simulation incentive technology are used for multithread parallel test simulation, reduce high-priority thread waiting time, improve system response speed and robustness;The application uses the above method, test task scheduling and parallel execution, compared with 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 increasingly large, and the testing tasks are becoming increasingly arduous. 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 the processing of timing constraints between test items have all 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 usage requirements, which seriously affects the test efficiency. Summary of the Invention

[0003] The purpose of the present invention is to provide a method for intelligent planning of test tasks, which is oriented to the actual engineering needs of efficient execution and dynamic scheduling of test tasks, performs hierarchical collaborative scheduling of workpieces and internal test items, and constructs 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 under various modes, generate and edit task sequences, and enable test tasks to 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 the 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 using a disjunctive graph. Each artifact is treated as a subgraph, test items in the subgraph are treated as nodes, test information is used as node attributes, and timing constraints and resource usage constraints between test items are used as 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] 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, and the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment. 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 networks and reinforcement learning algorithms. Two scheduling agents, PPO1 and PPO2, are created using a combination of graph neural networks and reinforcement learning algorithms.

[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 idle test stations appear, the PPO2 agent performs station scheduling until there are no idle test stations.

[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 performs station scheduling;

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

[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: Initialize the simulation environment based on the test item list and test resource information in the test file, including creating a test item table, a resource margin list, a test item scheduling completion list, and a remaining test item list. The test item state matrix serves as the state space of the test item scheduling simulation environment. All test items in the remaining test item list that meet timing constraints and resource occupancy constraints at the current scheduling moment serve as the action space of the test item scheduling process.

[0020] The process of creating a workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a list of completed workpieces, and a list of remaining workpieces, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the list of remaining workpieces at the current scheduling moment 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 is established to represent the timing constraint relationship between test items, and a resource occupancy relationship model RE is established to describe the test resource occupancy. The formula is as follows:

[0025]

[0026] In the above formula, tr ij If it is 1, it 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, 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 artifact, test start time, test end time, current test status, and remaining test time;

[0029] Each row of the artifact status matrix represents the attributes 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 the PPO1 agent and the PPO2 agent is as follows:

[0032] Both the PPO1 and PPO2 agents consist of a graph neural network and a reinforcement learning algorithm. The number of input nodes, test items, and output nodes of the graph neural network are consistent. The graph neural network uses a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, 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 serve as the input of the proximal policy optimization algorithm, and outputs the node selection probability based on 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 for policy evaluation.

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

[0035] An 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 parameter update of the agents.

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

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

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

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

[0040] Among them, h Gi Represents the result of pooling all test item information within artifact i. represents the embedding vector obtained after the test item j is updated by the graph neural network for the Kth time, P represents the pooling function, V i Represents the test item set contained in artifact i;

[0041] S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the workpiece embedding vector. 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 that 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 moment, 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 obtain

[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 moment, 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. The selection probability of all test items is output, and 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. The reward value is then calculated using the overall test time as the reward function.

[0056] Preferably, 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:

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

[0058] Step 72: Reset the artifact 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 step 73 and the rescheduling time recorded in step 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, multi-threaded programming technology is adopted in step S7 to create a thread for each workstation for simulation testing, and unfair lock technology is used. Based on real-time simulation incentive technology, changes in test requirements are realized through user interface operations, including reduction of simulated test resources, increase or decrease of test items and workpieces, 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 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; 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 It is a schematic diagram of the modeling method of the present invention;

[0068] Figure 4 This is a schematic diagram 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 generally 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 based on the actual specifications of the device, etc. The specific selection calculation method adopts the existing technology in this 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 the 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 using a disjunctive graph. Each artifact is treated as a subgraph, test items in the subgraph are treated as nodes, test information is used as node attributes, and timing constraints and resource usage constraints between test items are used as 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] 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, and the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment. 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: Initialize the simulation environment based on the test item list and test resource information in the test file, including creating a test item table, a resource margin list, a test item scheduling completion list, and a remaining test item list. The test item state matrix serves as the state space of the test item scheduling simulation environment. All test items in the remaining test item list that meet timing constraints and resource occupancy constraints at the current scheduling moment serve as the action space of the test item scheduling process.

[0083] The process of creating a workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a list of completed workpieces, and a list of remaining workpieces, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the list of remaining workpieces at the current scheduling moment 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 is established to represent the timing constraint relationship between test items, and a resource occupancy relationship model RE is established to describe the test resource occupancy. The formula is as follows:

[0088]

[0089] In the above formula, tr ij If it is 1, it means that test item i has test item j as its predecessor. Otherwise, there is no timing constraint relationship. The test item itself is self-connected, and the diagonal elements are all 1. 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 artifact, test start time, test end time, current test status, and remaining test time;

[0092] Each row of the artifact state matrix represents the attributes 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 networks and reinforcement learning algorithms. Two scheduling agents, PPO1 and PPO2, are created using a combination of graph neural networks and reinforcement learning algorithms.

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

[0095] Both the PPO1 and PPO2 agents consist of a graph neural network and a reinforcement learning algorithm. The number of input nodes, test items, and output nodes of the graph neural network are consistent. The graph neural network uses a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, 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 serve as the input of the proximal policy optimization algorithm, and outputs the node selection probability based on 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 for policy evaluation.

[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 network parameters of the PPO1 and PPO2 agents are updated as follows:

[0098] An 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 parameter update of the agents.

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

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

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

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

[0103] Among them, h Gi Represents the result of pooling all test item information within artifact i. represents the embedding vector obtained after the test item j is updated by the graph neural network for the Kth time, P represents the pooling function, V i Represents the test item set contained in artifact i;

[0104] S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the workpiece embedding vector. 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 inputs to the PPO algorithm. The agent PPO2 outputs the selection probabilities of all workpieces. The workpiece with the largest probability value is selected from all workpieces for scheduling, and the workpiece is placed in the currently idle workstation. The workpiece is then removed from the list of remaining workpieces, added to the workpiece scheduling completion list, and the scheduling workpiece simulation scheduling environment information is updated. The workpiece state matrix, workpiece relationship matrix, and workpiece mask at the next moment are obtained, and the reward value is calculated using the overall test time as the reward function.

[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 the station scheduling is performed; the test item scheduling process is as follows:

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

[0110] Create a test item mask that 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 moment, 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 obtain

[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 moment, 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. The selection probability of all test items is output, and 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. The reward value is then calculated using the overall test time as the reward function.

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

[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] During the test process, rescheduling trigger conditions 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 artifact 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 step 73 and the rescheduling time recorded in step 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, changes in test requirements are realized through user interface operations, including reduction of simulated test resources, increase and decrease of test items and workpieces, 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 involving multiple aircraft, each aircraft requires a test station. Each test item within the aircraft requires test resources such as test equipment, power supplies, and cranes. These resources are capped, and each test item's resource usage must not exceed that cap. There are also timing constraints between test items, meaning that test item B cannot begin until test item A completes.

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

[0131] The test item list stores all 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 artifact.

[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 order must be met between the test items within each aircraft. 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. The test process modeling is based on the disjunctive graph, and a test process is divided into the artifact layer and the test item layer, where the test station is used as the aircraft layer resource, and other types of test resources are occupied by the test items. Each test item is a node in the graph, and there are two types of edge connection relationships. The first is to connect through the front and back timing constraints, with the direction of the edge from the parent node to the child node and a weight of 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 is established to represent the timing constraint relationship between test items, and a resource occupancy relationship model RE is established to describe the test resource occupancy. Assuming that there are currently 4 test items, the matrix is ​​represented as follows.

[0136]

[0137] where tr ij If it is 1, it 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 test item i and test item j have no resource occupation conflict, otherwise it means that the two 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 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 margin 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 meet 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 spliced ​​together as input to 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 the workpiece 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 a test item, the reset function resets the simulation scheduling environment, and the reward function calculates the reward value obtained for the current action. The reward function is calculated as the negative of the overall test time. The step function is designed to implement 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. Based on the current scheduling time and the test item time, the start and end test times of the test item are calculated. It then enters the next scheduling time and updates the information at the corresponding position in the state space. Then, the resource margin list is updated, the test item is removed from the list of remaining test items, and added to the scheduling completion list. Finally, the updated test item state matrix, reward function, test item relationship matrix, and test item mask are returned.

[0153] For workpieces, the reset and reward functions perform the same function. The step function takes the workpiece selected by the PPO2 agent as input and places it in the currently idle workstation. It then removes the workpiece from the remaining workpiece list, adds it to the completed workpiece scheduling list, and updates the workpiece state matrix. Finally, it returns the updated workpiece state matrix, reward function, workpiece relationship matrix, and workpiece mask.

[0154] The PPO2 model is called to select workpieces and place them at the corresponding workstations based on the scheduling status information. Once all workstations have been filled, the PPO1 model is called to perform mixed scheduling of the test items for each workpiece tested at all workstations. Idle workstations, rescheduling, and test completion are then determined in sequence. If any idle workstations exist, the PPO2 model is called to select workpieces from the remaining workstations and place them there, until no idle workstations remain.

[0155] If there is a situation that requires rescheduling due to resource interruption, addition or deletion of test items, etc., 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 ends.

[0156] Therefore, the present invention adopts a test task intelligent planning method, which uses a combination of reinforcement learning and graph neural networks, can give full play to the advantages of strong information extraction ability of graph neural networks 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 high-dimensional scheduling requirements; 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 solutions of the present invention rather than to limit the same. 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 solutions of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A test task intelligent planning method, characterized by: The following steps are involved: S1: Get the 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 using a disjunctive graph. Each artifact is treated as a subgraph, test items in the subgraph are treated as nodes, test information is used as node attributes, and timing constraints and resource usage constraints between test items are used as 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. 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, and the artifact state matrix and the artifact relationship matrix at the initial scheduling time are obtained from the artifact scheduling simulation environment. The test item state matrix and the artifact state matrix are updated with the scheduling time. S3: Test process planning based on graph neural networks and reinforcement learning algorithms. Two scheduling agents, PPO1 and PPO2, are created using a combination of graph neural networks and reinforcement learning algorithms. 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 idle test stations appear, the PPO2 agent performs station scheduling until there are no idle test stations. S5: When all test stations are occupied, the PPO1 agent schedules the test items in sequence until an idle test station appears, and then performs station scheduling; S6: Repeat the above steps S4-S5 in a loop until all test items of all workpieces are completed, and record and save the test plan; 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: Initialize the simulation environment based on the test item list and test resource information in the test file, including creating a test item table, a resource margin list, a test item scheduling completion list, and a remaining test item list. The test item state matrix serves as the state space of the test item scheduling simulation environment. All test items in the remaining test item list that meet timing constraints and resource occupancy constraints at the current scheduling moment serve as the action space of the test item scheduling process. The process of creating a workpiece scheduling simulation environment is as follows: obtain the number of workpieces and workstations in the test file, create a workstation list, a list of completed workpieces, and a list of remaining workpieces, use the workpiece state matrix as the state space of the workpiece scheduling simulation environment, and use the list of remaining workpieces at the current scheduling moment 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 is established to represent the timing constraint relationship between test items, and a resource occupancy relationship model RE is established to describe the test resource occupancy. The formula is as follows: In the above formula, tr ij If it is 1, it means that test item i has test item j as its predecessor. Otherwise, there is no timing constraint relationship. The test item itself is self-connected, and the diagonal elements are all 1. 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 artifact, test start time, test end time, current test status, and remaining test time; Each row of the artifact status matrix represents the attributes 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 the PPO1 agent and the PPO2 agent is as follows: Both the PPO1 and PPO2 agents consist of a graph neural network and a reinforcement learning algorithm. The number of input nodes, test items, and output nodes of the graph neural network are consistent. The graph neural network uses a graph isomorphism network, and the reinforcement learning algorithm uses a proximal policy optimization algorithm, 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 serve as the input of the proximal policy optimization algorithm, and outputs the node selection probability based on 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 for policy evaluation. The parameter update process of PPO1 agent and PPO2 agent is as follows: An 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 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 as follows: For agent PPO2, create a workpiece mask that records whether the workpiece can be scheduled at the current moment. The workpiece state matrix is ​​converted into the workpiece embedding vector. The conversion process is as follows: The embedding vector of the artifact is obtained according to the following steps: S41: Divide the disjunctive graph composed of all test items into several subgraphs according to the artifacts to which they belong. Each subgraph represents a set of test items belonging to the artifact. Perform average pooling on the divided test item sets in turn. The average pooling formula is as follows: Among them, h Gi Represents the result of pooling all test item information within artifact i. represents the embedding vector obtained after the test item j is updated by the graph neural network for the Kth time, P represents the pooling function, V i Represents the test item set contained in artifact i; S42: The pooled information of the workpiece is calculated using a fully connected network to obtain the workpiece embedding vector. The formula is as follows: s I represents the final embedding vector representation of workpiece 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 that 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 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 moment, 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 obtain 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 moment, 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. The selection probability of all test items is output, and 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. The reward value is then calculated using the overall test time as the reward function.

6. A test task intelligent planning method according to claim 5, characterized in that: In step S7, 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 workpieces. The specific rescheduling process is as follows: Step 71: Record the current scheduling time and test progress information; Step 72: Reset the artifact 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 step 73 and the rescheduling time recorded in step 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. The method for intelligent planning of test tasks 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, changes in test requirements are realized through user interface operations, including reduction of simulated test resources, increase and decrease of test items and workpieces, as rescheduling trigger conditions.

Citation Information

Patent Citations

  • 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