A Distributed Testing Method and Apparatus for UAV Flight Control Computer Based on DAG
By adopting a DAG-based distributed testing method, which utilizes static allocation and dynamic scheduling of multi-node collaborative work, the problem of node status being easily affected in UAV flight control computer testing is solved, achieving efficient test coverage and resource utilization, and ensuring the real-time performance and reliability of the test.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HARBIN INST OF TECH
- Filing Date
- 2021-12-27
- Publication Date
- 2026-05-05
AI Technical Summary
During testing, the UAV flight control computer suffers from issues such as node status being easily affected and uneven resource allocation, making it difficult to meet strict combinational and timing logic constraints. A single test node cannot meet the test performance requirements.
A DAG-based distributed testing method is adopted, which utilizes the DAG task scheduling model for static allocation and dynamic scheduling through the collaborative work of multiple test nodes and management nodes to ensure the timing synchronization of test cases and resource utilization. An ant colony algorithm is used for dynamic adjustment.
It improves the computing efficiency and test coverage of the UAV autonomous and controllable computing platform, ensures the real-time performance and reliability of the test, dynamically allocates resources to adapt to changes in node load, and improves test efficiency.
Smart Images

Figure CN116414671B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of testing, specifically relating to a distributed testing method for UAV flight control computers based on DAG. Background Technology
[0002] The flight control computer of an unmanned aerial vehicle (UAV) is a highly complex, real-time embedded system. It comprises both software systems (flight control software, operating system, etc.) and hardware circuits (high-performance processors, fiber optic communication chips, etc.). During its operation, it is subject to strict constraints on the combinational and sequential logic of the coordinated operation of the software and hardware. Especially for near-field unmanned aerial vehicles (UAVs) characterized by long operating cycles and complex, variable operating environments, thorough testing of their flight control computers during the development phase is crucial.
[0003] In UAV testing systems, there are numerous instances where constraints exist between the values of the same sensor parameter and between different sensor parameters. Ignoring these constraints can render the generated test stimulus data invalid and even reduce test coverage. Furthermore, UAV flight control computers have strict timing requirements for multi-task scheduling. The input order of different parameters and the input of the same parameter with the same value at different times will lead to different processing results. If a single test node is used for processing, the single-machine test mode, which is often limited by the upper limit of the test tool, will be completely unable to meet the performance requirements of the UAV testing system. Summary of the Invention
[0004] This invention provides a distributed testing method for UAV flight control computers based on DAG, which solves the problems of easy influence from node states and uneven distribution of node resources in the current UAV hardware-in-the-loop simulation test platform test case scheduling. In other words, it solves the problem that the combinational logic and timing logic of UAV flight control computers are strictly constrained and difficult to handle.
[0005] This invention provides a distributed testing device for UAV flight control computers based on DAG.
[0006] This invention provides a computer device.
[0007] This invention provides a non-transitory computer-readable storage medium.
[0008] This invention is achieved through the following technical solution:
[0009] A distributed testing method for UAV flight control computers based on DAG, the distributed testing method comprising the following steps:
[0010] Step 1: Build a distributed testing system;
[0011] Step 2: Based on the distributed testing system in Step 1, construct a DAG task scheduling model;
[0012] Step 3: Based on the DAG task scheduling model in Step 2, perform static allocation before scheduling;
[0013] Step 4: Based on the DAG task scheduling model from Step 2 and the allocated static tasks, implement dynamic scheduling.
[0014] Furthermore, in step 1, the distributed testing system is built by connecting multiple test nodes to the management node via a bus. Test cases are input through the intranet bus and allocated and scheduled by the execution engine of each test node. The test nodes maintain time synchronization through communication strategies.
[0015] Furthermore, when a test node in the system fails, the execution engines of the remaining test nodes will immediately adjust the scheduling method of the test cases.
[0016] Once the faulty test node recovers, it will immediately request a synchronization signal from the intranet to synchronize the status of each test node in the current system, thereby restoring the status of the entire system.
[0017] Furthermore, the construction of the DAG task scheduling model in step 2 specifically includes the following steps:
[0018] Suppose a distributed testing system contains N test nodes and the test tasks to be assigned contain M test cases;
[0019] The test tasks to be assigned are represented as G = (T, E, R, W), where: T is the vertex set {T} in the task set. i};E is the set of directed edges {E i}; R is the set of execution times for fixed-point tasks {R i}; W is the set of timing costs between test cases {W i};
[0020] Assuming that the communication cost between tasks assigned to the same processing core is zero, after a task is completed, the newly generated data is sent to all its successor nodes;
[0021] The objective f of task scheduling is represented as follows:
[0022] f:{T i}→{C i}, i=0, 1, 2,..., j=0, 1, 2,...
[0023] The target f of task scheduling must satisfy the following: max is the system resource utilization rate, and min is the total system running time.
[0024] Furthermore, the static allocation in step 3 specifically includes the following steps:
[0025] Step 3.1: Generate test cases using the DAG task scheduling model, thus forming a test case database;
[0026] Step 3.2: Extract the set of test cases to be tested from the test case database in Step 3.1;
[0027] Step 3.3: Based on the test case set to be tested in Step 3.2, parse each test case;
[0028] Step 3.4: Perform the first screening and segmentation of the test cases parsed in Step 3.3;
[0029] Step 3.5: Based on the filtering and segmentation in Step 3.4, form a classification subset t. f ,t p ,t t The corresponding subset size is n f ,n p ,n t ;
[0030] Step 3.6: Based on the roulette wheel algorithm, from the subset t in Step 3.5... f ,t p ,t t Choose the size and number of (n) respectively f ,n p ,n t If the test cases are grouped into a set of N, then the first batch of test case entity sets testlisi1, testlisi2, ..., testlisi N ;
[0031] Step 3.7: Evaluate the completeness of the test cases using formula (1).
[0032]
[0033] Where d i For the completeness of the i-th test case, The sum of real numbers representing the descriptive values of all the above factors, max(D) is the maximum value among all the descriptive values of the above factors, and α is a user-defined scaling parameter;
[0034] Step 3.8: Evaluate the complexity of the test cases using formula (2).
[0035]
[0036] Where r i This indicates the completeness of the i-th test case. R represents the sum of real numbers representing the descriptive power of all the factors above, max(R) represents the maximum value among all the descriptive power of the factors above, and β is a user-defined scaling parameter.
[0037] Step 3.9: Use formula (3) to evaluate the priority of test cases.
[0038] V i =V i TRI *W TRI +V i TRC *W TRC ……………………………..(3)
[0039] Where V i TRI V i TRC W represents the requirement completeness and requirement complexity of the i-th test case, respectively. TRI W TRC These represent the weights for the completeness and complexity of test case requirements, respectively.
[0040] Step 3.10: Perform a second round of screening of test cases. Based on the principle that the higher the priority, the higher the priority, the test cases in the set are sorted to form the second batch of test case entity sets.
[0041] Step 3.11: Assign test tasks. Once the test nodes are deployed, distribute the assigned tasks to each node using a non-preemptive allocation strategy.
[0042] Furthermore, the dynamic scheduling in step 4 specifically involves,
[0043] Step 4.1: Initialize pheromones using the ant colony algorithm;
[0044] Step 4.2: Based on the pheromone from Step 1, select test case task1 for the ant colony, and find the dependent tasks of task1 in TDD. k ;
[0045] Step 4.3: If task1 from step 4.2 exists and a test node has been assigned, proceed to step 4.4; if task1 does not exist and no test node has been assigned, proceed to step 4.5.
[0046] Step 4.4: Assign task 1 to task 1 k Same test node;
[0047] Step 4.5: Construct the solution;
[0048] Step 4.6: Based on steps 4.4 and 4.5, update the local pheromone of the test node;
[0049] Step 4.7: Based on step 4.6, update the pheromones of the test cases;
[0050] Step 4.8: Repeat steps 4.2-4.7 until test nodes are assigned to all test cases;
[0051] Step 4.9: Calculate whether the test nodes allocated for the test cases in Step 4.8 are optimal. If they are optimal, proceed to Step 4.10. If they are not optimal, return to Step 4.2 and repeat the ant colony algorithm.
[0052] Step 4.10: Update the minimum execution time of the test cases;
[0053] Step 4.11: Based on the results of step 4.10, update the global pheromone of the test node;
[0054] Step 4.12: Check if the iteration conditions are met. If not, return to (4-6); if met, proceed to step 4.13.
[0055] Step 4.13: Output the test case allocation for the test nodes.
[0056] A distributed testing device for UAV flight control computers based on DAG, the testing device comprising multiple test nodes and management nodes.
[0057] The test node is used to process test cases and output the processing results to the UAV flight control computer.
[0058] Implement management nodes to monitor the status of each test node, ensure timing synchronization between test nodes, and perform static allocation and dynamic scheduling of test cases.
[0059] A computer device includes a memory and a processor, the memory storing a computer program, and the processor implementing the steps of any of the methods described above when processing the computer program.
[0060] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0061] The beneficial effects of this invention are:
[0062] This invention improves the computing efficiency of the autonomous and controllable computing platform for unmanned aerial vehicles (UAVs); static scheduling can maximize the resource utilization of test nodes while ensuring reasonable load on test nodes; dynamic allocation can update the allocation direction of test cases in real time based on changes in the load of test nodes, thereby improving the efficiency and reliability of testing. Attached Figure Description
[0063] Figure 1 This is a distributed node deployment diagram of the test system of the present invention.
[0064] Figure 2 This is a schematic diagram of a DAG diagram example of the present invention.
[0065] Figure 3 This is a basic flowchart of the static allocation of test cases in this invention.
[0066] Figure 4 This is a diagram of the test case execution node allocation mechanism based on the ant colony algorithm of the present invention.
[0067] Figure 5 This is a schematic diagram of the method of the present invention. Detailed Implementation
[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0069] A distributed testing method for UAV flight control computers based on DAG, the distributed testing method comprising the following steps:
[0070] Step 1: Build a distributed testing system; consisting of T0, T1, ... T N-1 Distributed testing systems can effectively solve the problems of slow testing speed and low coverage of single test nodes by setting up multiple test nodes.
[0071] Step 2: Based on the distributed testing system in Step 1, construct a DAG task scheduling model. The task scheduling model describes the scheduled tasks in an abstract way. The task scheduling model carries the necessary information for task scheduling, such as task type, running time, and inter-task dependencies.
[0072] Step 3: Based on the DAG task scheduling model in Step 2, perform static allocation before scheduling;
[0073] Step 4: Based on the DAG task scheduling model from Step 2 and the allocated static tasks, implement dynamic scheduling.
[0074] A distributed testing method for UAV flight control computers based on DAG (Directed Acyclic Graph) is disclosed. Step 1 involves building a distributed testing system, specifically: multiple test nodes are connected to a management node via a bus; test cases are input via an intranet bus and allocated and scheduled by the execution engines of each test node; a reasonable number of test cases are allocated to each test node (this allocation is based on the processing power of the test node and the complexity of the test cases; generally, test nodes with stronger processing power are assigned more test cases. Alternatively, if many simple test cases are assigned to a certain node, then that test node will also bear more test case tasks); and the test nodes maintain time synchronization through a communication strategy.
[0075] A distributed testing method for UAV flight control computers based on DAG is proposed. When a test node in the system fails and is unable to receive test cases due to downtime or network anomalies, the execution engines of the remaining test nodes will immediately adjust the scheduling method of the test cases to ensure the real-time performance and accuracy of test case processing as much as possible.
[0076] Once the faulty test node recovers, it will immediately request a synchronization signal from the intranet to synchronize the status of each test node in the current system, thereby restoring the status of the entire system.
[0077] A distributed testing method for UAV flight control computers based on DAG, wherein the construction of the DAG task scheduling model in step 2 specifically includes the following steps:
[0078] Suppose a distributed testing system contains N test nodes and the test tasks to be assigned contain M test cases;
[0079] The test tasks to be assigned are represented as G = (T, E, R, W), where: T is the vertex set {T} in the task set. i};E is the set of directed edges {E i}; R is the set of execution times for fixed-point tasks {R i}; W is the set of timing costs between test cases {W i};
[0080] Tasks are executed in a non-preemptive manner. For a given task, it can only run after all its predecessor task nodes have finished running.
[0081] Assuming that the communication cost between tasks allocated on the same processing core is zero, non-preemptive task scheduling has been proven to be NP-complete compared to preemptive task scheduling; after a task completes its execution, it sends the newly generated data to all its successor nodes.
[0082] Figure 2 It is a DAG graph containing 12 tasks, with each rectangle representing a task vertex T. i Each vertex consists of two parts, where T i Let i represent task i, located in T. i The number below represents the execution time R(T) of task i. i The number attached to each directed edge represents the time cost W(T) between two task vertices. i ,T j ).
[0083] (2-5) can be described by a function f, which represents the goal of task scheduling. Through this function, tasks are assigned to various processing cores, while satisfying the maximum system resource utilization and the minimum overall execution time.
[0084] A function f can be used to describe the goal of task scheduling. Through this function, tasks are allocated to various processing cores while maximizing system resource utilization and minimizing overall execution time.
[0085] The objective f of task scheduling is represented as follows:
[0086] f:{T i}→{C i}, i = 0, 1, 2, ..., j = 0, 1, 2, ...
[0087] The target f of task scheduling must satisfy the following: max is the system resource utilization rate, and min is the total system running time.
[0088] A distributed testing method for UAV flight control computers based on DAG, wherein the static allocation in step 3 specifically includes the following steps.
[0089] Step 3.1: Generate test cases using the DAG task scheduling model, thus forming a test case database;
[0090] Step 3.2: Extract the set of test cases to be tested from the test case database in Step 3.1;
[0091] Step 3.3: Based on the test case set to be tested in Step 3.2, parse each test case to obtain data such as type, runtime, and resource consumption.
[0092] Step 3.4: Perform the first screening and segmentation of the test cases parsed in Step 3.3;
[0093] Step 3.5: Based on the filtering and segmentation in Step 3.4, form a classification subset t. f ,t p,t t The corresponding subset size is n f ,n p ,n t ;
[0094] Step 3.6: Based on the roulette wheel algorithm, from the subset t in Step 3.5... f ,t p ,t t Choose the size and number of (n) respectively f ,n p ,n t If the test cases are grouped into a set of N, then the first batch of test case entity sets testlisi1, testlisi2, ..., testlisi N ;
[0095] Step 3.7: Evaluate the completeness of the test cases using formula (1).
[0096]
[0097] Where d i For the completeness of the i-th test case, The sum of real numbers representing the descriptive values of all the above factors, max(D) is the maximum value among all the descriptive values of the above factors, and α is a user-defined scaling parameter;
[0098] Step 3.8: Evaluate the complexity of the test cases using formula (2).
[0099]
[0100] Where r i This indicates the completeness of the i-th test case. R represents the sum of real numbers representing the descriptive power of all the factors above, max(R) represents the maximum value among all the descriptive power of the factors above, and β is a user-defined scaling parameter.
[0101] Step 3.9: Use formula (3) to evaluate the priority of test cases.
[0102] V i =V i TRI *W TRI +V i TRC *W TRC ……………………………..(3)
[0103] Where V i TRI V i TRCW represents the requirement completeness and requirement complexity of the i-th test case, respectively. TRI W TRC These represent the weights for the completeness and complexity of test case requirements, respectively.
[0104] Step 3.10: Perform a second round of screening for test cases (after evaluating the priority of test cases using a formula, screen them according to their priority). Sort the test cases in the set according to the principle that the higher the priority, the higher the priority to select, to form the second batch of test case entity sets.
[0105] Step 3.11: Allocate test tasks (referring to the test case entity set after the second round of screening). After the test nodes are deployed (i.e., based on the distributed test system built in Step 1), distribute the divided tasks to each node using a non-preemptive allocation strategy.
[0106] A distributed testing method for UAV flight control computers based on DAG, wherein the dynamic scheduling in step 4 specifically involves using an ant colony algorithm to dynamically allocate test case nodes under strong real-time testing tasks. The flowchart is shown below. Figure 4 As shown,
[0107] Step 4.1: Initialize pheromones using the ant colony algorithm;
[0108] Step 4.2: Based on the pheromone from Step 1, select test case task1 for the ant colony, and find the dependent tasks of task1 in TDD. k ;
[0109] Step 4.3: If task1 from step 4.2 exists and a test node has been assigned, proceed to step 4.4; if task1 does not exist and no test node has been assigned, proceed to step 4.5.
[0110] Step 4.4: Assign task 1 to task 1 k Same test node;
[0111] Step 4.5: Construct the solution (i.e., the solution of the ant colony algorithm);
[0112] Step 4.6: Based on steps 4.4 and 4.5, update the local pheromone of the test node;
[0113] Step 4.7: Based on step 4.6, update the pheromones of the test cases;
[0114] Step 4.8: Repeat steps 4.2-4.7 until test nodes are assigned to all test cases;
[0115] Step 4.9: Calculate whether the test nodes allocated for the test cases in Step 4.8 are optimal. If they are optimal, proceed to Step 4.10. If they are not optimal, return to Step 4.2 and repeat the ant colony algorithm.
[0116] Step 4.10: Update the minimum execution time of the test cases;
[0117] Step 4.11: Based on the results of step 4.10, update the global pheromone of the test node;
[0118] Step 4.12: Check if the iteration conditions are met. If not, return to (4-6); if met, proceed to step 4.13.
[0119] Step 4.13: Output the test case allocation for the test nodes.
[0120] A distributed testing device for UAV flight control computers based on DAG, the testing device comprising multiple test nodes and management nodes.
[0121] The test node is used to process test cases and output the processing results to the UAV flight control computer.
[0122] Implement management nodes to monitor the status of each test node, ensure timing synchronization between test nodes, and perform static allocation and dynamic scheduling of test cases.
[0123] A computer device includes a memory and a processor, the memory storing a computer program, and the processor implementing the steps of any of the methods described above when processing the computer program.
[0124] A non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.
[0125] By building a distributed testing environment, four independently operating computers are connected via a local area network and bus to achieve resource sharing, decentralized operation, centralized management, collaborative work, load balancing, and test process monitoring. Distributed testing systems are characterized by networking, distribution, openness, real-time operation, dynamism, handling of uncertainty, and high reliability, enabling them to flexibly complete testing tasks under various complex environments. Therefore, by rationally designing the test task scheduling algorithm in a distributed testing system, the problem of high requirements for combinational and sequential logic in testing systems can be effectively solved.
Claims
1. A distributed testing method for UAV flight control computers based on DAG, characterized in that, The distributed testing method includes the following steps: Step 1: Build a distributed testing system; Step 2: Based on the distributed testing system in Step 1, construct a DAG task scheduling model; Step 3: Based on the DAG task scheduling model in Step 2, perform static allocation before scheduling; Step 4: Based on the DAG task scheduling model from Step 2 and the already allocated static tasks, implement dynamic scheduling; The construction of the DAG task scheduling model in step 2 specifically includes the following steps: Suppose a distributed testing system contains N test nodes and the test tasks to be assigned contain M test cases; The test tasks to be assigned are represented as follows: Where: T is the set of vertices in the task set. E is the set of directed edges. R is the set of execution times for fixed-point tasks. W is the set of timing costs between test cases. ; Assuming that the communication cost between tasks assigned to the same processing core is zero, after a task is completed, the newly generated data is sent to all its successor nodes; The objective f of task scheduling is represented as follows: The target f of task scheduling must satisfy the following: max is the system resource utilization rate, and min is the total system running time. The static allocation in step 3 specifically includes the following steps: Step 3.1: Generate test cases using the DAG task scheduling model, thus forming a test case database; Step 3.2: Extract the set of test cases to be tested from the test case database in Step 3.1; Step 3.3: Based on the test case set to be tested in Step 3.2, parse each test case; Step 3.4: Perform the first screening and segmentation of the test cases parsed in Step 3.3; Step 3.5: Based on the filtering and segmentation in Step 3.4, form a classification subset. The size of the corresponding subset is ; Step 3.6: Based on the roulette wheel algorithm, from the subset of Step 3.5 The number of sizes selected respectively is The test cases are composed of a set, thus obtaining the first batch of test case entity sets. , ,… ; Step 3.7: Evaluate the completeness of the test cases using formula (1). …………………………………….(1) in For the completeness of the i-th test case, The sum of real numbers representing the descriptive degree of the integrity factors. This represents the maximum descriptive value of the completeness factor. The scaling parameter is user-defined; Step 3.8: Use formula (2) to evaluate the complexity of the test cases. …………………………………….(2) in This indicates the completeness of the i-th test case. The sum of real numbers representing the descriptive degree of complexity factors. This represents the maximum descriptive value of the complexity factors. The scaling parameter is user-defined; Step 3.9: Use formula (3) to evaluate the priority of test cases. ……………………………..(3) in , These represent the requirement completeness and requirement complexity of the i-th test case, respectively. , These represent the weights for the completeness and complexity of test case requirements, respectively. Step 3.10: Perform a second round of screening of test cases. Based on the principle that the higher the priority, the higher the priority, the test cases in the set are sorted to form the second batch of test case entity sets. Step 3.11: Assign test tasks. Once the test nodes are deployed, distribute the assigned tasks to each node using a non-preemptive allocation strategy.
2. The distributed testing method for UAV flight control computer based on DAG according to claim 1, characterized in that, Step 1, building a distributed testing system, specifically involves multiple test nodes connected to a management node via a bus, test cases being input via an intranet bus and allocated and scheduled by the execution engine of each test node, allocating a reasonable number of test cases to each test node, and maintaining time synchronization between the test nodes through a communication strategy.
3. The distributed testing method for UAV flight control computer based on DAG according to claim 2, characterized in that, When a test node in the system fails, the execution engines of the other test nodes will immediately adjust the scheduling method of the test cases. Once the faulty test node recovers, it will immediately request a synchronization signal from the intranet to synchronize the status of each test node in the current system, thereby restoring the status of the entire system.
4. The distributed testing method for UAV flight control computer based on DAG according to claim 1, characterized in that, The dynamic scheduling in step 4 specifically involves, Step 4.1: Initialize pheromones using the ant colony algorithm; Step 4.2: Select test cases for the ant colony based on the pheromones from Step 1. Searching in TDD Dependency ; Step 4.3, if step 4.2 is... If a test node exists and has been assigned, proceed to step 4.
4. If no test node exists and has not been assigned, proceed to step 4.5; Step 4.4, for Allocation and Same test node; Step 4.5: Construct the solution; Step 4.6: Based on steps 4.4 and 4.5, update the local pheromone of the test node; Step 4.7: Based on step 4.6, update the pheromones of the test cases; Step 4.8: Repeat steps 4.2-4.7 until test nodes are assigned to all test cases; Step 4.9: Calculate whether the test nodes allocated for the test cases in Step 4.8 are optimal. If they are optimal, proceed to Step 4.
10. If they are not optimal, return to Step 4.2 and repeat the ant colony algorithm. Step 4.10: Update the minimum execution time of the test cases; Step 4.11: Based on the results of step 4.10, update the global pheromone of the test node; Step 4.12: Check if the iteration conditions are met. If not, return to step 4.6; if met, proceed to step 4.
13. Step 4.13: Output the test case allocation for the test nodes.
5. The distributed testing device for UAV flight control computer based on DAG according to claim 3, characterized in that, The testing device includes multiple testing nodes and management nodes. The test node is used to process test cases and output the processing results to the UAV flight control computer. Implement management nodes to monitor the status of each test node, ensure timing synchronization between test nodes, and perform static allocation and dynamic scheduling of test cases.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor performs the steps of the computer program, it implements the method of any one of claims 1-4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-4.