A safety-critical autonomous system modeling method and tool based on SysML
By using the SysML extended subset SubSysML and the natural language requirement template RNLReq, the ambiguity of natural language requirements in safety-critical autonomous systems is resolved, and the automatic conversion from natural language to SysML models is realized, improving the accuracy and efficiency of modeling.
Patent Information
- Application Number
- CN202110480086.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-30
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-04-30
AI Technical Summary
In safety-critical autonomous systems, handling architecture modeling based on natural language requirements is a challenge, especially when automatically generating architecture models, as existing technologies struggle to effectively handle ambiguous natural language text requirements.
Using SubSysML, an extended subset of SysML, we identify and repair natural language requirement documents by constraining the natural language requirement template RNLReq and constraint rules, and generate different views of the SysML architecture model, including hierarchical structure, internal interactions, functional and non-functional views.
It achieves automated conversion from natural language requirements to SysML models, reduces the ambiguity of natural language requirements, improves the accuracy and efficiency of system modeling, and reduces the cost of development and iterative design.
Smart Images

Figure CN113190222B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of aerospace technology, and in particular relates to a safety-critical autonomous system modeling method and tool based on SysML. Background Art
[0002] In recent years, model-driven development (MDD) has received more and more attention and is considered by the industry to be an important and feasible means to ensure system safety and reliability. Model-driven safety-critical CPS system design and implementation methods commonly used modeling languages include Modelica, SysML, AADL (Architecture Analysis & Design Language, AADL), etc. For example: Modelica supports multi-domain modeling such as mechanical, electronic, electrical, hydraulic, and thermal, AADL supports multi-perspective hardware and software modeling such as functional, non-functional, and execution platform, and SysML integrates various views of large and complex systems to model hardware, software, data, processes, requirements, and even human and other resources. However, in safety-critical autonomous systems, more and more AI requires MDD engineers to adjust their work. One of the difficulties is how to deal with the architecture modeling of such systems based on natural language requirements.
[0003] However, when developing safety-critical intelligent software, if you want to automate MDD, you need to automatically generate an architecture model based on system requirements. Since system requirements are mostly written in the form of free natural language text, this text is usually vague and difficult to process automatically. Therefore, automatically generating an architecture model based on system requirements is a very big challenge, that is, how to deal with the architecture modeling of such systems based on natural language requirements is a difficult point. Summary of the invention
[0004] Purpose of the invention: In order to realize automatic generation of architecture model according to system requirements, the present invention proposes a safety-critical autonomous system modeling method and tool based on SysML.
[0005] Technical solution: A SysML-based safety-critical autonomous system modeling method, including the following steps:
[0006] Step 1: For various natural language requirement documents in safety-critical autonomous systems, use requirement templates and constraint rules to regulate natural language requirement documents and define the RNLReq metamodel;
[0007] Step 2: Select the extended SysML subset to support the functional and non-functional extensions of the RNLReq metamodel and define the transformation rules from the RNLReq metamodel to different views in the SysML architecture model;
[0008] Step 3: Based on the transformation rules, the RNLReq metamodel is transformed into different views in the SysML architecture model.
[0009] Further, the RNLReq metamodel includes a data dictionary, a domain vocabulary, an expression of the architecture of the safety-critical autonomous system constrained by the requirement template, and an expression of the functional / non-functional characteristics of the safety-critical autonomous system constrained by the constraint rules;
[0010] Wherein, the requirement template includes a system requirement template for expressing the highest level requirements and a basic requirement template for expressing the requirements of each component in a safety-critical autonomous system;
[0011] The system requirement template can be decomposed into multiple subsystem requirement templates, each subsystem requirement template can be decomposed into multiple function requirement templates, and each function requirement template can be decomposed into multiple sub-function requirement templates;
[0012] The architecture of the safety-critical autonomous system is expressed through the hierarchical relationship between templates.
[0013] Furthermore, the constraint rules include:
[0014] General restriction rules for limiting the use of natural language;
[0015] Functional requirement constraint rules are used to constrain the expression of functional characteristics of safety-critical autonomous systems according to predefined functional sentences;
[0016] Non-functional requirement constraint rules are used to constrain the expression of non-functional attribute characteristics of safety-critical autonomous systems according to predefined non-functional sentence patterns;
[0017] AI requirement constraint rules are used to constrain the expression of requirements for AI components.
[0018] Furthermore, the functional sentence structure includes:
[0019] Send sentence is used to express the action of sending data;
[0020] Assign sentence pattern is used to indicate the action of assigning a value to a certain data;
[0021] The call sentence is used to indicate the call to a function module inside the system or a shared function module outside the system.
[0022] Jump sentence is used to indicate the transfer of a specified action in the functional flow;
[0023] ValueCondition sentence pattern, used to express complex conditions consisting of AND / OR relationships;
[0024] EventCondition sentence pattern, used to express event triggering conditions;
[0025] TimeCondition sentence pattern, used to express time constraints;
[0026] ConditionalSentence sentence pattern, used to express if-else conditional judgment;
[0027] LoopSentence sentence pattern, used to express loop structure;
[0028] ConcurrentSencence sentence pattern is used to represent the parallel operation of statements.
[0029] Furthermore, the non-functional sentence patterns include:
[0030] ConstraintSentence, used to constrain quantitative non-functional requirements;
[0031] RangeSentence, used to constrain quantitative non-functional requirements;
[0032] PeriodicitySentence, used to collaborate qualitative non-functional requirements with corresponding requirement templates;
[0033] TradeOffSentence is used to describe the optimization relationship.
[0034] Furthermore, the step 3 specifically includes the following steps:
[0035] Identify the RNLReq metamodel, repair the incorrectly identified RNLReq metamodel, and convert the correctly identified RNLReq metamodel into different views in the SysML architecture model according to the transformation rules;
[0036] The conversion rules include generation algorithms of hierarchy view / data view, generation algorithms of internal interaction view, generation algorithms of functional view and generation algorithms of non-functional view.
[0037] Furthermore, the algorithm for generating the hierarchical structure view / data view includes:
[0038] Convert each data in the data dictionary in the RNLReq metamodel to a value type in the SysML architecture model;
[0039] Generate a block definition diagram for the system requirement template in the RNLReq metamodel; convert each subsystem requirement module into a Block, connect them through the hierarchical relationship between each Block, and attach each Block and the connection relationship to the block definition diagram;
[0040] The generation algorithm of the internal interaction view includes:
[0041] Generate an internal module diagram according to the interface requirements in the subsystem requirement template, and associate the internal module diagram with the block definition diagram of the system requirement template corresponding to the subsystem requirement template; add the Block corresponding to the subsystem requirement template to the internal module diagram, and represent the communication relationship through interface connection;
[0042] The generation algorithm of the functional view includes:
[0043] The expression of the functional characteristics of the safety-critical autonomous system constrained by the constraint rules includes simple sentences and compound behavior sentences, wherein the simple sentences include: Send sentence, Assign sentence, Call sentence and Jump sentence; the compound behavior sentence includes: ValueCondition sentence, EventCondition sentence, TimeCondition sentence, ConditionnalSentence sentence, LoopSentence sentence and ConcurrentSencence sentence;
[0044] Map simple sentences to corresponding activity nodes;
[0045] Treat the composite behavior sentence as a search tree that requires recursion, and convert the functional requirements into an activity diagram by searching and parsing all subtrees in the search tree;
[0046] The generation algorithm of the non-functional view includes:
[0047] The expression of non-functional characteristics of the safety-critical autonomous system constrained by constraint rules and user requirements are inserted into the diagram of the SysML architecture model.
[0048] The present invention also discloses a tool for a safety-critical autonomous system modeling method based on SysML, comprising:
[0049] A term extraction module, which is used to extract terms from various natural language requirement documents in safety-critical autonomous systems;
[0050] The requirement classification module is used to classify and annotate various natural language requirement documents in safety-critical autonomous systems based on the extracted terms, generate domain lexicons and data dictionaries, and import the generated domain lexicons and data dictionaries into the requirement view module;
[0051] The demand view module is used to analyze user needs and use a graphical interface to display or edit domain lexicons, data dictionaries, and write demand templates according to user needs;
[0052] The requirement specification tool is used to specify various natural language requirement documents in the safety-critical autonomous system using requirement templates and constraint rules to obtain the RNLReq metamodel; the RNLReq metamodel includes a data dictionary, a domain vocabulary, an expression of the architecture of the safety-critical autonomous system constrained by the requirement template, and an expression of the functional / non-functional characteristics of the safety-critical autonomous system constrained by the constraint rules;
[0053] A transformation engine, for transforming the RNLReq metamodel into different views in the SysML architecture model according to transformation rules; the transformation rules include generation algorithms for hierarchy view / data view, generation algorithms for internal interaction view, generation algorithms for function view and generation algorithms for non-function view;
[0054] A graphical layout generation module for viewing a graphical representation of the generated SysML architecture model.
[0055] Further, the requirement template includes a system requirement template for expressing the highest level requirements and a basic requirement template for expressing the requirements of each component in the safety-critical autonomous system;
[0056] The system requirement template can be decomposed into multiple subsystem requirement templates, each subsystem requirement template can be decomposed into multiple function requirement templates, and each function requirement template can be decomposed into multiple sub-function requirement templates;
[0057] The architecture of the safety-critical autonomous system is expressed through the hierarchical relationship between templates.
[0058] Furthermore, the constraint rules include:
[0059] General restriction rules for limiting the use of natural language;
[0060] Functional requirement constraint rules are used to constrain the expression of functional characteristics of safety-critical autonomous systems according to predefined functional sentences;
[0061] Non-functional requirement constraint rules are used to constrain the expression of non-functional attribute characteristics of safety-critical autonomous systems according to predefined non-functional sentence patterns;
[0062] AI requirement constraint rules are used to constrain the expression of requirements for AI components.
[0063] Beneficial effects: The present invention has the following advantages:
[0064] (1) Starting from natural language requirements, the present invention explores the architecture modeling of a safety-critical autonomous system composed of traditional components and AI components. Through a structured limited Chinese natural language requirement template, the description method of the natural language requirements of traditional components and AI components is constrained, effectively reducing the ambiguity of natural language requirement expression;
[0065] (2) The present invention proposes an automatic conversion method from RNLReq to a SysML subset, which automates the model-driven development process and reduces the cost of development and iterative design. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] Figure 1 For tool framework;
[0067] Figure 2 The BNF grammar for the data dictionary;
[0068] Figure 3 BNF grammar for the domain vocabulary;
[0069] Figure 4 SubSysML metamodel;
[0070] Figure 5 A framework for the automatic conversion of RNLReq to SysML models. DETAILED DESCRIPTION
[0071] The inventive method is further described below in conjunction with the accompanying drawings.
[0072] The safety-critical autonomous system of the present invention is composed of traditional components and AI components. For traditional components, the original requirements are divided into four categories: functional requirements, interface requirements, data requirements, and non-functional requirements. Each requirement is now described:
[0073] Functional requirements: services that the system must provide;
[0074] Interface requirements: various interface relationships between the system and the environment;
[0075] Data requirements: describe the various data used by the component and the requirements for data collection;
[0076] Non-functional requirements: including security, reliability, real-time, performance and environmental constraints.
[0077] For AI components, the original requirements are divided into four categories: target requirements, AI functional requirements, AI non-functional requirements, and training / testing / operation data requirements. Each requirement is explained below:
[0078] Target requirements: the goals that the AI component needs to achieve;
[0079] AI functional requirements: describe the learning process of machine learning, such as the type of problem, description of the algorithm (or model), etc.
[0080] AI non-functional requirements: including security / reliability, real-time, performance (such as the quality of prediction results, such as accuracy, precision, recall, etc.), resource consumption, environmental constraints, explainability, robustness, etc.;
[0081] Training / testing / operational data requirements: including the quantity and quality of training / testing / operational data, such as consistency, completeness, correctness, and diversity.
[0082] Most of the above requirements are written in the form of free natural language text, which is usually ambiguous and difficult to process automatically. In order to reduce the ambiguity of natural language requirement expression, the present invention proposes a method of limiting the natural language requirement template RNLReq and configuring constraint rules to restrict users from recording requirements.
[0083] The restricted natural language requirement template RNLReq aims to reduce the ambiguity of natural language requirements without changing the requirements writing habits of system engineers. Specifically, the restricted natural language requirement template RNLReq consists of three parts: data dictionary, domain glossary (Glossary Repository) and requirement specification template (RNL template). The requirement specification template has a well-defined sentence pattern based on restriction rules.
[0084] The data dictionary refers to a dictionary that covers the data and its attributes involved in the requirements document. The data dictionary needs to fill in the Chinese name, English name, data composition (for example, (angular velocity, angular position)), unit, range, accuracy, rate, ID and other information of the data. Figure 2 The BNF grammar of the data dictionary is given. According to the actual needs of the industry, the data dictionary includes but is not limited to static data, input data, and output data. Among them, static data refers to the constants in the system, input data refers to the input of each component, and output data refers to the output of each component.
[0085] The domain glossary repository refers to a glossary that covers various object nouns in the requirement document. The domain glossary needs to contain the Chinese name, English name, noun category, ID and other information of the object noun. Figure 3 The BNF grammar of the domain vocabulary is given.
[0086] Among them, the requirement specification template includes a system requirement template and a basic requirement template; the system requirement template (SystemRequirement Template, SRT) represents the highest level requirements of the system, and engineers can decompose the highest level requirements of the system into multiple subsystem requirements, which are described by the subsystem requirement template (Sub SystemRequirement Template, SubSRT). The decomposition of SubSRT can be iterative. Each subsystem requirement is decomposed into multiple function requirement templates (Function Requirement Template, FRT), and the function requirement template is decomposed into a sub function requirement template (Sub Function Requirement Template, SubFRT). The standard of template granularity, especially whether SubSRT should be decomposed into FRT instead of a lower-level SubSRT, is the implementation strategy for each subsystem and function. The basic requirement template supports the requirements of traditional components and AI components. Table 1 gives the basic requirement template. Note that when the basic requirement template is used to specify the requirements of AI components, functional requirements and non-functional requirements are marked as NA.
[0087] Table 1 Basic requirement template
[0088]
[0089] The constraint rules provided by the present invention include general restriction rules, functional requirement constraint rules, non-functional requirement constraint rules and AI requirement constraint rules.
[0090] General restrictions include but are not limited to the following:
[0091] R1: The subject of the sentence must be the module name.
[0092] R2: The sentence must be a declarative sentence.
[0093] R3: The sentence must be in present tense.
[0094] R4: Do not use passive voice.
[0095] R5: Only complete sentences are allowed.
[0096] R6: Do not use modal verbs, pronouns, adverbs and adjectives that express negative meaning.
[0097] R7: The same word should be used to refer to the same object.
[0098] R8: Describe the interactions between systems without neglecting subjects or objects.
[0099] Functional requirement constraint rules are targeted at functional requirements, including simple functional sentences and compound behavior sentences (Compound Sentence); among them, simple functional sentences include: Send sentence, which indicates the action of sending data. Assign sentence, which indicates the action of assigning a value to a certain data. Call sentence, which indicates the call to a functional module inside the system or a shared functional module outside. Jump sentence, which indicates the transfer of the specified function in the functional flow. Simple behavior sentences can only express basic functional behaviors and cannot be applied to some complex event sequences, conditional sequences and other execution behaviors in system requirements. Therefore, it is necessary to use predefined keywords (IF ELSE, AND, OR, LOOP, etc.) and sentences to combine simple description statements into compound behavior sentences (Compound Sentence). Complex functional sentences include ValueCondition, EventCondition, TimeCondition, LoopSentence, ConcurrentSencence, etc. Among them, ValueCondition represents a complex condition composed of AND / OR relationships, EventCondition represents an event-triggered condition, TimeCondition represents a time constraint, LoopSentence represents a loop structure, and ConcurrentSencence represents the parallel execution of a group of behavioral statements.
[0100] The following are simple function sentences:
[0101] S1: SimpleBehaviorSentence, is the minimum granularity of functional behavior decomposition, which can be implemented as one of s2 to s5.
[0102] S2: Send, Send <data>at <port>
[0103] S3:Assign,Assign <data-a>to <data-b>
[0104] S4:Call,Call <system> <sharedfunction>
[0105] S5:Jump,Jump <function>
[0106] The following are compound action sentences:
[0107] S6: SimpleValueCondition: <p1> <comparator> <value> <unit>, indicating a value condition, the attribute p1 and the value Value are compared according to the rules specified by Comparator, for example: P1>Value.
[0108] S7:ValueCondition: multiple SimpleValueConditions connected by AND, OR, etc.;
[0109] S8: EventCondition: The current module receives event E;
[0110] S9: TimeCondition: DURING (T1, T2), indicating the time constraint from T1 to T2;
[0111] S10:ConditionnalSentence:IF Condition,THEN SentenceA,[ELSESentenceB];
[0112] S11: LoopSentence: LOOP SentenceA EACH T UNTIL E;
[0113] S12:ConcurrentSencence:MEANWHILE(SentenceA,SentenceB,SentenceC,..);
[0114] Non-functional requirements focus on the performance of the system and the constraints it faces. Non-functional requirements do not exist independently, they are a supplement to functional requirements. Non-functional requirements include the following attributes: performance, security, reliability, environmental constraints, etc. Among them, the non-functional requirements attributes that can be quantitatively described and analyzed include performance, reliability and security. Among them, performance includes but is not limited to the system's time performance and the system's resource performance. The system's time performance, that is, real-time requirements, includes periodic / non-periodic execution, deadline, timeout, jitter, response time, schedulability, etc. The system's resource performance includes resource consumption (such as power consumption, CPU, storage, bus) and physical environment constraints (such as temperature, quality, pressure). Reliability includes the probability of system failure, etc. The constraint sentences of non-functional requirements include: using ConstraintSentence and RangeSentence to give quantitative non-functional requirement constraint statements, using PeriodicitySentence to collaborate qualitative non-functional requirements with corresponding system / functional templates, and using TradeOffSentence to describe an "optimization" relationship that can be calculated by function.
[0115] The following is the constraint sentence structure of non-functional requirements:
[0116] S13:ConstraintSentence: <property> <comparator> <value> <unit><margin oferror>
[0117] S14:RangeSentence: <property>within[min,max]
[0118] S15:PeriodicitySentence:LOOP SentenceA EACH T UNTIL E
[0119] S16:TradeOffSentence: <property>optimizedBy <obj1> , <obj2> , <obj3>with <method>
[0120] As for AI requirement constraint rules, as mentioned above, AI requirements are divided into six categories, including training data requirements, test data requirements, operation data requirements, target requirements, AI functional requirements and AI non-functional requirements. The description and further decomposition of each category are explained as follows:
[0121] Training data requirements and test data requirements: Machine learning methods generate models based on training data and evaluate the generated models based on test data. Both data are collected during development. This category is broken down into quantity, completeness, consistency, and correctness. Among them:
[0122] Quantity: Data specifications include the properties of data quantity, such as size and diversity. Since the training data and test data come from the same source, they share the same data specification.
[0123] Completeness: Completeness specifies the sparsity of data in each feature.
[0124] Consistency: The consistency between input data and test data (assuming the same environment) ensures consistency.
[0125] Correctness: Strongly influenced by how data is cleaned, collected, and stored.
[0126] Completeness, consistency, and correctness constitute data quality. The following are the constraints on data quality, including:
[0127] D1: Data must cover all possible values.
[0128] D2: Additional data sources that satisfy the assumptions can be used to augment the original data to obtain a richer training dataset.
[0129] D3: Each data in a dataset must be in the same format and representation.
[0130] D4: Data must be validated and cleaned before use.
[0131] D5: No user-collected or labeled data is used.
[0132] To ensure completeness, rule D1 checks the sparsity of data in each feature, rules D2 and D3 are used to ensure data consistency, rule D4 emphasizes the data collection process, which has a great impact on the correctness of the data, and rule D5 reduces discrimination and bias in data from users.
[0133] Operational data requirements: Like traditional components, AI components take data as input when operating. This data is called input data or operational data. Although the distribution of training data and test data is roughly the same, their relationship with operational data is not clear, and operational data often changes over time or in the environment. Therefore, it is very important to check the consistency between operational data and training data and test data.
[0134] Target requirements: well-defined satisfaction criteria, such as evaluation metrics, expected state of the system, expected prediction range.
[0135] AI functional requirements: Machine Learning (ML) in AI includes more than a dozen problem types (e.g., binary or multi-class classification, regression, clustering), as well as more specific algorithm types (e.g., logistic regression, linear regression, naive Bayes, nearest neighbor, deep neural network). In order to get a global view of the ML solution used, AI functional requirements include problem type, algorithm type, layer information in the deep learning system, and characteristics of the model when updating.
[0136] AI non-functional requirements: To ensure the robustness of AI components, several aspects of non-functional quality such as security / reliability, real-time, performance, and explainability are considered.
[0137] Safety / Reliability: If the safety / reliability estimate of a single prediction reaches a threshold, the model should be retrained or the solution refined.
[0138] Real-time / performance: The accuracy (correctness of the output) and real-time (speed of the process) of AI components need to be guaranteed, and a fallback plan needs to be specified.
[0139] Resource consumption: Onboard computing and communication are limited by resources such as bandwidth for sending / receiving data, power consumption, storage, and storage of data buffers.
[0140] Interpretability: Although ML models are opaque structures and inherently difficult to interpret, engineers are able to give specifications to explain the model’s behavior around a given data point or feature.
[0141] Through the above templates or rules, complex structures, ambiguities and inconsistencies in requirements can be effectively avoided, ultimately improving the quality of requirements.
[0142] Since the computing, physical and communication parts of a safety-critical intelligent autonomous system are closely integrated and heterogeneous, the present invention proposes a multi-view method based on SysML to model the safety-critical intelligent autonomous system, which enables designers to focus on specific aspects of the system from different perspectives.
[0143] In order to realize the automatic generation of SysML architecture model, the present invention provides an extended subset of SysML, SubSysML, and uses the template function provided by Xtend to realize the mapping of the limited natural language requirement template RNLReq to the SysML subset element conversion rule, thereby realizing the conversion of RNLReq to the SysML architecture model.
[0144] Figure 4 The metamodel of SubSysML is given. SubSysML consists of block definition diagram (BDD), internal block diagram (IBD), activity diagram (ActD) and stereotypes (such as ConstraintRequirement and AIComponent). The views of SysML architecture model include hierarchy view, internal interaction view, functional view, non-functional view and data view; the hierarchy view, internal interaction view, functional view, non-functional view and data view are introduced in detail below.
[0145] The hierarchical view reflects the compositionality of the system; the hierarchical view is represented by a block definition diagram (BDD) and its elements such as Block and AIComponent (dashed rectangular box nodes). Block is a key element of BDDs and can represent the basic structural decomposition for static structural modeling of the system. The attributes of Block represent the state and properties of the system. AIComponent is a subtype of SysMLBlock and has attributes that describe the data and algorithm characteristics in the AI requirement template. Given a system, SubSysML specifies the system model as a BDD. Inside the BDD, it uses Block to represent the hierarchical structure of the system.
[0146] The internal interaction view reflects the interaction between different sub-components in the system; the internal interaction view is represented by internal block diagrams IBDs and their elements such as ports and attributes (solid line rectangular box nodes). For example, given a parent block, we use IBD to represent the communication between child blocks through ports. The internal block diagram IBD and the block definition diagram BDD provide complementary views of the block.
[0147] The functional view reflects the dynamic behavior of the system. The functional view is represented by the activity diagram (ActD) and its elements (solid line rounded box nodes).
[0148] SubSysML contains several types of activity nodes, such as call behavior operations (representing the basic functional unit in an activity), initial / final nodes (marking the start / end of an activity), fork / join nodes (marking the start / end of a concurrent sequence), decision / merge nodes (marking the start / end of an alternate sequence), send signal operations (sending a signal instance to a target), and accept event operations (waiting for a signal to continue an activity). ActivityPartition assigns activity nodes to blocks. The ConstraintRequirement of an activity node can represent some constraints, such as the timing that the running component should meet.
[0149] Non-functional view: In the non-functional view, the existing SysML constraint stereotypes are extended to specify non-functional properties, including safety, reliability, performance, etc. A ConstraintRequirement can contain an OCL expression that formalizes acceptance conditions, thresholds for traditional components, or data requirements for AI components.
[0150] Data View: Captures the data structure of the system using objects, attributes, operations, and relationships. Extends the SysML ValueType stereotype to model the system data structure specified by the data dictionary. The BaseType package contains predefined data types such as Integer 16, Float 64, and Boolean. The DataType package contains all data types defined by the system engineer.
[0151] Figure 5 The automatic conversion framework from RNLReq to SysML architecture model is given. Figure 5 , the conversion method from RNLReq to SysML architecture model is explained.
[0152] Identify incorrect templates and repair them; for example, if SystemTemplate has an input port but cannot find the corresponding output port, it means that the RNLReq metamodel is incorrect and needs to be repaired; only RNLReq that passes the detection can be converted into different views in the SysML architecture model according to the conversion rules.
[0153] Based on the generation algorithm of the hierarchical structure view / data view, the detected RNLReq model is converted into the hierarchical structure view / data view in the SysML architecture model.
[0154] The following pseudo code is used to illustrate the generation algorithm of the hierarchical view / data view:
[0155] Using the RNLReq metamodel as input, each data defined in the data dictionary in the RNLReq metamodel is converted into a value type in the SubSysML model (see lines 1 to 3); a block definition diagram (BDD) is generated for the system requirement template (see lines 4 to 6); each subsystem requirement module is converted into a Block block, and each Block block is connected to the top Block block using a combination relationship through a connector, and each Block block is attached to the Block definition diagram (see lines 7 to 11).
[0156] The hierarchical structure of the system is constructed through the generation algorithm of the hierarchical structure view / data view, and the top-level system requirement template is the root block in the hierarchy.
[0157]
[0158] Based on the internal interaction view generation algorithm, the detected RNLReq model is converted into the internal interaction view in the SysML architecture model.
[0159] The following pseudo code is used to illustrate the generation algorithm of the internal interaction view: First, check whether each subsystem requirement template contains interface requirements. If it contains input / output information, an internal block diagram (IBD) is generated and associated with the system requirement template (parent template). Then, the blocks corresponding to each subsystem requirement template will be added to the IBD, and the communication relationship between them is represented by the connection between the ports.
[0160]
[0161]
[0162] Based on the functional view generation algorithm, the detected RNLReq model is converted into the functional view in the SysML architecture model.
[0163] The following pseudo code is used to illustrate the algorithm for generating functional views:
[0164] The functional requirements are converted into activity diagrams. The structure of the functional requirement template can be viewed as a tree, with each simple functional sentence and conditional sentence being viewed as a parsable leaf node. Lines 9 to 12 and 21 to 25 show the rules for mapping conditional sentences and functional sentences to corresponding activity nodes. Lines 13 to 14 indicate that the compound behavior sentence is a non-leaf node, requiring a recursive search tree until all subtrees are searched and parsed, before the entire functional requirement can be converted into an activity diagram.
[0165] The pseudo code of the function view generation algorithm is expressed as:
[0166]
[0167]
[0168] Based on the generation algorithm of non-functional views, the detected RNLReq model is converted into the non-functional views in the SysML architecture model.
[0169] The following pseudo code is used to illustrate the generation algorithm of non-functional views:
[0170] Insert non-functional and AI requirements into the diagram of the SysML model. Lines 4 to 7 convert constraint statements and scope statements into OCL expressions and add the OCL expressions to the constraints of the SysML model. Lines 8 to 12 add behavioral constraints (WCET or deadline) to the activity diagram to constrain the corresponding activity nodes. Lines 13 to 23 convert each system requirement module containing AI requirements into an AIComponent block and generate the properties of the block.
[0171] The pseudo code of the non-functional view generation algorithm is expressed as:
[0172]
[0173]
[0174] like Figure 1 The tool framework shown in the figure, which implements the tool of the present invention, is developed on an Eclipse platform integrated with a Papyrus plug-in, and mainly includes: a term extraction module Glossary Extractor, a requirement classification module ReqClassifier, a requirement view module Req Viewer, a conversion engine RNL2SysML Mapper, and a graphic layout generation module Layout Visualizer.
[0175] The Glossary Extractor module performs word segmentation, part-of-speech tagging, and syntactic analysis on the original demand text based on the HanLP Chinese NLP toolkit, extracts terms, and generates a preliminary domain vocabulary and data dictionary based on the extracted terms;
[0176] The requirement classification module Req Classifier classifies and annotates the original requirement text based on HanLP and scikit-learn toolkit, and imports the classified requirement text into the requirement view module Req Viewer;
[0177] Req Viewer, a demand view module, is used to analyze user needs, edit domain lexicons, data dictionaries, and write demand templates;
[0178] The requirement specification tool is used to specify various natural language requirement documents in safety-critical autonomous systems using requirement templates and constraint rules to obtain the RNLReq metamodel.
[0179] The conversion engine RNL2SysML Mapper uses ecore to implement the metamodel and uses EMF (Eclipse Modeling Framework) technology to generate the corresponding model code. In the Papyrus environment, SysML models are stored in files with extensions of di, uml, and notation. The .di file saves the model's workspace status information, the .uml file saves the model element definition and semantic relationship information, and the .notation file saves the model's visualization information, such as coordinates, size, color, etc. The Element Generator is responsible for generating the .uml file corresponding to the SysML architecture model element.
[0180] The graphical layout generation module Layout Visualizer is used to generate the corresponding graphical elements, save them in .notation files, and then open the .di file to use the built-in editor of Papyrus to view the graphical display of the generated SysML architecture model.< / method> < / obj2> < / obj1> < / property> < / property> < / unit> < / value> < / comparator> < / property> < / unit> < / value> < / comparator> < / p1> < / function> < / sharedfunction> < / system> < / port> < / data>
Claims
1. A SysML-based safety-critical autonomous system modeling method, characterized by: The following steps are involved: Step 1: For various natural language requirement documents in a safety-critical autonomous system, a requirement template and constraint rules are used to regulate the natural language requirement documents and define an RNLReq metamodel; the safety-critical autonomous system includes an AI component; Step 2: Select the extended SysML subset to support the functional and non-functional extensions of the RNLReq metamodel and define the transformation rules from the RNLReq metamodel to different views in the SysML architecture model; Step 3: Based on the transformation rules, the RNLReq metamodel is transformed into different views in the SysML architecture model; Each type of natural language requirement document includes a natural language requirement document corresponding to the original requirements of the AI component, and the original requirements of the AI component include: target requirements, AI functional requirements, AI non-functional requirements, training data requirements, test data requirements, and operation data requirements; The constraints include: General restriction rules for limiting the use of natural language; Functional requirement constraint rules are used to constrain the expression of functional characteristics of safety-critical autonomous systems according to predefined functional sentences; Non-functional requirement constraint rules are used to constrain the expression of non-functional attribute characteristics of safety-critical autonomous systems according to predefined non-functional sentence patterns; AI requirement constraint rules are used to constrain the expression of AI component requirements; including data quality constraint rules corresponding to training data requirements and test data requirements, constraint rules corresponding to operation data requirements, constraint rules corresponding to target requirements, constraint rules corresponding to AI functional requirements, and constraint rules corresponding to AI non-functional requirements; The data quality constraint rules corresponding to the training data requirements and the test data requirements include: D1: The data must cover all possible values; D2: Additional data sources that meet the assumptions can be used to augment the original data to obtain a richer training dataset; D3: Each data must be in the same format and representation; D4: Data must be verified and cleaned before use; D5: Do not use data collected or labeled by users; The constraint rules corresponding to the operation data requirements include: consistency between the operation data and the training data and the test data; The constraint rules corresponding to the target requirements include: meeting the defined satisfaction standards; The constraint rules corresponding to the AI functional requirements include: covering the problem type, algorithm type, layer information in the deep learning system, and the characteristics of the model during update; The constraint rules corresponding to the non-functional requirements of AI include: Constraints on safety or reliability, including: if the safety or reliability estimate of a single prediction reaches a threshold, the model is retrained; Constraints on real-time or performance, including: specifying fallback plans; Constraints on resource consumption, including: Constraints on resource consumption for onboard computing and communications; Constraints on interpretability, including: canonical explanations of the model’s behavior around a given data point or feature; The step 3 specifically includes the following steps: Identify the RNLReq metamodel, repair the incorrectly identified RNLReq metamodel, and transform the correctly identified RNLReq metamodel into different views in the SysML architecture model according to transformation rules, wherein the views include: a hierarchical structure view, an internal interaction view, a functional view, a non-functional view, and a data view; The conversion rules include generation algorithms of hierarchical structure view / data view, generation algorithms of internal interaction view, generation algorithms of functional view and generation algorithms of non-functional view; The algorithm for generating the hierarchical structure view / data view includes: Convert each data in the data dictionary in the RNLReq metamodel to a value type in the SysML architecture model; Generate a block definition diagram for the system requirement template in the RNLReq metamodel; convert each subsystem requirement module into a Block, connect them through the hierarchical relationship between each Block, and attach each Block and the connection relationship to the block definition diagram; The generation algorithm of the internal interaction view includes: Generate an internal module diagram according to the interface requirements in the subsystem requirement template, and associate the internal module diagram with the block definition diagram of the system requirement template corresponding to the subsystem requirement template; add the Block corresponding to the subsystem requirement template to the internal module diagram, and represent the communication relationship through interface connection; The generation algorithm of the functional view includes: The expression of the functional characteristics of the safety-critical autonomous system constrained by the constraint rules includes simple sentences and compound behavior sentences, wherein the simple sentences include: Send sentence, Assign sentence, Call sentence and Jump sentence; the compound behavior sentence includes: ValueCondition sentence, EventCondition sentence, TimeCondition sentence, ConditionnalSentence sentence, LoopSentence sentence and ConcurrentSencence sentence; Map simple sentences to corresponding activity nodes; Treat the composite behavior sentence as a search tree that requires recursion, and convert the functional requirements into an activity diagram by searching and parsing all subtrees in the search tree; The generation algorithm of the non-functional view includes: The expression of non-functional characteristics of the safety-critical autonomous system constrained by constraint rules and user requirements are inserted into the diagram of the SysML architecture model.
2. A SysML-based safety-critical autonomous system modeling method according to claim 1, characterized in that: The RNLReq metamodel includes a data dictionary, a domain vocabulary, an expression of the architecture of the safety-critical autonomous system constrained by a requirement template, and an expression of the functional / non-functional characteristics of the safety-critical autonomous system constrained by constraint rules; Wherein, the requirement template includes a system requirement template for expressing the highest level requirements and a basic requirement template for expressing the requirements of each component in a safety-critical autonomous system; The system requirement template can be decomposed into multiple subsystem requirement templates, each subsystem requirement template can be decomposed into multiple function requirement templates, and each function requirement template can be decomposed into multiple sub-function requirement templates; The architecture of the safety-critical autonomous system is expressed through the hierarchical relationship between templates.
3. The method for modeling a safety-critical autonomous system based on SysML according to claim 1, characterized in that: The functional sentences include: Send sentence is used to express the action of sending data; Assign sentence pattern is used to indicate the action of assigning a value to a certain data; The call sentence is used to indicate the call to a function module inside the system or a shared function module outside the system. Jump sentence is used to indicate the transfer of a specified action in the functional flow; ValueCondition sentence pattern, used to express complex conditions consisting of AND / OR relationships; EventCondition sentence pattern, used to express event triggering conditions; TimeCondition sentence pattern, used to express time constraints; ConditionalSentence sentence pattern, used to express if-else conditional judgment; LoopSentence sentence pattern, used to express loop structure; ConcurrentSencence sentence pattern is used to represent the parallel operation of statements.
4. The method for modeling a safety-critical autonomous system based on SysML according to claim 1, characterized in that: The non-functional sentences include: ConstraintSentence, used to constrain quantitative non-functional requirements; RangeSentence, used to constrain quantitative non-functional requirements; PeriodicitySentence, used to collaborate qualitative non-functional requirements with corresponding requirement templates; TradeOffSentence is used to describe the optimization relationship.
5. A tool for modeling a safety-critical autonomous system based on SysML according to any one of claims 1 to 4, characterized in that: include: A term extraction module, which is used to extract terms from various natural language requirement documents in safety-critical autonomous systems; The requirement classification module is used to classify and annotate various natural language requirement documents in safety-critical autonomous systems based on the extracted terms, generate domain lexicons and data dictionaries, and import the generated domain lexicons and data dictionaries into the requirement view module; The demand view module is used to analyze user needs and use a graphical interface to display or edit domain lexicons, data dictionaries, and write demand templates according to user needs; Requirements specification tool, which is used to specify various natural language requirements documents in safety-critical autonomous systems using requirements templates and constraint rules to obtain the RNLReq metamodel; The RNLReq metamodel includes a data dictionary, a domain vocabulary, an expression of the architecture of a safety-critical autonomous system constrained by a requirement template, and an expression of the functional / non-functional characteristics of a safety-critical autonomous system constrained by constraint rules; A transformation engine, for transforming the RNLReq metamodel into different views in the SysML architecture model according to transformation rules; The conversion rules include a generation algorithm for a hierarchical structure view / data view, a generation algorithm for an internal interaction view, a generation algorithm for a functional view, and a generation algorithm for a non-functional view; A graphical layout generation module for viewing a graphical representation of the generated SysML architecture model.
6. The tool according to claim 5, characterized in that: The requirement templates include a system requirement template for expressing the highest level requirements and a basic requirement template for expressing the requirements of each component in a safety-critical autonomous system; The system requirement template can be decomposed into multiple subsystem requirement templates, each subsystem requirement template can be decomposed into multiple function requirement templates, and each function requirement template can be decomposed into multiple sub-function requirement templates; The architecture of the safety-critical autonomous system is expressed through the hierarchical relationship between templates.
7. The tool according to claim 5, characterized in that: The constraints include: General restriction rules for limiting the use of natural language; Functional requirement constraint rules are used to constrain the expression of functional characteristics of safety-critical autonomous systems according to predefined functional sentences; Non-functional requirement constraint rules are used to constrain the expression of non-functional attribute characteristics of safety-critical autonomous systems according to predefined non-functional sentence patterns; AI requirement constraint rules are used to constrain the expression of requirements for AI components.
