CN100538633C - A kind of merging method and system of structural model - Google Patents
A kind of merging method and system of structural model Download PDFInfo
- Publication number
- CN100538633C CN100538633C CNB2007101638984A CN200710163898A CN100538633C CN 100538633 C CN100538633 C CN 100538633C CN B2007101638984 A CNB2007101638984 A CN B2007101638984A CN 200710163898 A CN200710163898 A CN 200710163898A CN 100538633 C CN100538633 C CN 100538633C
- Authority
- CN
- China
- Prior art keywords
- atom information
- merging
- entity
- reciprocity
- information
- 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.)
- Active
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
The invention discloses a kind of merging method and system of structural model, method comprises: resolve the entity structure that participates in merging according to organization definition, obtain the set of atom information; According to the set of atom information, entity structure after the merging of a sky of structure; According to the semanteme sign or the station location marker of atom information, search the reciprocity atom information that has same sign in each merged entity; Merge reciprocity atom information, and be saved in after the empty merging in the entity structure; Wherein, merge reciprocity atom information and comprise: more reciprocity atom information, the atom information after the atom information that changes is defined as merging; If reciprocity atom information is different, then manually adjust; Wherein, reciprocity atom information is in the process that merges, respectively same entity to due a plurality of variant versions in, represent one group of atom information of same semanteme.This merging process guarantees to merge back being kept perfectly property of message structure, has eliminated text and has merged the destruction of mode to model structure.
Description
Technical field
The present invention relates to software engineering, particularly relate to a kind of merging method and system of structural model.
Background technology
Under the concurrent development environment of operation system, such situation often occurs: when client's secondary development operation system, a plurality of versions that develop simultaneously need merge.Therefore, in order to support concurrent development, the source code that all needs usually to realize operation system merges mechanism.The notion that merges is meant that same information entity can be simultaneously by different main body modifications, can form a plurality of modification variants of this information entity then, when need be accumulated in the modification of a plurality of variants intention together, just need merge, obtain the version of a new complete meaning of this information entity these variants.
Under general software development pattern, development is mainly software source code, and industry is generally taked to merge based on the source code of text mode.The accuracy of this merging mechanism is lower, and semantic correctness can not get guaranteeing that generally all need be combined the result by the developer after merging carries out a large amount of adjustment.
And under the pattern based on the model development framework, main development is a model.Software source code and the structural model difference in merging process is mainly reflected in the message structure feature, and source code generally is presented as this information of style of writing in merging process, and structural model then is presented as peculiar structurized information.Because structure of models is more complicated than general source code, if still adopt text mode to merge the complicated model structure, in the process that merges along with the merging (comprising that additions and deletions change operation) of row information, the possibility of result that merges does not satisfy the structure of models demand, thereby destroyed the basic structure of model, also destroyed simultaneously model and wanted the information expressed, it merges the non-constant of effect, do not have availability substantially.
Summary of the invention
Technical matters to be solved by this invention provides a kind of merging method and system of structural model, adopts text mode combinatorial construction model to solve, and has destroyed the problem of model structure.
For solving the problems of the technologies described above,, the invention discloses following technical scheme according to specific embodiment provided by the invention:
A kind of merging method of structural model comprises:
Resolve the entity structure that participates in merging according to organization definition, obtain the set of atom information with same structure;
According to the set of described atom information, entity structure after the merging of a sky of structure;
According to the semanteme sign or the station location marker of atom information, search the reciprocity atom information that has same sign in each merged entity;
Merge reciprocity atom information, and be saved in after the merging of described sky in the entity structure; Wherein, the reciprocity atom information of described merging specifically comprises: more reciprocity atom information, the atom information after the atom information that changes is defined as merging; If reciprocity atom information is different, then manually adjust;
Wherein, described reciprocity atom information is in the process that merges, respectively same entity to due a plurality of variant versions in, represent one group of atom information of same semanteme.
Described method also comprises: preserve merging back entity according to organization definition.
Wherein, described step of searching reciprocity atom information comprises: the atom information sign comprises semantic sign and station location marker; Identify the atom information of searching each merged entity according to semanteme, do not have the entity structure of semantic sign and search according to the station location marker of atom information in entity structure.
Wherein, each entity structure that participate in to merge is identical, and described entity structure is specific to model, the entity structure difference of model, and analysis mode is also different.
A kind of combination system of structural model comprises:
The structure elucidation unit is used for resolving the entity structure with same structure that participates in merging according to organization definition, obtains the set of atom information; And according to the set of described atom information, entity structure after the merging of a sky of structure;
Merge cells is used for semanteme sign or station location marker according to atom information, searches the reciprocity atom information that has same sign in each merged entity; Merge reciprocity atom information, and be saved in after the merging of described sky in the entity structure; Wherein, the reciprocity atom information of described merging specifically comprises: more reciprocity atom information, the atom information after the atom information that changes is defined as merging; If reciprocity atom information is different, then manually adjust;
Wherein, described reciprocity atom information is in the process that merges, respectively same entity to due a plurality of variant versions in, represent one group of atom information of same semanteme.
Described system also comprises: storage unit is used for preserving merging back entity.
Wherein, the atom information sign comprises semantic sign and station location marker; Described merge cells identifies the atom information of searching each merged entity according to semanteme, does not have the entity structure of semantic sign and then searches according to the station location marker of atom information in entity structure, obtains to have the reciprocity atom information of same sign.
Wherein, each entity structure that participates in merging is identical, and described entity structure is specific to model; Described structure elucidation unit carries out difference at the entity structure of different models and resolves.
According to specific embodiment provided by the invention, the invention discloses following technique effect:
The merging mode that the embodiment of the invention provides at structurized model entity, is characterized as the basis with structure of models and merges.When reality is carried out merging process, at first the entity structure that will participate in merging according to organization definition resolves to the set of atom information, and construct entity structure after the merging of a sky, atom information according to each merged entity identifies then, search the reciprocity atom information that has same sign, merge reciprocity atom information, and be saved in the entity structure after the described merging, thereby finish the merging of structural model.
Described merging process is that unit merges with the atom information of entity structure, and the being kept perfectly property of message structure after guaranteeing to merge merges the destruction of mode to model structure thereby eliminated text.
Description of drawings
Fig. 1 is the flow chart of steps of the described structural model of embodiment of the invention merging method;
Fig. 2 is the combination system structured flowchart of the described structural model of the embodiment of the invention.
Embodiment
For above-mentioned purpose of the present invention, feature and advantage can be become apparent more, the present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
Text based merges the capable structural information that mainly is based on text in the prior art, if the target information structure that merges is not based on capable structure, then adopts the possibility of result after text merges can not meet the target information structure.The embodiment of the invention provides a kind of method that merges at structure of models information, is characterized as the basis with structure of models and merges, and can guarantee the integrality of target information structure in merging process, eliminates the destruction of merging process to message structure.
Introduce structural model below earlier, as previously mentioned, structural model is presented as peculiar structurized information, illustrates:
One section simple model source code:
public?class?HelloWorld{
public?static?void?main(String[]args){
System.out.println("Hello?World.");
}
}
If explain with text structure, it is that this constitutes by 4 styles of writing.And in order to explain identical semanteme, this section sample code can also have multiple text presentation form, as:
public?class?HelloWorld{
public?static?void?main(String[]args){System.out.println("Hello?World.");}
}
If the structure with the java applet language explains that it is made up of following structure:
A class definition comprises:
A method definition comprises:
Way access limits definition
The definition of method rreturn value
The method parameter definition
The definition of method body comprises:
A statement
At above sample model, if resolve, will resolve to different contents according to text mode, promptly can resolve to 4 styles of writing originally, also can resolve to 3 styles of writing originally; If resolve according to model structure, then can obtain identical structured message.Therefore, the present invention is based on described principle, proposed a kind of merging mode that is characterized as the basis with structure of models.
With reference to Fig. 1, be the flow chart of steps of described structural model merging method.Illustrate:
The prototype version of a model is as follows:
Ver0
package?foo;
public?class?HelloWorld{
public?static?void?main(String[]args){
String?name=fullName("bill","gates");
System.out.println(name);
}
private?static?String?fullName(String?firstName,String?lastName){
return?firstName+"."+lastName;
}
}
An exploitation stream is made following modification, v0-〉v1:
Ver1
package?foo;
public?class?HelloWorld{
public?static?void?main(String[]args){
String?name=fullName("Bill","gates");
System.out.println(name);
}
private?static?String?fullName(String?firstName,String?lastName){
return?firstName+"."+lastName;
}
}
An exploitation stream is made following modification, v0-〉v2:
Ver2
package?foo;
public?class?HelloWorld{
public?static?void?main(String[]args){
String?name=fullName("bill","Gates");
System.out.println(name);
}
private?static?String?fullName(String?firstName,String?lastName){
return?firstName+"."+lastName;
}
}
When merging, need lump together with respect to the modification of v0 and v2 v1 with respect to the modification of v0, form one and comprise two parts and revise semantic redaction v '.Merging process is as follows:
Many parts of entities that step 101, input participate in to merge and structural information thereof.In the example, the entity that participates in merging refers to v0, v1 and v2, and the structural information of entity refers to source code Ver0, Ver1 and the Ver2 of difference corresponding v0, v1 and v2.
Step 103 is resolved the entity of importing according to described organization definition.Because entity structure is specific to model, thus the analysis mode of entity also specific to model, promptly at different model structures, the analysis mode of taking is also different.If the structure with the java applet language explains that the Java Source structure of entity v0 is as follows:
A package statement
Comprise a bag title
A class declaration
Comprise a class access profile statement
Comprise a class title
Comprise a method statement
Comprise a way access scope statement
Comprise a static statement
Comprise a rreturn value type declarations
Comprise a method name
Comprise a method parameter statement
Comprise a parameter type
Comprise a parameter name
Comprise the statement of method body
Comprise a variable declarations
Comprise the types of variables statement
Comprise name variable
Comprise the statement of assignment expression r value
Comprise a method call
Comprise the method statement that is called
Comprise the statement of method call parameter
Comprise parameter " bill "
Comprise parameter " gates "
Comprise a method call
Comprise the method statement that is called
Comprise the statement of method call parameter
Comprise parameter
Comprise a method statement
...?...
The example of analyzing above-mentioned entity structure as can be known, entity structure is the set of a plurality of atom information, described atom information is to describe the least unit of entity structure information.Because the information of entity is to be formed by the information combination of subsection more, entity structure information is used for describing this syntagmatic, and described syntagmatic is a kind of hierarchical relationship, and each level is represented an atom information.
Need to prove that many parts of entities that participate in merging are the entities with same structure.Therefore, the structure of structure that entity v1 and v2 parse and entity v0 is now same, just the contents value difference: the contents value of entity v1 is " Bill ", " gates ", and the contents value of entity v2 is " bill ", " Gates ".
Step 105 travels through the atom information of all entities according to organization definition, according to the atom information sign, searches the reciprocity atom information that has same sign in each merged entity.The traversal entity information is exactly according to the textural association relation, visits all atom information in a certain order.In the process that merges, same entity has a plurality of variant versions, and reciprocity atom information is exactly respectively in a plurality of variants, represents one group of atom information of same semanteme.And in entity structure information, each atom information is all distinguished by identifying, and searches atom information with semantic identification information usually, if there is not semantic sign in the entity structure, then searches by the station location marker of atom information in structure.
In the example, each atom information among the searching loop v0, and find peer-to-peer in two other version v1 and v2 simultaneously.Seek the method for peer-to-peer: search the atom information of same structure type, when atom information of the same type has a plurality of example, (promptly have v0, v1 and v2), need find the equal information of expression according to semantic identification information; Do not search according to the sign of the positional information in structure when having semantic identification information.Like this, for each atom information one group of lookup result that comprises 3 values of information is arranged all.
Step 106 merges reciprocity atom, and the atom information after the merging is kept in the entity structure after the merging, and the atom information sign before keeping merging.Merging process is: the equality of mutual more described 3 values in every group of value of information, and choose a value then and copy in the v ' structure as the merging value; Conflict has so just appearred merging in=Info2, needs artificial decision to choose Info1 or Info2.Wherein, Info0, Info1, Info2 represent the reciprocity atom information among v0, v1 and the v2 respectively.
In example, except parameter " bill " and these two atom information of parameter " gates ", other all atom information all are Info0=Info1=Info2, so directly duplicate Info0 among the v ';=Info1, Info0=Info2, then v ' gets the value " Bill " of Info1;=Info2, then v ' gets the value " Gates " of Info2.
Step 107 is preserved entity after the described merging according to organization definition.Merged all atom information, obtained entity v ' after the complete merging, then v ' being output into the exterior storage form is exactly amalgamation result.
In the example, the result after the merging is:
package?foo;
public?class?HelloWorld{
public?static?void?main(String[]args){
String?name=fullName("Bill","Gates");
System.out.println(name);
}
private?static?String?fullName(String?firstName,String?lastName){
return?firstName+"."+lastName;
}
}
By result after the merging of above-mentioned merging method acquisition, the message structure after can guaranteeing to merge meets the target information structure, thereby guarantees the integrality of model structure in the merging process, has eliminated the destruction of merging process to message structure.
Above-mentioned merging mode based on model structure is compared with text merging mode, resolves v0, v1, v2, obtain 3 parts of structurized information according to the row structural information:
The content of V0:
Row 01:package foo;
Row 02:public class HelloWorld{
Row 03:public static void main (String[] args)
Row 04:String name=fullName (" bill ", " gates ");
Row 05:System.out.println (name);
Row 06:}
Row 07:private static String fullName (String firstName, StringlastName)
Row 08:return firstName+ ". "+lastName;
Row 09:}
Row 10:}
The result that V1, v2 parse also is a same structure, and just contents value is different.
Result after the merging is:
package?foo;
public?class?HelloWorld{
public?static?void?main(String[]args){
??????????????
System.out.println(name);
}
private?static?String?fullName(String?firstName,String?lastName){
return?firstName+"."+lastName;
}
}
In the result of this merging of above style of writing, "? " expression can't obtain result accurately.Therefore, it is different adopting the result of two kinds of merging methods, the crucial difference of its realization: structure merges need special resolution logic and data structure support at different object constructions; And the row structure is the simple structure of fixing, can common treatment; And the merging semanteme that structuring merges is more accurate.
At the merging method based on model structure, the present invention also provides the combination system embodiment of structural model.With reference to Fig. 2, be the structured flowchart of described combination system, described system mainly comprises structure elucidation unit 201, merge cells 202 and storage unit 203.
Described structure elucidation unit 201 is used for resolving the entity structure that participates in merging according to organization definition, obtains the set of atom information; And according to the entity structure that obtains after the described parsing, entity structure after the merging of a sky of structure.Because entity structure is specific to model, thus the analysis mode of entity also specific to model, promptly at different model structures, the analysis mode of taking is also different.
Described merge cells 202 is used for searching the reciprocity atom information that has same sign in each merged entity according to the atom information sign; Merge reciprocity atom information, and be saved in the entity structure after the described merging, the entity after will merging then is saved in storage unit 203.Search procedure is the atom information of all entities of traversal, according to the information that semantic identification information finds expression to equate, does not search according to the positional information in structure when having semantic identification information.After finding reciprocity atom information, the more reciprocity atom information of described merge cells, the atom information after the atom information that changes is defined as merging; If reciprocity atom is different, then manually adjust.
The part that does not describe in detail in the system shown in Figure 2 can be considered for length referring to the relevant portion of method shown in Figure 1, is not described in detail in this.
More than to the merging method and system of a kind of structural model provided by the present invention, be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, part in specific embodiments and applications all can change.In sum, this description should not be construed as limitation of the present invention.
Claims (8)
1, a kind of merging method of structural model is characterized in that, comprising:
Resolve the entity structure that participates in merging according to organization definition, obtain the set of atom information with same structure;
According to the set of described atom information, entity structure after the merging of a sky of structure;
According to the semanteme sign or the station location marker of atom information, search the reciprocity atom information that has same sign in each merged entity;
Merge reciprocity atom information, and be saved in after the merging of described sky in the entity structure; Wherein, the reciprocity atom information of described merging specifically comprises: more reciprocity atom information, the atom information after the atom information that changes is defined as merging; If reciprocity atom information is different, then manually adjust;
Wherein, described reciprocity atom information is in the process that merges, respectively same entity to due a plurality of variant versions in, represent one group of atom information of same semanteme.
2, method according to claim 1 is characterized in that, also comprises: preserve merging back entity according to organization definition.
3, method according to claim 1 is characterized in that, described step of searching reciprocity atom information comprises:
The atom information sign comprises semantic sign and station location marker;
Identify the atom information of searching each merged entity according to semanteme, do not have the entity structure of semantic sign and search according to the station location marker of atom information in entity structure.
4, method according to claim 1 is characterized in that: each entity structure that participate in to merge is identical, and described entity structure is specific to model, the entity structure difference of model, and analysis mode is also different.
5, a kind of combination system of structural model is characterized in that, comprising:
The structure elucidation unit is used for resolving the entity structure with same structure that participates in merging according to organization definition, obtains the set of atom information; And according to the set of described atom information, entity structure after the merging of a sky of structure;
Merge cells is used for semanteme sign or station location marker according to atom information, searches the reciprocity atom information that has same sign in each merged entity; Merge reciprocity atom information, and be saved in after the empty merging in the entity structure; Wherein, the reciprocity atom information of described merging specifically comprises: more reciprocity atom information, the atom information after the atom information that changes is defined as merging; If reciprocity atom information is different, then manually adjust;
Wherein, described reciprocity atom information is in the process that merges, respectively same entity to due a plurality of variant versions in, represent one group of atom information of same semanteme.
6, system according to claim 5 is characterized in that, also comprises: storage unit is used for preserving merging back entity.
7, system according to claim 5 is characterized in that: the atom information sign comprises semantic sign and station location marker; Described merge cells identifies the atom information of searching each merged entity according to semanteme, does not have the entity structure of semantic sign and then searches according to the station location marker of atom information in entity structure, obtains to have the reciprocity atom information of same sign.
8, system according to claim 5 is characterized in that: each entity structure that participates in merging is identical, and described entity structure is specific to model; Described structure elucidation unit carries out difference at the entity structure of different models and resolves.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101638984A CN100538633C (en) | 2007-10-11 | 2007-10-11 | A kind of merging method and system of structural model |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2007101638984A CN100538633C (en) | 2007-10-11 | 2007-10-11 | A kind of merging method and system of structural model |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101126983A CN101126983A (en) | 2008-02-20 |
CN100538633C true CN100538633C (en) | 2009-09-09 |
Family
ID=39095033
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2007101638984A Active CN100538633C (en) | 2007-10-11 | 2007-10-11 | A kind of merging method and system of structural model |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100538633C (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20180072436A (en) * | 2016-12-21 | 2018-06-29 | 엘에스산전 주식회사 | Apparatus for providing program |
CN110069455B (en) * | 2017-09-21 | 2021-12-14 | 北京华为数字技术有限公司 | File merging method and device |
CN110704178B (en) * | 2019-09-04 | 2023-05-23 | 北京三快在线科技有限公司 | Machine learning model training method, platform, electronic device and readable storage medium |
-
2007
- 2007-10-11 CN CNB2007101638984A patent/CN100538633C/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN101126983A (en) | 2008-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Sevilla Ruiz et al. | Inferring versioned schemas from NoSQL databases and its applications | |
CN103412853B (en) | A kind of automatic example generation method for file convertor | |
Antwerpen et al. | A constraint language for static semantic analysis based on scope graphs | |
US8789018B2 (en) | Statically derived symbolic references for dynamic languages | |
Igamberdiev et al. | An integrated multi-level modeling approach for industrial-scale data interoperability | |
Chillón et al. | A model-driven approach to generate schemas for object-document mappers | |
Schauerhuber et al. | Bridging existing Web modeling languages to model-driven engineering: a metamodel for WebML | |
Shigarov et al. | TabbyXL: Software platform for rule-based spreadsheet data extraction and transformation | |
Domínguez et al. | Evolution of XML schemas and documents from stereotyped UML class models: A traceable approach | |
CN102542027A (en) | Construction method of data integration system for studying ontology based on relation schema | |
Rudkin | Inheritance in LOTOS | |
Radke et al. | Translating essential OCL invariants to nested graph constraints focusing on set operations | |
Le Calvar et al. | Efficient ATL Incremental Transformations. | |
Mammar et al. | From a B formal specification to an executable code: application to the relational database domain | |
CN100538633C (en) | A kind of merging method and system of structural model | |
Boshernitsan | Harmonia: A flexible framework for constructing interactive language-based programming tools | |
Maddox III | Incremental static semantic analysis | |
Boukhari et al. | The role of user requirements in data repository design | |
CN109299004B (en) | Method and system for analyzing difference of key elements | |
Laleau et al. | Specification of integrity-preserving operations in information systems by using a formal UML-based language | |
Heinz et al. | Axioms of linguistic architecture | |
Jodłowiec et al. | Towards the pattern-based transformation of SBVR models to association-oriented models | |
CN103440324A (en) | Fuzzy ontology description method and fuzzy ontology modeling method | |
Hellmann et al. | TowardsWeb-Scale Collaborative Knowledge Extraction | |
Schiavio et al. | DynQ: a dynamic query engine with query-reuse capabilities embedded in a polyglot runtime |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |