A method and apparatus for implementing a sysml diagram
By converting SysML diagrams into tree diagrams, the problem of the system architecture platform being unable to effectively combine MBSE and document methods is solved, achieving low-cost and efficient information management and storage.
Patent Information
- Application Number
- CN202210065142.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-01-20
AI Technical Summary
The existing system architecture platform cannot effectively combine MBSE and document-based methods, resulting in high maintenance costs and high error rates.
The information in the SysML diagram is divided into graphical element information, logical relationship information, and element attribute information. A tree diagram is generated and stored in the form of a tree diagram. The top node corresponds to the outer frame of the diagram and associates graphical elements and logical relationship nodes to achieve loosely coupled association of production elements.
The MBSE method was implemented on a system architecture platform with document and table output functions, which reduced maintenance costs and error rates, while optimizing the structure and information expression of the tree diagram.
Smart Images

Figure CN114461860B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of system engineering, in particular to a SysML diagram implementation method and device. BACKGROUND
[0002] Traditional document-based system engineering not only requires a large amount of cost to maintain output such as text documents, spreadsheets, etc., but also has a high error rate, such as inconsistent document data due to human negligence, etc. In recent years, as an effective solution, MBSE (Model Based System Engineering) has been favored by many system engineers.
[0003] Practitioners of the MBSE method usually use SysML (Systems Modeling Language), which defines semantics for structural models, behavioral models, requirement models and parameter models of systems. In the actual design and production process, engineers may also want to manage the system through modeling and output necessary text documents, spreadsheets and pictures, etc., which requires the combination of MBSE and document-based methods.
[0004] Nowadays, many document-based system architecture platforms are implemented through tree models, such as SystemWeaver (electronic and electrical collaborative design and development platform). The SystemWeaver platform already has powerful document table output functions, but it cannot represent SysML diagrams in the form of tree diagrams, so it cannot have the advantages of both MBSE and document-based methods. SUMMARY
[0005] The present application provides a SysML diagram implementation method and device to store SysML diagrams in the form of tree diagrams. The specific technical solutions are as follows:
[0006] In a first aspect, the present application provides a SysML diagram implementation method, which includes:
[0007] Divide the information in each SysML diagram into graphical element information, logical relationship information and element attribute information, wherein the graphical element information includes an outer frame of the diagram.
[0008] According to the graphic element information, the logical relationship information and the element attribute information, a tree diagram for storing the SysML diagram information is generated, wherein a top node of the tree diagram corresponds to the outer frame of the diagram, the top node is associated with a first node and a second node, the first node is used for associating a graphic element node, the second node is used for associating a logical relationship node, a child node of the graphic element node is determined according to a logical relationship node corresponding to the graphic element node, and each node in the tree diagram stores element attribute information corresponding to the node.
[0009] Optionally, the child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, and specifically includes the following steps.
[0010] The relationship between each graphic element node and the logical relationship node corresponding to the graphic element node is determined, wherein each graphic element in the SysML diagram is associated with at least one logical relationship, and each graphic element associated with each logical relationship has a respective role.
[0011] According to the relationship between each graphic element node and the logical relationship node corresponding to the graphic element node, a plurality of relationship nodes are generated, the relationship node being a node corresponding to the role of each graphic element in the corresponding logical relationship.
[0012] The relationship node is associated with the corresponding logical relationship node as a child node of the logical relationship node.
[0013] The relationship node or the logical relationship node is associated with the corresponding graphic element node.
[0014] Optionally, the child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, and specifically includes the following steps.
[0015] The relationship between each graphic element node and the logical relationship node corresponding to the graphic element node is determined, wherein each graphic element in the SysML diagram is associated with at least one logical relationship, and each graphic element associated with each logical relationship has a respective role.
[0016] According to the relationship between each graphic element node and the logical relationship node corresponding to the graphic element node, at least one logical relationship node is associated with the corresponding graphic element node.
[0017] Optionally, the graphic element node includes a graphic element node associated with a production element, and the specific steps of associating the production element include the following steps.
[0018] A production element identifier is assigned to each production element.
[0019] The production element identifier is stored in the corresponding graphic element node, so as to trace the production element through the graphic element node associated with the production element.
[0020] Optionally, the production element identifier is obtained by a universally unique identifier (UUID) method.
[0021] Optionally, the top node stores all graphical information associated with the corresponding figure frame.
[0022] Optionally, each node of the tree diagram has a node identifier, and the node identifier is obtained by a UUID method.
[0023] In a second aspect, an embodiment of the present application provides an implementation device of a SysML diagram, and the device comprises:
[0024] A division module is configured to divide information in each SysML diagram into graphical element information, logical relationship information, and element attribute information, wherein the graphical element information comprises a figure frame.
[0025] A determination module is configured to generate a tree diagram for storing SysML diagram information according to the graphical element information, the logical relationship information, and the element attribute information, wherein a top node of the tree diagram corresponds to the figure frame, the top node is associated with a first node and a second node, the first node is used to associate a graphical element node, the second node is used to associate a logical relationship node, a child node of the graphical element node is determined according to a corresponding logical relationship node of the graphical element node, and each node in the tree diagram stores element attribute information corresponding to the node.
[0026] Optionally, the child node of the graphical element node is determined according to the corresponding logical relationship node of the graphical element node, and specifically includes:
[0027] The relationship between each graphical element node and a corresponding logical relationship node is determined, wherein each graphical element in the SysML diagram is associated with at least one logical relationship, and each graphical element associated with each logical relationship has a respective role.
[0028] According to the relationship between each graphical element node and a corresponding logical relationship node, a plurality of relationship nodes are generated, and the relationship nodes are nodes corresponding to the role of each graphical element in the corresponding logical relationship.
[0029] The relationship nodes are associated with the corresponding logical relationship nodes as child nodes of the logical relationship nodes.
[0030] The relationship nodes or the logical relationship nodes are associated with the corresponding graphical element nodes.
[0031] Optionally, the child node of the graphical element node is determined according to the corresponding logical relationship node of the graphical element node, and specifically includes:
[0032] determining the relationship between each graphical element node and its corresponding logical relationship node, wherein each graphical element in the SysML diagram is associated with at least one logical relationship, and for each logical relationship, each graphical element associated with the logical relationship has a respective role;
[0033] associating at least one logical relationship node to the corresponding graphical element node according to the relationship between each graphical element node and its corresponding logical relationship node.
[0034] Optionally, the graphical element node includes an associated production element graphical element node, and the specific steps of associating the production element include:
[0035] assigning a production element identifier to each production element;
[0036] storing the production element identifier in the corresponding graphical element node, so as to trace back to the production element through the associated production element graphical element node.
[0037] Optionally, the production element identifier is obtained in a universal unique identifier (UUID) manner.
[0038] Optionally, the top node stores all graphical information associated with the corresponding outer frame.
[0039] Optionally, each node of the tree diagram has a node identifier, and the node identifier is obtained in a UUID manner.
[0040] As can be seen from the above, the implementation method and device of the SysML diagram provided by the embodiment of the present application divide the information in each SysML diagram into graphical element information, logical relationship information and element attribute information, wherein the graphical element information includes an outer frame; according to the graphical element information, the logical relationship information and the element attribute information, a tree diagram for storing SysML diagram information is generated, wherein the top node of the tree diagram corresponds to the outer frame, the top node is associated with a first node and a second node, the first node is used for associating a graphical element node, the second node is used for associating a logical relationship node, the child node of the graphical element node is determined according to the corresponding logical relationship node of the graphical element node, and each node in the tree diagram stores the corresponding element attribute information of the node.
[0041] By applying the embodiment of the present application, the SysML diagram can be expressed and stored in the form of a tree diagram, and the production elements are associated in a loose coupling manner. Of course, any product or method implementing the present application does not necessarily need to achieve all the advantages described above.
[0042] The technical effects of the embodiment of the present application include:
[0043] 1、Because the existing system architecture platform with document table output function is realized by tree model, so the existing MBSE method cannot be applied to this kind of system architecture platform. The embodiment of the application generates the top node of the tree diagram according to the different types of figure outer frame, takes two nodes respectively associated with the graphic element and the logical relationship as the child nodes of the top node, and constitutes the tree diagram for expressing and storing the SysML diagram. The MBSE method can be effectively applied to the system architecture platform with document and table output function, the above system platform is managed by modeling, the maintenance cost of the text document, electronic table and other output is saved, the error rate caused by human negligence is reduced, and the MBSE and the method based on the document are effectively fused.
[0044] 2、The embodiment of the application defines the relationship element in detail when the graphic element node is associated with the child node, obtains a plurality of relationship nodes, and each relationship node specifically expresses the relationship between a certain graphic element node and the corresponding logical relationship node. The relationship node is taken as the child node of the corresponding graphic element node, so that the association relationship between the graphic element and the corresponding logical relationship in the SysML diagram can be expressed in detail. Because the logical relationship corresponds to a plurality of graphic elements, the relationship between the graphic elements with the logical relationship is indirectly expressed. This is convenient for determining other node information related to the node information.
[0045] 3、In addition, when the graphic element node is associated with the child node, the embodiment of the application can also connect the graphic element node and the logical relationship node by the relationship between the graphic element node and the logical relationship node after the relationship is determined, and take the logical relationship node as the child node of the corresponding graphic element node. The graphic of the tree diagram realized by the method is simple, and the structure of the tree diagram is optimized.
[0046] 4、In the embodiment of the application, the top node of the tree diagram stores all the graphical information, which is beneficial to quickly generate graphics and does not need to traverse all the graphic element nodes in the tree diagram.
[0047] 5、When the production element is associated, the embodiment of the application stores the UUID of the production element in the element attribute of the graphic element node in the form of recording the UUID of the production element. This loose coupling does not affect the baseline of the production element, and is convenient for tracing the production element through the graphic element node. BRIEF DESCRIPTION OF DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only represent some of the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
[0049] Figure 1 A flowchart of one of the implementation methods of the SysML diagram provided by the embodiments of the present application;
[0050] Figure 2A A schematic diagram of one of the SysML sequence diagrams provided by the embodiments of the present application;
[0051] Figure 2B A schematic diagram of one of the tree diagrams corresponding to the SysML sequence diagram provided by the embodiments of the present application;
[0052] Figure 3 A flowchart of one of the methods for associating the child nodes of a graphical element node;
[0053] Figure 4 A schematic diagram of one of the methods for associating the child nodes of a graphical element node;
[0054] Figure 5 Another flowchart of one of the methods for associating the child nodes of a graphical element node;
[0055] Figure 6 Another schematic diagram of one of the methods for associating the child nodes of a graphical element node;
[0056] Figure 7 A schematic diagram of one of the devices for storing the SysML diagram based on the tree diagram provided by the embodiments of the present application. DETAILED DESCRIPTION
[0057] The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments only represent some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those of ordinary skill in the art without any creative effort belong to the protection scope of the present application.
[0058] It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally further include steps or units not listed, or can optionally further include other steps or units inherent to these processes, methods, products or devices.
[0059] The present application provides a SysML diagram implementation method and system. The embodiments of the present application are described in detail below.
[0060] Figure 1 A flowchart of a SysML diagram implementation method provided by the embodiments of the present application. The method can include the following steps:
[0061] S101: Divide the information in each SysML diagram into graphical element information, logical relationship information and element attribute information, wherein the graphical element information includes an outer frame of the diagram.
[0062] SysML defines semantics for structural models, behavioral models, requirement models and parameter models of systems. The behavioral model emphasizes the behavior of objects in the system, and the behavior includes activities, interactions and state histories, which are represented by use case diagrams, activity diagrams, sequence diagrams and state machine diagrams. All information in the SysML diagram can be abstracted into three categories, namely graphical element (Element) information, logical relationship (relation) information and element attribute (Attribute) information. The graphical element is the basic expression carrier of the SysML diagram. Taking a time sequence diagram as an example, the graphical element includes an outer frame of the diagram, objects, roles, messages, combination segments and gates. The logical relationship is the logical relationship between elements in the SysML diagram, such as the relationship between the object sending a message, the object receiving a message and the message. The element attribute information is the basic attribute information of each element in the SysML diagram, such as the content of the note, the constraint content and the message type.
[0063] It should be noted that the logical relationship information is obtained according to the association relationship between each graphical element in the SysML diagram and its related graphical elements.
[0064] S102: generating a tree diagram for storing SysML diagram information according to the graphic element information, the logical relationship information, and the element attribute information, wherein a top node of the tree diagram corresponds to the outer frame of the diagram, the top node is associated with a first node and a second node, the first node is used for associating a graphic element node, the second node is used for associating a logical relationship node, a child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, and each node in the tree diagram stores the element attribute information corresponding to the node.
[0065] In the embodiment of the present application, each SysML diagram corresponds to a tree diagram. Since each outer frame of the SysML diagram corresponds to a type of SysML diagram, the types are distinguished according to the attributes of the SysML diagram, and the types of the SysML diagram include, for example, a timing diagram type, a state machine diagram type, and a use case diagram type. Therefore, the top node of the tree diagram in the embodiment of the present application contains not only the outer frame information of the corresponding SysML diagram, but also the information of the corresponding type of the SysML diagram. Since the tree diagram is generated based on the outer frame in the embodiment of the present application, the top node of the tree diagram can be set as the corresponding outer frame information. The top node of each tree diagram has two child nodes, namely a first node and a second node. The first node is used for associating all graphic elements in the corresponding SysML diagram, for example, the first node is associated with all graphic element nodes corresponding to the outer frame. The second node is used for associating all logical relationships in the SysML diagram, for example, the second node is associated with all logical relationship nodes corresponding to the outer frame. It should be noted that each graphic element node can be associated with a child node related to the corresponding logical relationship, or can be associated with other graphic element nodes related to the graphic element node. Both are acceptable. The child node corresponding to each graphic element node can be associated with the node, which can more clearly express the main information of the SysML diagram. In addition, it should be noted that if the SysML diagram does not have logical relationship information, the second node will not be associated with its child node, and the child node of the first node will not exist, for example, the graphic element node will not be associated with a child node.
[0066] The SysML diagram is expressed and stored in the form of a tree diagram, which can effectively apply the MBSE method to a system architecture platform with document and table output functions, realize management of the system platform through modeling, improve the management efficiency of the platform, reduce the maintenance cost of the platform, and effectively integrate the MBSE and the document-based method.
[0067] In one embodiment, the SysML timing diagram is expressed and stored in the form of a tree diagram. Figure 2A A schematic diagram of the SysML timing diagram provided in the embodiment of the present application is shown in FIG. 1.Figure 2A As shown in the figure, the graphic elements in the SysML sequence diagram 20 include an object 1 (Object1) 201, an actor 1 (Actor1) 202, and a message 1 (Message1) 203, and the logical relationship is that the object 1 (Object1) 201 is the sending end of the message, the actor 1 (Actor1) 202 is the receiving end, and the message 1 (Message1) 203 is sent to the actor 1 (Actor1) 202.
[0068] Figure 2B A schematic diagram of the tree diagram corresponding to the SysML sequence diagram provided by the embodiment of the present application is shown in the figure. Figure 2B As shown in the figure, the sequence diagram 300 is the top node of the tree diagram. The top node sequence diagram 300 is connected with a first node graphic element container 310 and a second node logical relationship container 320, and then each graphic element is connected with the first node graphic element container 310 as the child node of the first node graphic element container 310, i.e., the child nodes of the first node graphic element container 310 include an object 1 (Object1) 311, an actor 1 (Actor1) 312, and a message 1 (Message1) 313. The logical relationship node is connected with the second node logical relationship container 320 as the child node of the second node logical relationship container 320, i.e., the child node of the second node logical relationship container 320 is a message 1 relationship (Message1 Relation) 321.
[0069] In an optional embodiment, each node of the tree diagram has a node identifier, and the node identifier is obtained by a universal unique identifier (UUID) method.
[0070] UUID(Universally Unique Identifier) is a software construction standard, which aims to enable all elements in a distributed system to have unique identification information. The tree diagram nodes are distinguished by UUID, and if the UUIDs are the same, it is considered that the two nodes are the same element. By distinguishing the nodes of the tree diagram by the UUID method, not only the same nodes are effectively identified, but also the model is further optimized because the central control terminal is not needed to specify the identification information.
[0071] Figure 3 A flowchart of a method for associating a graph element node with its child nodes is shown. In an optional embodiment, the child nodes of the graph element node are determined according to the logical relationship node corresponding to the graph element node, as shown in Figure 3 The method can include the following steps:
[0072] S201: Determine the relationship between each graph element node and its corresponding logical relationship node, wherein each graph element in the SysML diagram is associated with at least one logical relationship, and for each logical relationship, each graph element associated with it has a respective role.
[0073] Each graph element in the SysML diagram is associated with at least one logical relationship, and each graph element has a respective role in each logical relationship, for example, in the process of message sending, some graph elements are the sending end and some graph elements are the receiving end. The embodiment of the present application defines the logical relationship node in detail to determine the relationship between each graph element node and the corresponding logical relationship node.
[0074] S202: Generate a plurality of relationship nodes according to the relationship between each graph element node and its corresponding logical relationship node, wherein the relationship node is the node corresponding to the role of each graph element in its corresponding logical relationship.
[0075] It should be noted that each graph element generates different relationship nodes for different logical relationships.
[0076] S203: Associate the relationship nodes as child nodes of the logical relationship nodes to the corresponding logical relationship nodes.
[0077] Different logical relationship nodes are all hung under the second node as child nodes of the second node, and each logical relationship node only stores the relationship node corresponding to the logical relationship node itself.
[0078] S204: Associate the relationship nodes or the logical relationship nodes to the corresponding graph element nodes.
[0079] It should be noted that when the logical relationship node is a sub-node of the graph element node, the sub-node can also be hung with the relationship node corresponding to the logical relationship node.
[0080] The method of associating the sub-nodes of the graph element node is realized by steps S201-S204. Since the relationship element is defined in detail, a plurality of relationship nodes are obtained, each of which specifically expresses the relationship between a certain graph element node and its corresponding logical relationship node. Taking the relationship node as the sub-node of the graph element node, the association relationship between the elements in the SysML diagram can be described in detail.
[0081] In one embodiment, as shown in Figure 2A Message 1 (Message1) 203 is connected to Object 1 (Object1) 201 and Actor 1 (Actor1) 202 respectively, and there is a logical relationship between the three elements. Object 1 (Object1) 201 sends Message 1 (Message1) 203, i.e., there is a sending relationship between Object 1 (Object1) 201 and Message 1 (Message1) 203. Actor 1 (Actor1) 202 receives Message 1 (Message1) 203, i.e., there is a receiving relationship between Actor 1 (Actor1) 202 and Message 1 (Message1) 203. The sending end of Message 1 (Message1) 203 is Object 1 (Object1) 201, and the receiving end is Actor 1 (Actor1) 202. Among them, the sending relationship and the receiving relationship are both derived from Message 1 (Message1) 203. Therefore, a tree diagram corresponding to Figure 2A can be generated as shown in Figure 4 Figure 4 An illustration of associating sub-nodes with a graphical element node. The top node is a time sequence diagram 400, and the top node is connected with two top nodes, a first node graphical element container 410 and a second node logical relation container 420. The first node graphical element container 410 is connected with three nodes, an object 1 411, an actor 1 412, and a message 1 413. The object 1 411, the actor 1 412, and the message 1 413 are graphical element nodes. The second node logical relation container 420 is connected with a message 1 relation 421, which is a logical relation node. The logical relation element is defined in detail, and the defined relation element is connected with the corresponding graphical element node as a sub-node.
[0082] In an implementable manner, the object 1 411 is connected with a message 1 source 431, the actor 1 412 is connected with a message 1 target 432, and the message 1 413 is connected with a message 1 relation 433. It is to be noted that in order to trace information, each logical relation node in the tree diagram is connected with a corresponding relation element node of a graphical element node, for example, the message 1 relation 433 is connected with a message 1 source 441 and a message 1 target 442, and the message 1 relation 421 is connected with a message 1 source 451 and a message 1 target 452. Figure 4
[0083] Figure 5 Another flowchart of a method of associating sub-nodes with a graphical element node.
[0084] In an optional embodiment, the child nodes of the graphical element node are determined based on the logical relationship node corresponding to the graphical element node, and the method may include the following steps:
[0085] S301: Determine the relationship between each graphical element node and its corresponding logical relation node. In the SysML graph, each graphical element is associated with at least one logical relation. For each logical relation, each graphical element associated with it has its own role.
[0086] In a SysML diagram, each graphical element is associated with at least one logical relationship. Within each logical relationship, each graphical element has its own role; for example, in message sending, some graphical elements are the source, and others are the destination. This invention provides a detailed definition of logical relationship nodes, determining the relationship between each graphical element node and its corresponding logical relationship node.
[0087] S302: Based on the relationship between each graphical element node and its corresponding logical relation node, associate at least one logical relation node with the corresponding graphical element node.
[0088] A graphic element can have multiple logical relationships with multiple other graphic elements, and two graphic elements can also have multiple logical relationships. The relationship between each graphic element node and its corresponding logical relationship node can be considered as the connection relationship between the graphic element node and its child node, where the child node is the logical relationship node corresponding to the graphic element node.
[0089] Another method to associate graphical element nodes with their child nodes through steps S301-S302 is to connect graphical element nodes and logical relationship nodes with the relationship after determining the relationship between graphical element nodes and logical relationship nodes, and to use logical relationship nodes as child nodes of the corresponding graphical element nodes. The tree diagram implemented by this method is simple and optimizes the structure of the tree diagram.
[0090] In one embodiment, such as Figure 2A As shown, Message1 (Message1) 203 is connected to Object1 (Object1) 201 and Actor1 (Actor1) 202 respectively. These three elements have a logical relationship: Object1 (Object1) 201 sends Message1 (Message1) 203, meaning Object1 (Object1) 201 is the sender; Actor1 (Actor1) 202 receives Message1 (Message1) 203, meaning Actor1 (Actor1) 202 is the receiver; and Message1 (Message1) 203 is the owner within the message itself. Therefore, it is possible to generate... Figure 2A The corresponding tree diagram is as follows Figure 6As shown, Figure 6 Another diagram for associating the child nodes with the graph element node. The top node is the timing diagram 600, and the child nodes of the top node are two top nodes, i.e., a first node graph element container 610 and a second node logical relation container 620. The child nodes of the first node graph element container 610 are an object 1 611, an actor 1 612, and a message 1 613, which are all graph element nodes. The child node of the second node logical relation container 620 is a message 1 relation 621, which is a logical relation node. After determining the relationship between the graph element node and the logical relation node, the logical relation node is associated with the corresponding graph element node in this relationship.
[0091] In an implementable manner, the child node of the object 1 611 is a message 1 relation 641, the connection relationship between the object 1 611 and the message 1 relation 642 is a sending end 632, the child node of the actor 1 612 is a message 1 relation 642, the connection relationship between the actor 1 612 and the message 1 relation 641 is a receiving end 631, and the child node of the message 1 613 is a message 1 relation 643. The connection relationship between the message 1 613 and the message 1 relation 641 is an owner 633. In addition, because the same element has the same UUID, for example, the UUID of the message 1 relation element is M1, it is convenient to trace the sending and receiving ends of the message subsequently or to determine the related message from the object or the actor.
[0092] In an optional embodiment, the graph element node includes an associated production element, and the specific steps of associating the production element include:
[0093] assigning a production element identifier to each production element.
[0094] storing the production element identifier in the corresponding graphical element node so as to trace back to the production element through the graphical element node of the associated production element.
[0095] The production element identifier is used to distinguish different production elements. SysML is oriented to system engineering, so various production elements in system engineering are associated in a SysML diagram. The embodiment of the present application assigns a respective identifier to each production element and stores the identifier in the corresponding graphical element node. The loose coupling manner of associating production elements does not affect the baseline of the production element and facilitates tracing back to the production element through the diagram.
[0096] In addition, the graphical element node in the tree diagram stores, in addition to the UUID of the associated production element, an element type and element internal information. The element type is, for example, the type of a message in a time sequence diagram, and the element internal information is, for example, internal conversion of a state element in a state machine diagram. It should be noted that the relationship element does not store any other information.
[0097] In an optional embodiment, the production element identifier is obtained through a universal unique identifier (UUID).
[0098] The UUID manner is used to distinguish the production elements, and the central control end is not required to specify identification information, thereby further optimizing the model.
[0099] In an optional embodiment, the top node stores all graphical information associated with the outer frame of the diagram.
[0100] The top node stores all graphical information, such as the positions of all graphical elements, all text information in the diagram, and all styles in the diagram, and the like. This is advantageous for quickly generating a diagram without traversing all graphical element nodes in the tree diagram.
[0101] Figure 7 A schematic diagram of an apparatus for storing a SysML diagram based on a tree diagram according to an embodiment of the present application.
[0102] According to the method embodiment described above, the embodiment of the present application provides an apparatus for storing a SysML diagram based on a tree diagram. The apparatus comprises:
[0103] The dividing module is configured to divide information in each SysML diagram into graphical element information, logical relationship information, and element attribute information. The graphical element information includes an outer frame of a diagram.
[0104] determining module, configured to generate a tree diagram for storing SysML diagram information according to the graphic element information, the logical relationship information and the element attribute information, wherein a top node of the tree diagram corresponds to the outer frame of the diagram, the top node is associated with a first node and a second node, the first node is used to associate a graphic element node, the second node is used to associate a logical relationship node, a child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, and each node in the tree diagram stores the element attribute information corresponding to the node.
[0105] In an optional embodiment, the child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, including:
[0106] determining a relationship between each graphic element node and the logical relationship node corresponding to the graphic element node, wherein each graphic element in the SysML diagram is associated with at least one logical relationship, and each graphic element associated with each logical relationship has a respective role.
[0107] generating a plurality of relationship nodes according to the relationship between each graphic element node and the logical relationship node corresponding to the graphic element node, the relationship nodes being nodes corresponding to the role of each graphic element in the corresponding logical relationship.
[0108] associating the relationship nodes as child nodes of the logical relationship nodes to the corresponding logical relationship nodes.
[0109] associating the relationship nodes or the logical relationship nodes to the corresponding graphic element nodes.
[0110] In an optional embodiment, the child node of the graphic element node is determined according to the logical relationship node corresponding to the graphic element node, including:
[0111] determining a relationship between each graphic element node and the logical relationship node corresponding to the graphic element node, wherein each graphic element in the SysML diagram is associated with at least one logical relationship, and each graphic element associated with each logical relationship has a respective role.
[0112] associating at least one logical relationship node to the corresponding graphic element node according to the relationship between each graphic element node and the logical relationship node corresponding to the graphic element node.
[0113] In an optional embodiment, the graphic element node includes a graphic element node associated with a production element, and the specific steps of associating the production element include:
[0114] assigning a production element identifier to each production element.
[0115] The production element identifier is stored in the corresponding graphic element node, so as to trace back to the production element through the graphic element node of the associated production element.
[0116] In an optional embodiment, the production element identifier is obtained by a universally unique identifier (UUID) method.
[0117] In an optional embodiment, the top node stores all graphic information associated with the corresponding graphic frame.
[0118] In an optional embodiment, each node of the tree diagram has a node identifier, which is obtained by a UUID method.
[0119] The system and device embodiments correspond to the system embodiment, and have the same technical effects as the method embodiment. For specific descriptions, refer to the method embodiment. The device embodiment is based on the method embodiment, and specific descriptions can be found in the method embodiment section, which will not be repeated here. Those skilled in the art can understand that the accompanying drawings are only schematic diagrams of an embodiment, and the modules or processes in the accompanying drawings are not necessarily required to implement the present application.
[0120] Those skilled in the art can understand that the modules in the device in the embodiments can be distributed in the device in the embodiments as described in the embodiments, or can be located in one or more devices different from the embodiments. The modules in the above embodiments can be combined into one module, or can be further split into multiple sub-modules.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for implementing SysML diagrams, characterized in that, The method includes: The information in each SysML diagram is divided into graphic element information, logical relationship information, and element attribute information, wherein the graphic element information includes the diagram outline; Based on the graphical element information, the logical relationship information, and the element attribute information, a tree diagram for storing SysML graph information is generated. The top node of the tree diagram corresponds to the graph outline. The top node is associated with a first node and a second node. The first node is used to associate graphical element nodes, and the second node is used to associate logical relationship nodes. The child nodes of the graphical element nodes are determined according to the logical relationship nodes corresponding to the graphical element nodes. Each node in the tree diagram stores the element attribute information corresponding to that node. The child nodes of the graphic element node are determined based on the logical relationship node corresponding to the graphic element node, including: Determine the relationship between each graphical element node and its corresponding logical relation node. In the SysML graph, each graphical element is associated with at least one logical relation. For each logical relation, each graphical element associated with it has its own role. Based on the relationship between each graphical element node and its corresponding logical relationship node, multiple relationship nodes are generated, wherein the relationship node is the node corresponding to the role of each graphical element in its corresponding logical relationship; Associate the relation node as a child node of the logical relation node with the corresponding logical relation node; Associate the relationship node or the logical relationship node with the corresponding graphical element node.
2. The method as described in claim 1, characterized in that, The child nodes of the graphic element node are determined based on the logical relationship node corresponding to the graphic element node, including: Determine the relationship between each graphical element node and its corresponding logical relation node. In the SysML graph, each graphical element is associated with at least one logical relation. For each logical relation, each graphical element associated with it has its own role. Based on the relationship between each graphical element node and its corresponding logical relation node, associate at least one logical relation node with the corresponding graphical element node.
3. The method as described in claim 1, characterized in that, The graphical element nodes include graphical element nodes associated with production elements, and the associated production elements include: Assign a production element identifier to each production element; The production element identifier is stored in the corresponding graphic element node so that the production element can be traced through the graphic element node associated with the production element.
4. The method as described in claim 3, characterized in that, The production element identifier is obtained through a universally unique identifier (UUID).
5. The method as described in claim 1, characterized in that, The top node stores all graphical information associated with the corresponding outer frame of the graph.
6. The method according to any one of claims 1 to 5, characterized in that, Each node in the tree diagram has a node identifier, which is obtained using a UUID.
7. A device based on SysML graph, a tree-graph storage system modeling language, characterized in that, The device includes: The partitioning module is used to divide the information in each SysML diagram into graphic element information, logical relationship information, and element attribute information, wherein the graphic element information includes the diagram outline; The determining module is used to generate a tree diagram for storing SysML diagram information based on the graphical element information, the logical relationship information, and the element attribute information. The top node of the tree diagram corresponds to the diagram outline. The top node is associated with a first node and a second node. The first node is used to associate with graphical element nodes, and the second node is used to associate with logical relationship nodes. The child nodes of the graphical element nodes are determined according to the logical relationship nodes corresponding to the graphical element nodes. Each node in the tree diagram stores the element attribute information corresponding to that node. The child nodes of the graphic element node are determined based on the logical relationship node corresponding to the graphic element node, including: Determine the relationship between each graphical element node and its corresponding logical relation node. In the SysML graph, each graphical element is associated with at least one logical relation. For each logical relation, each graphical element associated with it has its own role. Based on the relationship between each graphical element node and its corresponding logical relationship node, multiple relationship nodes are generated. The relationship node is the node corresponding to the role of each graphical element in its corresponding logical relationship. Associate the relation node as a child node of the logical relation node with the corresponding logical relation node; Associate the relationship node or the logical relationship node with the corresponding graphical element node.
8. The apparatus as claimed in claim 7, characterized in that, The child nodes of the graphic element node are determined based on the logical relationship node corresponding to the graphic element node, including: Determine the relationship between each graphical element node and its corresponding logical relation node. In the SysML graph, each graphical element is associated with at least one logical relation. For each logical relation, each graphical element associated with it has its own role. Based on the relationship between each graphical element node and its corresponding logical relation node, associate at least one logical relation node with the corresponding graphical element node.
Citation Information
Patent Citations
Tree diagram rendering method and device, equipment and medium
CN110489618A
Model element visual expression method for MBSE graphic modeling software
CN111459472A