Software requirement modeling method and device based on natural language, equipment and medium
By employing a multi-level processing architecture and a deep semantic analysis-based software requirements modeling method, this approach addresses the limitations of manual rules and training data scale in existing technologies, achieving efficient and accurate software requirements modeling and improving model consistency and quality.
Patent Information
- Application Number
- CN202511604465.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-05
- Publication Date
- 2026-01-23
AI Technical Summary
Existing SysML software requirement modeling methods and systems based on natural language processing are limited by manually defined rules and the scale of training data, and lack feedback mechanisms, which can easily lead to the accumulation of biases during the modeling process and affect the quality of the final model.
A multi-level processing architecture is adopted for requirement preprocessing and semantic analysis. Requirement elements and relationships are extracted through deep semantic analysis to form a formal intermediate representation, which automatically generates a standard software engineering model. Model consistency verification and optimization are used to ensure that the model is consistent with the original requirements.
Significantly reduce manual workload, minimize human error, ensure accuracy and consistency in the modeling process, and improve software product quality.
Smart Images

Figure CN121387236A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to software requirement modeling technology, in particular to a natural language-based software requirement modeling method, device, equipment and medium. BACKGROUND
[0002] In the traditional software development process, the requirement analysis stage usually involves communication between requirement analysts and customers to convert non-formalized requirement descriptions into structured requirement documents, and then create formalized requirement models. This process highly depends on human experience, and has problems such as low efficiency and easy introduction of ambiguity.
[0003] A natural language processing-based SysML software requirement modeling method and system are disclosed in Chinese patent CN117555519A, which belongs to the field of software requirement modeling. The method includes the following steps: preprocessing text data: organizing user requirements into requirement documents and preprocessing the requirement documents; requirement element identification: identifying requirement elements in the preprocessed requirement documents; SysML mapping: according to the syntax and semantic rules of the system modeling language SysML, the identified requirement elements are disassembled and mapped into the SysML requirement model; model relationship construction: according to the association and connection between the requirement elements in the requirement model, the association and connection between the requirement models are constructed; model verification: constructing constraint verification conditions for the requirement model, and marking the requirement model that does not meet the constraint verification conditions; requirement traceability and management: constructing traceability relationships for the requirement model. The invention converts natural language requirements into structured and visual models, improving the understandability and manageability of software requirements.
[0004] The existing natural language processing-based SysML software requirement modeling method and system are limited by manually defined rules and training data size, and lack feedback mechanisms, which leads to deviation accumulation in the modeling process and affects the quality of the final model. SUMMARY
[0005] The purpose of the present application is to provide a natural language-based software requirement modeling method, device, equipment and medium to solve the problem that the modeling method in the prior art is limited by manually defined rules and training data size, and lacks feedback mechanisms, which leads to deviation accumulation in the modeling process and affects the quality of the final model.
[0006] To achieve the above purpose, the present application provides the following technical solution: a natural language-based software requirement modeling method, device, equipment and medium, comprising:
[0007] Requirement preprocessing and semantic analysis: preprocessing and deep semantic analysis of the input natural language requirement documents, extracting requirement elements and relationships;
[0008] Formalized representation of requirements, transforming the extracted requirement elements and relations into a formalized intermediate representation, forming a formalized requirements model;
[0009] Automatic generation of software models, transforming the formalized requirements model into standard software engineering models;
[0010] Model consistency verification and optimization, fine-tuning the generated standard software engineering models to be consistent with the original requirements.
[0011] Preferably, the requirement preprocessing and semantic analysis includes:
[0012] The requirement document is processed using a multi-level processing architecture, which consists of a lexical analysis layer and a syntactic analysis layer;
[0013] Deep extraction of requirement elements, including functional requirement extraction, non-functional requirement extraction, and business rule extraction;
[0014] Building a requirement element relationship graph, with nodes representing requirement elements and edges representing the relationship between elements, including temporal relationship, dependency relationship, composition relationship, and refinement relationship. Temporal relationship uses temporal conjunction words to identify the order of action execution, dependency relationship analyzes data flow and control flow dependency, identifies preconditions and postconditions, composition relationship identifies whole-part relationship, and refinement relationship identifies the refinement relationship between abstract requirements and specific implementation.
[0015] Preferably, the lexical analysis layer uses a bidirectional maximum matching algorithm combined with a domain-specific dictionary for word segmentation, and optimizes software engineering professional terms. A word identification model based on Transformer is used to identify words in technical documents, filter and optimize stop words, and retain software requirement description words.
[0016] The syntactic analysis layer uses a dependency syntactic analyzer based on graph neural networks to identify syntactic components, applies a semantic role labeling enhancement model to label traditional semantic roles, and specifically identifies condition roles, constraint roles, and exception handling roles in software requirements, and performs cross-sentence reference resolution.
[0017] Preferably, the functional requirement extraction uses a pattern matching rule library to identify functional verbs, applies a condition-action pair extraction algorithm, extracts requirements patterns in the format "When <condition>, the system should <action>", and identifies input parameters, output results, and side effects of operations through a sequence labeling model.
[0018] The non-functional requirement extraction includes performance requirements, security requirements, and reliability requirements, the performance requirements include identifying requirements containing quantitative indicators, the security requirements include identifying authentication, authorization, and encryption requirements, and the reliability requirements include identifying availability, fault tolerance, and recovery requirements, and a multi-label classifier is used to classify and prioritize the non-functional requirements;
[0019] The business rule extraction includes identifying business entities and their attributes and relationships, extracting business constraints and integrity rules, and converting self-text business rules into formal representations using a rule template library.
[0020] Preferably, in the requirement model formal representation, there are three parts: a multi-level formal representation framework, a template library and a pattern matching engine, and formal representation verification,
[0021] The multi-level formal representation framework represents requirements from different abstraction levels;
[0022] The template library and the pattern matching engine are divided into a template library organization structure, intelligent template matching, and template instantiation, the classification method of the template library organization structure includes classification by domain, classification by requirement type, and classification by abstraction level, the intelligent template matching method includes matching requirement descriptions with templates using semantic similarity calculation, applying a multi-factor weighting algorithm, matching multiple templates for complex requirements and combining them, the template instantiation includes establishing a parameter binding mechanism to bind requirement elements with template parameters and realizing constraint propagation; type checking is used to verify the consistency of the instantiation results;
[0023] The formal representation verification includes syntax verification, semantic verification, and quality attribute verification, the syntax verification includes checking the syntax correctness of the formal specification, verifying the consistency of variable declaration and use, checking type matching and correct use of operators, the semantic verification includes using a theorem prover to verify the consistency of the specification, applying model detection technology to verify the satisfaction of timing properties, and using a constraint solver to verify the satisfiability of data constraints, the quality attribute verification includes checking the integrity of the specification, evaluating the accuracy of the specification, and analyzing the readability of the specification.
[0024] Preferably, the multi-level formalization representation framework is a three-level formalization representation framework, which is composed of an abstract semantic layer, a behavior specification layer and an interaction protocol layer. The abstract semantic layer uses a domain ontology to represent core business concepts and relationships, adopts description logic to represent classification and constraint relationships between terms, and constructs a domain concept map to visually display complex relationships between business concepts. The behavior specification layer uses linear temporal logic to represent requirements with temporal constraints, uses computation tree logic to represent branching temporal requirements, uses Z notation or B method to represent state-based requirement specifications, and uses event-condition-action rules to represent responsive requirements. The interaction protocol layer uses message sequence charts to formally describe interactions between components, uses process algebra to describe concurrent behavior, and uses state charts to formally describe state transition behavior.
[0025] Preferably, the automatic generation of the software model is divided into a multi-view model framework generation, model conversion and refinement, and visualization enhancement.
[0026] The multi-view model generation framework is used to describe a system from different perspectives.
[0027] The model conversion and refinement includes abstract-concrete refinement, model conversion, model merging and integration. The abstract-concrete refinement process includes refining high-level goals into specific operations, refining problem domain concepts into solution domain components, and refining logical design into physical design. The model conversion rules include defining conversion rules from formal specifications to UML models, implementing automatic mapping between model elements, and applying model conversion language to describe complex conversions. The model merging and integration includes merging model fragments from different requirements, resolving naming conflicts between model elements, and integrating multiple views to form a consistent complete model.
[0028] The visualization enhancement includes automatic layout algorithms, interactive visualization and visualization enhancement algorithms. The automatic layout algorithms include applying force-directed algorithms to achieve automatic layout of class diagrams and component diagrams, using hierarchical layout algorithms to optimize the layout of activity diagrams and state machine diagrams, and implementing incremental layout. The interactive visualization is used to provide model navigation functions, implement semantic zooming, and provide multi-view synchronization. The visualization enhancement algorithms use color coding to distinguish different types of model elements, apply icons and graphical symbols to enhance model readability, and provide tool tips and detailed view to display additional information of elements.
[0029] Preferably, the model consistency verification and optimization includes multi-level consistency verification, automated verification, model quality evaluation and optimization, and human-machine collaborative refinement.
[0030] The multi-level consistency verification includes internal consistency verification, external consistency verification and traceability verification, the internal consistency verification includes syntax consistency, static semantic consistency and dynamic semantic consistency, the external consistency includes requirement code consistency, model code consistency and cross-model consistency, the traceability verification includes establishing bidirectional traceability link, verifying traceability integrity and analyzing change influence;
[0031] The automated verification includes theorem proving application, model detection and constraint solving application;
[0032] The model quality evaluation and optimization includes quality attribute evaluation, automated optimization and optimization verification cycle;
[0033] The human-computer collaborative refinement includes visual feedback mechanism, interactive refinement interface and decision support.
[0034] An apparatus and device, comprising a processor and a memory, the memory stores machine executable instructions capable of being executed by the processor, the processor executes the machine executable instructions to implement a natural language based software requirement modeling method.
[0035] A machine readable medium, which stores machine executable instructions, when invoked and executed by a processor, for implementing a natural language based software requirement modeling method.
[0036] Compared with the prior art, the natural language based software requirement modeling method, device, equipment and medium provided by the application greatly reduce the manual workload through automated requirement analysis and model generation, and reduce errors caused by human understanding bias; through sharing intermediate representation and unified data model, the close connection between steps is ensured, the output of the previous step provides structured information for the input of the next step, and information loss or distortion is avoided; through the iterative requirement acquisition and modeling framework of human-computer collaboration, the requirement provider is allowed to participate in the model confirmation process, and the requirement model quality is continuously improved; the inter-model consistency analysis technology based on data flow dependency relationship can automatically detect the inconsistency between the requirement specification and the software model, and improve the software product quality. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art according to these drawings.
[0038] Figure 1 The modeling method block diagram provided by the embodiments of the present application. DETAILED DESCRIPTION
[0039] To enable those skilled in the art to better understand the technical solution of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings.
[0040] As attached Figure 1 As shown:
[0041] Example:
[0042] This invention provides a method, apparatus, device, and medium for software requirements modeling based on natural language, including:
[0043] Requirements preprocessing and semantic analysis: preprocessing and performing deep semantic analysis on the input natural language requirements document to extract requirements elements and relationships;
[0044] The formal representation of the demand model transforms the extracted demand elements and relationships into a formal intermediate representation, forming a formally represented demand model.
[0045] Software models are automatically generated, converting formally represented requirement models into standard software engineering models;
[0046] Model consistency verification and optimization: The standardized software engineering model generated is tuned to be consistent with the original requirements.
[0047] The aforementioned demand preprocessing and semantic analysis include:
[0048] The requirement document is processed using a multi-level processing architecture, which consists of a lexical analysis layer and a syntactic analysis layer.
[0049] Perform in-depth extraction of requirement elements, including functional requirement extraction, non-functional requirement extraction, and business rule extraction;
[0050] Construct a relationship diagram of requirement elements, where nodes represent requirement elements and edges represent relationships between elements. Relationships include temporal relationships, dependency relationships, composition relationships, and refinement relationships. Temporal relationships use temporal connectors to identify the order of action execution. Dependency relationships analyze data flow and control flow dependencies and identify preconditions and postconditions. Composition relationships identify whole-part relationships. Refinement relationships identify the refinement relationships between abstract requirements and concrete implementations.
[0051] The lexical analysis layer uses a bidirectional maximum matching algorithm combined with a domain-specific dictionary for word segmentation, optimizes software engineering terminology, and uses a Transformer-based part-of-speech tagging model to identify words in the technical document, filters and optimizes stop words, and retains software requirement description words.
[0052] The syntactic analysis layer uses a dependency parser based on graph neural networks to identify syntactic components, applies a semantic role labeling enhancement model to label traditional semantic roles, and specifically identifies conditional roles, constraint roles, and exception handling roles in software requirements to resolve cross-sentence references.
[0053] The functional requirement extraction uses a pattern matching rule base to identify functional verbs, applies a condition-action pair extraction algorithm to extract requirement patterns in the format of "when <condition>, the system should <action>", and identifies the input parameters, output results and side effects of the operation through a sequence labeling model.
[0054] The non-functional requirement extraction includes performance requirements, security requirements, and reliability requirements. Performance requirements include identifying requirements with quantifiable indicators. Security requirements include identifying authentication, authorization, and encryption requirements. Reliability requirements include identifying availability, fault tolerance, and recoverability requirements. A multi-label classifier is used to classify and prioritize the non-functional requirements.
[0055] The business rule extraction includes identifying business entities and their attributes and relationships, extracting business constraints and integrity rules, and using a rule template library to convert proprietary text business rules into formal representations.
[0056] The formal representation of the requirement model consists of three parts: a multi-level formal representation framework, a template library and pattern matching engine, and formal representation verification.
[0057] The multi-level formal representation framework represents requirements from different levels of abstraction;
[0058] The template library and pattern matching engine are divided into template library organization structure, intelligent template matching, and template instantiation. The template library organization structure can be classified by domain, by requirement type, and by abstraction level. For example, by domain: e-commerce, finance, healthcare, Internet of Things, etc.; by requirement type: functional requirements, data requirements, interface requirements, quality requirements; by abstraction level: high-level goals, user requirements, system requirements.
[0059] The intelligent template matching method includes using semantic similarity calculation to match requirement descriptions and templates, applying a multi-factor weighted algorithm, matching multiple templates for complex requirements and combining them, and the template instantiation includes establishing a parameter binding mechanism to bind requirement elements with template parameters to achieve constraint propagation; and using type checking to verify the consistency of instantiation results.
[0060] The formalized representation verification includes syntax verification, semantic verification and quality attribute verification, the syntax verification includes checking the syntax correctness of the formalized specification, verifying the consistency of variable declaration and usage, checking type matching and correct use of operators, the semantic verification includes verifying the consistency of the specification using theorem provers, verifying the satisfaction of timing properties using model checking techniques, verifying the satisfiability of data constraints using constraint solvers, the quality attribute verification includes checking the integrity of the specification, evaluating the precision of the specification, analyzing the readability of the specification.
[0061] The multi-level formalized representation framework is a three-level formalized representation framework, which consists of an abstract semantic layer, a behavior specification layer and an interaction protocol layer, the abstract semantic layer uses a domain ontology to represent core business concepts and relationships, adopts description logic to represent classification and constraint relationships between terms, and constructs a domain concept map to visually display complex relationships between business concepts; the behavior specification layer uses linear temporal logic to represent requirements with timing constraints, uses computation tree logic to represent branching timing requirements, uses Z notation or B method to represent state-based requirement specifications, and uses event-condition-action rules to represent responsive requirements; the interaction protocol layer uses message sequence chart to formalize the interaction between components, adopts process algebra to describe concurrent behavior, and uses state chart to formalize state transition behavior.
[0062] The software model automatic generation is divided into multi-view model framework generation, model conversion and refinement, and visualization enhancement,
[0063] The multi-view model generation framework is used to describe the system from different perspectives, and includes:
[0064] Structure view generation: class diagram generation: generating a UML class diagram from business entities and relationships, including classes, attributes, methods, associations, aggregations, compositions and inheritance relationships; component diagram generation: identifying system components and their interfaces, and generating a component diagram to show physical or logical component structure; deployment diagram generation: generating a deployment diagram of nodes and connectors for distributed system requirements;
[0065] Behavior view generation: use case diagram generation: generating a use case diagram from user goals and system functions, identifying actors and use case relationships; activity diagram generation: generating an activity diagram from operation sequences and conditions, describing business processes and workflows; state machine diagram generation: generating a state machine diagram to describe state transitions for stateful objects;
[0066] Interaction view generation: sequence diagram generation: generating a sequence diagram from interaction requirements, showing the timing of message exchange between objects; communication diagram generation: an interaction view that emphasizes the structural relationship of objects; timing diagram generation: an interaction view that focuses on time constraints;
[0067] Requirement view generation: requirement diagram generation: use SysML requirement diagram to visualize requirements and their relationships; requirement traceability matrix: establish traceability between requirements and model elements;
[0068] Constraint view generation: OCL constraint generation: generate object constraint language specification to express constraint conditions of model elements; business rule diagram: visualize business rules and their relationships;
[0069] The model conversion and refinement includes abstract-concrete refinement, model conversion, model merging and integration, the abstract-concrete refinement process includes refining high-level goals into specific operations, refining problem domain concepts into solution domain artifacts, refining logical design into physical design; the model conversion rules include defining conversion rules from formal specification to UML model, implementing automatic mapping between model elements, applying model transformation language to describe complex conversion; the model merging and integration includes merging model fragments from different requirements, resolving naming conflicts between model elements, integrating multiple views to form a consistent complete model;
[0070] The visualization enhancement includes automatic layout algorithm, interactive visualization and visualization enhancement algorithm, the automatic layout algorithm includes applying force-directed algorithm to realize automatic layout of class diagram and component diagram, using hierarchical layout algorithm to optimize layout of activity diagram and state machine diagram, realizing incremental layout, the interactive visualization is used to provide model navigation function, realize semantic zooming, provide multi-view synchronization; the visualization enhancement algorithm uses color coding to distinguish different types of model elements, applies icons and graphical symbols to enhance model readability, provides tool tips and detailed view to display additional information of elements.
[0071] The model consistency verification and optimization includes multi-level consistency verification, automated verification, model quality evaluation and optimization, human-computer collaborative refinement;
[0072] The multi-level consistency verification includes internal consistency verification, external consistency verification and traceability verification:
[0073] The internal consistency verification includes syntax consistency, static semantic consistency and dynamic semantic consistency, syntax consistency verifies whether the model conforms to the meta-model specification; static semantic consistency verifies whether the model meets OCL constraints; dynamic semantic consistency verifies whether the behavior model is consistent and conflict-free;
[0074] The external consistency includes requirement-code consistency, model-code consistency and cross-model consistency, requirement-model consistency verifies whether the model meets the original requirements; model-code consistency verifies whether the implementation code is consistent with the model; cross-model consistency verifies the consistency between different view models;
[0075] The traceability verification includes establishing bidirectional traceability links, verifying traceability integrity and analyzing change impact. The bidirectional traceability links are established to connect requirement statements and model elements. The traceability integrity is verified to ensure that all important requirements have corresponding model elements. The change impact is analyzed to evaluate the impact scope of requirement changes on the model.
[0076] The automated verification includes theorem proving application, model checking and constraint solving application.
[0077] Theorem proving application: static constraints are verified using first-order logic theorem provers. Timing properties are verified using temporal logic theorem provers. Complex system properties are verified using higher-order logic theorem provers.
[0078] Model checking techniques: finite state systems are verified using symbolic model checking. Larger scale systems are handled using bounded model checking. Infinite state systems are handled using abstract interpretation techniques.
[0079] Constraint solving application: data and functional constraints are verified using SMT solvers. Structural model consistency is verified using Alloy analyzers. Business rule consistency is verified using Prolog engines.
[0080] The model quality evaluation and optimization includes quality attribute evaluation, automated optimization and optimization verification cycle.
[0081] Quality attribute evaluation: structural quality: complexity, coupling, cohesion of the model are evaluated. Semantic quality: completeness, consistency, precision of the model are evaluated. Practical quality: understandability, maintainability, extensibility of the model are evaluated.
[0082] Automated optimization techniques: refactoring patterns application: model bad smells are identified and corresponding refactorings are applied. Design patterns introduction: design patterns are introduced at appropriate locations to improve quality. Architecture patterns application: overall architecture structure is optimized.
[0083] Optimization verification cycle: an iterative optimization process of "analysis-optimization-verification" is established. It is ensured that each optimization does not break the existing consistency relationships. Optimization history is maintained to support backtracking and comparison.
[0084] The human-machine collaborative refinement includes visual feedback mechanism, interactive refinement interface and decision support.
[0085] Visual feedback mechanism: problem localization view is provided. Inconsistent areas are highlighted. Explanatory reports are generated to explain the causes of problems and possible solutions. Repair suggestions are provided to recommend specific repair operations.
[0086] Interactive refinement interface: implement drag-and-drop model editing, support intuitive model modification; provide context-related menus, display the current available refinement operations; support multi-round dialogue refinement, guide users to perfect the model through question and answer mode;
[0087] Decision support function: provide alternative comparison, show the pros and cons of different design decisions; generate impact analysis report, predict the chain effect of modification; support hypothesis analysis, evaluate the results of different design choices.
[0088] An apparatus and device comprising a processor and a memory, the memory storing machine executable instructions executable by the processor, the processor executing the machine executable instructions to implement a natural language based software requirement modeling method.
[0089] A machine readable medium storing machine executable instructions, the machine executable instructions when invoked and executed by a processor, for implementing a natural language based software requirement modeling method.
[0090] The above only describes certain exemplary embodiments of the present application by way of illustration, and it is needless to say that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present application. Therefore, the above drawings and descriptions are illustrative in nature and should not be construed as limiting the scope of protection of the claims of the present application.
Claims
1. A method for natural language based software requirement modeling, characterized in that, Comprise: Requirement preprocessing and semantic analysis, preprocessing and deep semantic analysis of the input natural language requirement document, extracting requirement elements and relationships; Formalized representation of requirement model, converting the extracted requirement elements and relationships into formalized intermediate representation, forming formalized representation of requirement model; Automatic generation of software model, converting formalized representation of requirement model into standard software engineering model; Model consistency verification and optimization, optimizing the generated standardized software engineering model to be consistent with the original requirements.
2. The natural language based software requirement modeling method of claim 1, wherein, In the requirement preprocessing and semantic analysis, comprising: Using a multi-level processing architecture to process the requirement document, the multi-level processing architecture consists of a lexical analysis layer and a syntactic analysis layer; Deeply extracting requirement elements, including functional requirement extraction, non-functional requirement extraction and business rule extraction; Building a requirement element relationship graph, the nodes represent requirement elements, and the edges represent the relationships between elements, including temporal relationship, dependency relationship, composition relationship and refinement relationship, temporal relationship uses temporal conjunction word to identify action execution order, dependency relationship analyzes data flow and control flow dependency, identifies preconditions and postconditions, composition relationship identifies whole-part relationship, and refinement relationship identifies the refinement relationship between abstract requirements and specific implementation.
3. The natural language-based software requirement modeling method according to claim 2, characterized in that: The lexical analysis layer uses a bidirectional maximum matching algorithm combined with a domain professional dictionary to perform word segmentation, and optimizes software engineering professional term words, uses a word part-of-speech tagging model based on Transformer to identify single words in technical documents, filters and optimizes stop words, and retains software requirement description words; The syntactic analysis layer uses a graph neural network-based dependency syntactic analyzer to identify syntactic components, applies a semantic role labeling enhancement model to label traditional semantic roles, and particularly identifies condition roles, constraint roles and exception handling roles in software requirements, and performs cross-sentence reference resolution.
4. The natural language-based software requirement modeling method according to claim 2, characterized in that: The functional requirement extraction uses a pattern matching rule library to identify functional verbs, applies a condition-action pair extraction algorithm to extract requirements in the format "When <condition>, the system should <action>", and identifies input parameters, output results and side effects of operations through a sequence labeling model; The non-functional requirement extraction includes performance requirements, security requirements and reliability requirements, the performance requirements include identifying requirements containing quantitative indicators, the security requirements include identifying authentication, authorization and encryption requirements, and the reliability requirements include identifying availability, fault tolerance and recovery requirements, and a multi-label classifier is used to classify and prioritize non-functional requirements; The business rule extraction includes identifying business entities and their attributes and relationships, extracting business constraints and integrity rules, and converting self-text business rules into formalized representation using a rule template library.
5. The natural language based software requirement modeling method of claim 1, wherein, In the formalized representation of requirement model, it is divided into a multi-level formalized representation framework, a template library and a pattern matching engine, and a formalized representation verification, The multi-level formalized representation framework represents requirements from different abstraction levels; The template library and the pattern matching engine are divided into a template library organization structure, intelligent template matching and template instantiation, the classification mode of the template library organization structure includes classification by field, classification by demand type and classification by abstraction level, the intelligent template matching mode includes matching demand description with templates using semantic similarity calculation, applying a multi-factor weighting algorithm, matching multiple templates for complex demands and combining, the template instantiation includes establishing a parameter binding mechanism, binding demand elements with template parameters and realizing constraint propagation; using type checking to verify the consistency of instantiation results; The formalized representation verification includes syntax verification, semantic verification and quality attribute verification, the syntax verification includes checking the syntax correctness of the formalized specification, verifying the consistency of variable declaration and use, checking type matching and correct use of operators, the semantic verification includes using a theorem prover to verify the consistency of the specification, applying model detection technology to verify the satisfaction of timing properties, using a constraint solver to verify the satisfiability of data constraints, the quality attribute verification includes checking the integrity of the specification, evaluating the accuracy of the specification and analyzing the readability of the specification.
6. The natural language based software requirement modeling method of claim 5, wherein, The multi-level formalized representation framework is a three-layer formalized representation framework composed of an abstract semantic layer, a behavior specification layer and an interaction protocol layer, the abstract semantic layer uses a domain ontology to represent core business concepts and relationships, adopts description logic to represent classification and constraint relationships between terms, and constructs a domain concept map to visually display complex relationships between business concepts; the behavior specification layer uses linear temporal logic to represent requirements with timing constraints, uses computation tree logic to represent branching timing requirements, uses Z notation or B method to represent state-based requirement specifications, and uses event-condition-action rules to represent responsive requirements; the interaction protocol layer uses message sequence chart to formalize the interaction between components, adopts process algebra to describe concurrent behavior, and uses state chart to formalize state transition behavior.
7. The natural language based software requirement modeling method of claim 1, wherein, The software model automatic generation is divided into a multi-view model framework generation, model conversion and refinement, and visualization enhancement, The multi-view model generation framework is used to describe a system from different perspectives; The model conversion and refinement includes abstract-concrete refinement, model conversion, model merging and integration, the abstract-concrete refinement process includes refining high-level goals into specific operations, refining problem domain concepts into solution domain components, and refining logical design into physical design; the model conversion rules include defining conversion rules from formalized specifications to UML models, realizing automatic mapping between model elements, and applying model conversion language to describe complex conversion; the model merging and integration includes merging model fragments from different requirements, solving naming conflicts between model elements, and integrating multiple views to form a consistent complete model; The visualization enhancement includes automatic layout algorithm, interactive visualization and visualization enhancement algorithm, the automatic layout algorithm includes application of force directed algorithm to realize automatic layout of class diagram and component diagram, use of hierarchical layout algorithm to optimize layout of activity diagram and state machine diagram, realization of incremental layout, the interactive visualization is used to provide model navigation function, realize semantic zoom, provide multi-view synchronization; the visualization enhancement algorithm uses color coding to distinguish different types of model elements, applies icon and graphical symbol to enhance model readability, provides tool tip and detailed view to display additional information of elements.
8. The natural language based software requirement modeling method of claim 1, wherein, The model consistency verification and optimization includes multi-level consistency verification, automatic verification, model quality evaluation and optimization, and man-machine collaborative refinement. The multi-level consistency verification includes internal consistency verification, external consistency verification and traceability verification, the internal consistency verification includes syntax consistency, static semantic consistency and dynamic semantic consistency, the external consistency includes requirement code consistency, model code consistency and cross-model consistency, the traceability verification includes establishment of bidirectional traceability link, verification of traceability integrity and analysis of change impact; The automatic verification includes theorem proving application, model detection and constraint solving application; The model quality evaluation and optimization includes quality attribute evaluation, automatic optimization and optimization verification cycle; The man-machine collaborative refinement includes visualization feedback mechanism, interactive refinement interface and decision support.
9. An apparatus and device, characterized by A processor and a memory are included, the memory stores machine executable instructions capable of being executed by the processor, the processor executes the machine executable instructions to realize the natural language based software requirement modeling method in any one of claims 1-8.
10. A machine-readable medium, characterized in that, The machine readable medium stores machine executable instructions, when the machine executable instructions are called and executed by the processor, the natural language based software requirement modeling method in any one of claims 1-7 is realized.
Citation Information
Patent Citations
SysML software demand modeling method and system based on natural language processing
CN117555519A
Cited By
LLM-based system-level demand modeling and analysis method and platform
CN121635876A
System-level requirement modeling and analysis method and platform based on LLM
CN121635876B
MBSE-oriented multi-agent collaborative automatic modeling method and system
CN121638475A
Process modeling method oriented to man-machine cooperation and related equipment
CN122111425A