SysML model fault tree generation method based on large language model

By constructing a SysML model fault tree using a large language model and RAG technology, the problems of low efficiency and insufficient accuracy of traditional fault tree analysis are solved, realizing intelligent, fast and accurate fault tree generation and analysis, which is suitable for the design and verification of safety-critical systems.

CN121580178APending Publication Date: 2026-02-27NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511441141.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

Traditional fault tree analysis relies on expert experience, which is inefficient, costly, and prone to omissions and subjective biases. SysML models are complex and contain a large amount of information, making them difficult to analyze. Existing technologies have insufficient performance optimization in fault tree extraction tasks.

Method used

A knowledge base with safety-critical domains is constructed using a large language model. Combined with RAG technology and a mind chain prompting framework, a safety-related extension is extracted through a SysML model to generate a structured safety model and automatically generate a fault tree model. The FTAnalysis tool is used to achieve an integrated process.

Benefits of technology

It improves the intelligence level of fault tree generation, reduces reliance on expert experience, enhances analysis efficiency and accuracy, reduces human error, strengthens model interpretability and scalability, and supports rapid and safe analysis of SysML models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121580178A_ABST
    Figure CN121580178A_ABST
Patent Text Reader

Abstract

The invention discloses a SysML model fault tree generation method based on a large language model. The method comprises the following steps that 1, the large language model with safety key domain knowledge is constructed; 2, inputting the SysML model and the invalid text into the large language model, and designing cue words to guide the large language model to extract security correlation extension from the SysML model; the cue word is obtained according to a fault tree analysis cue framework based on a thinking chain; 3, generating a structured security model based on the extracted security correlation extension; and step 4, generating a fault tree model according to the structured security model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of safety-critical technology, specifically a method for generating fault trees based on SysML models using large language models. Background Technology

[0002] Safety-critical systems are complex systems composed of software, hardware, and firmware components. Their failure can lead to serious consequences such as personal injury, equipment damage, and property loss. Safety analysis and system development are conducted in parallel and throughout the entire lifecycle, with both working together to ensure the quality and safety of the system.

[0003] SysML, a typical model-based security analysis (MBSA) language, ensures system security through its model structure that supports formal verification and its integrated interface that supports various security analysis tools. Compared with other system modeling languages, SysML places greater emphasis on requirements tracing and functional structure consistency modeling throughout the system's entire lifecycle.

[0004] Fault tree analysis (FTA) is a typical top-down safety analysis method that can systematically identify fault paths and failure causes, and is one of the most commonly used system safety verification methods in industry. However, the modeling process of traditional FTA mainly relies on expert experience and manual extraction, which is not only inefficient and costly, but also prone to omissions and subjective biases. Summary of the Invention

[0005] Purpose of the Invention: This invention aims to address the problems of low efficiency, high cost, and susceptibility to omissions and subjective biases caused by the reliance on expert experience and manual extraction in traditional fault tree analysis. Furthermore, it addresses the challenges of analyzing complex SysML models with large amounts of information, as well as the insufficient performance optimization of existing prompting engineering techniques in fault tree extraction tasks. This invention provides a SysML model fault tree generation method based on a large language model, significantly improving the intelligence of fault tree generation and enhancing analysis efficiency and reliability.

[0006] Technical solution: A method for generating fault trees for SysML models based on large language models, comprising the following steps: Step 1: Construct a large language model with knowledge of safety-critical domains; Step 2: Input the SysML model and the failure text into the large language model, and design prompt words to guide the large language model to extract security-related extensions from the SysML model; the prompt words are obtained based on the fault tree analysis prompt framework based on the thought chain. Step 3: Based on the extracted security relevance extensions, generate a structured security model; Step 4: Generate a fault tree model based on the structured security model.

[0007] Furthermore, a large language model with safety-critical domain knowledge is constructed according to the following steps: Build an external knowledge base for key security areas; The external safety-critical domain knowledge base is used as an external knowledge source and attached to the large language model to obtain a large language model with safety-critical domain knowledge.

[0008] Furthermore, the fault tree analysis suggestion framework based on the thought chain specifically includes: Identify key components, including: parsing the SysML model to identify components, functions, and interfaces related to the failure scenario; Generate failure modes, including inferring possible failure modes using component descriptions; Generate failure effects, including inferring failure effects based on failure modes; Build security-related extensions, including outputting intermediate results according to a specific structure; Analyze the components of the security model, including analyzing the behavior definition, key attributes and constraints of each component in the SysML model, and identifying connections, interfaces and dependencies; Identify hazardous events, including extracting failure modes as candidate hazardous events; Identifying top-level events involves identifying the most systemic or lethal events from among the candidate hazardous events. Intermediate events and fault propagation paths include constructing multi-layered event propagation logic based on top-level events and dangerous events, combined with the structure and behavior of components in the SysML model, and selecting logic gates; Constructing a fault tree model involves combining top-level events, intermediate events, fault propagation paths, and hazardous events to build a multi-level fault tree model.

[0009] Furthermore, the prompt words are obtained based on a fault tree analysis prompt framework based on thought chains, including: The prompts include: task settings, a fault tree analysis prompt framework based on thought chain, example guidance, and output constraints; the output constraints are used to limit the large language model to generate intermediate results in JSON format and the multi-level fault tree model.

[0010] Furthermore, it also includes: Step 5: Generate a visualization of the fault tree model.

[0011] Furthermore, the process of generating a visualization from the fault tree model specifically includes: By recursively traversing the nodes of the fault tree model, PlantUML graphical language code is generated based on the node type and its gate type, and finally a visual fault logic structure diagram is constructed.

[0012] Furthermore, the retrieval enhancement generation technology introduces a hybrid weighted retrieval strategy into existing retrieval enhancement generation technologies; The hybrid weighted retrieval strategy involves weighting and merging the results from different retrieval tools by setting different weights to obtain the final retrieval result.

[0013] Furthermore, the retrieval enhancement generation technology introduces a re-ranking mechanism into existing retrieval enhancement generation technologies; The re-ranking mechanism involves using a cross-coding re-ranking model to score the deep relevance between the document and the query after the initial retrieval of the document. The text blocks are paired with the scores to find the top k text blocks with the highest similarity. Only the document with the highest score after re-ranking is retained as the output.

[0014] Beneficial Effects: This invention constructs a large model with knowledge of safety-critical domains using Retrieval Enhanced Generation (RAG) technology, enabling it to act as an expert in the relevant field. Through a chain-of-thought-based fault tree hint framework, complex tasks are broken down into relatively simple sub-tasks, thereby improving the performance of the large model in complex SysML model analysis tasks. This achieves the extraction of safety-related extensions from SysML models, the construction of safety models, and the automatic generation of fault tree models. Furthermore, this invention designs and develops an automated analysis tool based on Python, FTAnalysis, which integrates SysML model import, fault information extraction, safety model construction, and fault tree model construction. This method has significant advantages in improving fault tree generation efficiency and reducing human error, providing a new intelligent solution for the design and verification of safety-critical systems. Compared with existing technologies, this invention has the following advantages: (1) Intelligent security analysis: By introducing large language models and RAG technology, intelligent fault tree generation is realized, which reduces the reliance on expert experience and manual operation and improves analysis efficiency and accuracy.

[0015] (2) Improve analysis efficiency: The automated analysis tool FTAnalysis can quickly extract fault information from SysML models and generate fault trees, which greatly shortens the safety analysis cycle.

[0016] (3) Reduce human error: By using standardized prompting frameworks and automatic model generation, the subjective bias and omissions that may be introduced in manual analysis are reduced, and the reliability of the analysis results is improved.

[0017] (4) Enhance model interpretability: The thought chain prompting framework guides the model to reason step by step, making the reasoning process transparent and traceable, and facilitating manual inspection and verification.

[0018] (5) Optimize the performance of large models: By injecting RAG technology into the knowledge base of safety-critical domains and using a prompting framework based on the thought chain, the performance of large language models in specific security analysis tasks has been significantly improved.

[0019] (6) Integrated tool support: The FTAnalysis tool realizes the integrated process of SysML model import, fault information extraction, safety model construction and fault tree model construction, providing a convenient solution for the design and verification of safety-critical systems.

[0020] (7) Strong scalability: The extension mechanism of SysML V2 and the FaultProfile attachment extension proposed in this invention enable safety-critical systems to introduce safety analysis methods during modeling, which facilitates subsequent functional expansion and domain adaptation. Attached Figure Description

[0021] Figure 1 A schematic diagram of the overall framework of a SysML model fault tree generation method based on a large language model provided by the present invention; Figure 2 A schematic diagram of the RAG implementation process; Figure 3 Example diagrams for JSON formatted fault information expansion, structured security models, and fault tree models; Figure 4 Here is an example of visualizing a fault tree diagram using PlantUML, with a vehicle SysML model as an example. Detailed Implementation

[0022] The technical solution of the present invention will now be further described in conjunction with the accompanying drawings and embodiments.

[0023] This invention provides a method for generating fault trees for SysML models based on large language models, such as... Figure 1 As shown, it mainly includes the following two stages: the knowledge enhancement stage and the prompting engineering stage.

[0024] Phase 1: Knowledge Enhancement Phase. This phase aims to enhance the application capabilities of the large language model in safety-critical domains by constructing a knowledge base for safety-critical areas and combining it with the RAG retrieval enhancement mechanism. Specific operational steps include: Step 1: Construct a safety-critical domain knowledge base. The safety-critical domain knowledge base consists of manually written natural language requirements for the models and corresponding AADL model code. When constructing the knowledge base, its applicability and representativeness need to be considered, and a long text splitting strategy should be proposed based on task requirements.

[0025] The specific construction steps are as follows: S101: Define the degree of relevance and select a standard document.

[0026] Determine the scope of the security-critical areas to be included in the knowledge base, prioritize core-related documents, supplement with indirectly related documents, and exclude low-relevance documents.

[0027] The selected standard documents include, but are not limited to: "Fault Tree Analysis Guide GJB / Z768A-98" and "Fault Mode, Effects and Criticality Analysis Guide GJB / Z139-2006".

[0028] S102: Long Text Splitting Strategy The standards and guidelines selected in this embodiment are all long texts, ranging from tens to hundreds of pages in length and tens of thousands to hundreds of thousands of words. These long texts need to be broken down into smaller segments to facilitate learning by the large language model. The text splitting process requires comprehensive consideration of the semantic integrity of the text content, the segmentation logic, and the input length constraints of the model. Standard documents typically have a clear hierarchical structure. They are split according to the document structure, divided into several large modules by chapter, with multiple subsections under each chapter, each corresponding to a topic. Subsections are usually semantically self-consistent and independent content, suitable as basic learning units for the large language model. When the content within a subsection is still too long, it is further split into paragraphs or logical lists.

[0029] Step 2: RAG Specific Process.

[0030] Langchain is specifically designed for building complex, multi-step Natural Language Processing (NLP) applications. It provides a suite of tools and modules that make it easier for developers to create and manage NLP workflows consisting of multiple steps or components. The implementation process is as follows: (1) Load safety-critical domain knowledge files stored locally, such as "Fault Tree Analysis Guide GJB / Z768A-98". Read file: Read the contents of the loaded file and convert the contents into text format.

[0031] (2) The embedded model bge-small-zh is selected as the semantic chunker to divide the document into basic chunks. Length chunking: The basic chunks are divided into final chunks according to certain length rules.

[0032] (3) The segmented text is converted into numerical vectors by the selected Embedding model bge-large-zh and stored in the vector database chroma.

[0033] (4) Convert the user’s question or query into a vector in the same way as the text vectorization so that it can be compared in the same vector space.

[0034] (5) Match the top k most similar to the question vector in the vector text, and find the text vector that is closest to the question vector by calculating parameters such as cosine similarity and Euclidean distance.

[0035] (6) The matched text blocks are added to the Prompt along with the question as context information to form a context related to the question.

[0036] (7) Input the constructed Prompt into the large language model and use the efficient reasoning ability of the large language model to input the results of the adapted domain.

[0037] Step 3: RAG optimization strategy.

[0038] (1) To address the issues of RAG retrieval errors or failure to find relevant text blocks, this embodiment of the invention introduces a hybrid weighted retrieval strategy. The traditional retrieval method BM25 finds documents related to the query based on keyword matching. Vector retrieval uses an embedding model to convert text into vector representations and calculates semantic similarity based on cosine similarity. Hybrid weighted retrieval improves retrieval performance by combining these two methods. This embodiment sets different weights to weight and merge the retrieval results: 0.7 for the vector retrieval and 0.3 for the BM25 retrieval. This setting considers both keyword matching and semantic similarity simultaneously, avoiding information omissions or misunderstandings caused by a single retrieval method.

[0039] (2) Regarding the issue of RAG retrieving relevant content but not answering questions based on the relevant results, this problem indicates that the multiple content blocks returned by the model are not sorted or lack emphasis, failing to focus on core information. To address this issue, this embodiment of the invention introduces a re-ranking mechanism. After initially retrieving documents, a cross-coding re-ranking model is used to score the deep relevance between the documents and the query, pairing text blocks with scores to find the top k text blocks with the highest similarity. This significantly increases the priority of the most relevant documents in the input. Only the document with the highest score after re-ranking is retained as the generated output, ensuring the accuracy of the model's generation.

[0040] Phase Two: Hint Engineering. This phase aims to guide the large language model through SysML model analysis and generate a fault tree model using hint engineering techniques. Specifically, it includes the following steps: Mind chain hinting engineering is a technique that guides large language models to reason step by step by adding intermediate reasoning steps to hints. Its core idea is to break down complex problems into multiple sub-steps, requiring the model to explicitly demonstrate the reasoning process of each step before generating the final answer.

[0041] The core of the thought chain cues technology lies in guiding the model through step-by-step reasoning using structured cues. The cues explicitly require the model to follow predetermined analytical steps, thus introducing intermediate reasoning steps to ensure the logic and coherence of the reasoning process. The meticulous design of the cues is crucial; it clearly defines the task objectives at each stage, thereby reducing the possibility of ambiguity during reasoning. After receiving the thought chain cues, the model's internal mechanism generates reasoning content step-by-step according to the steps, resulting in a clearly structured output.

[0042] Based on the number of examples and design strategies, thought chain hints can be divided into different types. Few-shot thought chain hints (COT) utilize a small amount of example data to improve the model's performance on a specific task; zero-shot thought chain hints (COT) do not rely on any sample example data, but instead use existing knowledge and rules to solve problems.

[0043] In traditional fault tree analysis (FTA) methods, researchers need solid system knowledge, engineering experience, and meticulous logical reasoning skills to abstract top-level events from complex systems, identify relevant intermediate and basic events, and construct reasonable fault propagation paths based on these. Simply inputting a simple command like "generate a fault tree" into a large language model often fails to help the model understand the system structure, security logic relationships, or event progression chains. Therefore, introducing FTA hints based on thought chains can significantly improve the accuracy and interpretability of the analysis.

[0044] (1) Guiding step-by-step reasoning: The thinking chain breaks down complex tasks into multiple controllable sub-tasks, such as "identifying dangerous events → clarifying top-level events → constructing basic events → analyzing propagation paths", so that the model can gradually build a logic tree instead of outputting it all at once, avoiding omissions or logical breaks caused by task "jumping".

[0045] (2) Strengthen explicit modeling: The prompts at each step emphasize causal analysis and structural integrity, such as “each component must have a failure mode” and “logic gates must reflect dependencies”, to help the model maintain logical consistency and systematicity in the analysis.

[0046] (3) Enhance the depth of reasoning: A large amount of information implied in the SysML model or security extension, such as component functions and behavioral constraints, can be explicitly reasoned out by the model using strategies such as "reverse actions" and "connection dependencies" in the prompts, thereby improving the accuracy of fault identification.

[0047] (4) Enhanced traceability: The results of each stage of the thinking chain are clear and independent, which makes it easy for manual inspection of the rationality of each step. This is especially important for verification, validation and auditing in safety-critical systems.

[0048] (5) Stronger cross-model integration capability: The thought chain prompt allows multiple inputs (SysML model, security extension, security model) to be integrated into the inference chain, achieving a higher level of semantic fusion and structural mapping.

[0049] To improve the accuracy of FTA generation by large language models, this invention proposes a thought chain-based FTA prompting framework. This framework guides the large model to reason according to the thought process of manual analysis by designing a multi-step reasoning process in the prompt, thereby improving the accuracy and completeness of the fault tree generation by the large model. The specific reasoning steps are as follows: (1) Key component identification: First, the SysML model is parsed, and the language analysis capability is used to determine the hierarchy of the component structure, and to analyze the components, functions, interfaces and other modules related to the fault scenario. For example, child components or parent components are extracted and their corresponding interfaces are analyzed.

[0050] (2) Generate failure modes: Use component descriptions (especially behaviors / actions) to infer possible failure modes, guide deep thinking by prompting "antonyms of actions", and provide examples to improve the understanding of large models.

[0051] (3) Generate fault impact: Guide the large model to deduce the fault impact based on the fault modes obtained in the previous discussion.

[0052] (4) Construct a safety-related extension: Output an intermediate result from the SysML model to the fault tree model according to the structure {"component name", "failure mode", "failure impact"}, so that researchers or experts can compare and evaluate the results.

[0053] (5) Analyze the security model components: Analyze the type, function, connection, failure mode and security constraints of each component in the SysML model, and convert the failure information into structured fields (such as failure cause and constraint type).

[0054] (6) Hazardous event identification: The “failure mode” in the safety correlation extension is used as a candidate hazardous event.

[0055] (7) Top event determination: The most systematic and fatal event is identified from all dangerous events and designated as the top event.

[0056] (8) Intermediate events and fault propagation paths: Based on the top-level events and dangerous events, and combined with the structure and behavior of components in the SysML model, construct multi-layer event propagation logic. And reasonably select AND gates and OR gates.

[0057] (9) Fault tree model construction: Combine top-level events, intermediate events, propagation paths and dangerous basic events to construct a multi-level fault tree model.

[0058] Through explicit reasoning guidance, the large model proceeds step by step according to the nine reasoning stages mentioned above. While generating the final result, it ensures that the logical process of each step is output, thereby improving the transparency and credibility of the answer.

[0059] This invention provides a corresponding Prompt template. This template is systematically constructed from five aspects: task setting, input framework, thought chain guidance, example guidance, and output constraints. It aims to stimulate the model's multi-step reasoning ability and ensure the accuracy and structural consistency of the output. First, system prompts need to be set in the prompt words. System prompts need to clearly define the model's role and task objectives, which helps enhance the model's understanding of the task context.

[0060] System Prompt: You are a professional security analysis expert in a safety-critical area, with in-depth research on SysML V2 models. You are skilled at extracting potential fault information from the textual information and descriptions of the models and conducting professional fault tree analysis.

[0061] The prompt input structure is divided into two parts: a security analysis model (SysML model) and specific fault text. The prompt requires the model to complete the analysis step-by-step based on these two types of input information, thereby enhancing the efficiency of input information utilization. Simultaneously, the prompt incorporates the thought chain reasoning logic designed above, guiding the large language model and clearly outlining the analysis process. The thought chain-based prompt is as follows: Chain of Thought Prompt: 1. Analyze the SysML model, identify the components based on the "part def" field, and extract all component names, including child and parent components.

[0062] 2. Analyze the component description, identify the behaviors / actions defined in the model, and describe the most likely failure modes by "negating actions", such as "reset signal" can be "reset signal not triggered".

[0063] 3. Analyze the fault information, consider the parent or child components connected to the faulty component, and describe the most likely consequences.

[0064] 4. Output in the following format: {"component":"component name","failure_mode": "failure mode description","effect": "failure impact description"} 5. Analyze the behavior definition, key attributes, and constraints of each component based on the "attribute," "constraint," and "action" in the SysML model, and identify the connections, interfaces, and dependencies between components. Output the security model in the following format: {"components": [{"name": "component name","type": "component type","connections":["other connected components"],"functions": ["component functions"],"fault_modes": [{"name": "fault mode","description": "fault description","severity": severity,"causes": ["fault causes"],"effects": ["fault impact"]}]},"safety_constraints": [{"type": "constraint type","constraints": "constraint description"}]}]} 6. Analyze all expanded entries of fault information and extract the "fault mode" as a dangerous event.

[0065] 7. Analyze all hazardous events, identify their correlations and dependencies, and categorize the most systemic or fatal events as top-level events.

[0066] 8. Analyze the security model. Based on hazardous events and their dependencies, construct a multi-level intermediate event structure. The hierarchy should be clear and comprehensive, capable of representing the propagation of faults. Multiple levels of intermediate events are acceptable if necessary, ensuring the proper representation of fault propagation. Appropriately select AND or OR gates based on dependencies.

[0067] 9. Output the fault tree model in the following format: {"name": "Top-level event name","type": "top","gate": "OR / AND","description": "Detailed description","children": [{"name": "Intermediate event name","type": "intermediate","gate": "OR / AND(null)", "description": "Detailed description","children": [...]}]} The Prompt adds output constraints, requiring the model to generate intermediate results and fault tree models in JSON format, thereby ensuring that the content is standardized, parsable, and scalable.

[0068] This invention also proposes a conversion algorithm for generating visualization graphs from fault tree models, and a minimum cut set algorithm. These include: This invention presents an algorithm based on PlantUML language to automatically convert the fault tree model generated from the aforementioned large model into a visual diagram. The algorithm recursively traverses the nodes of the fault tree, generates PlantUML graphical language code based on the node type and its gate type, and finally constructs the fault logic structure diagram.

[0069] A PlantUML visualization algorithm for converting fault tree models recursively receives the name, type, gate logic, and list of child nodes for each node and encodes them uniformly into PlantUML syntax. Basic event nodes are directly mapped to node identifiers, while intermediate events are represented by rectangles, with circular logic gates generated below to connect their child nodes, forming a tree-like topology. This method effectively supports the visualization of fault tree models, significantly improving the readability and analysis efficiency of the fault tree model structure.

[0070] In fault tree analysis, a minimal cut set represents the smallest combination of basic events that leads to the top event. This invention provides a minimal cut set algorithm based on a fault tree model.

[0071] The algorithm processes nodes based on their gate type. If the current node is an OR gate, its minimum cut set is the union of the minimum cut sets of all its child nodes. If it is an AND gate, all sub-path combinations can be generated through the Cartesian product of the sets. Finally, all generated cut sets can be further transformed into Boolean expressions, clearly reflecting the system's fault logic structure. This method improves the accuracy of cut set solving based on fault tree models.

[0072] This invention also proposes an extension to the FaultProfile based on fault information. This includes: SysML V2 builds upon SysML V1 by introducing a more unified, modular, and formal model extension mechanism. This mechanism not only supports semantic enhancement but also provides stronger expressive power for system modeling.

[0073] Within the basic metamodel, a set of profile configuration files can be defined, which can contain several stereotypes. Each stereotype is equivalent to attaching new semantic tags to existing model elements (such as "Block", "Port", "Flow", etc.) and can incorporate custom attributes (Tagged Values).

[0074] (1) Introducing the Fault Profile Package To fully express the "failure mode-effect" information in the model, a dedicated "FaultProfile" sub-package is introduced under the root package, defining a set of common fault-related elements: <faultmode>>Enumerations (e.g., SignalLoss, Delay, IncorrectValue, Intermittent)< <faulteffect>Enumerations or ValueTypes (such as DataLoss, ControlError, Overheat, PressureImbalance), along with FaultPort and FaultFlow metamodels, are used to explicitly couple fault propagation channels between components. Through these extensions, fault entries can be mapped to SysML V2 elements, enabling the model to have a first-hand representation of fault information at the structural level.

[0075] (2) Refinement of internal component attributes and behaviors: Within the corresponding component, add the `faultStatus:Boolean` attribute and the `faultCode:FaultMode` attribute; define fault triggering conditions and judgment logic such as "input loss" and "feedback delay" through parameterized blocks or constraint blocks; introduce a transition path of "fault activation → switching to degraded mode" into the component's behavior (such as internal state machine, activity diagram). This enables fine-grained modeling of the failure behavior of individual components and provides a structured foundation for subsequent safety analyses (such as FMEA, FTA).

[0076] (3) System-level mode management and fault handling closed loop: In the mode_management subpackage, import FaultProfile and extend the state machine: DegradedOperationMode: When a critical system failure has not yet been resolved, the system enters "degraded operation" mode; EmergencyShutdownMode: In case of high-risk failures such as "overheating", the system immediately switches to emergency shutdown. SysML V2's extension mechanism introduces custom stereotypes, enabling safety-critical systems to incorporate safety analysis methods during modeling. This makes it suitable for system-level safety design and verification of complex safety-critical systems, such as those in the aerospace field.< / faulteffect> < / faultmode>

Claims

1. A method for generating fault trees in SysML models based on large language models, characterized in that: Includes the following steps: Step 1: Construct a large language model with knowledge of safety-critical domains; Step 2: Input the SysML model and the invalid text into the large language model, and design prompt words to guide the large language model to extract security-related extensions from the SysML model; The prompt words are obtained based on a fault tree analysis prompt framework based on thought chain; Step 3: Based on the extracted security relevance extensions, generate a structured security model; Step 4: Generate a fault tree model based on the structured security model.

2. The method for generating a fault tree for a SysML model based on a large language model according to claim 1, characterized in that: Construct a large language model with safety-critical domain knowledge according to the following steps: Build an external knowledge base for security-critical areas; The external safety-critical domain knowledge base is used as an external knowledge source and attached to the large language model to obtain a large language model with safety-critical domain knowledge.

3. The method for generating a fault tree for a SysML model based on a large language model according to claim 1, characterized in that: The fault tree analysis suggestion framework based on the thought chain specifically includes: Identify key components, including: parsing the SysML model to identify components, functions, and interfaces related to the failure scenario; Generate failure modes, including inferring possible failure modes using component descriptions; Generate failure effects, including inferring failure effects based on failure modes; Build security-related extensions, including outputting intermediate results according to a specific structure; Analyze the components of the security model, including analyzing the behavior definition, key attributes and constraints of each component in the SysML model, and identifying connections, interfaces and dependencies; Identify hazardous events, including extracting failure modes as candidate hazardous events; Identifying top-level events involves identifying the most systemic or lethal events from among the candidate hazardous events. Intermediate events and fault propagation paths include constructing multi-layered event propagation logic based on top-level events and dangerous events, combined with the structure and behavior of components in the SysML model, and selecting logic gates; Constructing a fault tree model involves combining top-level events, intermediate events, fault propagation paths, and hazardous events to build a multi-level fault tree model.

4. The method for generating a fault tree for a SysML model based on a large language model according to claim 3, characterized in that: The prompt words are obtained based on a fault tree analysis prompt framework based on thought chains, including: The prompts include: task settings, a fault tree analysis prompt framework based on thought chain, example guidance, and output constraints; the output constraints are used to limit the large language model to generate intermediate results in JSON format and the multi-level fault tree model.

5. The method for generating a fault tree for a SysML model based on a large language model according to claim 1, characterized in that: Also includes: Step 5: Generate a visualization of the fault tree model.

6. The method for generating a fault tree for a SysML model based on a large language model according to claim 5, characterized in that: The process of generating a visualization from a fault tree model specifically includes: By recursively traversing the nodes of the fault tree model, PlantUML graphical language code is generated based on the node type and its gate type, and finally a visual fault logic structure diagram is constructed.

7. The method for generating a fault tree for a SysML model based on a large language model according to claim 1, characterized in that: The search enhancement generation technology is to introduce a hybrid weight search strategy into existing search enhancement generation technologies; The hybrid weighted retrieval strategy involves weighting and merging the results from different retrieval tools by setting different weights to obtain the final retrieval result.

8. The method for generating a fault tree for a SysML model based on a large language model according to claim 1, characterized in that: The aforementioned search enhancement generation technology introduces a re-ranking mechanism into existing search enhancement generation technologies; The reordering mechanism involves using a cross-coding reordering model to score the deep relevance between the document and the query after the initial retrieval of the document. The text blocks are paired with the scores to find the top k text blocks with the highest similarity. Only the document with the highest score after reordering is retained as the output.