CN113204335A - UML model merging and consistency detection method and system for collaborative modeling - Google Patents

UML model merging and consistency detection method and system for collaborative modeling Download PDF

Info

Publication number
CN113204335A
CN113204335A CN202110424538.5A CN202110424538A CN113204335A CN 113204335 A CN113204335 A CN 113204335A CN 202110424538 A CN202110424538 A CN 202110424538A CN 113204335 A CN113204335 A CN 113204335A
Authority
CN
China
Prior art keywords
model
consistency
uml
updating
collaborative
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110424538.5A
Other languages
Chinese (zh)
Other versions
CN113204335B (en
Inventor
庄毅
许伟
叶彤
顾晶晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Aeronautics and Astronautics
Original Assignee
Nanjing University of Aeronautics and Astronautics
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Aeronautics and Astronautics filed Critical Nanjing University of Aeronautics and Astronautics
Priority to CN202110424538.5A priority Critical patent/CN113204335B/en
Priority claimed from CN202110424538.5A external-priority patent/CN113204335B/en
Publication of CN113204335A publication Critical patent/CN113204335A/en
Application granted granted Critical
Publication of CN113204335B publication Critical patent/CN113204335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a UML model merging and consistency detection method and system for collaborative modeling, and belongs to the field of software engineering. The method comprises the following steps: according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements; a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and the model version is updated through state conversion; detecting versions of the model and the document according to a model updating and consistency detecting method, if the new version of the model appears, updating the model, and detecting consistency of the model; and storing and updating the models and the documents of the various versions. The invention provides a simple and feasible model merging and consistency detection method for the collaborative research and development of large-scale software, the method has high accuracy and high efficiency, and an effective method is provided for the collaborative research and development of large-scale software and the automatic generation of codes.

Description

UML model merging and consistency detection method and system for collaborative modeling
Technical Field
The invention belongs to the field of collaborative modeling in software engineering, and particularly relates to a UML model merging and consistency detection method and system for collaborative modeling.
Background
With the rapid development of distributed software collaborative development and agile development technologies, methods of collaboration, communication and coordination among members of a software development team become more and more important. Particularly, the epidemic situation of the novel coronavirus in recent years causes that a plurality of large enterprises can only carry out remote office work, and workers at different positions and positions in different places work cooperatively on the internet, so that the remote cooperative work mode based on the internet is more and more concerned and more emphasized by people. This requires continuous exploration of the technology in the fields of software collaborative modeling, collaborative research and development, collaborative deployment, and the like.
The software collaborative modeling refers to a process that multiple subjects communicate with each other and collaborate together to complete the whole software modeling by means of a network technology. Through a visual collaborative modeling tool, different research and development personnel can model and update the partial models responsible for the research and development personnel, and form a software global model through view association. In recent years, many researchers have studied collaborative modeling of software. For example, Nicolaescu P et al in the united states propose a collaborative modeling method to reduce the gap between the collaborative mechanism and the conceptual model by modeling in a near real-time shared editing environment. Debreceni C et al, Hungary, propose a collaborative model that can guarantee certain correctness constraints, adapt to online scenarios through dynamic change propagation, and integrate into existing version control systems to support offline scenarios. Huangping et al, university of east China, proposed a collaborative modeling method based on SysML/MARTE, which realizes modeling of a complex system from different perspectives, including the structure, behavior, clock constraints and non-functional attributes NFP, etc. of the system. The Zhang Xiao et al of the university of Guangxi has developed a collaborative modeling software, which realizes the functions of cloud database storage and multi-person collaborative modeling and verification. Although some research works in the collaborative modeling aspect exist at present, the research works focus on the implementation of collaborative modeling tools, and how to improve the combinability of software models is still a main problem to be solved urgently in the field of software collaborative modeling.
In the process of software model collaborative modeling, the situation of inconsistent semantics such as model elements is inevitable, for example, people such as Famelis M in Spain use an attribute locking method to carry out more effective locking, and the semantics of modeling language is proposed to avoid the introduction of model update which may cause inconsistency by users. Koshima et al, at the university of namul, developed a collaborative model editing tool DicoMEF, however this tool can only detect conflicts at low granularity levels. Suny é et al, France, states that the above collaborative modeling tools use a centralized architecture based on a version control system, model updates in an asynchronous manner, proposes a synchronous collaborative framework based on a peer-to-peer architecture, and uses a consistency algorithm for synchronous model updates.
Collaborative model driven Software Engineering (CSE) is a rapidly developing field, with the popularization of the internet and the perfection of the application of enterprise networks, some tools supporting Collaborative Software Engineering have appeared, such as group collaboration management, Collaborative writing, and the like. The development of collaborative software engineering extends the traditional software engineering and requires research on the cooperativity in the distributed team collaboration. The collaborative model drives the software engineering to pay more and more attention in academia and practice, the use of the collaborative method in the software engineering improves the software development efficiency to a great extent, a target software system can be constructed by cooperation of multiple persons through a flexible collaborative mode, and the update of a software version is realized through partial code replacement. However, most of the collaboration methods in current software engineering are concentrated on the code level of engineering implementation, and a collaboration method for modeling a system in a model design stage is lacked. The model is more complex than a plain text, the data structure of the interconnected elements is richer, a plurality of information contained in the model can be lost by using the traditional version control system to carry out model version control, and the problems of inconsistent grammar and semantics and the like can occur in the merging process of the model.
Disclosure of Invention
The invention aims to solve the problems in the prior art, provides a simple and feasible model merging and detecting method for the collaborative research and development of large-scale software, and provides an effective technical approach for the collaborative research and development of large-scale software and the automatic generation of codes.
The technical solution for realizing the purpose of the invention is as follows: a UML model merging and consistency detection method oriented to collaborative modeling comprises the following steps:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
Further, the set of UML model operations in step 1 is represented as the following triplets:
Modeloperate=(Add,Delege,Modify) (1)
in the formula, Add (element, type) represents an Add operation, and includes two parameters, that is, a new model element is added, and the type is type; delete represents a Delete operation, namely deleting an existing model element with type; modify (element, feature, v)0,vn) Representing a modification operation, comprising four parameters, i.e. the value of the feature of the model element from v0Modified as vn(ii) a The identifiers of the above three operations are all model element elements.
Further, the step 2 of using the model state space search method to generate the state space incrementally when searching the next state and update the model version through state transition specifically includes:
defining a new model: model from original ModeloldModel evolved into new ModelnewThe process in between is a sequence of operations, denoted as set Δ ═ Δ1,Δ2,...,Δn}, thereby defining the new model as:
Modelnew=Modelold+Θ (2)
in the formula, Θ represents the difference between the two model version operation sequence sets Δ, and the inverse of the difference Θ is denoted as
Figure BDA0003029320930000033
Represents a set of series of operations as opposed to Θ;
step 2-1, defining a preliminary merging model based on the UML model operation set and corresponding model elements:
given n sets of collision-free operation sequences { Δ }1,Δ2,...,ΔnH.using conf (. DELTA.. delta.)i,Δj) Represents a set ΔiAnd deltajSet of operations with conflict in, using nonconf (Δ)i,Δj) Represents a set ΔiAnd deltajA conflict-free operation set, i, j ═ 1,2, ·, n; let the common original Model be a Model, and go through n operation sequence sets { delta [ delta ])1,Δ2,...,ΔnGeneration of Model revision Model1,Model2,...,ModelnModel for preliminary merging of n modelsinComprises the following steps:
Modelin=Model+(Δ′12∪Δ′21∪...∪Δ′1n∪Δ′n1) (3)
in formula (II), delta'1n=nonconf(Δ1,Δn),Δ′n1=nonconf(Δn,Δ1),Δ′1nRepresents a set Δ1And deltanOf no conflict operation set, Δ'n1Represents a set ΔnAnd delta1A conflict-free set of operations; the operator "+" represents the application of a series of sets of operations to the original Model, i.e., using the triple Model in equation (1)operateAdding, deleting and modifying the model;
step 2-2, Model is merged preliminarilyinSet of included operation sequences ΔstasAnd canBy assembling Δ by sequence of operationsavailAre all initialized to be empty sets
Figure BDA0003029320930000031
Namely, it is
Figure BDA0003029320930000032
Step 2-3, judging whether the inconsistency list S.incostencies is an empty set, if not, executing the step 2-4 and the step 2-5, otherwise, jumping to the step 2-6;
step 2-4, deleting the first conflicted operation sequence set in the S.incognitions, and marking as S.incognitions: for each set l of operation sequences remaining in the list, checking whether l belongs to s.inconsistence, and removing l that is not satisfied from the list;
step 2-5, the available operation sequence set deltaavailUpdating:
Figure BDA0003029320930000043
where locn (a) represents the current state bit information of operation a, ΔrepairRepresenting the set of repair operations, Δ, obtained during the preliminary mergingpThe operation sequence set comprises the current operation and the inheritance state bit applying the operation and is used for representing the path from the initial state S to the inheritance state S';
steps 2-6, operate Δ 'for each of a set of available sequences of operations'iIf Δ'iBelonging to a conflict-free set, then a set of operation sequences is subjected tostaAnd s, updating:
Δstas:=Δstas∪{(S′,Δ′i)},S′=S+Δ′i (5)
repeating the steps until each operation in the available operation sequence set is traversed;
step 2-7, according to the ratio of ≤ and
Figure BDA0003029320930000041
sequencing the operation sequence set; wherein ≦ belongs to partial ordering in the incomplete ordering,
Figure BDA0003029320930000042
it is in strong partial order.
Further, the step 3 of detecting versions of the model and the document according to the model update and consistency detection method, updating the model if the new version of the model appears, and performing consistency detection on the model specifically includes:
step 3-1, Client side is processed according to formulas (2) to (3)iLocal UML Model on topijUpdating to obtain ModelijAnd performing local updates; wherein i is more than or equal to 1 and less than or equal to m, j is more than or equal to 1 and less than or equal to p, m is the total number of local modeling client i participating in collaborative modeling, and p is the total number of all client j having a direct collaborative relationship with the current client i;
step 3-2, Client sideiUploading the updated local UML Model to a Model merging Server, and generating a Model 'by the Server'ijAnd updating ClientiMsg ═ { Clienti, Model'ijAnd broadcast to ClientiAll clients with direct collaborative relationship1...Clientj};
Step 3-3, each Client receiving the update messageiChecking the Model of the clientijWhether or not to Model'ijIf the model is consistent with the state space search method in the step 2, performing conflict processing according to the state space search method in the step 2, and uploading the updated model to a Server;
step 3-4, the Server receives the ClientiAfter the sent updated model is sent, the step 3-2 and the step 3-3 are repeatedly executed to realize the updating with the ClientiThe method comprises the steps that a model consistency detection and updating operation with a direct collaborative relationship is carried out, and a Server records an updated model;
step 3-5, all Model and ModelijModels with direct or indirect synergistic relationships have all been betterAfter updating, the updated local UML is subjected to conflict processing according to the steps 2-1 to 2-7, and whether the operation sequence set subjected to conflict processing meets the consistency constraint C or not is judged1To C3If not, feeding back error information to a corresponding client, otherwise, receiving an updated global UML model; wherein C is1Matching rules representing operation names, C2Matching rules representing sequence diagrams and state diagrams, C3Representing a consistency constraint on inheritance relationships.
Further, the method further comprises:
and 4, storing data of each updated model and each updated document.
A collaborative modeling oriented UML model merging and consistency detection system, the system comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for creating a UML model operation set and corresponding model elements according to consistency constraint and combination rules in collaborative modeling;
the second module is used for generating a state space in an increment mode when searching the next state by adopting a model state space searching method and updating the model version through state conversion;
and the third module is used for detecting the versions of the model and the document according to the model updating and consistency detecting method, updating the model if the new version of the model appears, and detecting the consistency of the model.
Further, the system further comprises:
and the fourth module is used for storing data of each updated model and each updated document.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
Compared with the prior art, the invention has the following remarkable advantages: 1) mapping the model merging process to corresponding operation semantics by using a symbolic model state space searching method so as to update the model version, thereby reducing the probability of generating conflict in the model merging process; 2) by using a model updating and consistency detecting method and scheduling the process of collaborative modeling of a plurality of clients, the collaborative modeling and collaborative development efficiency is remarkably improved; 3) and the model version and the document data are stored by using the collaboration server, so that the integrity of the data is ensured.
The present invention is described in further detail below with reference to the attached drawing figures.
Drawings
Fig. 1 is a flowchart of a method for merging and consistency detection of a UML model oriented to collaborative modeling according to the present invention.
Fig. 2 is a frame diagram of the UML model merging and consistency detection method for collaborative modeling according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that if the description of "first", "second", etc. is provided in the embodiment of the present invention, the description of "first", "second", etc. is only for descriptive purposes and is not to be construed as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions in the embodiments can be combined with each other, but must be based on the realization of the technical solutions by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent, and is not within the protection scope of the present invention
In order to improve combinability of models, integrity of model combination and consistency of model updating, the invention takes cooperative modeling of control system software as a research object, provides a UML model combination and consistency detection method facing cooperative modeling, establishes a corresponding frame and provides a model combination rule and a model combination method; a model state space searching method and a model updating and consistency detecting method are provided. The method is suitable for collaborative modeling of software, and provides an effective method for solving the problems of model merging, model updating and consistency detection in collaborative modeling and research and development of software. The method can be applied to model merging and updating in collaborative modeling.
In one embodiment, in conjunction with fig. 1 and fig. 2, a method for merging and consistency detection of UML models oriented to collaborative modeling is provided, the method comprising the following steps:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
Further, in one embodiment, the software model is generally composed of a set of model elements, which is a set of multi-tuple records that should contain: a generic unique identifier, a data type, and zero or more named structural features, the values of which may be base types or references to other model elements. The set of UML model operations in step 1 is represented as the following triplets:
Modeloperate=<Add,Delete,Modify> (6)
in the formula, Add (element, type) represents an Add operation, and includes two parameters, that is, a new model element is added, and the type is type; delete represents a Delete operation, namely deleting an existing model element with type; modify (element, feature, v)0,vn) Representing a modification operation, comprising four parameters, i.e. the value of the feature of the model element from v0Modified as vn(ii) a The identifiers of the above three operations are all model element elements.
If the operation is recorded as a, the inverse operation of a can be recorded as
Figure BDA0003029320930000084
The Add operation Add (element, type) and the Delete operation Delete (element, type) are inverse operations to each other; the inverse of the Modify operation can be denoted as Modify (element, feature, v)n,v0)。
Further, in one embodiment, the step 2 of using the model state space search method to generate the state space incrementally when searching for the next state and update the model version through state transition specifically includes:
defining a new model: model from original ModeloldModel evolved into new ModelnewThe process in between is a sequence of operations, denoted as set Δ ═ Δ1,Δ2,...,Δn}, thereby defining the new model as:
Modelnew=Modelold+Θ (7)
in the formula, Θ represents the difference between the two model version operation sequence sets Δ, and the inverse of the difference Θ is denoted as
Figure BDA0003029320930000085
Represents a set of series of operations as opposed to Θ;
after the positive and negative operation sets are simultaneously acted on the model, the model is kept unchanged, namely:
Figure BDA0003029320930000081
Figure BDA0003029320930000082
the inversion of the operation sequence in (1) replaces each operation a with its inverse
Figure BDA0003029320930000083
When two or more operation sets Δ from different versions1And Δ2When applied to the same model, e.g., their common original model, conflicts may arise due to conflicting change operations. E.g. at1In which a Modify operation is performed at2The Delete operation is executed to generate Delete-Modify conflict; when the same model is modified in a different way of operation, i.e. by performing a modification in Δ 10,vm) Operation at Δ2In the execution of Modify (element, feature, v)0,vn) The operation will generate a Modify-Modify conflict;
state space search is a process of traversing conflicts that arise during model merging, where each in the search spaceThe states represent a model to be merged. Using an initial state MiRepresenting a preliminary merging model. The models that are merged in the target state are consistent and in order to reach the target state, the search may need to go through several intermediate states that may contain inconsistencies. All conflicts are recorded using an inconsistency list named NPI, each state S being associated with the NPI list S. incosinestationies and the NPI list S. incosinestationy of the selective repair in the merge model.
Set operation A of two conflict-free operation sets1And A2,A1≤A2Is represented by A1In preference to A2If and only if the following equation is satisfied:
Figure BDA0003029320930000091
where ≦ is an incomplete ordering reflecting the difference between the conflicting and non-conflicting sets of operations. The significance of this is that a scheme will be prioritized if it has fewer non-conflicting operations or more conflicting operations, even if no conflict actually arises. It is obvious that A1≤A2Is not meant to imply
Figure BDA0003029320930000092
Therefore, a higher priority ranking is used as follows to indicate A1Is A2A subset of (a).
Set operation A of two conflict-free operation sets1And A2
Figure BDA0003029320930000093
If and only if the following equation is satisfied:
Figure BDA0003029320930000094
wherein
Figure BDA0003029320930000095
Can deduce
Figure BDA0003029320930000096
But the opposite is not true because conflicting operations may occur.
In this approach, the state space is implicit, and by being incrementally generated when searching for the next state, a key component of the search is searching for the next state from a given state. According to this model state space search method should follow the following steps:
step 2-1, defining a preliminary merging model based on the UML model operation set and corresponding model elements:
given n sets of collision-free operation sequences { Δ }1,Δ2,...,ΔnH.using conf (. DELTA.. delta.)i,Δj) Represents a set ΔiAnd deltajSet of operations with conflict in, using nonconf (Δ)i,Δj) Represents a set ΔiAnd deltajA conflict-free operation set, i, j ═ 1,2, ·, n; let the common original Model be a Model, and go through n operation sequence sets { delta [ delta ])1,Δ2,...,ΔnGeneration of Model revision Model1,Model2,...,ModelnModel for preliminary merging of n modelsinComprises the following steps:
Modelin=Model+(Δ′12∪Δ′21∪...∪Δ′1n∪Δ′n1) (11)
in formula (II), delta'1n=nonconf(Δ1,Δn),Δ′n1=nonconf(Δn,Δ1),Δ′1nRepresents a set Δ1And deltanOf no conflict operation set, Δ'n1Represents a set ΔnAnd delta1A conflict-free set of operations; the operator "+" represents the application of a series of sets of operations to the original Model, i.e., using the triple Model in equation (1)operateAdding, deleting and modifying the model;
step 2-2, Model is merged preliminarilyinIncluding operationsMake a set of sequences ΔstasAnd set of available operation sequences ΔavailAre all initialized to be empty sets
Figure BDA0003029320930000097
Namely, it is
Figure BDA0003029320930000098
Step 2-3, judging whether the inconsistency list S.incostencies is an empty set, if not, executing the step 2-4 and the step 2-5, otherwise, jumping to the step 2-6;
step 2-4, deleting the first conflicted operation sequence set in the S.inco sustencies, and marking as S.inconsistency: for each set l of operation sequences remaining in the list, checking whether l belongs to s.inconsistence, and removing l that is not satisfied from the list;
step 2-5, the available operation sequence set deltaavailUpdating:
Figure BDA0003029320930000101
where locn (a) represents the current state bit information of operation a, ΔrepairRepresenting the set of repair operations, Δ, obtained during the preliminary mergingPThe operation sequence set comprises the current operation and the inheritance state bit applying the operation and is used for representing the path from the initial state S to the inheritance state S';
steps 2-6, operate Δ 'for each of a set of available sequences of operations'iIf Δ'iBelonging to a conflict-free set, then a set of operation sequences is subjected tostasUpdating:
Δstas:=Δstas∪{(S′,Δ′i)},S′=S+Δ′i (13)
repeating the steps until each operation in the available operation sequence set is traversed;
step 2-7, according to the ratio of ≤ and
Figure BDA0003029320930000102
sequencing the operation sequence set; wherein ≦ belongs to partial ordering in the incomplete ordering,
Figure BDA0003029320930000103
it is in strong partial order.
Further, in one embodiment, model consistency is a relationship between multiple local UML models. Consistency among multiple local UML models with a collaborative relationship refers to a problem of consistency among UML models of different versions of the same software. Generally, the consistency problem is caused by model conflict and division during version update, wherein the model conflict causes differences in the content or actual meaning of different versions, and the model division causes different abstraction levels of a plurality of models with different versions and a collaborative relationship, so that the consistency problem between the models is generated.
Model updates for UML software co-modeling, i.e. version updates of local UML models, may result in version updates of global models. At this time, different versions of the UML local model may have consistency problems between models due to having different abstraction levels. The consistency detection algorithm aims to ensure that all models related to local models participating in updating are in the same abstraction level, so that the consistency of global models is ensured.
In order to ensure consistency in the model updating process, step 3 comprises the following steps:
step 3-1, Client side is executed according to the formulas (7) and (11)iLocal UML Model on topijIs updated to obtain Model'ijAnd performing local updates; wherein i is more than or equal to 1 and less than or equal to m, j is more than or equal to 1 and less than or equal to p, m is the total number of local modeling client i participating in collaborative modeling, and p is the total number of all client j having a direct collaborative relationship with the current client i;
step 3-2, Client sideiUploading the updated local UML Model to a Model merging Server, and generating a Model 'by the Server'ijAnd updating ClientiMsg ═ Client informationi,Model′ijAnd broadcast to ClientiAll clients with direct collaborative relationship1...Clientj};
Step 3-3, each Client receiving the update messageiChecking local UML Model of the clientijWhether or not to Model'ijIf the model is consistent with the state space search method in the step 2, performing conflict processing according to the state space search method in the step 2, and uploading the updated model to a Server;
step 3-4, the Server receives the ClientiAfter the sent updated model is sent, the step 3-2 and the step 3-3 are repeatedly executed to realize the updating with the ClientiThe method comprises the steps that a model consistency detection and updating operation with a direct collaborative relationship is carried out, and a Server records an updated model;
step 3-5, all Model and ModelijAfter the models with the direct or indirect cooperative relationship are updated, performing conflict processing on the updated local UML according to the steps 2-1 to 2-7, and judging whether the operation sequence set subjected to conflict processing conforms to the consistency constraint C1To C3If not, feeding back error information to a corresponding client, otherwise, receiving an updated global UML model; as shown in Table 1 below, C1Matching rules representing operation names, C2Matching rules representing sequence diagrams and state diagrams, C3Representing a consistency constraint on inheritance relationships.
Table 1 consistency constraint list
Figure BDA0003029320930000111
Figure BDA0003029320930000121
Further, in one embodiment, the method further comprises:
and 4, storing data of each updated model and each updated document.
In one embodiment, a collaborative modeling-oriented UML model merging and consistency detection system is provided, the system comprising:
the system comprises a first module, a second module and a third module, wherein the first module is used for creating a UML model operation set and corresponding model elements according to consistency constraint and combination rules in collaborative modeling;
the second module is used for generating a state space in an increment mode when searching the next state by adopting a model state space searching method and updating the model version through state conversion;
and the third module is used for detecting the versions of the model and the document according to the model updating and consistency detecting method, updating the model if the new version of the model appears, and detecting the consistency of the model.
Further, in one embodiment, the system further comprises:
and the fourth module is used for storing data of each updated model and each updated document.
For specific limitations of the cooperation-modeling-oriented UML model merging and consistency detection system, reference may be made to the above limitations on the cooperation-modeling-oriented UML model merging and consistency detection method, and details are not repeated here. The modules in the above-mentioned UML model merging and consistency detection system oriented to collaborative modeling may be implemented wholly or partially by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
Further, in one embodiment, the processor, when executing the computer program, further performs the following steps:
and 4, storing data of each updated model and each updated document.
For specific definition of each step, see the above definition of the UML model merging and consistency detection method for collaborative modeling, which is not described herein again.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
Further, in one embodiment, the computer program when executed by the processor further performs the steps of:
and 4, storing data of each updated model and each updated document.
For specific definition of each step, see the above definition of the UML model merging and consistency detection method for collaborative modeling, which is not described herein again.
The invention provides a simple and feasible model merging and consistency detection method for the collaborative research and development of large-scale software, the method has high accuracy and high efficiency, and an effective method is provided for the collaborative research and development of large-scale software and the automatic generation of codes.
The foregoing illustrates and describes the principles, general features, and advantages of the present invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (9)

1. A UML model merging and consistency detection method for collaborative modeling is characterized by comprising the following steps:
step 1, according to consistency constraint and combination rule in collaborative modeling, establishing a UML model operation set and corresponding model elements;
step 2, a model state space searching method is adopted, a state space is generated in an incremental mode when the next state is searched, and model versions are updated through state conversion;
and 3, detecting the versions of the model and the document according to a model updating and consistency detecting method, updating the model if the model has a new version, and detecting the consistency of the model.
2. The method for merging and consistency-detecting UML models oriented to collaborative modeling according to claim 1, wherein the operation set of the UML models in step 1 is represented as the following triplets:
Modeloperate=(Add,Delete,Modify) (1)
in the formula, Add (element, type) represents an Add operation, and includes two parameters, that is, a new model element is added, and the type is type; delete represents a Delete operation, i.e. deleting a currentSome model elements are of type; modify (element, feature, v)0,vn) Representing a modification operation, comprising four parameters, i.e. the value of the feature of the model element from v0Modified as vn(ii) a The identifiers of the above three operations are all model element elements.
3. The method for merging and consistency detection of UML models oriented to collaborative modeling according to claim 2, wherein the step 2 employs a model state space search method, incrementally generates a state space when searching for a next state, and updates a model version through state transition, and specifically includes:
defining a new model: model from original ModeloldModel evolved into new ModelnewThe process in between is a sequence of operations, denoted as set Δ ═ Δ1,Δ2,...,Δn}, thereby defining the new model as:
Modelnew=Modelold+Θ (2)
in the formula, Θ represents the difference between the two model version operation sequence sets Δ, and the inverse of the difference Θ is denoted as
Figure FDA0003029320920000011
Represents a set of series of operations as opposed to Θ;
step 2-1, defining a preliminary merging model based on the UML model operation set and corresponding model elements:
given n sets of collision-free operation sequences { Δ }1,Δ2,...,ΔnH.using conf (. DELTA.. delta.)i,Δj) Represents a set ΔiAnd deltajSet of operations with conflict in, using nonconf (Δ)i,Δj) Represents a set ΔiAnd deltajA conflict-free operation set, i, j ═ 1,2, ·, n; let the common original Model be a Model, and go through n operation sequence sets { delta [ delta ])1,Δ2,...,ΔnGeneration of Model revision Model1,Model2,...,ModelnModel for preliminary merging of n modelsinComprises the following steps:
Modelin=Model+(Δ′12∪Δ′21∪...∪Δ′1n∪Δ′n1) (3)
in formula (II), delta'1n=nonconf(Δ1,Δn),Δ′n1=nonconf(Δn,Δ1),Δ′1nRepresents a set Δ1And deltanOf no conflict operation set, Δ'n1Represents a set ΔnAnd delta1A conflict-free set of operations; the operator "+" represents the application of a series of sets of operations to the original Model, i.e., using the triple Model in equation (1)operateAdding, deleting and modifying the model;
step 2-2, Model is merged preliminarilyinSet of included operation sequences ΔstasAnd set of available operation sequences Δavail(the sets represent operation conflict-free) are all initialized to the empty set
Figure FDA0003029320920000021
Namely, it is
Figure FDA0003029320920000022
Step 2-3, judging whether the inconsistency list S.incostencies is an empty set, if not, executing the step 2-4 and the step 2-5, otherwise, jumping to the step 2-6;
step 2-4, deleting the first conflicted operation sequence set in the S.incognitions, and marking as S.incognitions: (ii) s.inconsistence.rernoveffirst () and for each set l of operation sequences remaining in the list, checking whether l is satisfied for s.inconsistence, removing l that is not satisfied from the list;
step 2-5, the available operation sequence set deltaavailUpdating:
Figure FDA0003029320920000023
where locn (a) represents the current state bit information of operation α, ΔrepairRepresenting the set of repair operations, Δ, obtained during the preliminary mergingPThe operation sequence set comprises the current operation and the inheritance state bit applying the operation and is used for representing the path from the initial state S to the inheritance state S';
steps 2-6, operate Δ 'for each of a set of available sequences of operations'iIf Δ'iBelonging to a conflict-free set, then a set of operation sequences is subjected tostasUpdating:
Δstas:=Δstas∪{(S′,Δ′i)},S′=S+Δ′i (5)
repeating the steps until each operation in the available operation sequence set is traversed;
step 2-7, according to
Figure FDA0003029320920000033
And
Figure FDA0003029320920000031
sequencing the operation sequence set; wherein
Figure FDA0003029320920000034
Belonging to a partial order in the incomplete ordering,
Figure FDA0003029320920000032
it is in strong partial order.
4. The method for merging and consistency detection of a UML model oriented to collaborative modeling according to claim 3, wherein the step 3 detects versions of the model and the document according to a model update and consistency detection method, updates the model if a new version of the model occurs, and detects consistency of the model, and specifically includes:
step 3-1, Client side is processed according to formulas (2) to (3)iOffice ofPartial UML ModelijIs updated to obtain Model'ijAnd performing local updates; wherein i is more than or equal to 1 and less than or equal to m, j is more than or equal to 1 and less than or equal to p, m is the total number of local modeling client i participating in collaborative modeling, and p is the total number of all client j having a direct collaborative relationship with the current client i;
step 3-2, Client sideiUploading the updated local UML Model to a Model merging Server, and generating a Model 'by the Server'ijAnd updating ClientiMsg ═ { client ═ informationi,Model′ijAnd broadcast to ClientiAll clients with direct collaborative relationships1...clientj};
Step 3-3, each Client receiving the update messageiChecking the Model of the clientijWhether or not to Model'ijIf the model is consistent with the state space search method in the step 2, performing conflict processing according to the state space search method in the step 2, and uploading the updated model to a Server;
step 3-4, the Server receives the ClientiAfter the sent updated model is sent, the step 3-2 and the step 3-3 are repeatedly executed to realize the updating with the ClientiThe method comprises the steps that a model consistency detection and updating operation with a direct collaborative relationship is carried out, and a Server records an updated model;
step 3-5, all Model and ModelijAfter the models with the direct or indirect cooperative relationship are updated, performing conflict processing on the updated local UML according to the steps 2-1 to 2-7, and judging whether the operation sequence set subjected to conflict processing conforms to the consistency constraint C1To C3If not, feeding back error information to a corresponding client, otherwise, receiving an updated global UML model; wherein C is1Matching rules representing operation names, C2Matching rules representing sequence diagrams and state diagrams, C3Representing a consistency constraint on inheritance relationships.
5. The UML model merging and consistency detection method for collaborative modeling according to claim 4, further comprising:
and 4, storing data of each updated model and each updated document.
6. Collaborative modeling-oriented UML model merging and consistency detection system implementing the method of any of claims 1 to 5, characterized in that it comprises:
the system comprises a first module, a second module and a third module, wherein the first module is used for creating a UML model operation set and corresponding model elements according to consistency constraint and combination rules in collaborative modeling;
the second module is used for generating a state space in an increment mode when searching the next state by adopting a model state space searching method and updating the model version through state conversion;
and the third module is used for detecting the versions of the model and the document according to the model updating and consistency detecting method, updating the model if the new version of the model appears, and detecting the consistency of the model.
7. The system for merging and consistency-testing UML models oriented to collaborative modeling according to claim 6, further comprising:
and the fourth module is used for storing data of each updated model and each updated document.
8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 5 are implemented when the computer program is executed by the processor.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202110424538.5A 2021-04-20 UML model merging and consistency detection method and system oriented to collaborative modeling Active CN113204335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110424538.5A CN113204335B (en) 2021-04-20 UML model merging and consistency detection method and system oriented to collaborative modeling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110424538.5A CN113204335B (en) 2021-04-20 UML model merging and consistency detection method and system oriented to collaborative modeling

Publications (2)

Publication Number Publication Date
CN113204335A true CN113204335A (en) 2021-08-03
CN113204335B CN113204335B (en) 2024-05-17

Family

ID=

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114091270A (en) * 2021-11-25 2022-02-25 西南交通大学 Manufacturing equipment resource access method for cloud production line virtual recombination
CN114564293A (en) * 2022-03-02 2022-05-31 北京大学 Large-scale online service system change scheduling method and system based on constraint detection and conflict resolution

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457747A (en) * 2019-07-02 2019-11-15 浙江工业大学 A kind of network control system synergy emulation method based on NS3 and MATLAB
US20200108203A1 (en) * 2018-10-05 2020-04-09 Arizona Board Of Regents On Behalf Of Arizona State University Systems, methods, and apparatuses for utilizing co-simulation of a physical model and a self-adaptive predictive controller using hybrid automata

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200108203A1 (en) * 2018-10-05 2020-04-09 Arizona Board Of Regents On Behalf Of Arizona State University Systems, methods, and apparatuses for utilizing co-simulation of a physical model and a self-adaptive predictive controller using hybrid automata
CN110457747A (en) * 2019-07-02 2019-11-15 浙江工业大学 A kind of network control system synergy emulation method based on NS3 and MATLAB

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王武华;陈新宁;: "基于CPN模型的COA状态空间搜索算法", 电脑知识与技术, no. 14 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114091270A (en) * 2021-11-25 2022-02-25 西南交通大学 Manufacturing equipment resource access method for cloud production line virtual recombination
CN114564293A (en) * 2022-03-02 2022-05-31 北京大学 Large-scale online service system change scheduling method and system based on constraint detection and conflict resolution

Similar Documents

Publication Publication Date Title
Dijkman et al. Aligning business process models
US8265979B2 (en) Automatic generation of process models
US9225774B2 (en) System and method for performing distributed asynchronous calculations in a networked environment
Mateescu et al. Adaptation of service protocols using process algebra and on-the-fly reduction techniques
US9565246B1 (en) System and method for project and process management by synchronizing custom objects between an application and external server
Pinter et al. Discovering workflow models from activities’ lifespans
US7904418B2 (en) On-demand incremental update of data structures using edit list
JP5006324B2 (en) Server-side project manager
Baier et al. Bridging abstraction layers in process mining by automated matching of events and activities
US20110191277A1 (en) Automatic data mining process control
CN103514223A (en) Data synchronism method and system of database
US8364840B2 (en) Dynamic message routing
Luo et al. Exception handling for conflict resolution in cross-organizational workflows
CN113204335B (en) UML model merging and consistency detection method and system oriented to collaborative modeling
CN113204335A (en) UML model merging and consistency detection method and system for collaborative modeling
Ayzenshtadt et al. Multi-Agent-Based Generation of Explanations for Retrieval Results Within a Case-Based Support Framework for Architectural Design.
CN113407230B (en) Intelligent main model management system based on data driving
CN113448493B (en) Method, electronic device and computer readable medium for backing up data
CN111259082B (en) Method for realizing full data synchronization in big data environment
Kourla et al. REBD: A Conceptual Framework for Big Data Requirements Engineering
Zhang et al. Composite-level conflict detection in uml model versioning
Wang et al. Discovering web services to improve requirements decomposition
Sun et al. A model-driven collaborative modeling method for software
US11934800B2 (en) Generating metadata to facilitate code generation
Sun et al. Incremental workflow mining with optional patterns and its application to production printing process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant