Software modeling method based on SysML model

Through the software modeling method based on SysML model, using the conversion and formal verification technology of EMF and Uppaal meta-model, the problem of low formal verification efficiency and high cost in software development is solved, and the correctness and robustness of the system design are achieved. It improves the reliability and security of software and reduces testing costs.

CN118819480APending Publication Date: 2024-10-22SHANGHAI FORMAL TECH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411020527.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

The existing model-driven software development method has the problems of low efficiency and high cost of formal verification.

Method used

Through the software modeling method based on the SysML model, EMF technology is used to construct the SysML activity diagram and Uppaal meta-model, and through formal verification technology, the SysML activity diagram is converted into an Uppaal timed automaton, and LTL, CTL, and TCTL are used to define the formal Property specification, model checking is performed to verify whether the SysML activity diagram meets the software requirements.

Benefits of technology

It enables potential problems to be discovered and corrected early in the design phase, avoiding expensive redesign and maintenance in the later stages of system development, significantly improving software reliability and security, reducing testing costs, and simplifying the writing process of formal property specifications. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118819480A_ABST
    Figure CN118819480A_ABST
Patent Text Reader

Abstract

The invention provides a software modeling method based on a SysML model, and relates to the technical field of software engineering. The software modeling method based on the SysML model comprises the following specific steps: S101, on the basis of an EMF (Empirical Mode Function) technology, constructing a SysML activity diagram and a Uppaa l meta-model; and S102, based on a corresponding relation between SysML activity diagram elements and Uppaa l model elements, realizing conversion from the SysML activity diagram to a Uppaa l timed automaton model by means of the meta-model. The problem that available formalized verification tools are lacked in the current model-based software development field is solved, the reliability and safety of software are remarkably improved, the test cost of the software is reduced, meanwhile, a formalized standard property template based on LTL, CTL and TCTL is provided, the requirement for the specialty of a user is reduced, and the test efficiency is improved. And the writing speed of the formalized property specification can be obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software engineering, and in particular to a software modeling method based on a SysML model. Background Art

[0002] The System Modeling Language (SysML) is a general-purpose modeling language used to support system engineering applications. It provides a standardized method to describe all aspects of a system, including its structure, behavior, requirements, and parameters. Activity diagrams in SysML are an important type of behavioral diagram used to describe the logical sequence of processes and operations in a system. They graphically represent the system's activities (or processes), decision paths, parallel control flows, and synchronization information, allowing engineers to understand and analyze complex system behaviors in an intuitive way.

[0003] Model checking is an automated technique for verifying whether the model of a finite state system satisfies a given specification or property. By fully exploring all possible states of the system, model checking can ensure that the system behavior follows specific correctness conditions. This is particularly important in the design and verification of complex systems, because manual analysis often finds it difficult to cover all potential behaviors and interactions. A key advantage of model checking is that it can provide counterexamples, that is, specific system execution paths that lead to non-compliance with the specifications, which is very useful for diagnosing and solving design problems.

[0004] To this end, we have developed a new software modeling method based on SysML model. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In view of the deficiencies in the prior art, the present invention provides a software modeling method based on the SysML model, which solves the problems of low efficiency and high cost of formal verification in the existing model-driven software development method.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions: a software modeling method based on SysML model, comprising the following specific steps:

[0009] S101. Construct SysML activity diagram and Uppaal metamodel based on EMF technology;

[0010] S102, based on the correspondence between SysML activity diagram elements and Uppaal model elements, with the help of metamodel, realize the conversion from SysML activity diagram to Uppaal timed automaton model;

[0011] S103. Based on formal verification technology, write formal property specifications, verify them with Uppaal timed automata, and then confirm that the SysML activity diagram meets the conditions of the property specifications.

[0012] Preferably, the S101 includes:

[0013] Based on the definition of key elements in SysML activity diagram and its XML source file details, Ecore is used to build SysML activity diagram as metamodel;

[0014] According to the key element definitions in Uppaal timed automaton and its XML source file details, Uppaal timed automaton is established as a metamodel using Ecore.

[0015] Preferably, the S102 includes:

[0016] Map the action nodes in the SysML activity diagram to the template in Uppaal, which contains two locations, one named "Initial" to indicate the waiting state, and the other with the same name as the action to indicate that the action is being executed;

[0017] The start condition of the action in the SysML activity diagram is simulated using the Boolean global variable in Uppaal. Uppaal provides a unique Boolean variable for each input edge of the control flow to represent the control token.

[0018] The control nodes in the SysML activity diagram correspond to the template in Uppaal. Different control nodes correspond to different locations and edge information in the template.

[0019] Preferably, the S103 includes:

[0020] Define formal property specification templates based on LTL, CTL, and TCTL;

[0021] According to the actual software requirements, fill the properties that need to be met into the property specification template to form a formal property specification;

[0022] According to the defined formal property specifications, the Uppaal timed automaton is verified, and according to the results returned by the model checker, it is determined whether the SysML activity diagram satisfies the property specifications, that is, whether it meets the software requirements.

[0023] Preferably, the metamodel established by the SysML activity diagram is managed and input by a model management module, and after the SysML activity diagram is input, the SysML activity diagram is converted into an Uppaal timed automaton according to the above method.

[0024] Preferably, the formal property specification in S103 is input by using a property management module, and according to the above method, a formal property specification template is provided and the input formal property specification is recorded.

[0025] Preferably, the S102 includes a mapping configuration module for mapping variables of the SysML activity diagram to atomic propositions in the formal property specification.

[0026] Preferably, the S102 includes a model verification module, which is used to call the model solver according to the mapping between SysML activity diagram variables and formal property specification atomic propositions, verify the Uppaal model, and return the verification result.

[0027] (III) Beneficial effects

[0028] The present invention provides a software modeling method based on SysML model, which has the following beneficial effects:

[0029] 1. This software modeling method based on SysML model, by converting SysML activity diagram into Uppaal model and verifying it by model checking, constitutes a powerful method to ensure the correctness and robustness of system design. Through this method, potential problems can be discovered and corrected early in the design stage, thus avoiding expensive redesign and maintenance problems in the later stages of system development or actual deployment. This model-based verification method provides an efficient and systematic way for the development of complex systems, ensuring that the system design can meet its requirements and expected behaviors.

[0030] 2. The software modeling method based on SysML model, by modeling both SysML model activity diagram and Uppaal time automaton as EMF metamodel, then defining the mapping relationship between the model elements of SysML model activity diagram and the constituent elements of Uppaal time automaton, realizing the conversion between the two based on EMF metamodel, then providing a formal specification property template based on LTL, CTL and TCTL, allowing users to convert software requirements into formal property specifications based on this template, finally, according to the formal property specification, calling the model checker to verify whether Uppaal time automaton satisfies the specification, and then indicating whether the SysML model activity diagram representing the software structure satisfies the formal specification, i.e., the software requirement. This method fills the problem of lack of available formal verification tools in the current model-based software development field, significantly improves the reliability and security of software, reduces the testing cost of software, and can reduce the requirements for user professionalism, and can significantly improve the writing speed of formal property specifications. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is a flow chart of the method of the present invention;

[0032] Figure 2 A schematic diagram of the metamodel modeling of the present invention;

[0033] Figure 3 It is a structural diagram of the device of the present invention;

[0034] Figure 4 It is a schematic diagram of an electronic device of the present invention. DETAILED DESCRIPTION

[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] Embodiment 1:

[0037] like Figure 1 As shown, an embodiment of the present invention provides a software modeling method based on a SysML model, comprising the following specific steps:

[0038] S101. Based on EMF technology, a SysML activity diagram and a metamodel of Uppaal are constructed, wherein the SysML activity diagram is established as a metamodel using Ecore according to the definition of key elements in the SysML activity diagram and its XML source file details, and the Uppaal timed automaton is established as a metamodel using Ecore according to the definition of key elements in the Uppaal timed automaton and its XML source file details;

[0039] S102. Based on the correspondence between SysML activity diagram elements and Uppaal model elements, with the help of metamodel, the conversion from SysML activity diagram to Uppaal timed automaton model is realized, and the action nodes in the SysML activity diagram are mapped to the template in Uppaal, which includes two locations, one named "Initial" indicating the waiting state, and the other with the same name as the action indicating that the action is being executed. The starting condition of the action in the SysML activity diagram is simulated using the Boolean type global variable in Uppaal. Uppaal provides a unique Boolean variable for each input edge of the control flow to represent the control token. The control nodes in the SysML activity diagram correspond to the template in Uppaal. The number of locations and edge information in the template corresponding to different control nodes are different.

[0040] S103. Define a formal property specification template based on LTL, CTL, and TCTL. Fill the properties that need to be met into the property specification template according to the actual software requirements to form a formal property specification. Then, verify the Uppaal time automaton according to the defined formal property specification. According to the result returned by the model checker, determine whether the SysML activity diagram satisfies the property specification, that is, whether it meets the software requirements. Write a formal property specification and verify it with the Uppaal time automaton to confirm that the SysML activity diagram meets the conditions of the property specification.

[0041] Embodiment 2:

[0042] The difference between this embodiment and the first embodiment is that a software modeling method based on a SysML model includes the following specific steps:

[0043] S101, a model management module, which is used to manage the input SysML activity diagram model. After the SysML activity diagram is input, the SysML activity diagram is converted into the Uppaal time automaton according to the defined SysML activity diagram and the metamodel of the Uppaal time automaton;

[0044] S102, a property management module, used to manage input formal property specifications, provide formal property specification templates and record input formal property specifications;

[0045] S103, a mapping configuration module, used to map variables on a SysML activity diagram to atomic propositions in a formal property specification;

[0046] S104, a model verification module, is used to call the model solver according to the mapping between SysML activity diagram variables and formal property specification atomic propositions, verify the Uppaal model, and return the verification result.

[0047] Comparative Example:

[0048] Using the conventional software modeling method based on SysML model, the specific steps are as follows:

[0049] S101, Requirements Analysis: Use SysML requirements diagrams to capture and manage system requirements. Ensure a comprehensive understanding of the system by identifying and analyzing the functional and non-functional requirements of the system;

[0050] S102 System Architecture Design: Use SysML structure diagrams and behavior diagrams to describe the structure and behavior of the system. Structure diagrams may include component diagrams, internal block diagrams, etc., to represent the components of the system and the relationships between them. Behavior diagrams may include activity diagrams, state diagrams, etc., to describe the behavior and state transitions of the system.

[0051] S103, Model Analysis and Verification: Use SysML models to perform system analysis and verification, including simulation of system behavior, model checking and formal verification, etc. Through model analysis and verification, potential problems in system design can be discovered and resolved to ensure the correctness and reliability of the system;

[0052] S104, System Integration and Deployment: Use SysML models to guide the system integration and deployment process, including system assembly, software and hardware integration, system configuration, etc. The system views and documents provided by SysML models can simplify the system integration and deployment process and improve the efficiency and quality of system delivery.

[0053] S105, Continuous maintenance and evolution: The documentation and views provided by the SysML model help the development team understand the historical evolution and current status of the system, and provide support for the continuous improvement of the system.

[0054] The formal verification efficiency and cost of the software development method driven by model development in the above-mentioned multiple embodiments and comparative examples were tested, and the results are shown in the following table:

[0055] Example Verification efficiency (h) Cost (ten thousand yuan) Embodiment 1 8.7 20.1 Embodiment 2 9.2 23.7 Comparative Example 11.5 29.7

[0056] In summary, the present invention fills the problem of lack of available formal verification tools in the current model-based software development field, significantly improves the reliability and security of software, reduces the testing cost of software, and proposes a formal specification property template based on LTL, CTL and TCTL. This template-based method of writing formal properties can reduce the requirements for user professionalism and significantly improve the speed of writing formal property specifications.

[0057] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A software modeling method based on SysML model, characterized in that: The specific steps include: S101. Construct SysML activity diagram and Uppaal metamodel based on EMF technology; S102, based on the correspondence between SysML activity diagram elements and Uppaal model elements, with the help of metamodel, realize the conversion from SysML activity diagram to Uppaal timed automaton model; S103. Based on formal verification technology, write formal property specifications, verify them with Uppaal timed automata, and then confirm that the SysML activity diagram meets the conditions of the property specifications.

2. A software modeling method based on SysML model according to claim 1, characterized in that: The S101 includes: Based on the definition of key elements in SysML activity diagram and its XML source file details, Ecore is used to build SysML activity diagram as metamodel; According to the key element definitions in Uppaal timed automaton and its XML source file details, Uppaal timed automaton is established as a metamodel using Ecore.

3. The software modeling method based on SysML model according to claim 1, characterized in that: The S102 includes: Map the action nodes in the SysML activity diagram to the template in Uppaal, which contains two locations, one named "Initial" to indicate the waiting state, and the other with the same name as the action to indicate that the action is being executed; The start condition of the action in the SysML activity diagram is simulated using the Boolean global variable in Uppaal. Uppaal provides a unique Boolean variable for each input edge of the control flow to represent the control token. The control nodes in the SysML activity diagram correspond to the template in Uppaal. Different control nodes correspond to different locations and edge information in the template.

4. The software modeling method based on SysML model according to claim 1, characterized in that: The S103 includes: Define formal property specification templates based on LTL, CTL, and TCTL; According to the actual software requirements, fill the properties that need to be met into the property specification template to form a formal property specification; According to the defined formal property specifications, the Uppaal timed automaton is verified, and according to the results returned by the model checker, it is determined whether the SysML activity diagram satisfies the property specifications, that is, whether it meets the software requirements.

5. The software modeling method based on SysML model according to claim 3, characterized in that: The metamodel established by the SysML activity diagram is managed and input by a model management module, and after the SysML activity diagram is input, the SysML activity diagram is converted into an Uppaal time automaton according to the above method.

6. The software modeling method based on SysML model according to claim 4, characterized in that: The formal property specification in S103 is input by using a property management module, and according to the above method, a formal property specification template is provided and the input formal property specification is recorded.

7. The software modeling method based on SysML model according to claim 1, characterized in that: The S102 includes a mapping configuration module for mapping variables of the SysML activity diagram to atomic propositions in the formal property specification.

8. The software modeling method based on SysML model according to claim 1, characterized in that: The S102 includes a model verification module, which is used to call the model solver according to the mapping between SysML activity diagram variables and formal property specification atomic propositions, verify the Uppaal model, and return the verification result.