A sysML v2 model-driven software development full-process automatic generation method and system
Patent Information
- Application Number
- CN202611278728.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]针对现有技术的以上缺陷或改进需求,本发明提供了一种SysML v2模型驱动的软件开发全流程自动生成方法及系统,由此解决现有技术存在的自然语言输入不稳定、用户逐阶段重复补充信息、工件之间一致性弱、模型驱动范围局限的技术问题
1.减少用户重复输入并保留人工引导能力。本发明提供的方法,通过以已构建的SysML v2 模型作为软件开发全流程核心信息源,减少用户在 PRD、架构、开发、测试和部署阶段重复描述同一需求、结构、行为和约束信息,同时允许用户通过自然语言对生成目标、技术栈、输出格式和补充约束进行引导。
Smart Images

Figure CN122816613A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of software engineering, and more specifically, relates to a SysML v2 model-driven method and system for automatically generating the entire software development process. Background Technology
[0002] With the development of large-scale language models and agent technologies, AI-assisted software development tools have been widely applied in requirements analysis, code generation, test generation, technical documentation writing, and deployment script generation. Existing tools typically take natural language dialogues, prompts, requirements documents, code comments, or project description documents as input, and generate corresponding software development content through large-scale model reasoning.
[0003] In existing AI-assisted development processes, users typically need to repeatedly supplement context at different stages. For example, the Product Requirements Document (PRD) stage requires describing product goals and functional requirements; the architecture stage requires redefining module boundaries and interface relationships; the development stage requires explaining the code implementation logic; the testing stage requires supplementing acceptance criteria and assertion rules; and the deployment stage requires specifying the operating environment and deployment constraints. Although multi-agent software development processes can break down these stages for different agents, the context between different stages still mainly relies on natural language or documents, lacking a unified, stable, and traceable source of model-based information. Summary of the Invention
[0004] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a SysML v2 model-driven automatic generation method and system for the entire software development process, thereby solving the technical problems of unstable natural language input, repeated information supplementation by users at each stage, weak consistency between artifacts, and limited model-driven scope in existing technologies.
[0005] To achieve the above objectives, according to a first aspect of the present invention, a method for automatically generating the entire software development process driven by the SysML v2 model is provided, comprising: S1. The text representation of the constructed SysML v2 model is parsed to identify model elements, semantic relationships between model elements, and inter-layer tracking relationships. The model elements, semantic relationships, and inter-layer tracking relationships are extracted into a structured intermediate representation. User natural language guidance information is used as auxiliary guidance information and associated with the structured intermediate representation. The associated user natural language guidance information and the structured intermediate representation are semantically organized, contextually reorganized, and stage-adapted to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively. S2 generates corresponding software development artifacts based on the inputs at each stage; S3, perform consistency verification between the software development artifact and the SysML v2 model through the mapping, constraint or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, locate the source of the problem and perform backtracking correction.
[0006] According to a second aspect of the present invention, a SysML v2 model-driven automated software development process generation system is provided, comprising: The model parsing and stage adaptation module is used to parse the text representation of the constructed SysML v2 model, identify model elements, semantic relationships between model elements, and inter-layer tracking relationships; extract structured information from the model elements, semantic relationships, and inter-layer tracking relationships to generate a structured intermediate representation; associate user natural language guidance information as auxiliary guidance information with the structured intermediate representation; and perform semantic organization, context reorganization, and stage adaptation on the associated user natural language guidance information and the structured intermediate representation to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively. The artifact generation module is used to generate corresponding software development artifacts based on the inputs at each stage. The consistency verification and backtracking correction module is used to verify the consistency between the software development artifact and the SysML v2 model through the mapping, constraint or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, the source of the problem is located and backtracking correction is performed.
[0007] According to a third aspect of the present invention, an electronic device is provided, comprising: a computer-readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the method as described in the first aspect.
[0008] According to a fourth aspect of the invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to perform the method as described in the first aspect.
[0009] According to a fifth aspect of the invention, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the method as described in the first aspect.
[0010] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects: 1. Reduce repetitive user input while retaining human guidance capabilities. The method provided by this invention reduces the need for users to repeatedly describe the same requirements, structures, behaviors, and constraints during the PRD, architecture, development, testing, and deployment stages by using a pre-built SysML v2 model as the core information source for the entire software development process. At the same time, it allows users to guide the generation of goals, technology stack, output format, and supplementary constraints through natural language.
[0011] 2. Improve cross-phase consistency. The method provided by this invention parses multi-layered model information from the SysML v2 model, including the requirements analysis layer, functional design layer, architecture design layer, test case layer, and deployment configuration layer, and forms a structured intermediate representation that can be used in different development phases. Through the tracing relationships between model elements, structured intermediate representations, and generated artifacts, a foundation for consistency verification is established between requirements, architecture, code, tests, and deployment configurations.
[0012] 3. Improve the completeness of generated artifacts. The method provided by this invention, through a multi-layered unified association model system, enables the system to extract information from the requirements analysis layer, functional design layer, architecture design layer, test case layer, and deployment configuration layer, supporting the generation of multiple types of software development artifacts.
[0013] 4. Improve the controllability and adaptability of automatic generation. The method provided by this invention ensures the stability of structured transformation through rule mapping, and enhances the ability to handle complex semantic processing and stage adaptation through semantic organization and stage adaptation. This makes the model parsing results both controllable and adaptable to complex software development scenarios, taking into account both engineering feasibility and adaptability to complex scenarios.
[0014] 5. Supports incremental updates after model changes. The method provided by this invention enables the system to locate affected workpieces and perform incremental generation when the model changes, avoiding the repeated generation of irrelevant workpieces and improving software iteration efficiency and maintainability. By using model changes as the trigger source, the system automatically locates affected workpieces and performs incremental updates, reducing the costs of manual judgment and full regeneration.
[0015] 6. Enhanced traceability and maintainability. The method provided by this invention, through consistency verification, backtracking correction, and incremental consistency re-verification, enables the system to discover and correct issues such as missing requirements, missing tests, and missing deployment mappings after generation.
[0016] 7. Facilitates the integration of model-driven engineering, BMad-like phased processes, and AI-assisted software development. The method provided by this invention offers a stable and reproducible foundation for model information extraction through rule mapping, provides complex semantic recombination and phased input transformation capabilities through semantic organization and phased adaptation processing, and offers a phased workpiece organization method through BMad-like processes, enabling model-driven, user-guided natural language, and intelligent generation to work synergistically. Attached Figure Description
[0017] Figure 1 The flowchart shows the overall process of automatically generating the entire software development process driven by the SysML v2 model provided in this embodiment of the invention.
[0018] Figure 2 This is a flowchart of consistency correction and backtracking correction in the SysML v2 model-driven automatic generation method for the entire software development process provided in this embodiment of the invention.
[0019] Figure 3 This is a flowchart of the change impact analysis in the SysML v2 model-driven automatic generation method for the entire software development process provided in this embodiment of the invention.
[0020] Figure 4 The system architecture diagram for the automatic generation of the entire software development process driven by the SysML v2 model provided in this embodiment of the invention is shown. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.
[0022] The existing AI-assisted development process has the following shortcomings: 1. There is a strong reliance on natural language prompts or human-generated documentation. Existing AI software development tools typically rely on users to express their development needs through natural language prompts, dialogue logs, requirement documents, or code comments. The input content has a low degree of structure and is prone to ambiguity, omissions, and version inconsistencies.
[0023] 2. Users need to repeatedly input context across multiple development stages. Currently, PRD generation, architecture generation, code generation, test generation, and deployment configuration generation are often performed separately. Each stage requires users to repeatedly describe the same requirements, constraints, or design information, increasing communication costs and implementation discrepancies.
[0024] 3. Lack of a unified semantic carrier among artifacts at different stages. Requirements, design, code, testing, and deployment are usually associated through manually maintained documents or temporary contexts, lacking stable model tracing relationships and making it difficult to ensure consistency across stages.
[0025] 4. Existing model-driven methods often focus on local generation. Some model-driven development methods can generate code skeletons, interface definitions, or configuration files from design models, but they usually struggle to cover the entire process, including PRD, architecture, code, testing, deployment, and consistency verification.
[0026] 5. Existing multi-agent development processes lack a unified master model. Although multi-agent systems can divide tasks for requirements, architecture, development, and testing, the main inputs for each agent still come from information supplemented by the user at each stage, and the shared context between different agents lacks a modeled and traceable foundation.
[0027] 6. There is a lack of effective connection between model-driven development and AI-generative development. Existing model-driven methods tend to focus on rule-based and template-based transformations, which lack flexibility; existing large-scale model generation methods tend to focus on free text reasoning, which lacks stability and traceability. The two have not yet formed a stable collaborative mechanism for the entire software development process.
[0028] On the other hand, model-driven engineering and model-based systems engineering can express system requirements, structure, behavior, and constraints through SysML, UML, or domain models. SysML v2, as a next-generation system modeling language, can express information such as components, ports, actions, states, requirements, and constraints in complex systems in a more formal way. While existing model-driven methods can support requirements analysis, system design, or partial code generation, they mostly focus on a single phase and rarely use the constructed SysML v2 model as a unified information source for the entire software development process to continuously drive the automatic generation of various artifacts such as PRDs, architectures, code, tests, and deployments.
[0029] Therefore, in the development of complex software systems, how to make full use of the constructed SysML v2 model, so that it is not just an auxiliary material in the system design or verification phase, but becomes the core information source of the entire software development process, is a key issue to improve the automation, consistency and traceability of software development.
[0030] Based on this, embodiments of the present invention provide a method for automatically generating the entire software development process driven by the SysML v2 model, such as... Figure 1 As shown, it includes: S1, Model Parsing and Stage Adaptation: The text representation of the constructed SysML v2 model is parsed to identify model elements, semantic relationships between model elements, and inter-layer tracking relationships; structured information is extracted from the model elements, semantic relationships, and inter-layer tracking relationships to generate a structured intermediate representation; user natural language guidance information is used as auxiliary guidance information and associated with the structured intermediate representation; semantic organization, context reorganization, and stage adaptation are performed on the associated user natural language guidance information and the structured intermediate representation to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively.
[0031] Specifically, in step S1, input reading, model text parsing, rule mapping, user-guided information fusion, and staged input organization are completed around the constructed SysML v2 model text. Step S1 includes the following process: S11, SysML v2 Text Input: Receive or read the text representation of a completed SysML v2 model. The text representation can be SysML v2 text exported by the modeling tool, a text version in the model repository, or model text obtained through an interface.
[0032] In a preferred embodiment, the model includes at least some of the following layers: a requirements analysis layer, a functional design layer, an architecture design layer, a test case layer, and a deployment configuration layer, and there are mapping relationships, constraint relationships, or tracing relationships between different layers.
[0033] S12, Model Text Parsing: Parses the SysML v2 model text to identify model elements, semantic relationships between model elements, and inter-layer tracking relationships.
[0034] In a preferred embodiment, the identified subset of SysML v2 elements includes at least one of component definitions and component usages, port definitions and port usages, action definitions and action usages, state definitions and state usages, requirement definitions and requirement usages, and constraint definitions and constraint usages.
[0035] S13, Rule Mapping: Based on preset rules, structured information is extracted from model elements, semantic associations, and inter-layer tracking relationships to generate structured intermediate representations.
[0036] In a preferred embodiment, the structured intermediate representation may include at least one of the following: requirement items, functional units, structural units, interaction boundaries, behavioral flows, state constraints, constraint rules, verification criteria, deployment-related semantics, and tracking relationships.
[0037] S14, User Guidance Information Fusion: Receive the generation goal, technology stack preference, output format, supplementary business constraints, workpiece granularity, generation range or manual confirmation opinions provided by the user through natural language, and associate them with the structured intermediate representation as auxiliary guidance information.
[0038] When the user's natural language guidance information is inconsistent with the model's parsing results, it can be processed according to preset priorities, manual confirmation results, or backtracking correction rules.
[0039] S15, Semantic Organization and Stage Adaptation: Semantic organization, context reorganization, and stage adaptation are performed on the structured intermediate representation and user guidance information to form staged inputs corresponding to product requirement generation, architecture design generation, code generation, test generation, and deployment configuration generation, respectively.
[0040] This step can be achieved through rule-based procedures, large language models, intelligent agents, or a combination of these. Their common feature is that they use the model's parsing results as the primary source of semantics, and the user's natural language as guidance and supplement, rather than relying on the user to repeatedly input complete requirements at each stage.
[0041] The method provided by this invention employs a multi-layered unified association model parsing mechanism in step S1: utilizing model information such as the requirement analysis layer, functional design layer, architecture design layer, test case layer, and deployment configuration layer contained in the constructed SysML v2 model. Different model layers can form a unified association through mapping, dependency, constraint, or tracing relationships. By parsing the above relationships, the semantics of requirements, functions, structures, behaviors, constraints, verification, and deployment in the model are uniformly extracted into a structured intermediate representation. Simultaneously, a model source and natural language guidance fusion mechanism is also adopted: it does not rely entirely on fixed templates for mechanical conversion, nor entirely on the generation of large free text models, but rather adopts a fusion mechanism of "model parsing results as the main source and user natural language guidance as a supplement." The model parsing results are used to provide the main semantics such as requirements, functions, structures, behaviors, constraints, verification, and deployment; user natural language guidance information is used to supplement the generation goals, output format, technology stack preferences, artifact granularity, generation scope, and manual confirmation opinions. During fusion, the model source identifier and the user guidance source identifier are retained; when the two are inconsistent, they can be handled through preset priorities, conflict markers, manual confirmation, or backtracking correction rules. Furthermore, a hybrid driving mechanism of rule mapping and semantic processing stage adaptation is adopted: rule mapping is used to ensure the stability of element recognition, field transformation, retention of tracking relationships, and constraint extraction; semantic processing and stage adaptation are used to perform semantic processing, context reorganization, and stage adaptation on the structured intermediate representation and user natural language guidance information, so that the model parsing results can be consumed by different development stages. This mechanism can be implemented by rule programs, prompt templates, large language models, agents, or combinations thereof, but the key to this invention lies not in the specific generator itself, but in the generation method of stage inputs and the retention of model tracking relationships.
[0042] S2, Workpiece Generation: Generate corresponding software development workpieces based on the inputs of each stage.
[0043] Specifically, in step S2, a software development artifact is generated based on the staged input.
[0044] It should be noted that the phased generation of PRD, architecture, code, test or deployment configuration is an existing technology. Existing BMad-like methods, AI Coding tools or other software engineering automation processes all have similar artifact generation capabilities.
[0045] For example, this invention can refer to the phase division, role division, templated input, and phase-by-phase output generation methods in the BMad methodology, but the difference is that the main input of each phase is not the natural language described by the user in each phase, but a structured intermediate representation obtained by parsing the SysML v2 model text, and guided by the user's natural language in terms of goals, scope, format, and preferences, i.e., structured intermediate representation and user guidance information.
[0046] The software development artifacts include at least one of the following: PRD artifacts (i.e., product requirements artifacts), architecture design artifacts, code artifacts, test artifacts, and deployment configuration artifacts.
[0047] The PRD artifacts can include product objectives, functional descriptions, role responsibilities, constraints, and acceptance criteria; the architecture design artifacts can include module division, component relationships, interaction boundary descriptions, data flow descriptions, and deployment boundary descriptions; the code artifacts can include code skeletons, class definitions, interface boundary implementations, control logic, state handling logic, constraint verification logic, and configuration code; the test artifacts can include test cases, test scripts, assertion rules, verification processes, and requirements traceability tables; and the deployment configuration artifacts can include deployment scripts, deployment description documents, environment configuration files, runtime node configurations, external tool connection configurations, and result output path configurations.
[0048] The method provided by this invention, in step S2, adopts a phased artifact generation mechanism referencing the BMad methodology: it uses a phased generation approach rather than generating all artifacts end-to-end all at once. This phased organization method can refer to the idea of organizing work according to requirements, architecture, development, and testing phases in the BMad methodology, or it can adopt other similar phased software engineering processes. First, the PRD phase input is generated, producing product goals, functional descriptions, constraints, and acceptance criteria; then, the architecture phase input is generated, producing module divisions, interface specifications, and deployment boundaries; subsequently, the development phase input is generated, producing code skeletons, interface implementations, control logic, and constraint verification logic; further, the testing phase input is generated, producing test cases, assertion rules, and requirement traceability tables; finally, the deployment phase input is generated, producing runtime environment configurations, node configurations, and external tool connection configurations. Compared with a simple BMad or ordinary AI Coding process, the inputs of each stage in this invention are mainly generated by the parsing results of the SysML v2 model, and the user's natural language is mainly used for guidance, selection, supplementation, and confirmation.
[0049] S3, Consistency Verification and Backtracking Correction: The consistency between the software development artifact and the SysML v2 model is verified through the mapping, constraint, or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, the source of the problem is located and backtracking correction is performed.
[0050] Specifically, such as Figure 2As shown, in step S3, the consistency between the generated software development artifact and the SysML v2 model is verified based on the mapping, constraint, or tracing relationships in the model. When the consistency verification result does not meet the preset conditions, the module locates the source of the problem in the model parsing stage, rule mapping stage, stage adaptation stage, or artifact generation stage, and performs backtracking correction on at least one of the structured intermediate representation, preset rules, staged input, or software development artifact.
[0051] This step can be implemented using a large language model or an intelligent agent.
[0052] The method provided by this invention employs a consistency verification and backtracking correction mechanism in step S3: after generating the artifact, a consistency verification is performed based on the tracing relationship between model elements, structured intermediate representations, and software development artifacts. The consistency verification may include requirement consistency verification, structural consistency verification, interaction boundary consistency verification, behavioral flow consistency verification, test coverage consistency verification, and deployment mapping consistency verification. When problems such as unimplemented requirements, missing tests in implementations, missing component mappings in deployment configurations, or inconsistencies between interface descriptions and code are found, the source of the problem is located, and the relevant stages are re-executed.
[0053] Considering the shortcomings of existing AI-assisted development processes in locating the impact of requirement changes and incremental updates—that is, when requirements, constraints, interfaces, or deployment conditions change, existing technologies typically require manual identification of affected documents, code, tests, and deployment configurations, making it difficult to automatically locate affected artifacts, generate incremental updates, and re-verify consistency—this method, as a further preferred embodiment of the present invention, further includes: S4. When the SysML v2 model changes, identify the model change items, convert the model change items into semantic change items, and locate the affected software development artifacts by combining the tracking relationships in the SysML v2 model. Perform incremental generation and incremental consistency verification on the affected artifacts.
[0054] Specifically, such as Figure 3 As shown, when the SysML v2 model changes, the model change items are identified, converted into semantic change items, and the affected software development artifacts are located based on the tracking relationship to trigger incremental generation and incremental consistency verification.
[0055] The method provided by this invention employs a model change impact localization and incremental generation mechanism in step S4: When the SysML v2 model changes, the model elements, semantic associations, or inter-layer tracing relationships before and after the change are compared to identify model change items, which are then converted into semantic change items in a structured intermediate representation. Based on the semantic change items and tracing identifiers, at least one of the affected PRD artifacts, architecture design artifacts, code artifacts, test artifacts, and deployment configuration artifacts is located, and incremental generation is performed only on the affected artifacts and their directly related artifacts. After incremental generation is completed, incremental consistency verification is further performed to verify whether the interfaces, constraints, test coverage, deployment mappings, or tracing relationships between the updated artifacts and the unupdated artifacts are consistent.
[0056] To avoid mixing SysML v2 standard elements, intermediate semantics in model parsing, and generated artifact fields, the three-layer representation system of model information used in this invention will be described below.
[0057] 1. First level: Subset of SysML v2 elements The first layer refers to a subset of SysML v2 elements directly parsed and used by this invention. This subset is not an exhaustive list of all SysML v2 syntax elements, but rather can be selected according to the needs of software development artifact generation. Preferably, this subset includes at least one of the following: part definitions and usages (part def, part), port definitions and usages (port def, port), action definitions and usages (action def, action), state definitions and usages (state def, state), requirement definitions and usages (requirement def, requirement), and constraint definitions and usages (constraint def, constraint).
[0058] In addition to the aforementioned subset of core elements, some implementations may also involve model representations such as item, attribute, connection, interface, allocation, package, import, view, metadata, flow semantics, satisfying relationship, verify relationship, and allocation relationship; however, these contents are not limited to a fixed text keyword, but rather serve as extended semantic processing that can be expressed by SysML v2 or its underlying modeling mechanism.
[0059] 2. Second layer: Model parsing intermediate semantics (i.e., structured intermediate representation) The second layer refers to the general intermediate semantics obtained by processing the subset of elements and their relationships from the first layer through rule mapping or semantic organization and stage adaptation. It is mainly used to support subsequent staged generation. The intermediate semantics may include at least one of the following: requirement items, functional units, structural units, interaction boundaries, behavioral processes, state constraints, constraint rules, verification basis, deployment-related semantics, and tracking relationships.
[0060] This layer represents the extraction and organization results of this invention and is not equivalent to the standard text keywords of SysML v2.
[0061] 3. Third layer: Generate workpiece fields The third layer refers to the target artifact content or fields obtained by further transformation from the intermediate semantics of the second layer, specifically distributed in PRD, architecture, code, test, and deployment artifacts. The artifact fields may include: PRD fields, such as product goals, functional descriptions, role responsibilities, constraints, and acceptance criteria; architecture fields, such as module divisions, component relationships, interaction boundary descriptions, and deployment boundary descriptions; code fields, such as code skeletons, class definitions, interface boundary implementations, control logic, and state handling logic; test fields, such as test cases, test scripts, assertion rules, and coverage relationships; and deployment fields, such as environment configuration, service deployment descriptions, runtime node configurations, and output path configurations.
[0062] 4. Rules for using three-level representation When expressions such as `part def`, `port def`, `action def`, `state def`, `requirement def`, and `constraint def` are used, they should be understood as core examples belonging to the first-level SysML v2 element subset. Expressions such as `item`, `attribute`, `connection`, `interface`, `allocation`, `package`, `view`, and `metadata` can be understood as extended examples in the first level, based on the actual model text. Expressions such as requirement items, functional units, structural units, behavioral flows, and constraint rules should be understood as intermediate semantics in the second-level model parsing. Expressions such as module division, interface descriptions, code skeletons, test assertions, and deployment configurations should be understood as third-level generated artifact fields. Domain-specific fields appearing in the examples should be considered as instantiations of the second or third level in specific scenarios and should not be conversely limited to first-level SysML v2 standard elements.
[0063] In a preferred embodiment, the mapping relationships between different model layers in the SysML v2 model and the software development artifacts are shown in Table 1:
[0064] In a preferred embodiment, a subset of SysML v2 elements can be converted into software development artifact fields through rule mapping or semantic tidying and stage adaptation. Table 2 shows examples of the core mapping relationships preferred in this invention and is not an exhaustive limitation on the range of elements that SysMLv2 can parse.
[0065] In other implementations, the extended elements or semantic relationships shown in Table 3 can be further parsed and mapped based on the actual content of the model text:
[0066] The above mapping relationship is used to express the relationship between the subset of general SysML v2 elements used in this invention and the software artifacts. It is not bound to a specific business domain, nor does it require that each embodiment must parse all SysML v2 elements. When certain semantics need to be jointly expressed by multiple elements, the multiple elements and their relationships can be semantically reorganized through rule mapping or semantic organization and stage adaptation processing to form the target artifact field.
[0067] In summary, as shown in the figure, the method provided by this invention includes the following steps: (1) Receiving or reading input. The system receives or reads the text representation of the constructed SysML v2 model and receives user natural language guidance information. The SysML v2 model includes at least some of the following layers: requirements analysis layer, functional design layer, architecture design layer, test case layer, and deployment configuration layer, and different layers have mapping, constraint, or tracing relationships. The user natural language guidance information may include at least one of the following: generation target, target artifact type, technology stack preference, output format, supplementary business constraints, generation granularity, generation scope, or human confirmation comments.
[0068] (2) Perform model text parsing. Perform lexical, syntactic, or semantic parsing on the SysML v2 model text to identify model elements, semantic relationships between model elements, and inter-layer tracking relationships. The model elements may include at least one of partdef, part, port def, port, action def, action, state def, state, requirement def, requirement, constraint def, and constraint, and may also include other SysML v2 model expressions that can express items, attributes, connections, interfaces, assignments, views, metadata, satisfaction relationships, validation relationships, or tracking relationships.
[0069] (3) Generate a structured intermediate representation. Based on preset rules, structured information is extracted from the model elements, semantic associations, and inter-layer tracking relationships to generate a structured intermediate representation, and the model source identifier is retained for the structured intermediate representation. The structured intermediate representation includes at least one of the following: requirement items, functional units, structural units, interaction boundaries, behavioral processes, constraint rules, verification basis, and deployment-related semantics.
[0070] (4) Integrate user natural language guidance information. Convert user natural language guidance information into guidance constraints or generation parameters and associate them with structured intermediate representations. For example, convert natural language guidance information such as "implement using Python", "output detailed test cases", "prioritize generating architecture documents", and "adopt microservice architecture" into staged parameters such as technology stack, artifact type, output granularity, or architecture preference. When user guidance information conflicts with model parsing results, mark the conflict and determine the appropriate approach based on preset rules or manual confirmation results.
[0071] (5) Forming staged inputs. According to the stages of PRD, architecture design, code generation, test generation and deployment configuration generation, the structured intermediate representation and user guidance information are semantically organized, contextually reorganized and field adapted to form input packages that can be consumed at each stage. Each input package may include model source identifier, stage goal, required context, constraints, tracing relationships and user guidance parameters.
[0072] (6) Execute phased artifact generation. Referring to BMad-type phased workflows, prompt templates, agent division of labor, or other software engineering generation processes, provide the input packages for each phase to the corresponding artifact generation process to generate software development artifacts. The software development artifacts include at least one of PRD artifacts, architecture design artifacts, code artifacts, test artifacts, and deployment configuration artifacts.
[0073] (7) Establish artifact tracking relationships. Record the correspondence between fields, paragraphs, code snippets, test items or deployment configurations in software development artifacts and structured intermediate representations, model elements, and user guidance parameters for subsequent consistency verification, backtracking correction, and location of change impacts.
[0074] (8) Perform consistency verification. Based on the mapping, constraint or tracing relationships in the model, verify the consistency between the generated software development artifact and the SysML v2 model. The verification includes at least one of the following: requirement coverage, structure mapping, behavior implementation, interface consistency, test coverage and deployment mapping.
[0075] (9) Perform backtracking correction. When the consistency verification result does not meet the preset conditions, locate the source of the inconsistency problem as belonging to at least one of the following steps: model parsing, rule mapping, user-guided fusion, stage adaptation, or artifact generation. Then, perform backtracking correction on at least one of the following: structured intermediate representation, preset rules, user-guided parameters, staged input, or software development artifact. Subsequently, re-execute the corresponding software development artifact generation or consistency verification.
[0076] (10) Perform incremental generation after model change. When the SysML v2 model changes, identify the changed model elements, semantic associations or inter-layer tracking relationships, convert them into semantic change items in the structured intermediate representation, locate the affected software development artifacts in combination with the tracking relationships, and perform incremental generation and incremental consistency verification on the affected artifacts.
[0077] The following describes an automated generation system for the entire software development process driven by the SysML v2 model, provided by this invention. The automated generation system for the entire software development process driven by the SysML v2 model described below can be referred to in correspondence with the automated generation method for the entire software development process driven by the SysML v2 model described above.
[0078] This invention provides a SysML v2 model-driven automated software development process generation system, comprising: The model parsing and stage adaptation module is used to parse the text representation of the constructed SysML v2 model, identify model elements, semantic relationships between model elements, and inter-layer tracking relationships; extract structured information from the model elements, semantic relationships, and inter-layer tracking relationships to generate a structured intermediate representation; associate user natural language guidance information as auxiliary guidance information with the structured intermediate representation; and perform semantic organization, context reorganization, and stage adaptation on the associated user natural language guidance information and the structured intermediate representation to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively. The artifact generation module is used to generate corresponding software development artifacts based on the inputs at each stage. The consistency verification and backtracking correction module is used to verify the consistency between the software development artifact and the SysML v2 model through the mapping, constraint or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, the source of the problem is located and backtracking correction is performed.
[0079] Preferably, the system further includes: The change impact analysis module is used to identify model change items when the SysML v2 model changes, convert model change items into semantic change items, locate the affected software development artifacts by combining the tracking relationships in the SysML v2 model, and perform incremental generation and incremental consistency verification on the affected artifacts.
[0080] This invention provides an electronic device, including: a computer-readable storage medium and a processor; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the method as described in any of the above embodiments.
[0081] This invention provides a computer-readable storage medium storing computer instructions that cause a processor to perform the method described in any of the above embodiments.
[0082] This invention provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement the method described in any of the above embodiments.
[0083] Appendix: Explanation of Relevant Basic Concepts This appendix is used to explain the basic concepts related to the methods provided in this invention.
[0084] 1. MBSE Model-based systems engineering (MBSE) is a systems engineering approach that uses models as the primary carriers of information on system requirements, structure, behavior, constraints, verification, and analysis. Compared to the traditional document-centric approach, MBSE places greater emphasis on expressing system components, interface relationships, functional behaviors, and verification logic through models, and enhances the consistency and traceability of system design through the relationships between models.
[0085] In this invention, MBSE-related models can serve as the source or basis for an already constructed SysML v2 model.
[0086] 2. SysML v2 SysML v2, or Systems Modeling Language version 2.0, is a systems engineering modeling language used to express system requirements, structure, behavior, state, constraints, and verification information. SysML v2 can describe complex systems through relatively formalized model elements and their relationships, providing a foundation for cross-stage information tracing and automated processing.
[0087] In this invention, the SysML v2 model serves as the core information source for the entire software development process. The system can parse the model elements, such as components, ports, actions, states, requirements, and constraints, and their relationships, and convert them into a structured intermediate representation that can be used in the PRD, architecture, code, testing, and deployment phases.
[0088] 3. Model-Driven Engineering and Model-Driven Development Model-driven engineering and model-driven development typically refer to using models as the main development asset and supporting software system development through model conversion, model verification, code generation, or configuration generation.
[0089] The difference between this invention and traditional local model-driven code generation is that this invention does not only generate code skeletons from models, but uses model parsing results as a unified input, covering multiple stages such as PRD, architecture, code, testing, deployment and consistency verification.
[0090] 4. AI Coding / Artificial Intelligence-Assisted Software Development AI Coding, or Artificial Intelligence-Assisted Software Development, refers to the use of large language models, code generation models, or intelligent agents to assist in software engineering tasks such as requirements gathering, code generation, test writing, documentation generation, and bug fixing. Existing AI Coding methods often rely on natural language prompts, chat context, or project documents as input, which can easily lead to problems such as repeated contextual input, semantic drift, and inconsistencies across different stages.
[0091] This invention utilizes the semantic organization and stage adaptation capabilities of artificial intelligence or intelligent agents, but its main semantic source is the parsing results of the constructed SysML v2 model; the user's natural language can still serve as guiding input for the generation target, technology stack, output format, generation range, or supplementary constraints.
[0092] 5. Software Development Process for Intelligent Agents and Multi-Agents An intelligent agent is an intelligent processing unit capable of performing information processing, reasoning, generation, verification, or task scheduling around a specific goal. In the software development process, different intelligent agents can respectively undertake tasks such as requirement generation, architecture generation, code generation, test generation, and deployment generation.
[0093] In this invention, the core role of the agent is to perform semantic organization, contextual restructuring, and stage adaptation of the model's parsing results. Regardless of whether a single-agent or multi-agent approach is used, the common feature is that the model's parsing results are the primary source of information, rather than relying on repeated user input at each stage.
[0094] 6. BMad Methodology BMad can be understood as a phased software development organizational method or workflow reference, which typically emphasizes the division of labor and collaboration from product requirements, architecture design, development implementation to testing and verification. This invention can draw on a similar phase division method to BMad, dividing the software development process into phases such as PRD, architecture, code, testing, and deployment.
[0095] 7. Software Development Artifacts In this invention, software development artifacts refer to deliverables generated or maintained during the software development process, including but not limited to: Product Requirements Document (PRD), architecture design document, interface specification, source code or code skeleton, test cases, test scripts, requirements traceability table, deployment scripts, environment configuration files, and deployment specification documents.
[0096] This invention transforms the SysML v2 model parsing results into inputs at different stages, enabling the aforementioned artifacts to be generated based on a unified model source, and performs consistency verification, backtracking correction, and incremental updates through model tracking relationships.
[0097] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for automatically generating the entire software development process driven by the SysML v2 model, characterized in that, include: S1 parses the text representation of the constructed SysML v2 model, identifies model elements, semantic relationships between model elements, and inter-layer tracking relationships; The model elements, semantic associations, and inter-layer tracking relationships are extracted in a structured manner to generate a structured intermediate representation. User natural language guidance information is used as auxiliary guidance information and associated with the structured intermediate representation. The associated user natural language guidance information and the structured intermediate representation are semantically organized, contextually reorganized, and stage-adapted to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively. S2 generates corresponding software development artifacts based on the inputs at each stage; S3, perform consistency verification between the software development artifact and the SysML v2 model through the mapping, constraint or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, locate the source of the problem and perform backtracking correction.
2. The method as described in claim 1, characterized in that, Also includes: S4. When the SysML v2 model changes, identify the model change items, convert the model change items into semantic change items, and locate the affected software development artifacts by combining the tracking relationships in the SysML v2 model. Perform incremental generation and incremental consistency verification on the affected artifacts.
3. The method as described in claim 1, characterized in that, In step S1, the hierarchical structure of the SysML v2 model includes a requirements analysis layer, a functional design layer, an architecture design layer, a test case layer, and a deployment configuration layer. The model elements include at least one of the following: component definition and component usage, port definition and port usage, action definition and action usage, state definition and state usage, requirement definition and requirement usage, and constraint definition and constraint usage.
4. The method as described in claim 1, characterized in that, In step S1, the user natural language guidance information includes at least one of the following: generation goal, technology stack preference, output format, supplementary business constraints, workpiece granularity, generation range, and manual confirmation opinions provided by the user through natural language. The structured intermediate representation includes at least one of the following: requirement items, functional units, structural units, interaction boundaries, behavioral processes, state constraints, constraint rules, verification criteria, deployment-related semantics, and tracking relationships.
5. The method as described in claim 1, characterized in that, In step S2, the staged input includes model source identifier, stage objective, required context, constraints, tracking relationship, and user guidance parameters; The software development artifacts include at least one of the following: product requirements artifacts, architecture design artifacts, code artifacts, testing artifacts, and deployment configuration artifacts.
6. The method as described in claim 1, characterized in that, In step S3, the consistency verification includes requirement consistency verification, structural consistency verification, interaction boundary consistency verification, behavioral process consistency verification, test coverage consistency verification, and deployment mapping consistency verification. The situations in which the consistency verification result does not meet the preset conditions include at least one of the following: the requirement has not been implemented, the implementation lacks testing, the deployment configuration lacks component mapping, or the interface description is inconsistent with the code.
7. A SysML v2 model-driven automated software development process generation system, characterized in that, include: The model parsing and stage adaptation module is used to parse the text representation of the constructed SysML v2 model, identify model elements, semantic relationships between model elements, and inter-layer tracking relationships. The model elements, semantic associations, and inter-layer tracking relationships are extracted in a structured manner to generate a structured intermediate representation. User natural language guidance information is used as auxiliary guidance information and associated with the structured intermediate representation. The associated user natural language guidance information and the structured intermediate representation are semantically organized, contextually reorganized, and stage-adapted to form staged inputs corresponding to the product requirement generation stage, architecture design generation stage, code generation stage, test generation stage, and deployment configuration generation stage, respectively. The artifact generation module is used to generate corresponding software development artifacts based on the inputs at each stage. The consistency verification and backtracking correction module is used to verify the consistency between the software development artifact and the SysML v2 model through the mapping, constraint or tracing relationships between different levels in the SysML v2 model. When the consistency verification result does not meet the preset conditions, the source of the problem is located and backtracking correction is performed.
8. An electronic device, characterized in that, include: Computer-readable storage media and processors; The computer-readable storage medium is used to store executable instructions; The processor is configured to read executable instructions stored in the computer-readable storage medium and execute the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing a processor to perform the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the method as described in any one of claims 1-6.