Multimodal requirements and code tracing alignment methods and systems for the aerospace field
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-18
- Publication Date
- 2026-08-14
AI Technical Summary
检索结果往往缺乏明确的推理路径和关联证据,难以判断知识来源的可靠性和相关性
本发明提供的面向航天领域的多模态需求与代码追溯对齐方法及系统,通过引入文档与代码数据的多模态融合框架,构建具备层次化结构的航天领域知识库,使知识组织过程能够保留原始数据的逻辑关联与工程语义,为后续智能检索提供完整、连贯的上下文基础。
Smart Images

Figure CN122569999A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of aerospace multimodal knowledge management and information retrieval technology. Specifically, it relates to a method and system for aligning multimodal requirements and code tracing in the aerospace field, and also to a corresponding computer terminal and computer-readable storage medium. Background Technology
[0002] Existing knowledge base construction and retrieval solutions in the aerospace field can be broadly categorized into methods based on traditional information retrieval techniques, general-purpose large language models, and single-modal data. While these solutions address the basic needs of knowledge storage and retrieval to some extent, they still exhibit significant limitations in the multimodal, highly correlated, and semantically complex knowledge management scenarios within the aerospace field.
[0003] Traditional information retrieval techniques (such as keyword matching and vector retrieval) primarily rely on text similarity calculations, resulting in a superficial approach to document and code processing. While these methods are practical when the knowledge content structure is simple and the expression is standardized, they struggle to establish cross-modal semantic relationships when dealing with multi-source, heterogeneous data in the aerospace field (such as technical documents, program code, model files, and failure case studies). For aerospace engineering knowledge, there is a close connection between the technical descriptions in documents, the implementation logic in code, and the simulation parameters in models. However, traditional retrieval methods cannot achieve this deep semantic understanding, leading to poor relevance and fragmented knowledge in search results, failing to meet engineers' needs for precise knowledge acquisition of complex technical issues.
[0004] While general-purpose large language models offer advantages in natural language understanding, their training data primarily comes from general corpora, lacking a specific understanding of aerospace-specific technical terminology, engineering specifications, system architectures, and constraints. Without domain knowledge enhancement, the model is prone to "illusions" or introducing assumptions inconsistent with aerospace engineering realities, leading to uncertainties in the technical accuracy and engineering applicability of search results. Furthermore, general-purpose large models have limited processing capabilities for non-textual modal data such as code and models, hindering unified representation and associative retrieval of multimodal data, resulting in insufficient completeness and consistency in the knowledge base construction.
[0005] While solutions based on single-modal data (such as processing only documents or only code) are optimized for specific data types, they sever the inherent interconnectedness of aerospace engineering knowledge. In the development of aerospace models, requirements documents, design documents, code implementations, test cases, and fault reports constitute a complete knowledge chain. Single-modal methods cannot establish such cross-document, cross-code, and cross-lifecycle knowledge connections, resulting in knowledge retrieval only obtaining fragmented information, which is insufficient to support systematic technical decisions and problem attribution. For example, in fault diagnosis, retrieving only fault reports without linking them to relevant code implementations or design documents reduces the effectiveness of knowledge reuse.
[0006] Existing solutions generally lack a systematic approach to multimodal data fusion mechanisms in the aerospace field. Different types of aerospace data (such as technical documents, program code, simulation models, and failure cases) exhibit significant differences in semantic representation, structural features, and relationships. However, most existing solutions fail to effectively distinguish and fuse data modalities, often employing a uniform processing strategy, resulting in insufficient knowledge representation and limited retrieval accuracy. Furthermore, aerospace knowledge is highly time-sensitive and version-dependent, but existing solutions lack sufficient support for knowledge updates, version management, and knowledge evolution, making it difficult to adapt to the engineering practice requirements of continuous iteration in aerospace models.
[0007] Existing solutions also have significant shortcomings in terms of interpretability and traceability of knowledge retrieval. Retrieval results often lack clear reasoning paths and relevant evidence, making it difficult to determine the reliability and relevance of the knowledge source. In fields like aerospace engineering, where accuracy is paramount, retrieval results lacking interpretability are unlikely to be trusted and adopted by engineers, increasing the workload of manual verification. Furthermore, existing solutions lack a closed-loop feedback mechanism between the knowledge base construction process and engineering practices (such as design review, testing and verification, and fault analysis). The updating and maintenance of the knowledge base primarily rely on manual intervention, hindering the automated accumulation and continuous optimization of knowledge.
[0008] In summary, existing solutions for multimodal knowledge management in the aerospace field generally suffer from insufficient cross-modal fusion capabilities, weak domain adaptability, incomplete knowledge associations, poor engineering practicality, and insufficient interpretability, making it difficult to meet the high requirements of aerospace engineering for the accuracy, completeness, and traceability of knowledge retrieval. These problems are particularly prominent in scenarios with high knowledge management requirements, such as aerospace model development, on-orbit operation and maintenance, and fault handling. Summary of the Invention
[0009] To address the aforementioned shortcomings in the prior art, this invention provides a method and system for aligning multimodal requirements and code tracing in the aerospace field, along with a corresponding computer terminal and computer-readable storage medium.
[0010] According to one aspect of the present invention, a method for aligning multimodal requirements and code tracing in the aerospace field is provided, comprising: Transform source code from a sequence of characters into knowledge units with semantic and hierarchical relationships, and build a structured code semantic knowledge base; Natural language requirements are broken down into independent atomic requirement units, and a decoupled requirement semantic knowledge base is constructed. Each atomic requirement unit in the requirement semantic knowledge base is simultaneously subjected to parallel similarity retrieval with multiple knowledge units in the code semantic knowledge base, and multi-granularity retrieval-enhanced requirement implementation status discrimination is performed to generate individual traceability conclusions. Integrate all individual traceability conclusions to generate project-level requirements and code traceability alignment results.
[0011] Preferably, the step of converting the source code from a character sequence into knowledge units with semantic and hierarchical relationships to construct a structured code semantic knowledge base includes: Static code analysis tools are used to parse all source code files of the target aerospace software project and generate a unified abstract syntax tree; Traverse the abstract syntax tree, identify and extract all function definition syntax nodes, and obtain the function signatures of the syntax nodes and their positions in the source code; The complete source code fragment corresponding to each syntax node is combined with its function signature and fed into a large language model as basic input. Corresponding prompts are set, and the instructions generate a two-level semantic description for the function, one level being a functional summary and the other a process description. Based on the function call relationships contained in the abstract syntax tree, a function call graph is constructed to describe the dynamic dependencies between functions; The abstract syntax tree, function signature, flow description, and function call graph are vectorized at three granularities to form indexes at different levels; these include: Vectorize the integrated text containing function signatures, functional summaries, and process descriptions to form a function-level index; After aggregating the semantic descriptions of all functions within the same file, the data is fed back into the large language model to generate a summary of the overall process logic of the file and quantize it, forming a file-level index. Summarize the function signatures and process descriptions, generate project technology stack analysis and framework description, quantify them, and form a project-level index; All vectors at the above granularity and their metadata are stored in different indexes or namespaces of the same vector database to form a structured code semantic knowledge base.
[0012] Preferably, the step of decomposing natural language requirements into independent atomic requirement units to construct a decoupled requirement semantic knowledge base includes: Obtain aerospace-related requirement documents, and use predefined regular expressions or domain keyword matching rules to scan the requirement documents and locate the original requirement paragraphs containing the specified keywords; The original requirement paragraph is fed into the large language model, and the large oracle model is instructed to obtain the atomic requirement text after decoupling and normalization through the set Prompt. Each decoupled and normalized atomic requirement text is transformed into an embedded vector and stored together with its requirement information to form a requirement semantic knowledge base. The requirement information is obtained by parsing the input atomic requirement text, including: the requirement ID, the original requirement paragraph, and the requirement type for each requirement.
[0013] Preferably, the instruction oracle model yields decoupled and normalized atomic requirement text, including: Complex requirements are broken down into several single, atomized requirement descriptions to form atomic requirements; Complete the implicit subject, conditions and / or context for each atomic requirement, and rewrite it using standardized sentence patterns; Label each atomic requirement with its requirement type; Through the above steps, we obtain atomic requirement text that has been decoupled and normalized.
[0014] Preferably, the step of simultaneously performing parallel similarity searches between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, executing multi-granularity search-enhanced requirement implementation status discrimination, and generating individual traceability conclusions includes: The vector of each atomic requirement is simultaneously compared with multiple indices in the code semantic knowledge base for similarity retrieval to obtain Top-K functions, Top-M file summaries and / or atomic requirement texts to be judged; The retrieved Top-K functions, Top-M file summaries, and / or atomic requirement texts to be judged are organized into a structured prompt according to a preset template; The obtained structured hints are submitted to the large language model that has switched contexts to drive the large language model to perform requirement-code tracing tasks; Based on its code understanding and logical reasoning capabilities, the Big Prophecy Model analyzes whether and to what extent the retrieved code evidence meets the current needs, generates a structured individual judgment report, obtains the individual tracing conclusion, and forms a code tracing link.
[0015] Preferably, the step of performing parallel similarity retrieval on the vector of each atomic requirement with multiple indices in the code semantic knowledge base to obtain Top-K functions, Top-M file summaries, and / or atomic requirement texts to be judged includes: The K most relevant functions and their semantic descriptions are retrieved from the function-level index of the code semantic knowledge base to obtain the Top-K functions; The most relevant M file summaries are retrieved from the file-level index of the code semantic knowledge base to obtain the Top-M file summaries. Retrieve relevant technology stack descriptions from the project-level index of the code semantic knowledge base to obtain the atomic requirement text to be judged; The individual discrimination report shall include at least the following: state discrimination, localization, and missing data analysis.
[0016] Preferably, the process of integrating all individual traceability conclusions to generate project-level requirement and code traceability alignment results includes: Summarize the judgment conclusions of all atomic requirements, perform statistical analysis to generate a complete, project-level requirement-code traceability alignment report; wherein, the requirement-code traceability alignment report includes: the status of each requirement, the corresponding implementation code location, and the judgment basis provided by the large language model; Preferably, it also includes: generating a visual view based on the required-code tracing alignment report.
[0017] According to a second aspect of the present invention, a multimodal requirement and code tracing alignment system for the aerospace field is provided, comprising: The code parsing and enhancement module is used to convert source code from character sequences into knowledge units with semantic and hierarchical relationships, and build a structured code semantic knowledge base. The requirement processing and decoupling module is used to decompose natural language requirements into independent atomic requirement units and build a decoupled requirement semantic knowledge base. The multimodal vector discrimination module is used to perform parallel similarity retrieval between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, perform multi-granularity retrieval-enhanced requirement implementation status discrimination, and generate individual traceability conclusions. The project-level knowledge flow integration module is used to integrate the conclusions of all individual traceability and generate project-level requirements and code traceability alignment results.
[0018] According to a third aspect of the present invention, a computer terminal is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, can be used to perform the methods described above in the present invention.
[0019] According to a fourth aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, can be used to perform the methods described above in the present invention.
[0020] By adopting the above technical solution, the present invention has at least one of the following beneficial effects compared with the prior art: The present invention provides a method and system for aligning multimodal requirements and code traceability in the aerospace field. By introducing a multimodal fusion framework of document and code data, it constructs a hierarchical aerospace knowledge base, which enables the knowledge organization process to retain the logical connections and engineering semantics of the original data, providing a complete and coherent contextual basis for subsequent intelligent retrieval.
[0021] The present invention provides a method and system for aligning multimodal requirements and code traceability in the aerospace field. By constructing a knowledge enhancement mechanism in the aerospace field, generative additional information is injected during the knowledge base construction stage, and semantic constraints and logical reasoning are introduced during the retrieval process. This makes the generated results conform to the actual behavior patterns and industry standards of aerospace systems, significantly improving professionalism and engineering applicability.
[0022] This invention provides a method and system for aligning multimodal requirements and code tracing in the aerospace field. In terms of the knowledge base construction process, it adopts a phased processing strategy, separating multimodal data parsing, structured representation, vectorized indexing, and dynamic update mechanisms. Furthermore, it incorporates semantic matching degree reordering and interpretability enhancement at the end of the retrieval process. This design makes the knowledge base construction process more controllable and transparent, helping to ensure comprehensive knowledge coverage and timely updates, while also facilitating engineers' verification and adjustment of search results. In addition, by supporting dynamic field and metadata association, this method can flexibly adapt to the knowledge evolution needs during aerospace model iterations, avoiding increased maintenance costs due to data structure changes.
[0023] The present invention provides a method and system for aligning multimodal requirements and code traceability in the aerospace field. By combining multimodal data fusion, domain knowledge enhancement, dynamic field management, and a phased construction mechanism, it forms a set of RAG knowledge base construction technology and traceability alignment technology applicable to the aerospace field. This can effectively improve the accuracy, completeness, and engineering controllability of knowledge retrieval, provide a reliable knowledge infrastructure for aerospace intelligent systems, significantly improve the accuracy and practicality of knowledge retrieval in the aerospace field, and make the generated answers more professional and operable. Attached Figure Description
[0024] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1This is a flowchart illustrating the workflow of a preferred embodiment of the method for aligning multimodal requirements and code tracing in the aerospace field according to the present invention.
[0025] Figure 2 This is a schematic diagram of the components of a multimodal requirement and code tracing alignment system for the aerospace field, according to a preferred embodiment of the present invention.
[0026] Figure 3 The diagram shows a comparison of the working architecture of the technical solution of the present invention and the traditional method; wherein, (a) is a working architecture diagram of the simple fragmentation tracing and alignment of the traditional method, and (b) is a working architecture diagram of the fine-grained reasoning tracing and alignment of the technical solution of the present invention. Detailed Implementation
[0027] The embodiments of the present invention are described in detail below: These embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and specific operation processes. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention.
[0028] Existing knowledge base construction and retrieval solutions in the aerospace field generally suffer from insufficient cross-modal fusion capabilities, weak domain adaptability, incomplete knowledge associations, poor engineering practicality, and insufficient interpretability when handling multimodal knowledge management in the aerospace industry. These issues make it difficult to meet the high requirements of aerospace engineering for the accuracy, completeness, and traceability of knowledge retrieval. These problems are particularly prominent in scenarios with high knowledge management requirements, such as aerospace model development, on-orbit operation and maintenance, and fault handling. Therefore, there is an urgent need for a knowledge management and retrieval technology that can deeply integrate multimodal data, combine domain knowledge, and possess semantic understanding and associative reasoning capabilities.
[0029] To address the aforementioned issues, one embodiment of the present invention provides a method for tracing and aligning multimodal requirements and codes in the aerospace field, applicable to multimodal data fusion and intelligent retrieval scenarios. This method constructs a structured code semantic knowledge base and a decoupled requirement knowledge base, and utilizes Retrieval Enhanced Generation (RAG) technology to achieve accurate semantic mapping and verification between the two. This automatically and intelligently solves the core problem of difficulty in tracing between requirements and code in aerospace software development, tracing and aligning multimodal requirements and code, thereby realizing multimodal knowledge management and retrieval in the aerospace field, meeting high requirements for accuracy, completeness, and traceability.
[0030] Specifically, such as Figure 1 As shown, the multimodal requirements and code tracing alignment method for the aerospace field provided in this embodiment may include: S1 transforms source code from a sequence of characters into knowledge units with semantic and hierarchical relationships, constructing a structured code semantic knowledge base; S2 breaks down natural language requirements into independent atomic requirement units and constructs a decoupled requirement semantic knowledge base. S3 performs parallel similarity retrieval between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, executes multi-granularity retrieval-enhanced requirement implementation status discrimination, and generates individual traceability conclusions. S4 integrates all individual traceability conclusions to generate project-level requirements and code traceability alignment results.
[0031] In some preferred embodiments, S1 above, which converts the source code from a character sequence into knowledge units with semantic and hierarchical relationships to construct a structured code semantic knowledge base, may further include: S11 uses static code analysis tools (such as tree-sitter and srcML) to parse all source code files of the target aerospace software project and generate a unified abstract syntax tree (AST). S12, traverse the abstract syntax tree (AST), accurately identify and extract the syntax nodes of all function (method) definitions, and obtain the function signature (name, parameters, return type) of the syntax nodes and their location information in the source code; S13, combine the complete source code fragment corresponding to each syntax node with its function signature as the basic input; feed the basic input into the Large Language Model (LLM) and set a specific prompt, instructing the LLM to generate a two-level semantic description for the function: first, a concise functional summary, which explains in one sentence what the function or method "does"; second, a detailed process description, which explains in step-by-step how the function or method "does". S14, based on the function call relationships contained in the Abstract Syntax Tree (AST), further construct the function call graph of the entire project to characterize the dynamic dependencies between functions; S15, the above information (abstract syntax tree, function signature, flow description, and function call graph) is vectorized at three granularities to form indexes at different levels: Function level: Vectorize the combined text of "function signature + functional summary + process description"; File level: After aggregating the semantic descriptions of all functions in the same file, the data is fed into the LLM again to generate an overall process logic summary of the file and quantify it; Project level: Summarize function signatures and process descriptions, generate project technology stack analysis and framework description, and quantify them; S16 stores all vectors at three granularities and their metadata (such as their file, function name, and call relationship) into different indexes or namespaces of the same vector database to form a structured code semantic knowledge base.
[0032] This step is the foundation for the deep understanding and representation of code modalities in this invention. Its core improvement lies in the multi-granular semantic parsing and structured representation of code based on abstract syntax trees (AST), which transforms the source code from a sequence of characters into a searchable knowledge unit rich in semantics and with hierarchical relationships.
[0033] In some preferred embodiments, S2 above, which decomposes natural language requirements into independent atomic requirement units to construct a decoupled requirement semantic knowledge base, may further include: S21. Obtain requirements documents such as the Software Requirements Specification (SRS) for Aerospace. Use predefined regular expressions or domain keyword matching rules to scan the requirements documents and initially locate the original requirement paragraphs containing keywords such as "should be", "should have", "performance requirements", and "interface". S22, the identified raw requirement paragraphs are sent to the LLM. Through the set Prompt, the LLM is instructed to act as a requirements analyst and perform the following tasks: Requirement decomposition: Break down complex requirements (such as sentences containing multiple conditions or functions) into several single, atomic requirement descriptions to form atomic requirements; Semantic completion and normalization: Complete the implicit subject, condition or context for each atomic requirement, and rewrite it using standardized sentence patterns as much as possible; among them, the standardized sentence pattern can be: "The system / component should achieve [function / performance] under [condition] to meet [standard / indicator]"; Type labeling: Label the type of each atomic requirement (such as functional requirement, performance requirement, interface requirement); Through the above tasks, we obtain atomic requirement text that has been decoupled and normalized; S23 transforms each decoupled and normalized atomic requirement text into an embedded vector, which is then stored along with its requirement information to form a requirement semantic knowledge base. The requirement information is obtained by parsing the input atomic requirement text, including: the requirement ID, original requirement paragraph, type, and other information for each requirement.
[0034] This step is the core of the invention for in-depth analysis and standardization of requirement documents. Its core improvement lies in the atomization and semantic explicitness of requirements based on rule guidance and LLM reasoning, which aims to decompose complex and ambiguous natural language requirements into independent and verifiable atomic requirement units.
[0035] In some preferred embodiments, S3 above, which involves simultaneously performing parallel similarity searches between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, performing multi-granularity search-enhanced requirement fulfillment status discrimination, and generating individual traceability conclusions, may further include: For each atomic requirement unit (i.e., atomic requirement) in the requirement semantic knowledge base, the following sub-steps are performed, which generate an interpretable code traceability chain for each requirement: S31, Multi-source Parallel Retrieval: For each atomic requirement vector, perform the following similarity retrieval in parallel with multiple indices in the code semantic knowledge base: S311, retrieve the K most relevant functions and their semantic descriptions from the "function-level" index; S3112, Retrieve the most relevant M file summaries in the "file-level" index; S113. If necessary, relevant technology stack descriptions can be retrieved from the "project-level" index.
[0036] S32, Evidence Aggregation and Structured Prompt Construction: The retrieved Top-K functions (including their functional overview and process description), Top-M file overview, and atomic requirement texts to be judged are organized into a structured prompt according to a preset template. The template explicitly requires the LLM to analyze the requirement implementation status based on the provided code evidence.
[0037] S33, Evidence-Based Discriminative Generation and Report Output: The constructed Prompt is submitted to the context-switched large language model to drive the large language model to perform a requirement-code tracing task. Based on its code understanding and logical reasoning capabilities, the LLM analyzes whether and to what extent the retrieved code evidence meets the current requirements, and generates a structured individual discriminative report. This report must include: Implement status determination (implemented, partially implemented, not implemented); The location is implemented (specifically, which functions and files are used to implement it, and provide evidence to explain why). Missing information analysis (if not fully implemented, indicate the missing functionalities or logic).
[0038] This step is the core innovative step in achieving alignment verification between requirements and code. Its key improvement lies in integrating multi-granularity code semantics with a discriminative reasoning mechanism that enhances retrieval. Instead of relying on simple text matching, it retrieves multi-level evidence from a code knowledge base and guides the LLM (Local Management Module) to perform verifiable logical judgments, generating interpretable and traceable conclusions.
[0039] In some preferred embodiments, S4 above, which integrates all individual traceability conclusions to generate project-level requirement and code traceability alignment results, may further include: S41 summarizes the judgment conclusions of all atomic requirements, performs statistical analysis (such as implementation coverage, list of requirements to be verified, etc.), and generates a complete, project-level requirement-code traceability alignment report. This report clearly lists the status of each requirement, the corresponding implementation code location (file, function), and the judgment criteria provided by the LLM. These criteria refer to the judgment reports generated by the large model based on three dimensions: semantic retrieval matching degree, function functional rationality, and call chain rationality.
[0040] In addition, it can further include: S42 generates visualizations based on this data, such as a requirement coverage matrix, a list of unfulfilled requirements, and a relationship diagram between code modules and requirements, providing direct and structured evidence support for software quality review, change impact analysis, and delivery compliance verification.
[0041] This step is the final step in integrating all individual judgment results to form a project-level traceability view.
[0042] Through the coordinated execution of the above four steps, this invention constructs a complete process for automatically generating accurate, interpretable, and traceable links from original code and requirement documents. Its core improvement lies in transforming multimodal data into high-quality knowledge elements through dual-channel deep structured preprocessing (AST semanticization of code and atomization of requirements). Furthermore, it utilizes multi-granularity RAG and discriminative LLM reasoning to replace traditional shallow text matching or manual review, thereby systematically improving the automation level, coverage, and reliability of aerospace software requirement and code alignment verification. When dealing with multimodal knowledge in the aerospace field, it achieves traceability and alignment management, meeting the high requirements of aerospace engineering for the accuracy, completeness, and traceability of knowledge retrieval.
[0043] Based on the same inventive concept, one embodiment of the present invention also provides a multimodal requirements and code tracing alignment system for the aerospace field.
[0044] Specifically, such as Figure 2 As shown, the multimodal requirements and code tracing alignment system for the aerospace field provided in this embodiment may include: The code parsing and enhancement module is used to convert source code from character sequences into knowledge units with semantic and hierarchical relationships, and build a structured code semantic knowledge base. The requirement processing and decoupling module is used to decompose natural language requirements into independent atomic requirement units and build a decoupled requirement semantic knowledge base. The multimodal vector discrimination module is used to perform parallel similarity retrieval between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, perform multi-granularity retrieval-enhanced requirement implementation status discrimination, and generate individual traceability conclusions. The project-level knowledge flow integration module is used to integrate the conclusions of all individual traceability and generate project-level requirements and code traceability alignment results.
[0045] The technical solution provided by this embodiment of the present invention will be further described in detail below, in conjunction with the design and working principles.
[0046] The multimodal requirement and code tracing alignment system provided in this embodiment for the aerospace field is based on a core principle of constructing a "dual-channel structured processing engine." By introducing two preprocessing steps—code syntax structure parsing and requirement semantic decoupling—it transforms unstructured multimodal data (code, documents) into standardized, semantically rich structured knowledge elements. Based on this, a precise alignment verification mechanism based on vector retrieval and large language model reasoning is established. The entire method uses a multimodal vector knowledge base as its central hub, achieving automated generation from raw data to tracing conclusions through directed information flow and multi-round interactions. Its structural principle is broken down as follows: I. Code Analysis and Enhancement Module The core structural principle of this module is static code semantic modeling and generalization based on Abstract Syntax Trees (ASTs). Its working principle is not simple text slicing, but rather it establishes a precise structured representation of the code through the following progressive processing: This module first implements syntactic structure extraction. First, the AST parser acts as the front end, transforming the source code from a linear sequence of characters into a tree-like structured representation. This tree precisely captures all syntactic units of the language (such as function definitions, control flow statements, and expressions) and their nesting relationships. This step structurally ensures that code units (especially functions) are completely and unambiguously identified and isolated.
[0047] This module adds semantic information to the function-level code. It merges isolated syntactic units (function signatures, parameters) extracted from the AST with their corresponding source code blocks (function bodies) to form "raw code snippets." These snippets are then fed into the LLM for processing, essentially adding a natural language-based "semantic annotation layer" generated by the LLM to each syntactic unit. This layer transforms machine-executable syntactic logic into a semantic description understandable by both humans and machines.
[0048] This module models the hierarchical relationships of the overall project files. Building upon the semantic representation of individual functions, the code parsing module utilizes the inherent function call relationships within the AST to construct a project-level call graph. This is equivalent to establishing a network topology describing the dynamic execution dependencies between atomic "function-semantic" units. The file-level and project-level summaries involve dividing the network into communities at different granularities (file-level) and summarizing its overall characteristics (project-level).
[0049] This module implements vectorized storage for the aforementioned enhanced information. Ultimately, structured information at three different levels of abstraction—function level (individual semantics + local relationships), file level (community semantics + internal structure), and project level (overall architecture)—is uniformly encoded into vectors and stored in a vector library along with its metadata (such as the file it belongs to and call relationship pointers). The essence of its structural connection is to merge the code's "syntax tree structure" with the "LLM-derived semantic layer" to generate a vectorized projection of a multi-granular knowledge graph with rich relationships.
[0050] II. Requirements Processing and Decoupling Module The module's structural principle is based on a rule-guided and LLM-inference-based "requirement compilation" process. Its workflow design aims to "compile" fuzzy and complex natural language requirements into a clear and independently verifiable "requirement instruction set".
[0051] This module first performs preliminary location and coarse screening of the requirements information. It uses regular expression matching or a rule engine as the first layer of filter, and its structural principle is based on rapid scanning of keyword patterns or domain-specific templates. It does not handle deep understanding, but rather efficiently locates paragraphs that may contain the requirements from massive amounts of text, defining the scope for subsequent fine-tuning and reducing the processing load on the LLM (Local Language Management) system.
[0052] This module then implements semantic decoupling and normalization. This is the core component. The coarsely screened requirement paragraphs are fed into the LLM, whose structural principle is to leverage the powerful text understanding and generation capabilities of the LLM to perform logical decomposition and reconstruction under the constraints of preset instructions. The instructions require the LLM to act as a "system analyst," performing the following structured operations: 1) Identify complex logic: find the implicit "AND," "OR," and conditional relationships in the requirement sentences; 2) Atomized segmentation: break down complex sentences into multiple simple sentences that express only a single function, performance, or constraint; 3) Structured completion: supplement each atomic requirement with default context or standardized expression format. The result of this process is to transform an unstructured text into a well-structured, itemized "requirement list." The essence of its structural connection is: through a concatenated pipeline of "rule coarse screening + LLM fine processing," the natural language document is converted into a standardized, discrete set of requirement semantic units.
[0053] 3. Multimodal vector discrimination module This module is the decision-making center of the system, and its structural principle is a hybrid reasoning framework of "retrieval-enhanced generation (RAG) and discriminative question answering". It is not a single black box model, but a carefully designed multi-stage information processing and verification loop.
[0054] This module supports parallel multi-path retrieval. When an atomic requirement vector is input, the retrieval engine performs queries in parallel across multiple "partitions" or "namespaces" of the vector database. This leverages the vector database's support for multi-index queries. Queries are simultaneously sent to the "function semantic area," "document summary area," and "requirement list area," among others. Structurally, this is equivalent to broadcasting a requirement question to both the code's knowledge graph (individual nodes, community summaries, and overall description) and the requirement knowledge base, ensuring that the most relevant and comprehensive evidence fragments are collected.
[0055] This module features evidence aggregation and context construction. The retrieved Top-K evidence (function descriptions, document summaries, etc.) is aggregated and, along with the original requirements, organized into a structured prompt according to a pre-defined template. This prompt template is a key structured component, clearly defining the role of the LLM (auditor), the analytical framework (implementation status assessment, location, gap analysis), and the output format. Its structural principle lies in organizing discrete evidence text into a complete contextual environment containing "task instructions, background knowledge (project / document summary), specific evidence (function description), and the problem to be analyzed (requirement)," guiding the LLM to perform evidence-based reasoning rather than generating arbitrary conclusions.
[0056] This supports evidence-based discriminative generation, with LLM operating within this structured context. Its task is not open-ended creation, but rather reading comprehension, logical comparison, and judgment based on provided evidence. The principle is that LLM utilizes its pre-trained code understanding, natural language reasoning, and logical judgment capabilities to cross-validate the semantics of the requirement text with the semantics of the code evidence, determining whether functional coverage, logical matching, or condition satisfaction exists. Ultimately, it must cite specific evidence to support its judgment, generating a structured traceability report. The structural connection of this step essentially constructs a closed loop of "evidence input - inference engine - judgment output," where the quality and structure of the "evidence input" directly determine the reliability and interpretability of the "inference engine" output.
[0057] 4. Project-level knowledge flow (workflow and data flow) integration module From an overall structural perspective, the code pipeline and the document pipeline are two parallel preprocessing pipelines. They respectively "refine" and "purify" the raw data source, producing standardized knowledge elements that are then fed into the multimodal vector discrimination module. The retrieval and alignment functions implemented by the multimodal vector discrimination module are the core processing part that consumes these knowledge elements; it initiates queries, organizes reasoning, and produces results. The multimodal vector discrimination module is the "central knowledge bus" in the method framework, connecting the producers (the two preprocessing modules) and the consumers (the integration module). The data flow is unidirectional and phased: raw data → structured knowledge elements → vectorized storage → retrieval and reasoning → traceability report. This loosely coupled pipeline-filter architecture allows each module to be optimized independently (such as improving the AST parser, upgrading the LLM model, or changing the vector database) without affecting the overall system framework, ensuring the system's scalability and maintainability.
[0058] It should be noted that the steps in the method provided by the present invention can be implemented using the corresponding components in the system. Those skilled in the art can refer to the technical solution of the system to implement the steps of the method, and can also refer to the technical solution of the method to implement the composition of the system. That is, the embodiments in the system and the embodiments in the method can be understood as preferred examples of each other, which will not be elaborated here.
[0059] An embodiment of the present invention also provides a computer terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it can be used to execute the method of any of the above embodiments of the present invention, or to run the system of any of the above embodiments of the present invention.
[0060] Optionally, the memory is used to store programs; the memory may include volatile memory, such as random-access memory (RAM), such as static random-access memory (SRAM), double data rate synchronous dynamic random-access memory (DDR SDRAM), etc.; the memory may also include non-volatile memory, such as flash memory. The memory is used to store computer programs (such as application programs and functional modules that implement the above methods), computer instructions, etc., and the aforementioned computer programs and computer instructions can be partitioned and stored in one or more memories. Furthermore, the aforementioned computer programs, computer instructions, data, etc., can be accessed by the processor.
[0061] A processor is used to execute computer programs stored in memory to implement the various steps of the methods or various modules of the systems involved in the above embodiments. For details, please refer to the relevant descriptions in the preceding method and system embodiments.
[0062] The processor and memory can be separate structures or integrated structures. When the processor and memory are separate structures, they can be coupled together via a bus.
[0063] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can be used to perform the method of any of the above embodiments of the present invention, or to run the system of any of the above embodiments of the present invention.
[0064] Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of computer programs from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Alternatively, the ASIC can reside in a user device. Of course, the processor and storage medium can also exist as discrete components in a communication device.
[0065] The multimodal requirement and code tracing and alignment method and system for the aerospace field provided in the above embodiments of the present invention achieves an automated, interpretable, and fine-grained requirement-code tracing and alignment technology by introducing key technologies such as multi-granularity structured semantic parsing of codes, atomic decoupling and semantic normalization of requirements, and discriminative alignment verification based on multi-granularity retrieval enhancement. This technology has significant advantages in both architecture and practical functionality, effectively solving core problems in complex systems engineering such as aerospace, including low efficiency, incomplete coverage, difficulty in verification, and the shallow semantic understanding and lack of logical reasoning ability of existing automated tools.
[0066] Through the above technical solution, the present invention achieves the following structural and functional advantages: I. Structural Advantages The structural advantages of this invention are mainly reflected in the construction of a hierarchical, closed-loop processing system. Compared to the working process of traditional knowledge base construction schemes, this system... Figure 3 As shown in (a) and (b).
[0067] First, the solution establishes a closed-loop information processing structure of "dual-channel preprocessing - centralized knowledge base - intelligent alignment and discrimination". This structure transforms heterogeneous multimodal data into standardized semantic knowledge units through parallel code parsing and requirement processing channels, and stores them uniformly in a multimodal vector knowledge base. Finally, it achieves accurate alignment through an intelligent discrimination module that integrates retrieval enhancement and LLM inference.
[0068] This closed-loop design ensures the integrity and controllability of the information flow from raw data to traceable conclusions. Dual-channel preprocessing guarantees the quality of input information, a centralized knowledge base enables efficient knowledge fusion and retrieval, and the intelligent discrimination module constitutes an interpretable decision-making closed loop. Secondly, the solution constructs a three-tiered, progressive code semantic representation structure: function-level, file-level, and project-level. This hierarchical structure enables a comprehensive understanding of the codebase, from micro-level implementation logic to macro-level technical architecture: function-level descriptions focus on specific implementation details, file-level descriptions summarize module functions and internal collaboration, and project-level descriptions explain the overall technical framework.
[0069] This multi-granular representation not only better aligns with engineers' cognitive habits but also supports flexible and precise retrieval—specific functional requirements can be matched with function-level descriptions, module-level requirements can correspond to file-level summaries, and system-level constraints can be associated with project-level descriptions, thereby achieving a comprehensive and multi-layered in-depth understanding and precise positioning of the codebase.
[0070] II. Functional Advantages At the functional level, this invention achieves automation, fine-grainedness, and verifiable traceability capabilities that are difficult to achieve with traditional methods.
[0071] Its primary functional advantage is the realization of fine-grained, interpretable, and fully automated traceability. By breaking down requirements into atomic units and parsing the code to function-level semantics, the method can achieve a precise mapping from requirement points to specific code functions. Furthermore, the judgment report generated by LLM uses code semantics as evidence, making the traceability results logically interpretable and greatly improving traceability efficiency and result credibility.
[0072] Secondly, the solution possesses powerful change impact analysis capabilities. The established structured knowledge base and automated alignment process enable rapid and accurate identification of the scope of mutual impact when requirements or code change, providing an efficient tool for long-term configuration management and quality assurance of aerospace software. Thirdly, the solution provides systematic support for software quality review and delivery compliance verification. It can automatically generate structured requirement-code traceability matrix reports, clearly showing the implementation status of each requirement, its corresponding code location, and the judgment criteria, providing reviewers with digital and verifiable evidence, significantly improving the comprehensiveness and objectivity of the review.
[0073] Furthermore, while achieving its core objectives, the solution also generated significant added value. The function-level semantic descriptions, file-level logical summaries, and project-level framework specifications generated during the preprocessing phase constitute a high-quality project knowledge base. This not only helps new members quickly understand the code but also serves as a valuable organizational knowledge asset, enhancing code comprehensibility and the project's knowledge transfer capabilities. The specific application effect of the technical solution provided in the above embodiments of the present invention will be further explained below with reference to a specific application example.
[0074] This specific application example uses the multimodal data fusion and intelligent retrieval application scenario in the aerospace field. With the exponential growth of multi-source heterogeneous data such as documents, code, and models generated during the development of aerospace models, traditional keyword-based or single-modal retrieval methods have significant shortcomings in semantic understanding, cross-modal association, and knowledge reasoning, making it difficult to meet the needs of aerospace engineers for accurate knowledge acquisition of complex technical issues.
[0075] In this specific application example, the multimodal requirements and code tracing alignment method and system for the aerospace field provided by the above embodiments of the present invention are applied in the following typical areas of the above application scenario: 1. Aerospace Model Development and Design Verification: The development of launch vehicles, satellites, deep space probes, and other similar products involves a large number of design documents, technical specifications, simulation models, and program code. This invention can integrate multimodal data to build a unified knowledge base, supporting designers in quickly retrieving relevant technical solutions, historical experience, and failure cases. It is applicable to knowledge reuse and decision support in overall design, subsystem design, simulation verification, and other stages.
[0076] 2. Aerospace Software Engineering and Code Quality Assurance: Aerospace software has high reliability and security requirements, and the correlation between code and documentation is strictly required. This invention, by integrating data such as code repositories, requirement documents, and test cases, can construct a knowledge base covering the entire software engineering lifecycle, supporting scenarios such as code review, defect location, and impact analysis. It is applicable to the development and maintenance of systems such as spacecraft software, ground telemetry and control software, and flight control software.
[0077] 3. Aerospace Fault Diagnosis and Emergency Response: During spacecraft operation in orbit, rapid response to abnormal situations and the development of response plans are required. This invention can integrate multi-source knowledge such as historical fault cases, expert experience, and emergency response procedures to build a knowledge base for fault diagnosis. It supports ground control personnel in quickly retrieving similar fault modes and solutions, and is applicable to scenarios such as in-orbit anomaly handling, fault contingency plan development, and emergency drills.
[0078] 4. Aerospace Technology Training and Knowledge Transfer: The aerospace field boasts profound technological accumulation, but knowledge transfer faces challenges. This invention can construct a multimodal knowledge base containing technical documents, expert experience, and typical cases, supporting scenarios such as new employee training, technical inquiries, and experience learning. It is suitable for the construction of knowledge management systems in aerospace research institutes, universities, and training institutions.
[0079] 5. Other fields requiring multimodal knowledge fusion and intelligent retrieval: including complex equipment manufacturing fields such as aviation, shipbuilding, and nuclear industry, as well as industrial internet and intelligent manufacturing scenarios that require processing multi-source data such as documents, code, and images.
[0080] The technical solutions provided by the above embodiments of the present invention, in the above-mentioned fields, construct a unified knowledge representation and retrieval framework by integrating multimodal data such as documents and code, realize cross-modal semantic association and intelligent retrieval, improve the efficiency and accuracy of knowledge acquisition, reduce the cost of manual search, enhance the ability of knowledge reuse, and provide technical support for knowledge management in aerospace and other complex engineering fields.
[0081] Verification through applications in the aforementioned typical fields demonstrates that the technical solutions provided by the embodiments of this invention can achieve optimal performance in multiple key scenarios of aerospace software development and management. Through automation and intelligence, they solve the traditionally error-prone and highly manual traceability and verification challenges, with the optimal usage state as follows.
[0082] I. During the software detailed design review and coding implementation phase, it is used to ensure the accurate implementation of requirements into design. Once the software's detailed design is complete and it enters the critical coding implementation phase, the development team needs to ensure that every line of code precisely corresponds to the upstream requirements. At this point, this solution can act as an "automated code reviewer."
[0083] Specifically, once developers have completed the writing and initial testing of a functional module or code file, they can input the current codebase and the corresponding Software Requirements Specification (SRS) into this system. The system will automatically build a code semantic knowledge base for that module, decouple the SRS requirements into atomic entries, and then perform alignment and verification item by item. For example, for a requirement that "when the navigation system receives invalid positioning data, it should switch to backup inertial navigation mode and issue a warning within 100 milliseconds," the system will retrieve functions related to data validation, mode switching, and warning handling from the codebase. By analyzing the semantic descriptions of these functions (such as "the validate_gps_data() function checks the validity of the data; if invalid, it calls switch_to_ins_mode()"), the system can accurately determine whether the requirement has been fully implemented and locate the specific implementation function. This is equivalent to providing each code module with an automatically generated, well-documented "requirement compliance self-check report," greatly improving the efficiency and accuracy of quality control during the design-to-coding phase and ensuring that the code is strongly aligned with the requirements from the very beginning.
[0084] II. Used to generate objective and comprehensive conformity evidence during the software third-party independent testing (V&V) and delivery acceptance phases. Providing a complete Requirements Traceability Matrix (RTM) is mandatory when software undergoes independent third-party verification and validation (IV&V) or final delivery to the user for acceptance. Traditionally, compiling this matrix is time-consuming, labor-intensive, and difficult to verify. This solution can act as an "automated auditor" at this stage, performing a full alignment analysis of the integrated software project code and all requirements documents.
[0085] The system will generate a complete, structured traceability report. For example, the report will clearly list: Requirement item R-ID-023 (regarding the disturbance rejection capability of a certain control law) is determined to be "implemented," with implementation evidence pointing to the function `compensate_disturbance()` in the file `control_law.c` and its related algorithm functions; while requirement item P-ID-045 (regarding the power consumption limit in a certain mode) may be determined to be "partially implemented," indicating that the current code implements power consumption monitoring but lacks the logic to trigger system degradation when the limit is exceeded. This automatically generated report, with code evidence references, provides testers and acceptance personnel with objective, detailed, and traceable review basis, not only significantly shortening the time for preparing acceptance documents but also discovering "partial implementations" or logical gaps that might have been missed by manual review through deep semantic analysis, significantly improving the reliability and credibility of deliverables.
[0086] III. For efficient and accurate change impact analysis during software maintenance and iterative upgrade phases. Aerospace software undergoes frequent iterations throughout its long lifecycle due to mission changes, bug fixes, or performance optimizations. Any modification to requirements or code requires a clear assessment of its impact. This solution serves as an "intelligent impact analysis engine" in this scenario. When a requirement changes, maintenance personnel simply input the updated requirement document and existing codebase into the system. The system can quickly identify the changed requirement and re-execute the alignment process, accurately locating all relevant functions and files in the current code that need to be modified or verified. Conversely, when developers modify a core function, they can also use the "reverse tracing" function to query all parent requirements currently associated with that function, thereby clarifying which system functions were affected by the code modification and which test cases need to be retested.
[0087] For example, by modifying a low-level packetization function in the data communication protocol stack, the system can immediately list all high-level functional requirements that rely on that protocol for data exchange, guiding the testing team to conduct targeted regression testing. This two-way, precise impact analysis capability transforms change management from experience-driven to data-driven, effectively controlling regression risks during maintenance and ensuring the stability of software evolution.
[0088] The multimodal requirements and code traceability alignment method and system provided by the above embodiments of the present invention for the aerospace field aim to solve the problems commonly existing in the current aerospace knowledge base construction and intelligent retrieval process, such as difficulties in multimodal data fusion, insufficient semantic understanding, incomplete knowledge association, and insufficient engineering applicability. With the increasing complexity of aerospace model development, the multi-source heterogeneous data such as documents, code, and models generated in design, testing, and operation and maintenance stages are experiencing explosive growth. Traditional keyword-based or single-modal retrieval methods are difficult to achieve deep knowledge association and accurate semantic matching; while existing retrieval enhancement generation schemes based on general large language models lack domain knowledge constraints and structured data processing capabilities, making it difficult to meet the high requirements of aerospace engineering for accuracy, traceability, and real-time performance. The technical solution proposed in this invention is a systematic innovation addressing the above pain points.
[0089] In practical engineering, aerospace knowledge typically exists in multimodal forms, such as design specifications, software implementation code, simulation models, and failure case records. Different types of data exhibit significant differences in semantic representation, structural features, and relationships. Without a unified knowledge representation and cross-modal fusion mechanism, knowledge retrieval can easily become fragmented, failing to support systematic technical decision-making and problem tracing. This invention introduces a multimodal fusion framework for document and code data to construct a hierarchical aerospace knowledge base. This allows the knowledge organization process to preserve the logical connections and engineering semantics of the original data, providing a complete and coherent contextual foundation for subsequent intelligent retrieval.
[0090] Aerospace engineering is highly domain-specific, and its knowledge system contains a large number of professional terms, technical constraints, and engineering specifications, such as the state switching logic of spacecraft software, the timing requirements of attitude and orbit control systems, and contingency plans for handling on-orbit anomalies. Existing general-purpose retrieval solutions often fail to accurately understand this domain knowledge, easily leading to technical description biases or incorrect engineering assumptions. This invention constructs an aerospace domain knowledge enhancement mechanism, injecting domain ontology and expert experience during the knowledge base construction phase, and introducing semantic constraints and logical reasoning during the retrieval process. This ensures that the generated results conform to the actual behavioral patterns and industry standards of aerospace systems, significantly improving professionalism and engineering applicability.
[0091] Regarding the knowledge base construction process, this invention adopts a phased processing strategy, separating multimodal data parsing, structured representation, vectorized indexing, and dynamic update mechanisms. Furthermore, it incorporates re-ranking and interpretability enhancement steps at the end of the retrieval process. This design makes the knowledge base construction process more controllable and transparent, helping to ensure comprehensive knowledge coverage and timely updates, while also facilitating engineers' verification and adjustment of search results. In addition, by supporting dynamic field association with metadata, this method can flexibly adapt to the knowledge evolution needs of aerospace model iterations, avoiding increased maintenance costs due to data structure changes.
[0092] Through the above-mentioned technical means, this invention can significantly improve the accuracy and practicality of knowledge retrieval in the aerospace field, making the generated answers more professional and operable.
[0093] In summary, this invention combines multimodal data fusion, domain knowledge enhancement, dynamic field management, and a phased construction mechanism to form a RAG knowledge base construction method suitable for the aerospace field. This method can effectively improve the accuracy, completeness, and engineering controllability of knowledge retrieval, and provide a reliable knowledge infrastructure for aerospace intelligent systems.
[0094] Any matters not covered in the above embodiments of the present invention are well-known in the art.
[0095] The specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various modifications or variations within the scope of the claims, which do not affect the essence of the present invention.
Claims
1. A method for aligning multimodal requirements and code tracing in the aerospace field, characterized in that, include: Transform source code from a sequence of characters into knowledge units with semantic and hierarchical relationships, and build a structured code semantic knowledge base; Natural language requirements are broken down into independent atomic requirement units, and a decoupled requirement semantic knowledge base is constructed. Each atomic requirement unit in the requirement semantic knowledge base is simultaneously subjected to parallel similarity retrieval with multiple knowledge units in the code semantic knowledge base, and multi-granularity retrieval-enhanced requirement implementation status discrimination is performed to generate individual traceability conclusions. Integrate all individual traceability conclusions to generate project-level requirements and code traceability alignment results.
2. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 1, characterized in that, The process of converting source code from character sequences into knowledge units with semantic and hierarchical relationships to construct a structured code semantic knowledge base includes: Static code analysis tools are used to parse all source code files of the target aerospace software project and generate a unified abstract syntax tree; Traverse the abstract syntax tree, identify and extract all function definition syntax nodes, and obtain the function signatures of the syntax nodes and their location information in the source code; The complete source code fragment corresponding to each syntax node is combined with its function signature and fed into a large language model as basic input. Corresponding prompts are set, and the instructions generate a two-level semantic description for the function, one level being a functional summary and the other a process description. Based on the function call relationships contained in the abstract syntax tree, a function call graph is constructed to describe the dynamic dependencies between functions; The abstract syntax tree, function signature, flow description, and function call graph are vectorized at three granularities to form indexes at different levels; these include: Vectorize the fused text containing function signatures, functional summaries, and process descriptions to form a function-level index; After aggregating the semantic descriptions of all functions within the same file, the data is fed back into the large language model to generate a summary of the overall process logic of the file and quantize it, forming a file-level index. Summarize the function signatures and process descriptions, generate project technology stack analysis and framework description, quantify them, and form a project-level index; All vectors at the above granularity and their metadata are stored in different indexes or namespaces of the same vector database to form a structured code semantic knowledge base.
3. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 1, characterized in that, The process of decomposing natural language requirements into independent atomic requirement units to construct a decoupled requirement semantic knowledge base includes: Obtain aerospace-related requirement documents, and use predefined regular expressions or domain keyword matching rules to scan the requirement documents and locate the original requirement paragraphs containing the specified keywords. The original requirement paragraph is fed into the large language model, and the large oracle model is instructed to obtain the atomic requirement text after decoupling and normalization through the set Prompt. Each decoupled and normalized atomic requirement text is transformed into an embedded vector and stored together with its requirement information to form a requirement semantic knowledge base; wherein, the requirement information is obtained by parsing the input atomic requirement text, including: the requirement ID, the original requirement paragraph, and the requirement type of each requirement code.
4. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 3, characterized in that, The instruction oracle model yields decoupled and normalized atomic requirement texts, including: Break down complex requirements into several single, atomized requirement descriptions to form atomic requirements; Complete the implicit subject, conditions and / or context for each atomic requirement, and rewrite it using standardized sentence patterns; Label each atomic requirement with its requirement type; Through the above steps, we obtain atomic requirement text that has been decoupled and normalized.
5. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 1, characterized in that, The process of performing parallel similarity searches on each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, executing multi-granularity search-enhanced requirement implementation status discrimination, and generating individual traceability conclusions includes: The vector of each atomic requirement is simultaneously compared with multiple indices in the code semantic knowledge base for similarity retrieval to obtain Top-K functions, Top-M file summaries and / or atomic requirement texts to be judged; The retrieved Top-K functions, Top-M file summaries, and / or atomic requirement texts to be judged are organized into a structured prompt according to a preset template; The obtained structured hints are submitted to the large language model that has switched contexts to drive the large language model to perform requirement-code tracing tasks; Based on its code understanding and logical reasoning capabilities, the large language model analyzes whether and to what extent the retrieved code evidence meets the current requirements, generates a structured individual judgment report, obtains the individual tracing conclusion, and forms a code tracing link.
6. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 5, characterized in that, The step of performing parallel similarity retrieval on the vector of each atomic requirement with multiple indices in the code semantic knowledge base to obtain Top-K functions, Top-M file summaries, and / or atomic requirement texts to be judged includes: The K most relevant functions and their semantic descriptions are retrieved from the function-level index of the code semantic knowledge base to obtain the Top-K functions; The most relevant M file summaries are retrieved from the file-level index of the code semantic knowledge base to obtain the Top-M file summaries; Retrieve relevant technology stack descriptions from the project-level index of the code semantic knowledge base to obtain the atomic requirement text to be judged; The individual discrimination report shall include at least the following: state discrimination, localization, and missing data analysis.
7. The method for aligning multimodal requirements and code tracing in the aerospace field according to claim 1, characterized in that, The process of integrating all individual traceability conclusions to generate project-level requirement and code traceability alignment results includes: Summarize the judgment conclusions of all atomic requirements, perform statistical analysis to generate a complete, project-level requirement-code traceability alignment report; wherein, the requirement-code traceability alignment report includes: the status of each requirement, the corresponding implementation code location, and the judgment basis provided by the large language model; and / or Based on the aforementioned requirements - code tracing alignment report, a visual view is generated.
8. A multimodal requirement and code tracing and alignment system for the aerospace field, characterized in that, include: The code parsing and enhancement module is used to convert source code from character sequences into knowledge units with semantic and hierarchical relationships, and build a structured code semantic knowledge base. The requirement processing and decoupling module is used to decompose natural language requirements into independent atomic requirement units and build a decoupled requirement semantic knowledge base. The multimodal vector discrimination module is used to perform parallel similarity retrieval between each atomic requirement unit in the requirement semantic knowledge base and multiple knowledge units in the code semantic knowledge base, perform multi-granularity retrieval-enhanced requirement implementation status discrimination, and generate individual traceability conclusions. The project-level knowledge flow integration module is used to integrate the conclusions of all individual traceability and generate project-level requirements and code traceability alignment results.
9. A computer terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it can be used to perform the method of any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program can be used to perform the method of any one of claims 1-7.