A method for automatically generating assumptions for SCADE model combination verification environment based on machine learning
By automatically generating environmental assumptions for the SCADE model through a machine learning-based method, it solves the problems of high error rate and low efficiency of traditional manual writing of environmental assumptions, and achieves efficient combinatorial verification of complex safety-critical systems, which is suitable for SCADE models.
Patent Information
- Application Number
- CN202111228147.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-21
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-10-21
AI Technical Summary
In the field of safety-critical software, traditional combinatorial verification methods rely on manually written environmental assumptions, resulting in high error rates and low efficiency, especially in complex systems. Existing methods are difficult to effectively capture the continuous behavior of quantitative and numerical components, and for SCADE models There is no mature solution yet.
Using a method based on machine learning, model information is obtained through the API of the SCADE tool, test cases are generated, and the simulator is used for simulation to automatically generate environmental hypothesis Assume. Decision trees and genetic algorithms are combined to realize automatic generation of component environmental hypotheses.
It reduces errors in manually writing environmental assumptions, improves the efficiency of writing formal contracts, and reduces the manual workload in the combined verification process. It is suitable for the verification of complex safety-critical systems, especially SCADE models.
Smart Images

Figure CN114036041B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of safety-critical software, and in particular relates to a method for automatically generating SCADE model combination verification environment assumptions based on machine learning. Background Art
[0002] Safety-critical software refers to a type of software used in safety-critical systems in the fields of aviation, aerospace, nuclear energy, etc., and its operational failure will cause the system to be in a dangerous state, thereby leading to catastrophic consequences such as personal injury, major property loss or environmental damage. It has extremely high requirements for functional correctness, real-time performance, safety and other properties.
[0003] In recent years, safety-critical software design and development methods based on formal models have been gradually widely used. For example, the international standard DO-178C for software development for airborne system airworthiness certification uses model-based development methods (DO-331) and formal methods (DO-333) as important technical supplements to its core standards. Compared with general software, safety-critical software design and development often requires two complementary processes: on the one hand, the system is gradually decomposed through hierarchical design to form a software architecture and component behavior composed of systems, subsystems, and atomic components, namely the model-driven development process MBSD (Model-Based Software Development). MBSD generally considers the normal behavior model (Nominal Behavior Models) of the software system; on the other hand, on the basis of the normal behavior model, the fault model (Fault Models) is constructed to analyze the behavior of the software under failure conditions, namely the model-driven safety analysis process MBSA (Model-Based Safety Assessment). MBSD and MBSA are used in parallel and interactively, becoming an important means to improve the quality of safety-critical software and reduce development time and cost at the same time. Commonly used modeling languages in MBSD include Simulink, AADL, SCADE, etc. Compared with other languages, SCADE has a rigorous mathematical foundation. The use of SCADE tools can fundamentally ensure that the designed algorithms and control software models are accurate, unambiguous and deterministic. Its model-to-code generator is the only product on the market that is not customized in order and has been certified by multiple safety-critical industry tools as a development tool. SCADE products have also become the mainstream solution for software modeling, analysis and testing, simulation, and code generation in safety-critical fields because of its full system-level, model-based, and simulation and software implementation development platform.
[0004] However, with the continuous improvement of functional and non-functional requirements, safety-critical software is becoming more and more complex. Formal verification of safety-critical software models faces a huge state space explosion problem, and has become one of the major challenges of safety-critical software design and development methods based on formal models. Compared with general software, safety-critical software model verification not only considers functionality and correctness, but also needs to consider non-functional properties such as security, real-time, and resources. These non-functional properties are often affected by hardware and even the physical environment. In recent years, contract-based combinatorial verification methods have become an international frontier hotspot in the field of safety-critical software to solve the problem of verification state space explosion. The core idea of the contract-based combinatorial verification method is to use the combinatorial structure of the software system to decompose the verification problem, first verify the properties of each sub-component, and then comprehensively derive the properties of the entire system, and solve the state space explosion problem by divide and conquer. These properties are formalized by contracts. Contracts are abstract specifications for component inputs, internal behaviors, and outputs, generally expressed in two tuples.<Assume, Guarantee> To represent. Assume specifies the environmental constraints of the component, because the behavior of each component in the system is often affected by the components associated with it. The so-called environment refers to other components and connections that interact with the component. The components in the environment can be software, hardware or physical devices, etc. At present, there have been many studies in the field of contract-based combination verification methods. For example, Alfaro et al. proposed the concept and application of A / G interface in component-based design research, and Patricia Derler et al. studied the application scenarios of CPS modeled by Simulink for contracts. However, the traditional combination verification framework relies on manually derived contracts. Unlike Guarantee, which can be directly obtained from the requirement text, the environment assumption Assume requires engineers to derive it based on the natural language requirement text and combined with the specific system model and context environment, which is difficult and time-consuming. Therefore, how to automatically analyze and generate the environmental assumptions of model components will be of great help to the combination verification of complex safety-critical systems.
[0005] At present, there are some methods in the industry that can use machine learning algorithms based on regular languages and finite state automata to automatically generate environmental assumptions in the context of combinatorial verification reasoning. For example, the thread modular reasoning method behind the tool developed by Calvin et al., who are pioneers in this field, proposed work on alternate temporal logic ATL for specification and verification of open systems under the framework of temporal logic, and provided automated support through symbolic model checkers; Mocha toolkit et al. proposed component modular verification that supports ATL-based requirement specifications; Jamieson et al. used learning algorithms to continuously iteratively search for counterexamples to approximate the most accurate assumptions in theory. However, these methods assume that the components being analyzed and their environments can be specified as abstract finite state machines, but the expressiveness of state machines is not enough to capture the continuous behavior of quantitative and numerical components and systems interacting with the physical environment, and software components may not be easily specified in (abstract) state machine symbols. Converting them to such symbols may result in a lot of additional modeling work or may result in the loss of important information required for hypothesis learning. In addition, the system models targeted by the above methods are mostly mainstream modeling tool languages such as Simulink and SysML, and there are no methods for SCADE. Summary of the invention
[0006] Purpose of the invention: In order to reduce the errors in manually written environment assumptions and improve the efficiency of writing formalized contracts in the combination verification process, the present invention proposes a method for automatically generating SCADE model combination verification environment assumptions based on machine learning.
[0007] Technical solution: A method for automatically generating SCADE model combination verification environment assumptions based on machine learning, comprising the following steps:
[0008] S100: Obtain I / O information of the target SCADE model based on the API supported by SCADE;
[0009] S200: Mapping the I / O information to generate a specified number of test cases;
[0010] S300: Convert test cases into SCADE simulation scenario files;
[0011] S400: simulating the SCADE simulation scene file using a SCADE simulator to obtain a simulation result file;
[0012] S500: Generate the data set required by the environment assumption Assume based on the simulation result file;
[0013] S600: Generate component environment assumptions based on the data set using machine learning algorithms.
[0014] Beneficial effects: The present invention selects SCADE as the modeling and design language for safety-critical software, automatically generates a set of simulation scenario test case files for the components by reading the specified SCADE model component information and target requirements, and automatically generates environmental assumptions of the SCADE model components based on the test results with the help of machine learning methods, thereby reducing errors in manually written environmental assumptions and improving the efficiency of writing formalized contracts in the combination verification process. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 Automatically generate modular architecture diagrams for machine learning-based SCADE model combination verification environment assumptions;
[0016] Figure 2 This is a schematic diagram of data type conversion rules;
[0017] Figure 3 Build a flowchart for the decision tree;
[0018] Figure 4 It is the flow chart of genetic algorithm;
[0019] Figure 5 This is an example diagram of genetic algorithm individuals. DETAILED DESCRIPTION
[0020] By referring to the exemplary embodiments, the objects and functions of the present invention and the methods for achieving these objects and functions will be explained. However, the present invention is not limited to the exemplary embodiments disclosed below; it can be implemented in different forms. The essence of the description is only to help those skilled in the relevant art to comprehensively understand the specific details of the present invention.
[0021] The present invention proposes a method for automatically generating SCADE model combination verification environment assumptions based on machine learning. Through the Java API interface provided by the SCADE tool, the information of the specified SCADE model is read, and the automatic testing method is used to automatically generate test cases for the SCADE model. A decision tree is then established to automatically generate environment assumptions Assume for the specified model components to meet the target requirements. The above process steps are further explained.
[0022] Step 1: Use Java to call the Java API interface provided by the SCADE tool, and use EMF to obtain the information of the SCADE model in the target address, including input information, output information, assumption guarantee and other information.
[0023] Step 2: Generate test cases for the SCADE model using the test case automatic generation method, and convert the test cases into SCADE simulation scenario files; specifically, the following processes are included:
[0024] Based on the input information of the SCADE model, the SCADE variable type is mapped to the Java data type. The mapping rules are as follows:
[0025] typeConvertMap.put("uint8","short");
[0026] typeConvertMap.put("uint16","short");
[0027] typeConvertMap.put("uint32","int");
[0028] typeConvertMap.put("uint64","long");
[0029] typeConvertMap.put("int8","short");
[0030] typeConvertMap.put("int16","short");
[0031] typeConvertMap.put("int32","int");
[0032] typeConvertMap.put("int64","long");
[0033] typeConvertMap.put("float32","float");
[0034] typeConvertMap.put("float64","double");
[0035] typeConvertMap.put("bool","bool");
[0036] typeConvertMap.put("char","char");
[0037] After the mapping is completed, a complete list of model inputs can be obtained;
[0038] A random adaptive test case automatic generation method is used to randomly generate a value for each input parameter and store it in the test case list. Specifically:
[0039] If the input parameters are taken from a continuous interval, the interpolation random test method is used:
[0040] According to the I / O domain information of the read model preset, several control points are inserted on the domain to divide the domain into several small intervals;
[0041] Randomly select values in each small interval and add them to the data set;
[0042] If the input parameters are taken from a discrete interval, the random adaptive test method is used:
[0043] Randomly generate n candidate test points on the domain;
[0044] For each test point, take the minimum value of its distance from each test data in the test data set of the input parameter, and use this minimum value as a test data. If the test data set of the input parameter is empty, randomly select a candidate test point to add; and for each test point, take the maximum value of its distance from each test data in the test data set, and use this maximum value as the test data to add to the test data set of the input parameter; repeat the above process until the maximum number of cycles is reached or the amount of data in the test data set of the parameter reaches the upper limit.
[0045] Perform this operation for each input parameter, and finally get n test cases.
[0046] Each group of test cases needs to be filled in the SCADE simulation scenario format template, and a simulation case in the SCADE simulation scenario file is generated accordingly. The specific format is as follows:
[0047] SSM::set Operator1 / Input1 1.0;
[0048] SSM::set Operator1 / Input2 2.0;
[0049] SSM::cycle 1;
[0050] Among them, Input1 and Input 2 refer to the model input parameter names, and cycle refers to the number of times the simulation case is executed. You need to fill in the complete address, an example is as follows:
[0051] SSM::set fun / x 1.4425144;
[0052] SSM::cycle 1;
[0053] After generating a simulation scenario file with the suffix .sss, select the model in the SCADE Suit editor to rebuild and then enter the simulation mode. Load the scenario file and execute it. You can get a simulation result file with the suffix .csv. The file contains a header, which contains step (data sequence number), model input parameter list, and model output parameter list from left to right. Its format is as follows:
[0054] STEP; Operator1 / Input1; Operator1 / Input2; Operator1 / Output1; Operator1 / Output2; 1; 1.0; 2.0; 3.0; 2.0; 2; 1.0; 2.0; 3.0; 2.0;
[0057] The first line is considered as the table header, which records the step number, all inputs and all outputs. Starting from the second line, all data and serial numbers are separated by semicolons.
[0058] Use Java code to read the simulation result file, parse the simulation result and the requirement R described in the pre-input logic language into a Boolean variable, and label each test case with "pass" and "notpass" to indicate whether it meets or does not meet the requirement R, and obtain the test data file TC. The specific implementation method is as follows:
[0059] Call String.replaceAll() to replace the logical language with logical symbols;
[0060] Use the put function provided by ScriptEngine to replace the variables in the expression with the actual values in the simulation result file;
[0061] Call the eval function provided by ScriptEngine to calculate the logical expression of the String type.
[0062] The above operation is performed on each piece of data in the simulation result file. When the operation result is true, a "pass" label is added to the data, otherwise a "not pass" label is added. In this way, a labeled test data file TC that can be used for machine learning methods is obtained.
[0063] Step 3: Generate component environment assumptions Assume; specifically including:
[0064] The present invention mainly considers two methods, namely decision tree and genetic algorithm. Decision tree is often used for binary classification problems. The present invention uses maximum information gain as the basis for node division to construct a decision tree. The specific steps are as follows:
[0065] Read in the test data and iteratively build a decision tree; the creation of a decision tree requires an attribute set, a data set, and a basis for branch division. Combine the input attributes of the SCADE model and the label attribute of "whether it meets the requirements R" into an attribute set, use the test data file TC as the data set, select the maximum information gain as the basis for division, and implement the decision tree ID3 algorithm;
[0066] Algorithm1 Decision tree generation algorithm
[0067] Input: dataset D, attribute set A, label
[0068] Output: decision tree root node
[0069] Procedure: function TreeGenerate(D,A)
[0070]
[0071]
[0072] The algorithm is now explained in conjunction with the above pseudo code.
[0073] Create a node object node;
[0074] If all sample data in data set D belong to "pass" or "not pass", mark the node as a leaf node of "pass" or "not pass" and return; otherwise, continue;
[0075] If the variable set A (i.e., the model input and output variables) is not an empty set or the samples in the data set D have the same value on A, then mark the node with the label that has the majority of "pass" and "not pass" in the data set D, and return; otherwise, continue;
[0076] Calculate the variable with the largest information gain from the variable set A as the optimal partition attribute a*;
[0077] For each value ak of a*, DO:
[0078] Generate a branch for node, let Dv represent the set of all data in data set D whose value on variable A is ak;
[0079] If Dv is an empty set, mark the branch node as a leaf node, and take the label value of the majority of "pass" and "notpass" in the data set D, and return it;
[0080] Otherwise, Dv replaces the data set D, deletes a* from the variable set A, and returns 1 to iterate and generate a subtree.
[0081] The overall flow chart is shown in Figure 3 .
[0082] After the decision tree is built and pruned, the environment assumption it represents can be obtained through pre-order traversal. The specific steps are:
[0083] Read the decision tree and generate Assume; for any non-leaf node, let its value be x and the corresponding attribute be A; if attribute A is a continuous attribute, then take the logical expression ck='A<=x' corresponding to the branch from the node to its left child, and take the logical expression ck='A>x' corresponding to the branch from the node to its right child (k=1,2,...); if attribute A is a discrete attribute, then take the logical expression ck='A=x' corresponding to the branch from the node to its left child, and take the logical expression ck='A≠x' corresponding to the branch from the node to its right child (k=1,2,...);
[0084] According to the above rules, whenever a leaf node with a label attribute value of "pass" is traversed, a path from the root node of the decision tree to the leaf node can be found, thereby obtaining n logical expressions c1...cn. For these n expressions, the conjunction A1=c1^c2^...cn is taken, and A1 is the Assume corresponding to the path from the root node to the leaf node; since a decision tree may contain multiple leaf nodes with a label attribute value of "pass", a total of s Assumes A1,...,As can be obtained; taking the disjunction of A1...As, the component environment assumption Assume=A1VA2V...VAs is finally obtained.
[0085] Verify whether Assume meets the requirements; generate a large number of test cases for the model under the restrictions of Assume and convert them into scenario files for simulation. If the simulation results are all true, it can be considered that Assume meets the requirements. Otherwise, enter the next cycle, regenerate the test case set and merge it with the previous round of test cases; stop the cycle when Assume meets the requirements or the iteration limit is reached, and output the last Assume. See the specific algorithm diagram for details. Figure 3 .
[0086] The decision tree is suitable for the case where the data in the data set can well cover the model input definition domain and the data volume is sufficient. Otherwise, the machine learning method of the genetic algorithm is used to realize the automatic generation of the component environment assumption; including:
[0087] Initialize the Assume individual population, randomly select parents to generate the next generation of individuals, and after generating a sufficient number of populations, select the individuals that best meet the requirements from all generations of populations as the Assume output. Figure 4 , the specific algorithm is as follows:
[0088] Algorithm2 Genetic Algorithm Generates Assume
[0089] Output: preset demand R, required population size Max_Num, number of individuals in each population N
[0090] Output:Assume
[0091]
[0092]
[0093] The genetic algorithm of the present invention is now further described in conjunction with the above pseudo code.
[0094] First, define the individual in the genetic algorithm as a tree with a maximum depth not exceeding Max_Depth. The root node of the tree is labeled with a logical symbol (such as <, ≤, >, ≥, ∨, ∧, =). Randomly select any option on the right side of the grammatical expression 1 or 2 shown in the following table to recursively generate a subtree; the leaf node requires the label to be a const constant or a control point cp. An example of an individual generated is shown in Figure 5 .
[0095] Table 1: Syntax expressions
[0096] or-exp ::=or-exp∨or-exp|and-exp And-exp ::=and-exp∧and-exp|rel rel ::exp(<|≦|≧|>|=)0 exp ::exp(+|-|*| / )exp|const|cp
[0097] Initialize the population: randomly generate a population Pn with N individuals;
[0098] For each individual X in the population, calculate the fitness: get the test case TS, let TP = {the number of test cases in TS that satisfy Assume}, TN is not satisfied, then define the v-sound of individual A = TP / (TP+TN);
[0099] informative=(TP+TN) / TS;
[0100]
[0101] Among them, FN is the fitness of individual X, The operator indicates that v-sound takes the value 0 in the interval [0,1) and takes the value 1 when it is equal to 1.
[0102] The roulette wheel selection method is used to make the probability of each individual being selected proportional to its fitness. Each time, two individuals are selected from the population as parents to generate the next generation of individuals and add them to the next generation population until the next generation population reaches N. The method of generating the next generation is to randomly select one of the following three methods:
[0103] (a) Select one subtree from each parent, exchange the selected subtrees, and obtain two new individuals;
[0104] (b) Randomly select an individual from the current population to keep;
[0105] (c) Randomly select one of the parents, and for the selected individual, randomly select a subtree of it and replace it with a randomly generated subtree. The individual obtained after replacement is the new individual of the next generation;
[0106] Among them, method a must meet the following requirements:
[0107] The root node types of the two subtrees are consistent;
[0108] The maximum depth of the newly generated individual does not exceed Max_Depth;
[0109] The number of conjunctions and disjunctions contained in the newly generated individuals does not exceed the preset value;
[0110] If the root node type of the selected subtree is an expression, the control points in all control point type nodes of the subtree must be in the same position.
[0111] The c method must meet the last three of the above conditions.
[0112] If after the new Pn+1 population is generated, n+1 reaches the preset upper limit of the population size, the algorithm ends, otherwise it returns to 1 to continue generating.
[0113] At this point, the genetic algorithm has generated (n+1)*N Assumes using the test case set. See the flowchart for Figure 4 The one that best meets the preset requirement R is selected as the generated component environment hypothesis, and the tool running process ends.
[0114] Based on the above method, the present invention also proposes a tool for realizing automatic generation of SCADE model combination verification environment assumptions. The tool is realized based on the API interface and machine learning technology provided by SCADE. It obtains I / O information by loading the user-specified target software component, maps the I / O information, uses random automatic testing technology to generate a specified number of test cases and converts them into SCADE simulation scenario files, and reads the simulation result files obtained after simulation using the SCADE simulator to generate a data set, and then realizes automatic generation of Assume based on the data set with the help of machine learning algorithms. In order to minimize the manual operation of engineers during use, the tool participates in necessary manual operations such as simulation using SCADE in the form of the final result file as much as possible, thereby ensuring the efficiency of the tool. The SCADE model component environment assumption automatic generation tool realizes model loading based on the API supported by SCADE, realizes automatic generation of SCADE simulation scenario files based on automatic testing technology, and realizes automatic generation of assumptions using machine learning methods. In summary, the SCADE-oriented SCADE model component automatic generation method is divided into three steps: model loading, data set generation, and component assumption generation. For details, see Figure 1. Use the precision-based SCADE data type to Java data type conversion mapping rules, see Figure 2 , and adopts adaptive random testing method to automatically generate test cases, and builds decision tree with maximum information gain as the partitioning criterion.
[0115] SCADE model loading is mainly achieved through EMF and the API provided by SCADE. EMF is a model framework based on Eclipse. It is an important technical support for MDA model-driven development based on Java. The EMF project is a modeling framework and code generation tool. According to the model specification described in XML (SCADE model code can be expressed in XML), EMF can provide runtime support to convert the model into efficient, semantically accurate Java classes and a set of adapter classes that allow viewing and command-based model editing. EMF supports reading the local path of the model in the org.eclipse.emf.common.util tool package to create a model-specific URL for model loading.
[0116] The Java API provided by SCADE supports obtaining: all operators (SCADE's model is composed of n operators, which can be nested, so operators can be regarded as components of the software model), corresponding constants, input variables, output variables, preset input and output definition domains, and other information.
[0117] Using machine learning methods to generate environmental assumptions requires the support of a data set. Randomly generate test cases and map the test data to simulation scenario files. Finally, read the simulation results to generate the data set required by the machine learning method.
Claims
1. A method for automatically generating SCADE model combination verification environment assumptions based on machine learning, characterized by: The following steps are involved: S100: Obtain I / O information of the target SCADE model based on the API supported by SCADE; S200: Mapping the I / O information to generate a specified number of test cases; S300: Convert test cases into SCADE simulation scenario files; S400: simulating the SCADE simulation scene file using a SCADE simulator to obtain a simulation result file; S500: Generate the data set required by the environment assumption Assume based on the simulation result file; S600: Generates component environment assumptions based on data sets using machine learning algorithms; S500 specifically includes: Combined with the requirement R described in the pre-input logic language, each simulation result file is parsed to obtain the operation result; If the operation result is true, add a "pass" label to the simulation result, otherwise add a "not pass" label; Get the labeled dataset required for generating the environment hypothesis Assume; The specific implementation method of parsing each simulation result file is as follows: Replace logical language with logical symbols; Replace the variables in the expression with the actual values in the simulation result file; Calculates logical expressions of String type; In S600, based on the data set, a decision tree is used to generate the component environment assumption Assume. The specific implementation method is: Combine the input attributes, "pass" label attributes, and "not pass" label attributes of the SCADE model into an attribute set; select the maximum information gain as the basis for branch division; and establish a decision tree based on the attribute set, data set, and branch division basis: Pre-order traversal of the decision tree, for any non-leaf node, let its value be x, and the corresponding attribute be A; if attribute A is a continuous attribute, then take the logical expression ck='A<=x' corresponding to the branch from the node to its left child, and take the logical expression ck='A>x' corresponding to the branch from the node to its right child, where k=1,2,...; if attribute A is a discrete attribute, then take the logical expression ck='A=x' corresponding to the branch from the node to its left child, and take the logical expression ck='A≠x' corresponding to the branch from the node to its right child, where k=1,2,...; According to the above rules, whenever a leaf node with a label attribute value of "pass" is traversed, a path from the root node of the decision tree to the leaf node can be found, thereby obtaining n logical expressions c1...ck...cn. For these n expressions, the conjunction A1=c1^c2^...cn is taken, and A1 is the Assume corresponding to the path from the root node to the leaf node; For a decision tree, we can get A1,...,As, a total of s Assumes; take the disjunction of A1...As, and finally get the component environment assumption Assume=A1VA2V...VAs; Under the restriction of the component environment assumption Assume=A1\ / A2\ / ...\ / As, the SCADE simulation scenario file obtained in S300 is simulated. If the simulation results are all true, it is considered that the component environment assumption Assume=A1\ / A2\ / ...\ / As meets the requirements; otherwise, a specified number of test cases are regenerated, and the regenerated test cases are merged with the previous round of test cases, and S300 is executed; When the component environment assumption Assume meets the requirements or the iteration limit is reached, the loop stops and the last component environment assumption Assume is output.
2. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 1, characterized in that: S200 includes the following steps: Based on the mapping rules from SCADE data types to Java data types, the I / O information is mapped and processed to obtain a complete SCADE model input list; A random adaptive test case automatic generation method is used to randomly generate a value for each input parameter in the SCADE model input list, and finally n test cases are obtained. All test cases constitute a test case list.
3. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 2, characterized in that: The mapping rules from SCADE data types to Java data types include: typeConvertMap.put("uint8","short"); typeConvertMap.put("uint16","short"); typeConvertMap.put("uint32","int"); typeConvertMap.put("uint64","long"); typeConvertMap.put("int8","short"); typeConvertMap.put("int16","short"); typeConvertMap.put("int32","int"); typeConvertMap.put("int64","long"); typeConvertMap.put("float32","float"); typeConvertMap.put("float64","double"); typeConvertMap.put("bool","bool"); typeConvertMap.put("char","char").
4. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 2, characterized in that: The random adaptive test case automatic generation method randomly generates a value for each input parameter in the SCADE model input list, and finally obtains n test cases. Specifically, the following operations are performed on each input parameter, and finally obtains n test cases: If the input parameter is taken from a continuous interval, several control points are inserted on its domain. The control points divide the domain into several small intervals. Random values are taken in each small interval, and the obtained values are used as a test value of the input parameter. If the input parameter is taken from a discrete interval, n candidate test points are randomly generated on its definition domain. For each test point, the minimum value of its distance from each test data in the test data set of the input parameter is taken as a test data. If the test data set of the input parameter is empty, a candidate test point is randomly selected and added; and for each test point, the maximum value of its distance from each test data in the test data set is taken, and the maximum value is added as the test data to the test data set of the input parameter; Repeat the above process until the maximum number of cycles is reached or the amount of data in the parameter test data set reaches the upper limit.
5. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 2, characterized in that: In S300, each group of test cases is converted into a simulation case in a SCADE simulation scenario file based on the following SCADE simulation scenario format template; SSM::set Operator1 / Input1 1.0; SSM::set Operator1 / Input2 2.0; SSM::cycle 1; Among them, Input1 and Input 2 refer to the model input parameter names, and cycle refers to the number of times the simulation case is executed.
6. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 1, characterized in that: In S400, the SCADE simulator is used to simulate the SCADE simulation scene file to obtain a simulation result file with a .csv suffix, the format of which is as follows: The first row is regarded as the table header, which records the step number STEP, the model input parameter list and all outputs from left to right; The second line separates all data and sequence numbers with semicolons.
7. The method for automatically generating SCADE model combination verification environment assumptions based on machine learning according to claim 1, characterized in that: In S600, based on the data set, a genetic algorithm is used to generate the component environment assumption Assume. The specific implementation method is as follows: Initialize component environment assumptions Assume individual population; Randomly select parents to generate the next generation of individuals; After generating a sufficient number of populations, select the individuals that best meet the requirements from all generations of populations as the component environment hypothesis Assume for the final output.
