| Multi-task parallel testing can effectively improve the testing efficiency of automatic testing system.However,in the multi-task parallel test environment,due to the existence of instrument competition and preemption among test tasks,it may cause test data interference,which may lead to incorrect fault diagnosis results of the system.In addition,the parallel execution of test tasks may also cause thread deadlock issues,leading to system stagnation.In response to the above issues,the main research contents of this thesis include:(1)In order to facilitate the realization of the parallel automatic test system,this thesis first improves the universal realization method of the automatic test system.Therefore,this thesis analyzes and summarizes the commonality and difference among various test step types in the automatic test strategy,designs a unified data structure for these test steps,and organizes them into a tree structure.The data structure can not only clearly express the hierarchy and dependencies among test steps,but also provide guidance for the execution of parallel test task threads.Based on this data structure,this thesis designs a function that supports user built testing strategies,thereby improving the universal implementation method of automatic testing systems.(2)In order to achieve the goal of multi-task parallel testing,this thesis designs a program that starts multi-task threads in the main thread of the system,and parses the user-built test strategy into a thread function that runs the program.The design method of the thread function is to traverse from the root node of the automatic test strategy tree until reaching a certain leaf node in the tree.And during the traversal process,according to the instrument control information stored in the currently traversed node,call the driver of the corresponding instrument to realize the control of the instrument,or execute the corresponding judgment operation according to the fault judgment information stored in the node.(3)In order to avoid the problem of test data interference caused by the preemption of instrument resources by parallel execution of test tasks,this thesis adopts a thread lock mechanism to ensure that test task threads can exclusively use the instrument.(4)In order to prevent the system from stagnating due to thread deadlock,this thesis implements deadlock prevention by destroying the circular waiting condition in the necessary conditions for deadlock.The specific implementation method is to logically number the test instruments,and the test task thread obtains the right to use the instruments according to the sequence of numbers.In order to realize the sequential acquisition of instruments,this thesis uses a quick sort algorithm to sort the logical numbers of the instruments.Through experimental verification and user feedback,the parallel automatic test system program designed in this thesis has successfully increased the test efficiency by more than 30%,and the test data interference and thread deadlock problems did not occur.In addition,the system also has a good ability to support user-built test strategies. |