Method and system for generating SysMLv1.6 model from natural language
By combining the improved adaptive differential evolution algorithm and natural language generation technology with the GPT-4 model, the problems of insufficient user intent understanding and adaptability in system modeling are solved, achieving efficient and accurate SysMLv1.6 model generation and improving the automation and robustness of system modeling.
Patent Information
- Application Number
- CN202511517085.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-23
- Publication Date
- 2026-01-16
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing system modeling methods struggle to accurately understand user intent when dealing with complex system requirements. They lack adaptability and optimization mechanisms, resulting in models that cannot quickly respond to system changes, leading to low efficiency and accuracy.
An improved adaptive differential evolution algorithm and natural language generation technology are used, combined with a GPT-4 pre-trained model, to optimize the Prompt design and dynamically adjust parameters through the adaptive differential evolution algorithm, thereby generating a system model that conforms to the SysMLv1.6 standard.
It improves the accuracy and efficiency of system modeling, can flexibly respond to the needs of complex systems, reduces manual intervention, and enhances the automation level and robustness of the modeling process.
Smart Images

Figure CN121352016A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and system modeling, and in particular to a method and system for generating SysMLv1.6 models from natural language. Background Technology
[0002] With the increasing demands of modern systems engineering, system modeling faces increasingly complex challenges, especially in environments with frequent changes in requirements, dynamic adjustments to system structure, and parallel multitasking. Traditional modeling methods often rely on manual input and experience, failing to respond quickly to changes in system requirements and exhibiting significant room for optimization in model updates and adjustments. Existing system modeling tools and methods largely depend on traditional modeling languages and manual input, lacking interaction with real-time data and dynamic environments, and failing to effectively integrate automated generation and optimization techniques. These tools typically rely on fixed templates and preset rules, making it difficult to flexibly address the diversity of complex systems, resulting in low modeling efficiency, poor accuracy, and an inability to quickly adapt to changing system requirements.
[0003] To address these issues, system modeling methods based on natural language processing (NLP) technology have gained increasing attention. In the field of system modeling, the introduction of Large Language Models (LLMs) and deep learning techniques can transform user natural language input into a standard-compliant system model, thereby significantly improving modeling efficiency and accuracy. Especially when generating system models conforming to the SysMLv1.6 standard, LLMs can extract various elements of the system from the natural language description and automatically generate model code that meets the requirements.
[0004] Although existing technical solutions have solved the problem of converting natural language into system models to a certain extent, they still have the following shortcomings: (1) When dealing with the modeling needs of complex systems, existing methods often have misunderstandings and it is difficult to accurately convert user intentions into model elements, resulting in the generated models not being able to fully meet the user's requirements; (2) Traditional modeling tools and methods usually rely on fixed rules or templates for generation and cannot be adaptively adjusted according to different system needs, resulting in poor model flexibility and inability to quickly respond to system changes; (3) Existing methods usually lack optimization mechanisms during the generation process and cannot automatically adjust parameters according to actual needs, resulting in difficulty in guaranteeing generation efficiency and quality.
[0005] Therefore, how to provide an automated system modeling method based on natural language processing technology that can efficiently, accurately, and flexibly extract requirements from natural language and generate system models that conform to the SysMLv1.6 standard is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] This invention proposes a method and system for generating SysMLv1.6 models from natural language. This method effectively overcomes the limitations of traditional natural language processing techniques in complex system modeling by introducing an improved adaptive differential evolution algorithm. Through this algorithm, the model can more efficiently, accurately, and flexibly capture user-input modeling requests, especially improving accuracy and efficiency under dynamically changing and diverse system requirements. Simultaneously, combined with natural language generation technology, the method automatically transforms user-input natural language descriptions into structured SysMLv1.6 model code, further optimizing the modeling process and enhancing adaptability to changing environments. This method not only provides an efficient, accurate, and automated system modeling solution but also meets the needs of large-scale system integration and dynamically changing environments. The combination of intelligent natural language processing and generative adversarial networks significantly improves the efficiency and accuracy of the modeling process. This technical solution has significant application value in systems engineering and automated modeling, optimizing system modeling processes, reducing manual intervention, improving system stability and robustness, lowering modeling costs, and enhancing application effectiveness in complex system modeling environments.
[0007] A method and system for generating SysMLv1.6 models from natural language according to embodiments of the present invention include the following steps: S1. Based on the user's input natural language modeling request, preprocessed text is generated through text cleaning, standardization, text denoising, and word segmentation. S2. Parse the preprocessed text, extract key entities, operation types, modeling intent, and hierarchical relationships between word elements, and integrate them to generate structured JSON text; S3. Based on the structured JSON text, define mapping rules and mapping templates, extract the hierarchical structure, and integrate them to generate SysMLv2 model code. S4. Based on the GPT-4 pre-trained model, define the task objective, design the prompt, customize the output format template, and generate a customized incrementally modified LLM. S5. Using an improved adaptive differential evolution algorithm, continuously optimize and iterate the Prompt until the fitness converges, and use the optimal Prompt to update the customized incremental modification LLM. S6. Based on the user-input natural language modeling request and SysMLv2 model code, generate an incremental modification JSON object using customized incremental modification of the LLM model; S7. Define a JSON object parser, ID mapping module, API generation module, and API execution module to build a model operation execution engine; S8. Based on the model operation execution engine, it parses the incremental modification JSON object, performs ID conversion, generates API call instructions, executes the API call instructions, and completes the incremental modification operation.
[0008] Optionally, S1 specifically includes: S11. Clean the text of the natural language modeling request input by the user, remove useless symbols and punctuation, delete stop words, and obtain clean text; S12. Standardize the clean text, and standardize different terms and units into a unified representation to obtain standardized text; S13. Denoise the standardized text, remove irrelevant information, delete duplicate information, and obtain the denoised text; S14. Segment the denoised text into words, divide them into word elements, and finally generate the preprocessed text.
[0009] Optionally, S2 specifically includes: S21. Based on preprocessed text, use NLP technology to identify key entities and label entity types; S22. Based on the preprocessed text, identify the action words of system operations and label the operation type; S23. Based on preprocessed text, extract modeling intent through semantic analysis and label the intent type; S24. Based on the preprocessed text, extract the hierarchical relationships between word elements through syntactic analysis and dependency parsing, and label the hierarchical relationship types; S25. Integrate the hierarchical relationships of key entities, action words, modeling intents, and word elements to finally generate structured JSON text in JSON format.
[0010] Optionally, S3 specifically includes: S31. Based on structured JSON text, define the mapping rules and mapping templates for the SysMLv2 model; S32. Based on the mapping rules of the SysMLv2 model, convert the word elements in the structured JSON text into elements of the SysMLv2 model. S33. Based on the mapping template of the SysMLv2 model, convert the elements of the SysMLv2 model into element codes of the SysMLv2 model. S34. Based on the hierarchical relationship in structured JSON text, construct a multi-level element hierarchy structure for the SysMLv2 model; S35. Integrate the element code and element hierarchy structure of the SysMLv2 model to generate SysMLv2 model code.
[0011] Optionally, S4 specifically includes: S41. Based on the SysMLv2 model code and the GPT-4 pre-trained model, the task objective is defined as "to generate an incrementally modified JSON object that conforms to the SysMLv1.6 standard according to the SysMLv2 model code". S42. Based on the SysMLv2 model code and the GPT-4 pre-trained model, design a Prompt, continuously refine the prompts according to the GPT-4's response content, enhance the contextual information of the prompts, clarify the output format requirements, and update the Prompt after each iteration. S44. Customize the output format template. Based on the incremental modification requirements of the SysMLv1.6 model, define the field structure and content of the incremental modification and generate a JSON format template for the SysMLv1.6 model. S45. Integrate the task objectives, Prompt, and SysMLv1.6 model JSON format templates to obtain a customized incremental modification LLM.
[0012] Optionally, the improved adaptive differential evolution algorithm specifically includes: Construct a differential evolution population and initialize reinforcement learning agents. Create 100 initial Prompt samples, with each Prompt sample as an individual. Construct a differential evolution population and set the initial value of the mutation factor to 0.5 and the initial value of the crossover probability to 0.8. To evaluate the fitness of the customized incremental modification LLM model output, each Prompt sample is input into the customized incremental modification LLM model to generate the corresponding incremental modification JSON. Based on the field structure and content, the quality of the model output is evaluated and a fitness score is generated. Based on the fitness score, the values of the mutation factor and crossover probability of the reinforcement learning agent are dynamically adjusted. When the fitness fluctuates greatly, the value of the mutation factor is increased; when the fitness tends to be stable, the value of the mutation factor is decreased. When the fitness score increases, the value of the crossover probability is increased; when the fitness score decreases, the value of the crossover probability is decreased. The roulette wheel algorithm is used to select individuals with higher fitness as parents. By calculating the sum of fitness and the selection probability of each individual, a cumulative probability distribution list is generated, and parent individuals are continuously and randomly selected until a sufficient number of parent individuals are selected. The differential evolution algorithm is used to update the next generation of differential evolution population. According to the crossover probability, crossover is performed between the parent generation and the mutated individuals to generate new individuals. According to the mutation factor, the parent generation or the crossover offspring generation is mutated to generate new candidate solutions and generate the next generation of differential evolution population. Using a reinforcement learning agent, the mutation factor and crossover probability are dynamically adjusted based on the fitness score of the next generation of differential evolution population, and the differential evolution population is updated. This process is continued until the fitness converges and the optimal Prompt is selected. Update the customized incremental modification LLM model using the optimal Prompt.
[0013] Optionally, S6 includes: S61. Based on the user's input natural language modeling request, SysMLv2 model code, and context information, generate an incremental modification JSON object using customized incremental modification of the LLM model; S62. Modify the format and content of the JSON object incrementally, evaluate the generation quality score, and provide optimization suggestions; S63. Based on the optimization suggestions, supplement the context information, continue to optimize and iterate until the quality score converges, and output the incrementally modified JSON object.
[0014] Optionally, S7 includes: S71. Define a JSON object parser to extract operation node information from the input JSON object data and identify the operation type, element ID, and modified content. S72. Define the ID mapping module, create an ID mapping table to manage ID persistence tasks, and convert temporary element IDs in operation nodes into persistent element IDs. S73. Define an API generation module to generate API call instructions that conform to the SysMLv1.6 model format based on the operation type, element ID, and modified content. S74. Define the API execution module to perform actual incremental modification operations on the SysML model according to the API call instructions; S75 integrates a JSON object parser, ID mapping module, API generation module, and API execution module to build a model operation execution engine.
[0015] Optionally, S8 includes: S81. Based on the model operation execution engine, parse the incrementally modified JSON object to obtain operation node information; S82. Based on the model operation execution engine, convert the temporary element ID in the operation node information into a persistent element ID; S83. Based on the model operation execution engine, integrate the operation type, element ID, and modified content in the operation node information and convert them into API call instructions in SysMLv1.6 model format; S84, based on the model operation execution engine, executes API call instructions to complete the actual incremental modification operation of the SysML model.
[0016] A system for generating SysMLv1.6 models from natural language includes the following modules: The natural language preprocessing module is used to generate preprocessed text through text cleaning, standardization, text denoising, and word segmentation. The natural language extraction module is used to extract the hierarchical relationships between key entities, operation types, modeling intents, and word elements, and then integrate them to generate structured JSON text. The JSON mapping module is used to define mapping rules and templates based on structured JSON text, extract the hierarchical structure, and generate SysMLv2 model code after integration. The LLM customization module is used to define task objectives, design prompts, customize output format templates, and generate customized incremental modification LLMs. The algorithm optimization module is used to continuously optimize the Prompt through the improved differential evolution algorithm until the fitness converges, and then use the optimal Prompt to update the customized incremental modification LLM. The LLM conversion module is used to convert the user's input natural language modeling request and SysMLv2 model code into an incrementally modified JSON object through customized incremental modification of the LLM model; The model operation execution engine building module is used to define the JSON object parser, ID mapping module, API generation module, and API execution module to build the model operation execution engine. The Model Operation Execution Engine Execution Module is used to parse the incremental modification JSON object based on the Model Operation Execution Engine, perform ID conversion, generate API call instructions, execute API call instructions, and complete the incremental modification operation.
[0017] The beneficial effects of this invention are: (1) This invention successfully overcomes the limitations of traditional natural language processing methods in complex system modeling by combining adaptive differential evolution algorithm and reinforcement learning mechanism. Traditional natural language to system modeling conversion methods usually rely on static methods based on rules or preset templates, which often perform poorly when faced with dynamic requirements, system changes and complex environments. By introducing adaptive differential evolution algorithm, this invention can accurately capture key information in the natural language input by the user, especially the modeling requirements in the context of complex systems, thereby significantly improving the accuracy and efficiency of model generation.
[0018] (2) This invention achieves accurate generation and optimization in complex system modeling by combining adaptive differential evolution algorithm and reinforcement learning mechanism. Through reinforcement learning mechanism, the model can dynamically adjust the optimization strategy and provide real-time feedback of fitness information, thereby accurately generating system models that conform to the SysMLv1.6 standard. The adaptive differential evolution algorithm, by introducing the adaptive mechanism of reinforcement learning, makes the parameter adjustment process more refined, and can flexibly adjust the mutation factor and crossover probability according to different needs of the modeling task, further improving the generation quality of the model. The improved algorithm can dynamically optimize parameters based on the fitness feedback of each generation, enhance the global search capability of the algorithm, effectively avoid local optima problems, and improve the overall modeling effect.
[0019] (3) The method for generating SysMLv1.6 models from natural language in this invention combines advanced deep learning algorithms and adaptive differential evolution algorithms, which not only improves the accuracy and efficiency of system modeling, but also provides strong technical support for large-scale system modeling and automated generation in complex environments. By combining natural language processing and reinforcement learning, this invention provides a flexible, efficient, and accurate solution for complex system modeling, with broad application prospects, especially suitable for dynamic system modeling, cross-platform integration, and real-time modeling needs of large-scale datasets. Attached Figure Description
[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0021] Figure 1 This is an overall flowchart of a method and system for generating SysMLv1.6 models from natural language, as proposed in this invention. Figure 2 This is a flowchart of the improved adaptive differential evolution algorithm proposed in this invention. Detailed Implementation
[0022] The invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0023] refer to Figure 1-2 A method and system for generating SysMLv1.6 models from natural language, comprising the following steps: S1. Based on the user's input natural language modeling request, preprocessed text is generated through text cleaning, standardization, text denoising, and word segmentation. S2. Parse the preprocessed text, extract key entities, operation types, modeling intent, and hierarchical relationships between word elements, and integrate them to generate structured JSON text; S3. Based on the structured JSON text, define mapping rules and mapping templates, extract the hierarchical structure, and integrate them to generate SysMLv2 model code. S4. Based on the GPT-4 pre-trained model, define the task objective, design the prompt, customize the output format template, and generate a customized incrementally modified LLM. S5. Using an improved adaptive differential evolution algorithm, continuously optimize and iterate the Prompt until the fitness converges, and use the optimal Prompt to update the customized incremental modification LLM. S6. Based on the user-input natural language modeling request and SysMLv2 model code, generate an incremental modification JSON object using customized incremental modification of the LLM model; S7. Define a JSON object parser, ID mapping module, API generation module, and API execution module to build a model operation execution engine; S8. Based on the model operation execution engine, it parses the incremental modification JSON object, performs ID conversion, generates API call instructions, executes the API call instructions, and completes the incremental modification operation.
[0024] In this embodiment, S1 specifically includes: S11. Clean the text of the natural language modeling request input by the user, remove useless symbols and punctuation, delete stop words, and obtain clean text; S12. Standardize the clean text, and standardize different terms and units into a unified representation to obtain standardized text; S13. Denoise the standardized text, remove irrelevant information, delete duplicate information, and obtain the denoised text; S14. Segment the denoised text into words, divide them into word elements, and finally generate the preprocessed text.
[0025] This implementation achieves efficient preprocessing of user-input natural language modeling requests by performing text cleaning, standardization, denoising, and word segmentation. By cleaning up useless symbols, punctuation marks, and stop words, clean text is obtained, thus reducing noise. Standardization converts terms and units into a uniform format, ensuring data consistency. Denoising removes irrelevant information and repetitive content, making the text more concise and refined. Word segmentation of the denoised text divides it into independent word elements, and named entities are extracted, providing structured data input for subsequent modeling processes. This preprocessing improves the quality of the text data, ensuring that subsequent modeling tasks can be performed more accurately and efficiently.
[0026] In this embodiment, S2 specifically includes: S21. Based on preprocessed text, use NLP technology to identify key entities and label entity types; S22. Based on the preprocessed text, identify the action words of system operations and label the operation type; S23. Based on preprocessed text, extract modeling intent through semantic analysis and label the intent type; S24. Based on the preprocessed text, extract the hierarchical relationships between word elements through syntactic analysis and dependency parsing, and label the hierarchical relationship types; S25. Integrate the hierarchical relationships of key entities, action words, modeling intents, and word elements to finally generate structured JSON text in JSON format.
[0027] This implementation method achieves structured identification and extraction of modeling requests using NLP technology based on the analysis and processing of preprocessed text. Key entities in the text are identified and labeled using NLP technology to clarify their types. Action words for system operations are identified and labeled with their types to ensure the system understands the user's operational needs. Semantic analysis extracts the modeling intent and labels its type to clarify the user's modeling goals. Syntactic analysis and dependency parsing are used to extract hierarchical relationships between word elements in the text and label these relationships, further enriching the text's structural information. Finally, all extracted key entities, action words, modeling intents, and hierarchical relationships are integrated to generate structured text conforming to JSON format, providing standardized and easily processed input data for subsequent modeling processes.
[0028] In this embodiment, S3 specifically includes: S31. Based on structured JSON text, define the mapping rules and mapping templates for the SysMLv2 model; S32. Based on the mapping rules of the SysMLv2 model, convert the word elements in the structured JSON text into elements of the SysMLv2 model. S33. Based on the mapping template of the SysMLv2 model, convert the elements of the SysMLv2 model into element codes of the SysMLv2 model. S34. Based on the hierarchical relationship in structured JSON text, construct a multi-level element hierarchy structure for the SysMLv2 model; S35. Integrate the element code and element hierarchy structure of the SysMLv2 model to generate SysMLv2 model code.
[0029] This implementation successfully generated a SysMLv2 model using mapping rules and templates based on structured JSON text. The mapping rules and templates for the SysMLv2 model are defined to ensure that data in the structured JSON text can be accurately converted into SysMLv2 model elements. According to the mapping rules, word elements in the structured JSON text are converted into specific elements of the SysMLv2 model, ensuring that the data is correctly represented in the model. Based on the SysMLv2 model mapping template, these model elements are converted into SysMLv2 model element codes, ensuring compliance with the SysMLv2 standard. Based on the hierarchical relationships in the structured JSON text, a multi-level SysMLv2 model element hierarchy structure is constructed, enhancing the model's hierarchical expressive capabilities. Integrating the SysMLv2 model element codes with the element hierarchy structure generates the final SysMLv2 model code, providing an accurate and standardized code foundation for subsequent system analysis and modeling.
[0030] In this embodiment, S4 specifically includes: S41. Based on the SysMLv2 model code and the GPT-4 pre-trained model, the task objective is defined as "to generate an incrementally modified JSON object that conforms to the SysMLv1.6 standard according to the SysMLv2 model code". S42. Based on the SysMLv2 model code and the GPT-4 pre-trained model, design a Prompt, continuously refine the prompts according to the GPT-4's response content, enhance the contextual information of the prompts, clarify the output format requirements, and update the Prompt after each iteration. S44. Customize the output format template. Based on the incremental modification requirements of the SysMLv1.6 model, define the field structure and content of the incremental modification and generate a JSON format template for the SysMLv1.6 model. S45. Integrate the task objectives, Prompt, and SysMLv1.6 model JSON format templates to obtain a customized incremental modification LLM.
[0031] This implementation successfully generated incremental modification JSON objects by combining SysMLv2 model code and a GPT-4 pre-trained model. A clear task objective was defined: to generate incremental modification JSON objects conforming to the SysMLv1.6 standard based on the SysMLv2 model code. This clear task objective provided a clear direction for the subsequent generation process. Based on the GPT-4 output, a prompt was designed and optimized, providing refined hints in each iteration, enhancing contextual information, and clarifying output format requirements to ensure the accuracy and consistency of the generated results. The incremental modification requirements of the SysMLv1.6 model were customized, generating a standard-compliant JSON format template, providing a standardized structure for subsequent generation. By integrating the task objective, the optimized prompt, and the customized JSON format template, a customized incremental modification LLM was obtained. This model can generate incremental modification JSON objects conforming to the SysMLv1.6 standard based on the input natural language modeling request and in conjunction with the SysMLv2 code, ensuring the accuracy and efficiency of the model generation process.
[0032] In this embodiment, the improved adaptive differential evolution algorithm specifically includes: Construct a differential evolution population and initialize reinforcement learning agents. Create 100 initial Prompt samples, with each Prompt sample as an individual. Construct a differential evolution population and set the initial value of the mutation factor to 0.5 and the initial value of the crossover probability to 0.8. To evaluate the fitness of the customized incremental modification LLM model output, each Prompt sample is input into the customized incremental modification LLM model to generate the corresponding incremental modification JSON. Based on the field structure and content, the quality of the model output is evaluated and a fitness score is generated. Based on the fitness score, the values of the mutation factor and crossover probability of the reinforcement learning agent are dynamically adjusted. When the fitness fluctuates greatly, the value of the mutation factor is increased; when the fitness tends to be stable, the value of the mutation factor is decreased. When the fitness score increases, the value of the crossover probability is increased; when the fitness score decreases, the value of the crossover probability is decreased. The roulette wheel algorithm is used to select individuals with higher fitness as parents. By calculating the sum of fitness and the selection probability of each individual, a cumulative probability distribution list is generated, and parent individuals are continuously and randomly selected until a sufficient number of parent individuals are selected. The differential evolution algorithm is used to update the next generation of differential evolution population. According to the crossover probability, crossover is performed between the parent generation and the mutated individuals to generate new individuals. According to the mutation factor, the parent generation or the crossover offspring generation is mutated to generate new candidate solutions and generate the next generation of differential evolution population. Using a reinforcement learning agent, the mutation factor and crossover probability are dynamically adjusted based on the fitness score of the next generation of differential evolution population, and the differential evolution population is updated. This process is continued until the fitness converges and the optimal Prompt is selected. Update the customized incremental modification LLM model using the optimal Prompt.
[0033] This implementation optimizes the prompt design of a customized incrementally modified LLM model through an adaptive differential evolution algorithm and a reinforcement learning agent. A differential evolution population is constructed, creating 100 initial prompt samples, each treated as an individual. The differential evolution population is initialized with an initial mutation factor of 0.5 and an initial crossover probability of 0.8. By creating multiple initial prompt samples and treating them as individuals in the population, diverse inputs are provided in the initial stage, ensuring exploration of different solution spaces and preventing the model from getting trapped in local optima. By initializing the reinforcement learning agent, the system can intelligently adjust the mutation factor and crossover probability during the generation process to achieve adaptive optimization. The fitness of the customized incrementally modified LLM model is evaluated by inputting each prompt sample into the model, generating a corresponding incremental modification JSON, and assessing the quality of the model output based on its field structure and content to generate a fitness score. Based on the fitness score, the mutation factor and crossover probability of the reinforcement learning agent are dynamically adjusted. When fitness fluctuates significantly, the mutation factor is increased; when fitness tends to stabilize, the mutation factor is decreased; when fitness scores increase, the crossover probability is increased; when fitness scores decrease, the crossover probability is decreased. Fitness scores provide optimization directions for differential evolution algorithms and reinforcement learning agents, allowing for adjustments to control parameters such as mutation factors and crossover probabilities, which helps to explore the solution space more effectively and improve the performance of the generated model. A roulette wheel algorithm is used to select individuals with high fitness as parents. By calculating the sum of fitness and the selection probability of each individual, a cumulative probability distribution list is generated, and parent individuals are continuously and randomly selected until a sufficient number of parent individuals are chosen. This ensures that well-performing individuals are selected from the current population, providing a foundation for generating higher-quality solutions, and avoids over-convergence, maintaining population diversity, thereby enhancing exploration potential and avoiding getting trapped in local optima. The differential evolution algorithm is used to update the next generation of the differential evolution population. Based on the crossover probability, crossover occurs between parents and mutated individuals to generate new individuals; the mutation factor is used to mutate the parents or the crossover offspring to generate new candidate solutions, thus generating the next generation of the differential evolution population. The reinforcement learning agent dynamically adjusts the mutation factor and crossover probability based on the fitness score of the next generation of differentially evolved populations, continuously updating the differentially evolved populations until the fitness converges, and selecting the optimal Prompt. Finally, the optimal Prompt is used to update the customized incrementally modified LLM model, improving the generation quality and accuracy of incrementally modified JSON objects, ensuring that the model can handle subsequent tasks more accurately and efficiently.
[0034] In this embodiment, S6 specifically includes: S61. Based on the user's input natural language modeling request, SysMLv2 model code, and context information, generate an incremental modification JSON object using customized incremental modification of the LLM model; S62. Modify the format and content of the JSON object incrementally, evaluate the generation quality score, and provide optimization suggestions; S63. Based on the optimization suggestions, supplement the context information, continue to optimize and iterate until the quality score converges, and output the incrementally modified JSON object.
[0035] This implementation combines user modeling requests, SysMLv2 model code, and contextual information to generate incremental modification JSON objects using a customized incremental modification LLM model. This process of generating and optimizing incremental modification JSON objects improves modeling efficiency and accuracy, reduces human error, and enhances the intelligence and adaptability of model generation. Based on the format and content of the generated incremental modification JSON objects, the generation quality is evaluated, and optimization suggestions are provided to ensure high-quality generated content, thus improving overall development efficiency and accuracy. The optimization suggestions are used to supplement necessary contextual information, and optimization and iteration continue until the quality score converges, ensuring the accuracy and compliance of the incremental modification JSON objects. Finally, a compliant incremental modification JSON object is output as the basis for subsequent system processing.
[0036] In this embodiment, S7 specifically includes: S71. Define a JSON object parser to extract operation node information from the input JSON object data and identify the operation type, element ID, and modified content. S72. Define the ID mapping module, create an ID mapping table to manage ID persistence tasks, and convert temporary element IDs in operation nodes into persistent element IDs. S73. Define an API generation module to generate API call instructions that conform to the SysMLv1.6 model format based on the operation type, element ID, and modified content. S74. Define the API execution module to perform actual incremental modification operations on the SysML model according to the API call instructions; S75 integrates a JSON object parser, ID mapping module, API generation module, and API execution module to build a model operation execution engine.
[0037] This implementation successfully achieves incremental modification operations on a SysML model by constructing a model operation execution engine. A JSON object parser is defined to extract operation node information from the input JSON data, identifying the operation type, element ID, and modification content. This step ensures the system can correctly understand each part of the incremental modification. An ID mapping module is defined, creating an ID mapping table to manage ID persistence tasks, converting temporary element IDs in operation nodes into persistent element IDs, thereby ensuring data consistency and the correctness of subsequent operations. An API generation module is defined to generate API call instructions conforming to the SysMLv1.6 standard based on the operation type, element ID, and modification content. These instructions will be used in subsequent steps to perform the actual incremental modification operations on the SysML model. An API execution module is defined to execute the incremental modifications to the SysML model based on the generated API call instructions, ensuring the model data is updated and meets expectations. By integrating the JSON object parser, ID mapping module, API generation module, and API execution module, a model operation execution engine has been successfully constructed. This engine can efficiently and accurately process incremental modification requests and perform corresponding operations, ensuring that the incremental update process of SysML models is smooth and conforms to standards.
[0038] In this embodiment, S8 specifically includes: S81. Based on the model operation execution engine, parse the incrementally modified JSON object to obtain operation node information; S82. Based on the model operation execution engine, convert the temporary element ID in the operation node information into a persistent element ID; S83. Based on the model operation execution engine, integrate the operation type, element ID, and modified content in the operation node information and convert them into API call instructions in SysMLv1.6 model format; S84, based on the model operation execution engine, executes API call instructions to complete the actual incremental modification operation of the SysML model.
[0039] This implementation method achieves incremental modification operations on SysML models through a model operation execution engine. By parsing the incremental modification JSON object, operation node information is obtained, ensuring the system can understand and process incremental modification requests. Temporary element IDs in the operation node information are converted into persistent element IDs to ensure data consistency and avoid ID mismatch issues in subsequent operations. The operation type, element ID, and modification content in the operation node information are integrated and converted into API call instructions conforming to the SysMLv1.6 model format, ensuring that the generated instructions accurately express the model's incremental modification requirements. By executing the generated API call instructions, the actual incremental modification operation on the SysML model is completed, ensuring that the model update meets expectations and is reflected in the system in a timely manner. This process, through the automated processing of the model operation execution engine, improves the accuracy and efficiency of incremental modifications and ensures the standardization and normalization of the entire operation process.
[0040] refer to Figure 1 A system for generating SysMLv1.6 models from natural language, characterized by comprising the following modules: The natural language preprocessing module is used to generate preprocessed text through text cleaning, standardization, text denoising, and word segmentation. The natural language extraction module is used to extract the hierarchical relationships between key entities, operation types, modeling intents, and word elements, and then integrate them to generate structured JSON text. The JSON mapping module is used to define mapping rules and templates based on structured JSON text, extract the hierarchical structure, and generate SysMLv2 model code after integration. The LLM customization module is used to define task objectives, design prompts, customize output format templates, and generate customized incremental modification LLMs. The algorithm optimization module is used to continuously optimize the Prompt through the improved differential evolution algorithm until the fitness converges, and then use the optimal Prompt to update the customized incremental modification LLM. The LLM conversion module is used to convert the user's input natural language modeling request and SysMLv2 model code into an incrementally modified JSON object through customized incremental modification of the LLM model; The model operation execution engine building module is used to define the JSON object parser, ID mapping module, API generation module, and API execution module to build the model operation execution engine. The Model Operation Execution Engine Execution Module is used to parse the incremental modification JSON object based on the Model Operation Execution Engine, perform ID conversion, generate API call instructions, execute API call instructions, and complete the incremental modification operation.
[0041] Example 1: To verify the feasibility of this invention in practical applications, the method was applied to a system modeling and automated model generation system for a large-scale systems engineering project (hereinafter referred to as "Platform A"). In traditional system modeling, models typically rely on manual input and simple tool-based modeling methods. These methods are not only inefficient but also struggle to effectively respond to user needs when dealing with complex system requirements and dynamic changes, resulting in lengthy modeling processes and low-accuracy generated models. To address these issues, Platform A decided to adopt the method proposed in this invention for generating SysMLv1.6 models from natural language.
[0042] During implementation, Platform A first preprocesses the user-input natural language modeling request using natural language processing (NLP) techniques, including text cleaning, standardization, denoising, and word segmentation, to ensure the accuracy and consistency of the text data. Platform A then introduces a large language model (LLM) and an improved adaptive differential evolution algorithm to accurately generate system model code conforming to the SysMLv1.6 standard from natural language descriptions. The improved adaptive differential evolution algorithm, by incorporating an adaptive mechanism of reinforcement learning, makes the model generation process more accurate and efficient.
[0043] Platform A successfully overcomes the limitations of traditional modeling methods in complex environments by combining LLM with an improved adaptive differential evolution algorithm. First, Platform A leverages the powerful natural language processing capabilities of LLM to accurately transform users' natural language modeling requests into structured SysML models. Second, through the improved adaptive differential evolution algorithm, Platform A optimizes prompt design and dynamically adjusts control parameters, thereby improving the quality of generated models and rapidly responding to changes in user needs.
[0044] During implementation, the technical team of Platform A observed that, compared to traditional manual modeling methods, the method of generating SysMLv1.6 models from natural language according to this invention significantly improved modeling accuracy and efficiency. Traditional methods often cannot quickly respond to complex requirements and environmental changes, while the method of this invention can generate models in real time, ensuring the automation and accuracy of the system's modeling process. By introducing an improved adaptive differential evolution algorithm, Platform A can precisely adjust the generated model, improving modeling efficiency and quality while reducing manual intervention.
[0045] To further verify the effectiveness of this method, Platform A compared the data from the method of this invention with data from traditional system modeling methods. The comparison table is as follows:
[0046] Table 1 Comparison of Modeling Methods in Platform A System
[0047] As shown in Table 1, with the application of the method of this invention, the system modeling accuracy of Platform A increased from 78% to 92% compared to the traditional method, significantly improving modeling efficiency and reducing modeling time from 150 minutes to 50 minutes. System response time also decreased by 66.7%, while the error generation rate significantly decreased to only 5%. Furthermore, the method of this invention significantly improved processing power, increasing the number of models processed per second by 166.7% and improving multi-task parallel processing capability by 30%.
[0048] Using the method of this invention, platform A can generate high-precision SysMLv1.6 models more efficiently, improving system modeling efficiency, reducing resource waste, and enhancing the accuracy of the modeling process. This method not only improves the system's automation level and reduces manual intervention, but also significantly enhances the stability and robustness of the modeling system, providing strong technical support for large-scale system modeling and real-time modeling needs in complex environments.
[0049] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method of generating a SysML vl.6 model from natural language, characterized in that, The method comprises the following steps: S1, based on the user input natural language modeling request, through text cleaning, standardization processing, text denoising, word segmentation, to generate preprocessed text; S2, parse the preprocessed text, extract key entities, operation types, modeling intentions and hierarchical relationships between word elements, and integrate to generate structured JSON text; S3, according to the structured JSON text, define the mapping rules and mapping templates, extract the hierarchical structure, and integrate to generate the SysMLv2 model code; S4, based on the GPT-4 pre-training model, define the task target, design the Prompt, customize the output format template, and generate the customized incremental modification LLM; S5, using the improved adaptive differential evolution algorithm, continuously optimize and iterate the Prompt until the fitness converges, and update the customized incremental modification LLM using the optimal Prompt; S6, based on the user input natural language modeling request and the SysMLv2 model code, using the customized incremental modification LLM model to generate the incremental modification JSON object; S7, define the JSON object parser, ID mapping module, API generation module, API execution module, and build the model operation execution engine; S8, based on the model operation execution engine, parse the incremental modification JSON object, perform ID conversion, generate API call instructions, execute the API call instructions, and complete the incremental modification operation.
2. The method of claim 1, wherein, The S1 specifically comprises: S11, text cleaning is performed on the user input natural language modeling request, useless symbols and punctuation are removed, stop words are deleted, and pure text is obtained; S12, standardize the pure text, standardize different terms and units to a unified representation, and obtain standardized text; S13, denoising the standardized text, removing irrelevant information, deleting duplicate information, and obtaining denoised text; S14, word segmentation is performed on the denoised text, and word elements are divided, and finally preprocessed text is generated.
3. The method of generating SysML vl.6 models from natural language according to claim 1, wherein, The S2 specifically comprises: S21, based on the preprocessed text, use NLP technology to identify key entities and label entity types; S22, based on the preprocessed text, identify action words of system operation and label operation types; S23, based on the preprocessed text, extract modeling intentions through semantic analysis and label intention types; S24, based on the preprocessed text, extract hierarchical relationships between word elements through syntax analysis and dependency syntax analysis, and label hierarchical relationship types; S25, integrate key entities, action words, modeling intentions and hierarchical relationships between word elements, and finally generate structured JSON text in JSON format.
4. The method of generating SysML vl.6 models from natural language according to claim 1, wherein, The S3 specifically comprises: S31, based on the structured JSON text, define the mapping rules and mapping templates of the SysMLv2 model; S32, according to the mapping rules of the SysMLv2 model, convert the word elements in the structured JSON text into the elements of the SysMLv2 model; S33, according to the mapping template of the SysMLv2 model, convert the elements of the SysMLv2 model into the element code of the SysMLv2 model; S34, constructing a multi-level element hierarchy structure of the SysMLv2 model based on the hierarchical relationship in the structured JSON text; S35, integrating the element code and the element hierarchy structure of the SysMLv2 model to generate the SysMLv2 model code.
5. The method of claim 1, wherein, The S4 specifically comprises: S41, defining the task target as "generating an incremental modification JSON object conforming to the SysMLv1.6 standard according to the SysMLv2 model code" based on the SysMLv2 model code and the GPT-4 pre-training model; S42, designing a Prompt based on the SysMLv2 model code and the GPT-4 pre-training model, constantly refining the prompt according to the answer content of the GPT-4, enhancing the context information of the prompt, and clearly requiring the output format, and updating the Prompt after each iteration; S44, customizing the output format template, defining the field structure and content of the incremental modification according to the incremental modification requirements of the SysMLv1.6 model, and generating the JSON format template of the SysMLv1.6 model; S45, integrating the task target, Prompt, and JSON format template of the SysMLv1.6 model to obtain a customized incremental modification LLM.
6. The method of claim 1, wherein, The improved adaptive differential evolution algorithm specifically comprises: Constructing a differential evolution population and initializing a reinforcement learning agent, creating 100 initial Prompt samples, each Prompt sample as an individual, constructing a differential evolution population, and setting the initial value of the mutation factor to 0.5 and the initial value of the crossover probability to 0.8; Evaluate the fitness of the customized incremental modification LLM model output, input each Prompt sample into the customized incremental modification LLM model to generate the corresponding incremental modification JSON, evaluate the quality of the model output according to the field structure and content, and generate the fitness score; According to the fitness score, dynamically adjust the values of the mutation factor and the crossover probability of the reinforcement learning agent, increase the mutation factor value when the fitness fluctuates greatly, decrease the mutation factor value when the fitness tends to be stable, increase the crossover probability value when the fitness score becomes larger, and decrease the crossover probability value when the fitness score becomes smaller; Using the roulette algorithm to select individuals with higher fitness as parents, generating a cumulative probability distribution list by calculating the sum of fitness and the selection probability of each individual, and continuously randomly selecting parent individuals until a sufficient number of parent individuals are selected; Using the differential evolution algorithm to update the next generation of differential evolution population, crossing between parents and mutated individuals according to the crossover probability to generate new individuals, and mutating the parents or the offspring after crossing according to the mutation factor to generate new candidate solutions, and generating the next generation of differential evolution population; Using the reinforcement learning agent, dynamically adjusting the mutation factor and the crossover probability according to the fitness score of the next generation of differential evolution population, updating the differential evolution population, and continuously executing this process until the fitness converges, and selecting the optimal Prompt; Using the optimal Prompt to update the customized incremental modification LLM model.
7. The method of claim 1, wherein, The S6 comprises the following steps: S61, based on the natural language modeling request input by the user, the SysMLv2 model code, the context information, generate an incremental modification JSON object using a customized incremental modification LLM model; S62, according to the format and content of the incremental modification JSON object, evaluate the quality score and give optimization suggestions; S63, according to the optimization suggestions, supplement the context information, continue the optimization iteration until the quality score converges, and output the incremental modification JSON object.
8. The method of claim 1, wherein, The S7 specifically includes: S71, define a JSON object parser, extract operation node information from the input JSON object data, and identify operation type, element ID, and modification content; S72, define an ID mapping module, create an ID mapping table to manage ID persistence tasks, and convert temporary element IDs in the operation node to persistent element IDs; S73, define an API generation module, generate API call instructions conforming to the SysMLv1.6 model format according to operation type, element ID, and modification content; S74, define an API execution module, execute actual incremental modification operations on the SysML model according to the API call instructions; S75, integrate the JSON object parser, ID mapping module, API generation module, and API execution module to build a model operation execution engine.
9. The method of claim 1, wherein, The S8 specifically includes: S81, based on the model operation execution engine, parse the incremental modification JSON object to obtain operation node information; S82, based on the model operation execution engine, convert temporary element IDs in the operation node information to persistent element IDs; S83, based on the model operation execution engine, integrate operation type, element ID, and modification content in the operation node information to convert them into API call instructions conforming to the SysMLv1.6 model format; S84, based on the model operation execution engine, execute the API call instructions to complete actual incremental modification operations on the SysML model.
10. A system for generating SysML vl.6 models from natural language, characterized in that, The following modules are included: A natural language preprocessing module for generating preprocessed text through text cleaning, standardization, text denoising, and word segmentation; A natural language extraction module for extracting key entities, operation types, modeling intentions, and hierarchical relationships between word elements, and integrating to generate structured JSON text; A JSON mapping module for defining mapping rules and templates, extracting hierarchical structures, and integrating to generate SysMLv2 model code based on structured JSON text; An LLM customization module for defining task objectives, designing prompts, customizing output format templates, and generating a customized incremental modification LLM; An algorithm optimization module for continuously optimizing and iterating prompts using an improved differential evolution algorithm until fitness converges, and updating the customized incremental modification LLM using the optimal prompt; An LLM conversion module for generating an incremental modification JSON object using a customized incremental modification LLM model based on the natural language modeling request input by the user and the SysMLv2 model code; The model operation execution engine construction module is configured to define a JSON object parser, an ID mapping module, an API generation module, and an API execution module, and construct the model operation execution engine. The model operation execution engine execution module is configured to parse an incremental modification JSON object, perform ID conversion, generate API calling instructions, execute the API calling instructions, and complete the incremental modification operation based on the model operation execution engine.