Aircraft control logic test test case development method
Patent Information
- Application Number
- CN202611103326.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-23
- Publication Date
- 2026-10-20
AI Technical Summary
无人飞行器的控制逻辑复杂,需在地面进行充分验证后,才能执行飞行任务
本发明基于接口数据控制文件自动获取规则协议模型要素,并按照选定的规则协议模板,自动生成规则协议模型;根据规则协议模型自动生成指令参数库和观测参数库,实现了接口数据控制文件的自动处理与要素提取,提高了开发效率。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention belongs to the field of simulation testing technology, specifically relating to a method for developing test cases for aircraft control logic experiments based on a semi-physical simulation environment. Background Technology
[0002] The control logic / strategy of unmanned aerial vehicles (UAVs) is a core component, responsible for achieving stable flight, autonomous navigation, mission execution, and safety protection. The control logic of UAVs is complex and requires thorough verification on the ground before flight missions can be executed. Current control logic testing primarily involves designers manually creating test cases using Word, followed by manual execution of tests by testing personnel. This verification method suffers from low efficiency, high manpower costs, and low reusability. Furthermore, due to the lack of standardized expression, it cannot be automatically translated into machine-readable language, thus hindering the automation of testing processes.
[0003] In some trials where automated testing processes have been implemented (mainly interface automated testing), the automated execution of the testing process is driven by developing test scripts. In this testing mode, the workload of test script development is large, and the programming skills of developers are required to be high. Moreover, when the control logic changes, test cases cannot be built quickly, making it difficult to meet the test cycle requirements. Summary of the Invention
[0004] The purpose of this invention is to provide a method for developing test cases for aircraft control logic experiments, so as to solve the above-mentioned technical problems existing in aircraft control logic experiments.
[0005] This invention is achieved through the following technical solution: The method for developing test cases for aircraft control logic experiments includes the following steps: S01. Obtain the interface data block rule protocol and generate the rule protocol model; S02. Generate an interface data parameter library based on the rule protocol model; S03. Construct a private data dictionary to supplement parameters that are not defined in the interface data parameter library but are needed during the experiment, and generate a total parameter library; S04. Based on the parameter information in the total parameter library and the instruction-response rules in the control logic, construct the instruction-response relationship set and the combinational logic set, and configure the basic unit of the use case according to the instruction-response relationship set and the combinational logic set; S05. Based on the basic unit of the test case, construct the test case template according to the control logic; S06. Select a test case template, configure the test process and parameters, and construct the test task; S07. Generate test scripts based on the constructed test tasks.
[0006] In some embodiments, the step of generating a rule protocol model includes: S011. Import the interface data control file, obtain the interface data control file type, find all data frame IDs according to the structure of each type of interface data control file, and calculate the number of data frames; the data frame ID represents the specification index number of the data frame in the interface data control file, and includes the sending device information, receiving device information, and data frame sequence number; S012. Retrieve the interface data control file by data frame ID and construct the first-level index information; the first-level index information includes data frame ID and field ID, with each data frame ID corresponding to multiple field IDs; S013. Obtain the number of lists to be parsed based on the data frame ID, and automatically create a sub-thread based on the number of lists to be parsed; S014. After creating a child thread, automatically copy the imported interface data control file; S015. Retrieve the interface data control file according to the field ID in each data frame, and obtain the corresponding field ID and field parameter content table index. Each field ID corresponds to a field parameter content table index. S016. Construct a second-level index based on the obtained field ID, field parameter name, and field parameter content table index; S017. Retrieve the field parameter content table according to the field parameter content table index, obtain the field parameter name and field parameter content, and construct the third-level index information; the field parameter content table includes data bits, scale, and signal range. S018. Return the second-level and third-level index information constructed by the sub-thread to the main thread. Combine the first-level index information with the data frame ID, field ID, and field parameter content table index to construct a complete data dictionary. S019. Automatically generate a rule protocol model based on the selected rule model template and conversion rules.
[0007] In some embodiments, the interface data parameter library includes an instruction parameter library and an observation parameter library; The instruction parameter library includes all instruction parameter information input by the test system during the test, including instruction parameter name, instruction code and associated instruction parameters. The observation parameter library includes all parameter information generated or collected by the test system during the test, including parameter name and status parameter value.
[0008] In some embodiments, the step of automatically generating an interface data parameter library includes: Obtain the rule protocol model, and form the instruction parameter library and observation parameter library respectively based on the reception / transmission feature information in each data block / data frame in the rule protocol model.
[0009] In some embodiments, in step S03, parameters that are not defined in the interface data parameter library but are needed during the experiment are customized and supplemented using a private data dictionary to form a total parameter library required for the experiment. Key parameter information for custom supplementary parameters includes the custom parameter name, the parameter in the associated interface data parameter library, and the custom calculation method or formula.
[0010] In some embodiments, the “command-response” relationship set is used to characterize the expected parameters and parameter values of the device under test response after a certain command is input during the test. Its configuration methods include binding configuration by parameter name and binding configuration by data frame. The steps for binding a "command-response" relationship set by parameter name include: Search the total parameter library by instruction name and select the corresponding instruction group from the search results; The expected observation parameters corresponding to the input of the instruction are obtained by searching the total parameter library. The required observation parameters and parameter values are selected from the search results to construct the mapping relationship between the instruction group and the observation parameters and parameter values. The steps for configuring the "command-response" relationship set by binding data frame fields include: Search the instruction data frame structure in the interface data parameter library by device identification number, and select the instruction and instruction parameter fields; Search the observation parameter data frame structure, select the desired parameter data frame and the field where the desired parameter is located; Construct a mapping relationship between instructions or instruction parameter fields and expected parameter fields.
[0011] In some embodiments, the combinational logic set is used to characterize multiple combinations of instructions executed during the experiment; the configuration steps of the combinational logic set include: creating a new combinational logic name, searching for the "instruction-response" relationship set by instruction name, and obtaining the configured instructions and instruction parameter groups.
[0012] In some embodiments, step S05, the step of constructing a test case template based on the configured test case basic unit, includes: creating a new test case set, adding events, configuring event types, and configuring event content according to event types; Event types include sequential execution events, parallel execution events, conditional selection events, and loop execution events; The event content includes entry / exit conditions and event execution details; the event execution details include the test method and expected results. The entry conditions of an event represent the triggering conditions of the event, including configuration of 0, state point triggering, time point triggering, and both state point and time point triggering. When the event entry condition is configured to 0, it means that when the event is executed, the event content will be executed immediately and automatically without waiting for the entry condition to be met. The event entry condition is configured as a state point trigger, indicating that the event waits for the state point condition to be automatically met. The state point condition configuration includes state parameters and state parameter values. The event entry condition is configured to be triggered at a specific time, representing the time from execution to the event's exact moment. After the set time, the event content will be executed. The event entry condition is configured to be triggered by both a state point and a time point, indicating that the event content is executed after the current state point is met and the set time is waited. The test method characterizes the instructions and status judgment conditions that need to be executed during the test of this event, and is configured as action execution and parameter judgment; action execution includes instruction sending and system delay; instruction sending characterizes the process in which the instructions and parameters input by the test system during the test are framed according to the frame format in the rule protocol model, and the data frame is sent according to the configured number of transmission times and period.
[0013] In some embodiments, step S06, the step of constructing an experimental task according to the configured test case template, includes: creating a new experimental task, selecting a test case template, configuring the experimental process, and configuring experimental parameters according to different experimental conditions. The configured test process includes basic common procedures and test cases for each test subject; among which, the basic common procedures include simulation system restart and automatic launch; The test parameter configuration includes the entry condition parameters in the event, the instruction parameters in the test method, and the expected result parameters.
[0014] In some embodiments, step S07, the step of generating a test script based on the test task, includes: Based on the configured test tasks and test cases, an event set is formed according to the event number; The event types are obtained sequentially, and the script functions are automatically generated according to the mapping relationship between the event types, event elements and test script functions; Obtain the relationships between events and automatically generate test scripts based on these relationships.
[0015] Compared with the prior art, the present invention has the following advantages and beneficial effects: This invention automatically obtains rule protocol model elements based on interface data control files, and automatically generates rule protocol models according to selected rule protocol templates; it also automatically generates instruction parameter libraries and observation parameter libraries based on the rule protocol models, thereby realizing automatic processing and element extraction of interface data control files and improving development efficiency.
[0016] This invention constructs the relationship between command / fault execution and flight control logic response during automatic testing based on an input-output mapping table. Based on the mapping relationship, it automatically generates test execution logic for system command / command parameter sending and reporting parameter interpretation, simplifying the development process of command execution logic steps in test cases.
[0017] This invention is based on a modular design concept. It automatically extracts and generates the required instruction parameter library and observation parameter library through interface data control files. It constructs undefined parameters through a custom data dictionary, quickly generates a set of "instruction-response" relationships, generates the basic unit for test case development, and builds a set of combinational logic based on the relationships between instructions. This results in a modular test case development method that improves the reusability of test cases.
[0018] This invention enables rapid development of test cases based on a structured natural language configuration model. Based on the mapping rules between test case events and test scripts, it enables automatic generation of test scripts, drives the automatic execution of the test platform, and effectively reduces the difficulty of developing automatic test scripts. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the development process of test cases for aircraft control logic experiments in an embodiment of the present invention.
[0021] Figure 2 This is a flowchart illustrating the automatic generation of a rule protocol model in an embodiment of the present invention.
[0022] Figure 3 This is a flowchart of the basic unit configuration method for an embodiment of the present invention.
[0023] Figure 4 This is a schematic diagram of the test case template structure in an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the application. Furthermore, it should be noted that, for ease of description, only the parts relevant to this application are shown in the accompanying drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0025] To address the aforementioned problems in the logic testing of unmanned aerial vehicles (UAVs), this invention provides a method for developing modular UAV control logic test cases, enabling rapid development of control logic test cases, construction of test processes, and automatic generation of test scripts, thereby achieving automated testing.
[0026] This invention, based on interface data control files and a custom data dictionary, automatically constructs the basic unit set of "instruction-response" elements required for test case development. Building upon this, it constructs a set of combinatorial logic, forming a test case development model that supports reusable modules and multiple event types. This model can meet the development needs of complex control logic test cases for unmanned aerial vehicles. By using structured natural language for test case development, the amount of test script development is reduced, improving development efficiency in terms of automation and modular reusability, while simultaneously reducing the difficulty of test script development and maintenance.
[0027] In some embodiments of the present invention, the method for developing test cases for aircraft control logic experiments refers to... Figure 1 This includes the following steps: S01. Based on the aircraft interface data control file, obtain the interface data block rule protocol and automatically generate the rule protocol model; S02. Based on the rule-based protocol model, automatically generate the interface data parameter library; S03. Construct a private data dictionary to supplement parameters that are not defined in the interface data parameter library but are needed during the experiment, and generate a total parameter library; S04. Based on the parameter information in the total parameter library and the instruction-response rules in the control logic, construct the instruction-response relationship set and the combinational logic set to complete the basic unit configuration of the use case; S05. Based on the basic units of test cases (including the set of "instruction-response" relationships and the set of combinational logic), complete the test case template modeling according to the control logic; S06. Select the test case template, configure the test process and parameters, and complete the test task development; S07. Automatically generate executable test scripts based on the developed test tasks.
[0028] In some embodiments, in step S01, the interface data control file is retrieved, and a data frame / data block interface protocol file is automatically generated by associating context information with the data blocks in the interface data control file. Based on the generated data frame / data block interface protocol file, extract the data frame structure and detailed data frame content from the data frame / data block according to the selected rule protocol model format, and automatically generate the rule protocol model.
[0029] The formats of interface data control files include, but are not limited to, Word and Excel.
[0030] The interface types of the interface data control file include, but are not limited to, 1553B, RS422, CAN, UDP, discrete quantities, and analog quantities.
[0031] The generated rule protocol model formats include, but are not limited to, Excel, XML, and other file formats.
[0032] The elements of the generated rule protocol model can be customized, including basic elements and other elements. The basic elements include: data frame ID, parameter name, start bit, bit length, content, scale, parameter precision, etc.; other elements include: send / receive status, parameter group, fault type, data type, sorting order, control type, etc., which can be added or removed according to actual usage requirements.
[0033] The generation methods for rule protocol models include, but are not limited to, generation by individual device, generation by subsystem, generation by interface type, and generation by arbitrary combination of devices.
[0034] In some embodiments, refer to Figure 2 The steps for automatically generating a rule protocol model are as follows: S011. Import the interface data control file, obtain the interface data control file type, find all data frame IDs according to the structure of each type of interface data control file, and calculate the number of data frames; the data frame ID represents the specification index number of the data frame in the interface data control file, and generally includes basic elements such as sending device information, receiving device information, and data frame sequence number; S012. Retrieve the interface data control file by data frame ID and construct the first-level index information; the first-level index information includes: data frame ID and field ID; each data frame ID corresponds to multiple field IDs; S013. Obtain the number of lists to be parsed based on the data frame ID, and automatically create a sub-thread based on the number of lists to be parsed; S014. After creating a child thread, automatically copy the imported interface data control file; S015. Retrieve the interface data control file according to the field ID in each data frame, and obtain the corresponding field ID and field parameter content table index; each field ID corresponds to a field parameter content table index. S016. Construct a second-level index based on the obtained field ID, field parameter name, and field parameter content table index; S017. Retrieve the field parameter content table according to the index of the field parameter content table, obtain the field parameter name and field parameter content, and construct the third-level index information; the field parameter content table includes, but is not limited to, data bits, scale, signal range, etc. S018. Return the second and third layer index information constructed by the sub-thread to the main thread, and combine it with the first layer index information to construct a complete data dictionary based on the data frame ID, field ID, and field parameter content table index. S019. Automatically generate a rule protocol model based on the selected rule model template and conversion rules.
[0035] The transformation rule representation is based on the mapping relationship between data dictionary elements and rule protocol model elements.
[0036] After the rule protocol model conversion is complete, it is automatically validated according to the validation rules. The validation includes: the completeness of the generated rule protocol model elements; the completeness of the generated rule protocol model data blocks; the continuity of the start bits of parameter types in each data block of the generated rule protocol model; and the consistency between the (start bit + bit length) / 8 of the last parameter in the data block and the length of the data block in the generated rule protocol model. If the validation passes, the rule protocol model is exported; if the validation fails, it is highlighted and manually corrected.
[0037] In some embodiments, in step S02, the interface data parameter library includes an instruction parameter library and an observation parameter library.
[0038] The instruction parameter library includes all instruction parameter information input by the test system during the test, including but not limited to instruction parameter names, instruction codes and associated instruction parameters. The observation parameter library includes all parameter information generated or collected by the test system during the test, including but not limited to parameter names and status parameter values.
[0039] The steps to automatically generate the interface data parameter library are as follows: Obtain the rule protocol model, and form the instruction parameter library and observation parameter library respectively based on the reception / transmission feature information in each data block / data frame in the rule protocol model.
[0040] In some embodiments, in step S03, parameters that are not defined in the interface data parameter library but are needed during the experiment are customized and supplemented using a private data dictionary to form a total parameter library required for the experiment.
[0041] Key parameter information for custom supplementary parameters includes, but is not limited to, custom parameter names, parameters in the associated interface data parameter library, and custom calculation methods or formulas.
[0042] The elements of a private data dictionary include: parameter categories, custom parameter names, associated parameters, and calculation formulas; Parameter categories include constant values, process values, parameter combination calculations, and time-related values; The associated parameters are the parameters from the interface parameter library that are used in the calculation; The calculation formula represents how the custom parameters are calculated.
[0043] After the private data dictionary is supplemented, when configuring test cases, the information of the private data dictionary can be obtained by searching for parameter names. During the test, the associated parameter values are automatically retrieved and the parameter results are calculated based on the calculation formula in the private data dictionary information.
[0044] In some embodiments, in step S04, the “command-response” relationship set is used to characterize the expected parameters and parameter values of the device under test after a certain command is input during the test. As the basic unit of the test case, its configuration method is divided into two types: configuration by parameter name and configuration by data frame.
[0045] The set of “command-response” relationships is represented as follows: Input the characterization command and command parameters. After inputting the characterization command, the parameters and parameter values of the corresponding aircraft control logic response will be displayed. The configured input command types include: commands with parameters and commands without parameters; The configurable input command sending modes include: periodic command sending and event-triggered sending. In the periodic command sending mode, the command sending period and the number of sending cycles can be configured when constructing the command-response mapping relationship set. In the event-triggered sending mode, the number of command sending cycles can be configured when constructing the command-response mapping relationship set.
[0046] In the "command-response" relationship set, the output parameters can be configured as: command execution status, command report code value, observation parameters, and observation parameter values.
[0047] The output of the same command can be configured with multiple observation parameters. The observation parameter values can be configured as status values or parameter values. The configuration type of the observation parameter values can be binary code values or physical values.
[0048] The observation parameter values can be automatically configured by selecting the configured command parameter values.
[0049] The accuracy of the configured observation parameter values can be obtained automatically by manually configuring them or by retrieving parameter accuracy information from the protocol model according to the parameter name.
[0050] The observation parameters can be configured with various logical relationships, including logical AND, logical NOT, logical OR, etc.
[0051] The steps for binding a "command-response" relationship set by parameter name include: Search instruction group: Search the total parameter library by instruction name and select the corresponding instruction group from the search results; Search the total parameter library to obtain the expected observation parameters corresponding to the input of the command, select the required observation parameters and parameter values from the search results, and construct the mapping relationship between the command group and the observation parameters and parameter values.
[0052] After configuration, during the automated test, the instruction is executed according to the test case. Based on the configured observation parameters and parameter values, the test data is automatically searched, the expected values of the observation parameters are compared with the actual values, and the execution result of the instruction is obtained.
[0053] The search method for instruction groups and observation parameters is a fuzzy search by parameter name; for the same parameter name transmitted by multiple nodes in the data interface file, it is identified and selected by the parameter result label.
[0054] The steps for configuring the "command-response" relationship set by binding data frame fields include: Search the instruction data frame structure in the interface data parameter library by device identification number, and select the instruction and instruction parameter fields; Search the observation parameter data frame structure, select the desired parameter data frame and the field where the desired parameter is located; Construct the mapping relationship between instruction / instruction parameter fields and expected parameter fields.
[0055] After configuration, when an instruction is selected within this instruction field, the observation parameter data frame structure field is automatically associated. When the instruction is executed, the source code of the instruction frame field and the observation parameter data frame field is compared to confirm whether the instruction was executed successfully.
[0056] The "command-response" relationship set can be configured as a set of relationships where the command was executed successfully or unsuccessfully.
[0057] An example of a “command-response” relationship set is shown in Table 1.
[0058] Table 1 Examples of “Command-Response” Relationship Sets
[0059]
[0060] Combinational logic sets are used to characterize combinations of multiple instructions executed during an experiment.
[0061] The configuration steps for combinational logic sets are as follows: Create a new combinational logic name, search for the "instruction-response" relationship set by the instruction name in the constructed instruction-response mapping set, and obtain the instruction and instruction parameter group.
[0062] Once configured, during the automated testing process, when the combined logic is executed according to the test cases, the system will automatically execute the instruction sending and expected result interpretation processes sequentially according to the configured multiple instructions.
[0063] In some embodiments, refer to Figure 3 The specific steps for completing test case template modeling based on the basic units of test cases (including the set of "instruction-response" relationships and the set of combinational logic) include: creating a new test case set, adding events, configuring event types, and configuring event content according to event types.
[0064] Test cases consist of a series of basic events.
[0065] Event types include: sequential execution events, parallel execution events, conditional selection events, and loop execution events.
[0066] The event content includes: entry / exit conditions and event execution content. The event execution content includes elements such as test methods and expected results; the event content can be combined and configured to construct a complete event, the entry condition of an event is unique, and multiple sets of event execution content can be configured for one event.
[0067] The entry condition of an event represents the triggering condition of the event, and can be configured to various categories such as 0, state point trigger, time point trigger, and state point + time point trigger. When the event entry condition is configured to 0, it means that when the event is executed, the event content will be executed immediately and automatically without waiting for the entry condition to be met. The event entry condition is configured as a state point trigger, indicating that the event waits for the state point condition to be automatically met. The state point condition configuration includes state parameters and state parameter values; the state parameters can be configured as single parameters or multi-parameter combination logic. The event entry condition is configured to be triggered at a specific time, representing the time from execution to the event's exact moment. After the set time, the event content will be executed. The event entry condition is configured as a state point + time point trigger, indicating that the event content will be executed after the current state point is met and the set time is waited.
[0068] Event entry condition parameters and parameter values are obtained by searching the general parameter library.
[0069] The test method characterizes the instructions and status judgment conditions that need to be executed during the test of this event, and can be configured into two categories: action execution and parameter judgment. Action execution includes command sending, system delays, etc. Command transmission: The process of framing the commands and parameters input to the test system during the characterization test according to the frame format in the rule protocol model, and transmitting the data frames according to the configured number of transmission cycles and period; System latency characterizes the waiting time from the start of one step to the start of the next step during the experiment.
[0070] The execution of command-sending actions can be configured by retrieving the total parameter library or by constructing a set of "command-response" relationships or combinational logic sets.
[0071] If configured to send commands from the master parameter library, the commands will be sent according to the data frame format corresponding to the commands / command parameters in the master parameter library during the execution of the action. If configured to send instructions from the "instruction-response" relationship set, then the execution-response logic of the instruction in the instruction-response relationship set will be invoked to execute the instruction sending and response judgment logic; If the instruction set is configured to be sent from the "Combinatorial Logic" set, then the instruction set in the "Combinatorial Logic" set is retrieved, and then the instruction-response logic of the corresponding instruction in the "Instruction-Response" relationship set is called according to the instruction in the instruction set to execute the instruction sending and response judgment logic.
[0072] System delay actions can be configured to include system delay time, system delay count, etc.
[0073] The parameter interpretation in the testing method includes two categories: instantaneous parameter state interpretation and periodic loop interpretation. The interpretation parameters are configured by searching the total parameter library. The interpretation parameter configuration includes the parameter name and the expected parameter value. The expected parameter value can be configured as a state value, parameter data value, or function formula, etc.
[0074] Event Expected Result: Characterizes the expected result corresponding to the expected parameters of the aircraft control logic response after automatic triggering or action execution triggering; The expected result interpretation logic includes various types such as parameter instantaneous state value interpretation, parameter change curve interpretation over time interpretation, parameter mapping relationship interpretation, and parameter dynamic calculation value interpretation.
[0075] Test cases can be nested among different types of events.
[0076] Reference Figure 4 The following is an example of the structure of the configured test case template: Event 1 includes an entry condition and multiple sets of event execution content. Once the entry condition is met, the event content is executed sequentially according to the settings. Event 2 represents a conditional branch event, which includes multiple sets of conditional branches and event execution content. The conditions are mutually exclusive. During the experiment, an entry condition is met at the same time, and the events are executed in sequence according to the configuration. Conditional branches can be added as needed; Events 3 and 4 are executed in parallel. When event 2 is completed, the entry conditions for events 3 and 4 are triggered synchronously. Once the entry conditions are met, the corresponding events are executed. The number of parallel events can be increased as needed; Event 5 is a periodic loop event. Once the entry condition is met, the event content will be executed repeatedly according to the set loop cycle until the entry condition is no longer met, at which point the loop will exit. Event 1 and Event 2 are executed sequentially. Event 2 is executed sequentially with Events 3 and 4. Events 3 and 4 are executed in parallel. Event 3 and Event 5 are executed sequentially. The above event types can be nested in configuration.
[0077] In some embodiments, step S06, which involves constructing an experimental task based on a configured test case template, includes: creating a new experimental task, selecting a test case template, configuring the experimental process, and configuring experimental parameters according to different experimental conditions.
[0078] The configured test process includes basic common processes and test cases for each test subject; the basic common processes include simulation system restart and automatic launch.
[0079] The test parameter configuration includes entry condition parameters in test case events, instruction parameters in test methods, and expected result parameters. The test parameter configuration supports importing tables to automatically generate the mapping relationship between instruction parameters and expected parameters.
[0080] In some embodiments, step S07, the step of automatically generating a test script based on the test task, includes: Based on the configured test tasks and test cases, a set of test case events is formed according to the test case event number; The test case event types are obtained sequentially, and the script functions are automatically generated according to the mapping relationship between event type, event elements and test script functions; Obtain the relationships between events and automatically generate test tasks / threads based on these relationships.
[0081] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for developing test cases for aircraft control logic experiments, characterized in that, Includes the following steps: S01. Obtain the interface data block rule protocol and generate the rule protocol model; S02. Generate an interface data parameter library based on the rule protocol model; S03. Construct a private data dictionary to supplement parameters that are not defined in the interface data parameter library but are needed during the experiment, and generate a total parameter library; S04. Based on the parameter information in the total parameter library and the instruction-response rules in the control logic, construct the "instruction-response" relationship set and the combinational logic set, and configure the basic unit of the use case according to the "instruction-response" relationship set and the combinational logic set; S05. Based on the basic unit of the test case, construct the test case template according to the control logic; S06. Select a test case template, configure the test process and parameters, and construct the test task; S07. Generate test scripts based on the constructed test tasks.
2. The method for developing test cases for aircraft control logic experiments according to claim 1, characterized in that, The steps for generating a rule protocol model include: S011. Import the interface data control file, obtain the interface data control file type, find all data frame IDs according to the structure of each type of interface data control file, and calculate the number of data frames; the data frame ID represents the specification index number of the data frame in the interface data control file, and includes the sending device information, receiving device information, and data frame sequence number; S012. Retrieve the interface data control file by data frame ID and construct the first-level index information; the first-level index information includes data frame ID and field ID, with each data frame ID corresponding to multiple field IDs; S013. Obtain the number of lists to be parsed based on the data frame ID, and automatically create a sub-thread based on the number of lists to be parsed; S014. After creating a child thread, automatically copy the imported interface data control file; S015. Retrieve the interface data control file according to the field ID in each data frame, and obtain the corresponding field ID and field parameter content table index. Each field ID corresponds to a field parameter content table index. S016. Construct a second-level index based on the obtained field ID, field parameter name, and field parameter content table index; S017. Retrieve the field parameter content table according to the field parameter content table index, obtain the field parameter name and field parameter content, and construct the third-level index information; S018. Return the second-level and third-level index information constructed by the sub-thread to the main thread. Combine the first-level index information with the data frame ID, field ID, and field parameter content table index to construct a complete data dictionary. S019. Automatically generate a rule protocol model based on the selected rule model template and conversion rules.
3. The method for developing test cases for aircraft control logic experiments according to claim 1, characterized in that, The interface data parameter library includes the command parameter library and the observation parameter library; The instruction parameter library includes all instruction parameter information input by the test system during the test, including instruction parameter name, instruction code and associated instruction parameters. The observation parameter library includes all parameter information generated or collected by the test system during the test, including parameter name and status parameter value.
4. The method for developing test cases for aircraft control logic experiments according to claim 3, characterized in that, The steps for generating the interface data parameter library include: Obtain the rule protocol model, and form the instruction parameter library and observation parameter library respectively based on the reception / transmission feature information in each data block / data frame in the rule protocol model.
5. The method for developing test cases for aircraft control logic experiments according to claim 1, characterized in that, In step S03, for parameters that are not defined in the interface data parameter library but are needed during the experiment, they are customized and supplemented using a private data dictionary to form the total parameter library required for the experiment.
6. The method for developing test cases for aircraft control logic experiments according to claim 1, characterized in that, The "command-response" relationship set is used to characterize the expected parameters and parameter values of the device under test after a certain command is input during the test. Its configuration methods include binding configuration by parameter name and binding configuration by data frame. The steps for binding the "command-response" relationship set by parameter name include: Search the total parameter library by instruction name and select the corresponding instruction group from the search results; The expected observation parameters corresponding to the input of the instruction are obtained by searching the total parameter library. The required observation parameters and parameter values are selected from the search results to construct the mapping relationship between the instruction group and the observation parameters and parameter values. The steps for configuring a "command-response" relationship set by binding data frame fields include: Search the instruction data frame structure in the interface data parameter library by device identification number, and select the instruction and instruction parameter fields; Search the observation parameter data frame structure, select the desired parameter data frame and the field where the desired parameter is located; Construct a mapping relationship between instructions or instruction parameter fields and expected parameter fields.
7. The method for developing test cases for aircraft control logic experiments according to claim 6, characterized in that, The combinational logic set is used to characterize multiple combinations of instructions executed during the experiment; The configuration steps for a combinational logic set include: creating a new combinational logic name, searching for the "instruction-response" relationship set by instruction name, and obtaining the configured instructions and instruction parameter groups.
8. The method for developing test cases for aircraft control logic experiments according to claim 7, characterized in that, In step S05, the steps of constructing a test case template based on the configured basic test case unit include: creating a new test case set, adding events, configuring event types, and configuring event content according to event types; Event types include sequential execution events, parallel execution events, conditional selection events, and loop execution events; The event content includes entry / exit conditions and event execution details; the event execution details include the test method and expected results. The entry conditions of an event represent the triggering conditions of the event, including configuration of 0, state point triggering, time point triggering, and both state point and time point triggering. When the event entry condition is configured to 0, it means that when the event is executed, the event content will be executed immediately and automatically without waiting for the entry condition to be met. The event entry condition is configured as a state point trigger, indicating that the event waits for the state point condition to be automatically met. The state point condition configuration includes state parameters and state parameter values. The event entry condition is configured to be triggered at a specific time, representing the time from execution to the event's exact moment. After the set time, the event content will be executed. The event entry condition is configured to be triggered by both a state point and a time point, indicating that the event content is executed after the current state point is met and the set time is waited. The test method characterizes the instructions and status judgment conditions that need to be executed during the test of this event, and is configured as action execution and parameter judgment; action execution includes instruction sending and system delay; instruction sending characterizes the process in which the instructions and parameters input by the test system during the test are framed according to the frame format in the rule protocol model, and the data frame is sent according to the configured number of transmission times and period.
9. The method for developing test cases for aircraft control logic experiments according to claim 8, characterized in that, In step S06, the steps of constructing the test task according to the configured test case template include: creating a new test task, selecting a test case template, configuring the test process, and configuring test parameters according to different test conditions. The configured test process includes basic common procedures and test cases for each test subject; among which, the basic common procedures include simulation system restart and automatic launch; The test parameter configuration includes the entry condition parameters in the event, the instruction parameters in the test method, and the expected result parameters.
10. The method for developing test cases for aircraft control logic experiments according to claim 9, characterized in that, In step S07, the step of generating test scripts based on the experimental task includes: Based on the configured test tasks and test cases, an event set is formed according to the event number; The event types are obtained sequentially, and the script functions are automatically generated according to the mapping relationship between the event types, event elements and test script functions; Obtain the relationships between events and automatically generate test scripts based on these relationships.