An unmanned aerial vehicle ground control station remote control interface automatic test method
By remotely injecting remote control command test cases into the UAV ground control station and automatically checking the remote control command data using the Qt reflection mechanism, the problems of inaccurate test results and long testing time in the prior art are solved, and efficient and accurate automatic testing of remote control interfaces is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHENGDU AIRCRAFT INDUSTRY GROUP
- Filing Date
- 2026-03-19
- Publication Date
- 2026-06-30
Smart Images

Figure CN122309362A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of remote control interface testing for UAV ground control stations, and specifically relates to an automatic testing method for the remote control interface of UAV ground control stations. Background Technology
[0002] In the development and verification of UAV ground control station software, remote control command controls are designed in the software interface according to the air-to-ground interface control file requirements and UAV control needs of different UAV configurations. UAV operators send remote control commands by operating these controls, thereby controlling the UAV's operational status. Therefore, testing the remote control interface is a crucial step in the ground control station software development process. Existing software testing methods involve designing remote control command test cases based on the UAV's air-to-ground interface control file, manually operating the relevant remote control command controls in the software, and checking the correctness of the remote control command output. These existing methods are prone to human error, leading to incorrect test results, and the time required to iterate through all remote control command parameter test cases is excessive, impacting the software development schedule.
[0003] In existing testing methods for remote control interfaces of UAV ground control stations, Chinese invention patent: A static network data testing system and method for a UAV control station, authorized announcement number: CN113505054B, discloses the following steps: Step 11, running the basic framework function of the main program of the test system through the basic framework module, and loading various functional modules of the test system through the basic framework function; Step 12, after the network basic configuration module is loaded and started, obtaining network configuration information from its built-in network configuration file, and sending the obtained network configuration information to the core processing module and the UI display and control module; Step 13, after the core processing module is loaded and started, initializing the network communication protocol in the test system according to the network configuration information, and sending the initialized network communication status information to the UI display and control module; Step 14, after the UI display and control module is loaded and started, displaying the network configuration information according to the network configuration information, and displaying the network configuration status in conjunction with the network communication status information, and communicating... Step 15: The core processing module starts the timer of the test system and starts the call and listening of the data sending and receiving threads according to the network configuration information. It generates multiple threads for running test cases by loading the ICD configuration file from the UI display module, including: data frame sending thread, data receiving and parsing thread, and protocol conversion thread. Step 16: The UI display module calls the test case automatic generation module, which generates test cases according to the built-in test requirements including feature values, maximum values, minimum values, and random values, and sends the generated test cases to the core processing module. Step 17: The core processing module runs the test cases according to the received test cases and parses the test cases to generate test results through the data frame sending thread, data receiving and parsing thread, and protocol conversion thread it created. The test results are then sent to the UI display module for display.
[0004] The aforementioned existing technology has the following problems: Using existing technologies for remote control interface testing can easily lead to incorrect test results due to human error, and it takes a long time to traverse all remote control command parameter test cases, which affects the software development schedule. Summary of the Invention
[0005] The purpose of this invention is to overcome the aforementioned problems and propose an automatic testing method for the remote control interface of a UAV ground control station. This method addresses the issues in existing technologies where human error can easily lead to incorrect test results, and where the time required to traverse all remote control command parameter test cases is too long, thus affecting the software development progress.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: An automatic testing method for the remote control interface of an unmanned aerial vehicle (UAV) ground control station, characterized by the following specific steps: Step s1: Compile a remote control command test case table in the remote control command testing software; Step s2: The remote control command testing software injects the remote control command test case table into the software under test process in the UAV ground control station and creates a remote injection thread; Step s3: Use the remote control interface test software to execute remote control command test cases in the software process under test in the UAV ground control station; Step s4: Use remote control interface testing software to check whether the remote control commands output by the software under test in the UAV ground control station are consistent with the remote control command test cases. If the remote control command code output by the software under test is consistent with the remote control command test cases, and the source code value of the remote control command parameters output by the software under test is consistent with the remote control command test cases, then the code passes the test and the remote control interface is usable. If any of the following is inconsistent, the code test fails and the remote control interface is unusable.
[0007] In step s1, the remote control command test case table includes remote control commands, remote control command parameters, and remote control command control parameters. Remote control commands are divided into commands without parameters and commands with parameters. Remote control command parameters and remote control command control parameters only include commands with parameters. Commands without parameters are remote control commands that only have remote control command codes, while commands with parameters are remote control commands that have additional parameter information.
[0008] The remote control command includes a remote control command name, a remote control command code, a remote control command control type, and a remote control command control name. The remote control command name is the remote control command name in the ground-to-air interface control file; the remote control command code is a hexadecimal source code value; the remote control command control type is the type of remote control command control in the Qt interface, including QPushButton; and the remote control command control name is the name of the remote control command control in the Qt interface.
[0009] The remote control command parameters include the name of the remote control command parameter, the control type of the remote control command parameter, the control name of the remote control command parameter, the source code value of the control parameter of the remote control command parameter, the offset of the source code value of the remote control command parameter, and the parameter value of the control parameter of the remote control command parameter. The name of the remote control command parameter is the name of the remote control command parameter in the air-to-ground interface control file. The control type of the remote control command parameter is the type of the remote control command parameter control in the Qt interface, including QLineEdit and QComboBox. The control name of the remote control command parameter is the name of the remote control command parameter control in the Qt interface. The source code value of the remote control command parameter is the hexadecimal source code value corresponding to the remote control command parameter value. The offset of the source code value of the remote control command parameter is the offset byte of the source code value of the remote control command parameter in the remote control frame. The parameter value of the control parameter of the remote control command parameter is the engineering value of the remote control command parameter.
[0010] Remote control test cases and a remote control test case table are created using the remote control command name, remote control command code, remote control command control type, and remote control command control name, as well as the remote control command parameter name, remote control command parameter control type, remote control command parameter control name, remote control command parameter control parameter source code value, remote control command parameter control source code value offset, and remote control command parameter control parameter parameter value.
[0011] In step s2, the remote control command test software uses the interface provided by the UAV operating system to inject the remote control command excitation module with remote control command test cases into the process of the software under test and creates a remote injection thread.
[0012] The entry function of the remote injection thread is the initialization function of the remote control command excitation module.
[0013] The initialization function of the remote control command activation module creates a thread of type QThread, which is used to automatically start the event loop in Qt.
[0014] In step s3, the remote control interface testing software reads the remote control command test case table and sends the remote control commands selected by the user from the remote control command test case table to the remote control command excitation module.
[0015] The remote control command activation module obtains the corresponding control pointer using Qt's reflection mechanism based on the name and type information of the control remote control command and its parameters.
[0016] When the remote control instruction type of the control pointer is a parameterized instruction, the QMetaObject::invokeMethod method is used to set the value of the remote control instruction parameter control, and then the QMetaObject::invokeMethod method is used to trigger the mouse click signal of the remote control instruction control to execute the value of the remote control instruction parameter control.
[0017] In step s4, the remote control interface test software collects the remote control command code sent by the software under test in the UAV ground control station, checks whether the remote control command code output by the software under test is consistent with the remote control command test case, and checks whether the source code value of the remote control command parameter output by the software under test is consistent with the remote control command test case.
[0018] The advantages of using this invention are: I. Compared with the prior art, the present invention uses remote injection to automatically execute remote control command test cases without modifying the ground control station software, and automatically judges the test results by automatically checking the remote control command data; the automated execution of remote control command test cases and the automated acquisition of test results greatly improve testing efficiency and ensure the quality of software development; the structure of test cases is standardized, the standardization and manageability of test cases are realized, and the accuracy of test results is guaranteed.
[0019] Second, this invention uses Qt's reflection mechanism (QMetaObject::invokeMethod) to obtain control pointers, and utilizes Qt's event loop and signal-slot mechanism to perform cross-thread asynchronous calls, achieving deep integration with the Qt framework and a natural and efficient technical implementation.
[0020] Third, this invention automates the entire process from test case execution to result checking. It automatically executes test cases without manual operation and automatically obtains test results, avoiding errors from manual checking; thus greatly improving testing efficiency and shortening the testing cycle.
[0021] Fourth, this invention automatically collects and checks remote control command codes and remote control command parameter source code values; by accurately comparing test cases and output data, it achieves automatic judgment of test results; it avoids misjudgments and omissions that may be caused by manual inspection; and it ensures the accuracy and reliability of test results. Attached Figure Description
[0022] Figure 1 This is a flowchart of the automatic testing method for the remote control interface of the UAV ground control station according to the present invention. Detailed Implementation
[0023] Example 1 An automatic testing method for the remote control interface of an unmanned aerial vehicle (UAV) ground control station, comprising the following steps: Step s1: Compile a remote control command test case table in the remote control command testing software; Step s2: The remote control command testing software injects the remote control command test case table into the software under test process in the UAV ground control station and creates a remote injection thread; Step s3: Use the remote control interface test software to execute remote control command test cases in the software process under test in the UAV ground control station; Step s4: Use remote control interface testing software to check whether the remote control commands output by the software under test in the UAV ground control station are consistent with the remote control command test cases. If the remote control command code output by the software under test is consistent with the remote control command test cases, and the source code value of the remote control command parameters output by the software under test is consistent with the remote control command test cases, then the code passes the test and the remote control interface is usable. If any of the following is inconsistent, the code test fails and the remote control interface is unusable.
[0024] In step s1, the remote control command test case table includes remote control commands, remote control command parameters, and remote control command control parameters. Remote control commands are divided into commands without parameters and commands with parameters. Remote control command parameters and remote control command control parameters only include commands with parameters. Commands without parameters are remote control commands that only have remote control command codes, while commands with parameters are remote control commands that have additional parameter information.
[0025] The remote control command includes a remote control command name, a remote control command code, a remote control command control type, and a remote control command control name. The remote control command name is the remote control command name in the ground-to-air interface control file; the remote control command code is a hexadecimal source code value; the remote control command control type is the type of remote control command control in the Qt interface, including QPushButton; and the remote control command control name is the name of the remote control command control in the Qt interface.
[0026] The remote control command parameters include the name of the remote control command parameter, the control type of the remote control command parameter, the control name of the remote control command parameter, the source code value of the control parameter of the remote control command parameter, the offset of the source code value of the remote control command parameter, and the parameter value of the control parameter of the remote control command parameter. The name of the remote control command parameter is the name of the remote control command parameter in the air-to-ground interface control file. The control type of the remote control command parameter is the type of the remote control command parameter control in the Qt interface, including QLineEdit and QComboBox. The control name of the remote control command parameter is the name of the remote control command parameter control in the Qt interface. The source code value of the remote control command parameter is the hexadecimal source code value corresponding to the remote control command parameter value. The offset of the source code value of the remote control command parameter is the offset byte of the source code value of the remote control command parameter in the remote control frame. The parameter value of the control parameter of the remote control command parameter is the engineering value of the remote control command parameter.
[0027] Remote control test cases and a remote control test case table are created using the remote control command name, remote control command code, remote control command control type, and remote control command control name, as well as the remote control command parameter name, remote control command parameter control type, remote control command parameter control name, remote control command parameter control parameter source code value, remote control command parameter control source code value offset, and remote control command parameter control parameter parameter value.
[0028] In step s2, the remote control command test software uses the interface provided by the UAV operating system to inject the remote control command excitation module with remote control command test cases into the process of the software under test and creates a remote injection thread.
[0029] The entry function of the remote injection thread is the initialization function of the remote control command excitation module.
[0030] The initialization function of the remote control command activation module creates a thread of type QThread, which is used to automatically start the event loop in Qt.
[0031] In step s3, the remote control interface testing software reads the remote control command test case table and sends the remote control commands selected by the user from the remote control command test case table to the remote control command excitation module.
[0032] The remote control command activation module obtains the corresponding control pointer using Qt's reflection mechanism based on the name and type information of the control remote control command and its parameters. (How to handle commands without parameters?) When the remote control instruction type of the control pointer is a parameterized instruction, the QMetaObject::invokeMethod method is used to set the value of the remote control instruction parameter control, and then the QMetaObject::invokeMethod method is used to trigger the mouse click signal of the remote control instruction control to execute the value of the remote control instruction parameter control.
[0033] In step s4, the remote control interface test software collects the remote control command code sent by the software under test in the UAV ground control station, checks whether the remote control command code output by the software under test is consistent with the remote control command test case, and checks whether the source code value of the remote control command parameter output by the software under test is consistent with the remote control command test case.
[0034] If the remote control command code output by the software under test is consistent with the remote control command test case, and the source code value of the remote control command parameter output by the software under test is consistent with the remote control command test case, then the code passes the test.
[0035] 1) Compile test cases for remote control commands Based on the characteristics of remote control commands in the UAV ground-to-air interface control file, a storage table for remote control command test cases is designed, as shown in Table 1. The column headers represent the following meanings: Remote control command types include commands without parameters and commands with parameters. Commands without parameters indicate that the remote control command only has a remote control command code, while commands with parameters indicate that the remote control command has additional parameter information. The remote control command name is the remote control command name in the ground-to-air interface control file; The remote control command code is a hexadecimal source code value; The remote control command control type is the type of remote control command control in the Qt interface, which usually includes QPushButton (button). The remote control command control name is the name of the remote control command control in the Qt interface; The remote control command parameter name is the same as the remote control command parameter name in the ground-to-air interface control file. The remote control command control type refers to the type of remote control command parameter control in the Qt interface, typically including QLineEdit (line edit box), QComboBox (drop-down list), etc. The name of the remote control command parameter control is the same as the name of the remote control command parameter control in the Qt interface; The source code value of the remote control command parameter is the hexadecimal source code value corresponding to the remote control command parameter value. The calculation method is determined according to the UAV ground-to-air interface control file. The offset of the source code value of the remote control command parameter is the offset byte of the source code value of the remote control command parameter in the remote control frame, and its content is determined according to the UAV ground-to-air interface control file. The remote control command parameter value is the engineered value of the remote control command parameter, that is, the parameter value entered by the user on the Qt interface.
[0036] Table 1 Test Cases for Remote Control Commands
[0037] 2) Create a remote injection thread The UAV ground control station software is running normally. The remote control command testing software uses the interface provided by the operating system to inject the remote control command stimulus module into the process of the software under test and create an injection thread. The entry function of this thread is the initialization function of the remote control command stimulus module. In the initialization function, the remote control command stimulus module creates a thread of type QThread. This type of thread automatically starts the event loop in Qt, which facilitates cross-thread asynchronous calls using Qt's event loop and signal-slot mechanism.
[0038] 3) Test cases for executing remote control commands The process of executing remote control command test cases is as follows: The remote control interface testing software reads the remote control command test case table; Based on the test case line selected by the user, the remote control command type, remote control command code, remote control command control type, remote control command control name, remote control command parameter control type, remote control command parameter control name, and remote control command parameter value are sent to the remote control command activation module via a network interface or other interfaces. The remote control command activation module obtains the corresponding control pointer using Qt's reflection mechanism based on the name and type information of the remote control command control / remote control command parameter control. If the remote control command type is a parameterized command, the value of the remote control command parameter control is set using the QMetaObject::invokeMethod method; The QMetaObject::invokeMethod method is used to trigger mouse click signals or other signals of the remote control control.
[0039] 4) Check remote control command data The process of checking remote control command data is as follows: The remote control interface testing software collects remote control command frames sent by the UAV ground control station software; Check whether the output remote control command code is consistent with the test case; Check whether the source code values of the output remote control command parameters are consistent with the test cases; If the remote control command code output by the software under test matches the remote control command test case, and the source code value of the remote control command parameter output by the software under test matches the remote control command test case, then the code passes the test and the remote control interface is usable. If any of the following does not match, then the code test fails and the remote control interface is unusable.
[0040] The remote control interface testing software uses existing remote control interface testing software.
[0041] Example 2 To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the following description is only some embodiments of the present invention. For those skilled in the art, other implementation examples can be obtained without creative effort.
[0042] The flowchart of the method of this invention is as follows: Figure 1 The specific implementation steps are as follows: Step 1: Based on the UAV ground-to-air interface control file and the ground control station interface, compile remote control and command test cases, as shown in Table 1.
[0043] Table 1 Test Cases for Remote Control Commands
[0044] Step 2: Remotely inject the ground control station software using remote control command testing software; Step 3: The remote control command excitation module executes the "takeoff" command test case, triggering the mouse click operation of the takeoff_TC button control in the ground control station software; Step 4: The remote control command test software collects the remote control command data output by the ground control station software, checks whether the byte containing the command code is 0x05, and determines whether the test case passes based on the comparison results.
[0045] Step 5: The remote control command excitation module executes the "field height binding" command test case, updates the value of the command parameter control changgao_TCPara to 100, and triggers the mouse click operation of the button control changgaozhuangding_TC; Step 6: The remote control command test software collects the remote control command data output by the ground control station software, checks whether the byte containing the command code is 0xA1 and whether the 5th byte is 0x64, and determines whether the test case passes based on the comparison results.
Claims
1. An unmanned aerial vehicle ground control station remote control interface automatic test method, characterized in that: The specific steps are as follows: Step s1: Compile a remote control command test case table in the remote control command testing software; Step s2: The remote control command testing software injects the remote control command test case table into the software under test process in the UAV ground control station and creates a remote injection thread; Step s3: Use the remote control interface test software to execute remote control command test cases in the software process under test in the UAV ground control station; Step s4: Use remote control interface testing software to check whether the remote control commands output by the software under test in the UAV ground control station are consistent with the remote control command test cases. If the remote control command code output by the software under test is consistent with the remote control command test cases, and the source code value of the remote control command parameters output by the software under test is consistent with the remote control command test cases, then the code passes the test and the remote control interface is usable. If any of the following is inconsistent, the code test fails and the remote control interface is unusable.
2. The unmanned aerial vehicle ground control station remote control interface automatic test method according to claim 1, characterized in that: In step s1, the remote control command test case table includes remote control commands, remote control command parameters, and remote control command control parameters. Remote control commands are divided into commands without parameters and commands with parameters. Remote control command parameters and remote control command control parameters only include commands with parameters. Commands without parameters are remote control commands that only have remote control command codes, while commands with parameters are remote control commands that have additional parameter information.
3. The automatic testing method for the remote control interface of a UAV ground control station according to claim 2, characterized in that: The remote control command includes a remote control command name, a remote control command code, a remote control command control type, and a remote control command control name. The remote control command name is the remote control command name in the ground-to-air interface control file; the remote control command code is a hexadecimal source code value; the remote control command control type is the type of remote control command control in the Qt interface, including QPushButton; and the remote control command control name is the name of the remote control command control in the Qt interface.
4. The automatic testing method for the remote control interface of a UAV ground control station according to claim 3, characterized in that: The remote control command parameters include the name of the remote control command parameter, the control type of the remote control command parameter, the control name of the remote control command parameter, the source code value of the control parameter of the remote control command parameter, the offset of the source code value of the remote control command parameter, and the parameter value of the control parameter of the remote control command parameter. The name of the remote control command parameter is the name of the remote control command parameter in the air-to-ground interface control file. The control type of the remote control command parameter is the type of the remote control command parameter control in the Qt interface, including QLineEdit and QComboBox. The control name of the remote control command parameter is the name of the remote control command parameter control in the Qt interface. The source code value of the remote control command parameter is the hexadecimal source code value corresponding to the remote control command parameter value. The offset of the source code value of the remote control command parameter is the offset byte of the source code value of the remote control command parameter in the remote control frame. The parameter value of the control parameter of the remote control command parameter is the engineering value of the remote control command parameter.
5. The automatic testing method for the remote control interface of a UAV ground control station according to claim 4, characterized in that: Remote control test cases and a remote control test case table are created using the remote control command name, remote control command code, remote control command control type, and remote control command control name, as well as the remote control command parameter name, remote control command parameter control type, remote control command parameter control name, remote control command parameter control parameter source code value, remote control command parameter control source code value offset, and remote control command parameter control parameter parameter value.
6. The automatic testing method for the remote control interface of a UAV ground control station according to claim 5, characterized in that: In step s2, the remote control command test software uses the interface provided by the UAV operating system to inject the remote control command excitation module with remote control command test cases into the process of the software under test and creates a remote injection thread.
7. The automatic testing method for the remote control interface of a UAV ground control station according to claim 1, characterized in that: The entry function of the remote injection thread is the initialization function of the remote control command excitation module.
8. The automatic testing method for the remote control interface of a UAV ground control station according to claim 7, characterized in that: The initialization function of the remote control command activation module creates a thread of type QThread, which is used to automatically start the event loop in Qt.
9. The automatic testing method for the remote control interface of a UAV ground control station according to claim 8, characterized in that: In step s3, the remote control interface testing software reads the remote control command test case table and sends the remote control commands selected by the user from the remote control command test case table to the remote control command excitation module.
10. The automatic testing method for the remote control interface of a UAV ground control station according to claim 9, characterized in that: The remote control command activation module obtains the corresponding control pointer using Qt's reflection mechanism based on the name and type information of the control remote control command and its parameters; for commands without parameters, it only obtains the control remote control command.
11. The automatic testing method for the remote control interface of a UAV ground control station according to claim 10, characterized in that: When the remote control instruction type of the control pointer is a parameterized instruction, the QMetaObject::invokeMethod method is used to set the value of the remote control instruction parameter control, and then the QMetaObject::invokeMethod method is used to trigger the mouse click signal of the remote control instruction control to execute the value of the remote control instruction parameter control.
12. The automatic testing method for the remote control interface of a UAV ground control station according to claim 11, characterized in that: In step s4, the remote control interface test software collects the remote control command code sent by the software under test in the UAV ground control station, checks whether the remote control command code output by the software under test is consistent with the remote control command test case, and checks whether the source code value of the remote control command parameter output by the software under test is consistent with the remote control command test case.