An automated method and device for software testing of a flight control system
The automation of flight control system software testing is achieved through automated adapter devices, which solves the problems of low efficiency and artificial misoperation of traditional testing methods, and realizes an efficient and reliable testing process.
Patent Information
- Application Number
- CN202211417391.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2042-11-11
AI Technical Summary
The traditional flight control system software testing method is inefficient, consumes a lot of manpower and material resources, and the introduction of manual operation of human uncertainties affects the quality of the test and work progress.
The automated adapter device is used to realize non-interventional flight control system software testing, automatically complete power control, mode control, reset control and test file loading, and obtain test results in real time.
It improves the efficiency and quality of software testing, avoids problems caused by human misoperation, and achieves an efficient and reliable testing process.
Smart Images

Figure CN115757113B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of flight control system software testing, and particularly relates to an automated method and device for flight control system software testing. Background Art
[0002] With the increasing complexity of the functions of flight control system software and the growing scale of the software, the difficulty and workload of software testing have increased rapidly. Under the condition that the software development cycle remains unchanged, the traditional testing methods have the following problems:
[0003] 1) When testing the flight control system software, power control, mode control, reset control, test file loading, and test result acquisition need to be carried out manually, resulting in low testing efficiency and consuming a large amount of manpower and material resources;
[0004] 2) Since the testing process requires strict sequential execution, manual operation will introduce a large number of human uncertain factors, causing the test to pause or fail, affecting the test quality and the progress of the testing work.
[0005] Therefore, at present, the flight control system software testing methods and devices can no longer meet the requirements, and it is necessary to develop an efficient and reliable software automated testing solution according to the special requirements of the flight control system software testing environment. Summary of the Invention
[0006] The present invention proposes an automated method and device for flight control system software testing, which realizes the technical problem of automatically completing software testing on the target machine through the non-interventional automated testing function of the flight control system software, greatly improving the efficiency and quality of software testing.
[0007] On the one hand, the present invention proposes an automated method for flight control system software testing, and the method includes:
[0008] Step 1: The automated adaptation device detects whether there is a target file in the host computer; if so, start the test and execute Step 2; otherwise, re-execute Step 1;
[0009] Step 2: The automated adaptation device sets the mode switch of the target machine to the loading mode;
[0010] Step 3: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the loading mode where the mode switch is located, start and enter the loading mode;
[0011] Step 4: The automated adaptation device determines whether the loading mode of the target machine is started and completed within the first preset time period; if so, execute Step 5, otherwise, end the test and enter Step 2, and prompt an error message to the host computer;
[0012] Step 5: The automated adaptation device obtains the first target file from the host computer; the first target file is any target file existing in the host computer;
[0013] Step 6: The automated adaptation device loads the first target file into the target machine. When it detects that the target machine has finished loading, it proceeds to Step 7; when it detects that the loading of the target machine fails, it reloads and prompts an error message to the host computer;
[0014] Step 7: The automated adaptation device controls the power supply to stop supplying power to the target machine and powers off the target machine;
[0015] Step 8: The automated adaptation device sets the mode switch of the target machine to the normal operation mode;
[0016] Step 9: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine powers on, it starts and enters the normal operation mode according to the normal operation mode where the mode switch is located;
[0017] Step 10: The automated adaptation device determines whether the normal operation mode of the target machine has been successfully started within the second preset time period; if so, it proceeds to Step 11, otherwise, it ends the test and enters Step 7, and prompts an error message to the host computer;
[0018] Step 11: When the automated adaptation device receives the test result sent by the target machine, it saves the test result and sends it to the host computer. When the host computer receives the test result, it deletes the first target file; the test result is obtained by the target machine executing the first target file after entering the normal operation mode; then it enters Step 1 again.
[0019] Optionally, when the automated adaptation device sets the mode switch of the target machine to the loading mode, it includes:
[0020] The automated adaptation device provides a first preset level to the mode switch of the target machine;
[0021] When the automated adaptation device sets the mode switch of the target machine to the normal operation mode, it includes:
[0022] The automated adaptation device provides a second preset level to the mode switch of the target machine;
[0023] The first preset level is different from the second preset level.
[0024] Optionally, when the automated adaptation device determines whether the loading mode of the target machine has been successfully started within the first preset time period, it includes:
[0025] The automated adaptation device determines whether it has received the information indicating that the loading mode has been successfully started feedback from the target machine within the first preset time period;
[0026] The automated adaptation device determines whether the normal operation mode of the target machine is started and completed within the second preset time period, including:
[0027] The automated adaptation device determines whether it receives the information indicating that the normal operation mode of the target machine is started and completed within the second preset time period.
[0028] Optionally, saving the test result and sending it to the host computer includes:
[0029] The automated adaptation device verifies the test result. When the verification passes, it saves the test result in the preset storage area of the automated adaptation device and sends it to the host computer.
[0030] On the other hand, the present invention proposes an automated device for flight control system software testing. As the automated adaptation device, the automated adaptation device is respectively communicatively connected to the host computer and the target machine, and the automated adaptation device is also connected to the control end of the power supply of the target machine; the automated adaptation device is used to perform the following steps:
[0031] Step 1: The automated adaptation device detects whether there is a target file in the host computer; if so, it starts the test and executes Step 2; otherwise, it returns to Step 1;
[0032] Step 2: The automated adaptation device sets the mode switch of the target machine to the loading mode;
[0033] Step 3: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the loading mode where the mode switch is located, it starts to enter the loading mode;
[0034] Step 4: The automated adaptation device determines whether the loading mode of the target machine is started and completed within the first preset time period; if so, it executes Step 5, otherwise, it ends the test and enters Step 1, and prompts an error message to the host computer;
[0035] Step 5: The automated adaptation device obtains the first target file from the host computer; the first target file is any target file existing in the host computer;
[0036] Step 6: The automated adaptation device loads the first target file into the target machine. When it detects that the target machine has completed the loading, it executes Step 7; when it detects that the target machine has failed to load, it ends the test and enters Step 1, and prompts an error message to the host computer;
[0037] Step 7: The automated adaptation device controls the power supply to stop supplying power to the target machine and powers off the target machine;
[0038] Step 8: The automated adaptation device sets the mode switch of the target machine to the normal operation mode;
[0039] Step 9: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the normal operation mode where the mode switch is located, it starts to enter the normal operation mode;
[0040] Step 10: The automated adaptation device determines whether the startup of the normal operation mode of the target machine is completed within the second preset time period; if so, execute Step 11, otherwise, end the test and enter Step 1, and prompt an error message to the host computer;
[0041] Step 11: When the automated adaptation device receives the test result sent by the target machine, it saves the test result and sends it to the host computer. When the host computer receives the test result, it deletes the first target file; the test result is obtained by the target machine executing the first target file after entering the normal operation mode; enter Step 1 again.
[0042] Optionally, the automated adaptation device is specifically configured to provide a first preset level to the mode switch of the target machine to set the mode switch of the target machine in the loading mode;
[0043] The automated adaptation device is further configured to provide a second preset level to the mode switch of the target machine to set the mode switch of the target machine in the normal operation mode; the first preset level is different from the second preset level.
[0044] Optionally, the automated adaptation device is specifically configured to:
[0045] Determine whether the information indicating the completion of the startup of the loading mode is received from the target machine within the first preset time period;
[0046] The automated adaptation device is further configured to determine whether the information indicating the completion of the startup of the normal operation mode is received from the target machine within the second preset time period.
[0047] Optionally, the automated adaptation device is specifically configured to verify the test result, and when the verification passes, save the test result in the preset storage area of the automated adaptation device and send it to the host computer.
[0048] The present invention provides an automated method and device for flight control system software testing, which can complete the working mode, power supply, and reset of the target machine according to the control of the automated adaptation software, automatically load the test target file to the target machine, and obtain and analyze the test result file run by the target machine in real time. It realizes the non-interventional automated testing function of the flight control system software, avoids the problems caused by human misoperation, and also greatly improves the testing efficiency. Description of the Drawings
[0049] Figure 1 It is a schematic flowchart of the automated method for flight control system software testing provided by the present invention;
[0050] Figure 2 Schematic diagram of the structure of the automated device for testing the flight control system software provided by the present invention. Detailed implementation manners
[0051] Figure 1 It is a schematic diagram of the implementation process of the automated method for testing the flight control system software provided by the present invention. As Figure 1 shown, the specific steps include:
[0052] Step 1: Determine whether there is a target file. If so, execute Step 2; otherwise, re-execute Step 1.
[0053] Step 2: Set the target machine in the loading mode according to the setting of the mode switch specified in the configuration file;
[0054] For example, providing a high level to the mode switch can make the target machine in the loading mode.
[0055] Step 3: Power on the target machine according to the setting of the power switch specified in the configuration file;
[0056] For example, providing a high level to the power switch can supply power to the target machine.
[0057] Step 4: Receive and parse the serial port or network port data, and determine whether the loading mode has been started successfully. If so, execute Step 5; otherwise, end the test and enter Step 2;
[0058] It can be understood that if it has not been started successfully, it can wait for a period of time. After the start is completed, then enter Step 4. It can also be understood that when it fails to start after waiting for a period of time, Step 2 can be re-executed to restart once. It can also be that when the start fails, Step 1 is re-executed and an error message is prompted.
[0059] Step 5: Obtain the target file according to the configuration file;
[0060] It can be understood that one target file is obtained at a time, and the order of obtaining can be in the order of the generation time of the target files.
[0061] Step 6: Load the target file to the target machine through the network port and wait for the loading to complete. If the loading fails, reload it and prompt an error message; otherwise, execute Step 7;
[0062] Step 7: Power off the target machine according to the setting of the power switch specified in the configuration file;
[0063] For example, providing a low level to the power switch can stop supplying power to the target machine.
[0064] Step 8: Set the target machine in the normal operation mode according to the settings of the mode switch specified in the configuration file;
[0065] Step 9: Power on the target machine according to the settings of the power switch specified in the configuration file;
[0066] Step 10: Receive and parse the serial port or network port data, and determine whether the normal operation mode has been started successfully. If so, execute Step 11; otherwise, end the test.
[0067] It can be understood that if the startup is not completed, you can wait for a period of time, and then enter Step 11 after the startup is completed. It can also be understood that you can also re-execute Step 7 to restart once when the startup fails after waiting for a period of time. You can also return to Step 1 and prompt an error message when the startup fails.
[0068] Step 11: Receive the data of the serial port (or the specified port of the network port) and parse it, match the start flag and end flag of the test result, save the valid test result into a file in the specified folder, and store the files formed by one test in one file, and delete the executed target file.
[0069] It can be understood that after the test of a target file is completed, the target file will be deleted, so that the same target file will not be executed multiple times.
[0070] Step 12: Determine whether there is a target file. If so, execute Step 1; otherwise, end the test.
[0071] Figure 2 It is a schematic structural diagram of the automatic device for testing the flight control system software provided by the present invention. As Figure 2 shown, the device includes:
[0072] 1) A mode control module, which is used to control the mode of the target machine. The automatic adaptation device and the automatic adaptation software establish a connection through the network communication module, receive the mode control command issued by the automatic adaptation software, parse the control IO number and IO high and low level status included in the control command, match the corresponding IO interface according to the switch number and high and low level status, set the relay switch to be closed or open, and then feedback the control result to the automatic adaptation software through the network communication module, so as to realize the mode switching of the target machine.
[0073] For example, when the automatic adaptation software finds that there is a loading file, it issues a mode control command. The mode control command specifies a high IO level. At this time, the mode control module sets the relay to be closed according to the high IO level, and specifies a low IO level. At this time, the mode control module sets the relay to be open according to the low IO level.
[0074] 2) Power supply control module, which is used to control the power supply of the target machine. The automatic adaptation device and the automatic adaptation software establish a connection through the network communication module, receive the power supply control instructions issued by the automatic adaptation software, analyze the control IO numbers and IO high / low states included in the control commands, match the corresponding IO interfaces according to the switch numbers and high / low states, set the relay switch to be closed or opened, and then feedback the control result to the automatic adaptation software through the network communication module, so as to realize the power supply control of the target machine.
[0075] For example, when receiving a high-level instruction issued by the automatic adaptation software, the target machine is powered on, and when receiving a low-level instruction, the target machine is powered off.
[0076] 3) Reset control module, which is used to control the reset of the target machine. The automatic adaptation device and the automatic adaptation software establish a connection through the network communication module, receive the reset control instructions issued by the automatic adaptation software, analyze the control IO numbers included in the control instructions, match the corresponding IO interfaces according to the switch numbers, set the relay switch to be closed and opened once each, and then feedback the control result to the automatic adaptation software through the network communication module, so as to realize the reset control of the target machine.
[0077] For example, when the target machine starts up during power supply, if it detects an IO high level, the loading mode is started. If it is a low level, the normal operation mode is started.
[0078] 4) Network port communication module, which is used to communicate with the host computer and the target machine.
[0079] The automatic adaptation device and the automatic adaptation software establish a connection through a custom network communication protocol, which is designed based on the standard Socket communication. The network communication module receives the control instructions issued by the automatic adaptation software, calls other modules to complete the corresponding functions according to the control instructions, and feedbacks the results to the automatic adaptation software through the custom communication protocol.
[0080] The automatic adaptation device receives the target file sent by the host computer and transmits it to the target machine through the network port. And the information fed back by the target machine through the network port is sent to the automatic adaptation software. Among them, the protocol part of the communication between the network and the target machine is implemented by the test adaptation software, and the automatic adaptation device completes the forwarding. Thus, when the communication protocol of different target machines changes, the automatic adaptation device does not need to be updated, and only the automatic adaptation software needs to be modified, which has strong scalability and compatibility.
[0081] 5) The serial communication module is used to receive the target file sent by the network communication module, send the target file to the target machine through the serial port, receive the test result file sent by the target machine through the serial port, and then send it to the automated adaptation software through the network communication module. Among them, the serial communication protocol part is implemented by the automated adaptation software, and the automated adaptation device completes the forwarding. Thus, when the communication protocol of different target machines changes, the automated adaptation device does not need to be updated, and only the automated adaptation software needs to be modified, which has strong scalability and compatibility.
Claims
1. An automated method for testing flight control system software, characterized in that, The method includes: Step 1: The automatic adaptation device detects whether there is a target file in the host computer; if so, start the test and execute Step 2; otherwise, re - execute Step 1; Step 2: The automatic adaptation device sets the mode switch of the target machine to the loading mode; Step 3: The automatic adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the loading mode where the mode switch is located, it starts to enter the loading mode; Step 4: The automatic adaptation device determines whether the loading mode of the target machine is started and completed within the first preset time period; if so, execute Step 5, otherwise, end the test and enter Step 2, and prompt an error message to the host computer; Step 5: The automatic adaptation device obtains the first target file from the host computer; the first target file is any one of the target files existing in the host computer; Step 6: The automatic adaptation device loads the first target file to the target machine. When it detects that the target machine has completed the loading, execute Step 7; when it detects that the target machine has failed to load, re - perform the loading and prompt an error message to the host computer; Step 7: The automatic adaptation device controls the power supply to stop supplying power to the target machine and powers off the target machine; Step 8: The automatic adaptation device sets the mode switch of the target machine to the normal operation mode; Step 9: The automatic adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the normal operation mode where the mode switch is located, it starts to enter the normal operation mode; Step 10: The automatic adaptation device determines whether the normal operation mode of the target machine is started and completed within the second preset time period; if so, execute Step 11, otherwise, end the test and enter Step 7, and prompt an error message to the host computer; Step 11: When the automatic adaptation device receives the test result sent by the target machine, it saves the test result and sends it to the host computer. When the host computer receives the test result, it deletes the first target file; the test result is obtained by the target machine executing the first target file after entering the normal operation mode; then enter Step 1 again.
2. The method according to claim 1, characterized in that, The automatic adaptation device setting the mode switch of the target machine to the loading mode includes: The automatic adaptation device provides a first preset level to the mode switch of the target machine; The automatic adaptation device setting the mode switch of the target machine to the normal operation mode includes: The automatic adaptation device provides a second preset level to the mode switch of the target machine; The first preset level is different from the second preset level.
3. The method according to claim 1, wherein The automatic adaptation device determining whether the loading mode of the target machine is started and completed within the first preset time period includes: The automatic adaptation device determines whether it receives the information indicating that the loading mode is started and completed feedback from the target machine within the first preset time period; The automatic adaptation device determining whether the normal operation mode of the target machine is started and completed within the second preset time period includes: The automatic adaptation device determines whether it receives the information indicating that the normal operation mode is started and completed feedback from the target machine within the second preset time period.
4. The method according to claim 1, wherein Saving the test result and sending it to the host computer includes: The automatic adaptation device verifies the test result. When the verification passes, it saves it in the preset storage area of the automatic adaptation device and sends it to the host computer.
5. An automated device for software testing of a flight control system, characterized in that, As an automated adaptation device, the automated adaptation device is communicatively connected to the host computer and the target machine respectively, and the automated adaptation device is also connected to the control end of the power supply of the target machine; the automated adaptation device is used to perform the following steps: Step 1: The automated adaptation device detects whether there is a target file in the host computer; if so, start the test and execute Step 2; Otherwise, return to Step 1; Step 2: The automated adaptation device sets the mode switch of the target machine to the loading mode; Step 3: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the loading mode where the mode switch is located, it starts to enter the loading mode; Step 4: The automated adaptation device determines whether the loading mode of the target machine is started and completed within the first preset time period; If so, execute Step 5, otherwise, end the test and enter Step 1, and prompt an error message to the host computer; Step 5: The automated adaptation device obtains the first target file from the host computer; The first target file is any one of the target files existing in the host computer; Step 6: The automated adaptation device loads the first target file into the target machine. When it detects that the target machine has completed the loading, execute Step 7; when it detects that the target machine has failed to load, end the test and enter Step 1, and prompt an error message to the host computer; Step 7: The automated adaptation device controls the power supply to stop supplying power to the target machine and power off the target machine; Step 8: The automated adaptation device sets the mode switch of the target machine to the normal operation mode; Step 9: The automated adaptation device controls the power supply to supply power to the target machine. When the target machine is powered on, according to the normal operation mode where the mode switch is located, it starts to enter the normal operation mode; Step 10: The automated adaptation device determines whether the normal operation mode of the target machine is started and completed within the second preset time period; If so, execute Step 11, otherwise, end the test and enter Step 1, and prompt an error message to the host computer; Step 11: When the automated adaptation device receives the test result sent by the target machine, it saves the test result and sends it to the host computer. When the host computer receives the test result, it deletes the first target file; The test result is obtained by the target machine executing the first target file after entering the normal operation mode; Enter Step 1 again.
6. The apparatus according to claim 5, wherein The automated adaptation device is specifically used to provide a first preset level to the mode switch of the target machine to set the mode switch of the target machine to the loading mode; The automated adaptation device is also used to provide a second preset level to the mode switch of the target machine to set the mode switch of the target machine to the normal operation mode; The first preset level is different from the second preset level.
7. The device according to claim 5, characterized in that The automated adaptation device is specifically used for: Determine whether the information indicating that the loading mode is started and completed feedback by the target machine is received within the first preset time period; The automated adaptation device is also used to determine whether the information indicating that the normal operation mode is started and completed feedback by the target machine is received within the second preset time period.
8. The device according to claim 5, wherein The automated adaptation device is specifically used to verify the test result. When the verification passes, the test result is saved in the preset storage area of the automated adaptation device and sent to the host computer.
Citation Information
Patent Citations
Automatic test equipment and control method thereof
CN110568345A
A partition space isolation-oriented full-automatic test method
CN112380108A
Cited By
Flight control system whole-process autonomous testing device and method
CN122132314A