CN107273407B - A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction - Google Patents

A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction Download PDF

Info

Publication number
CN107273407B
CN107273407B CN201710290213.6A CN201710290213A CN107273407B CN 107273407 B CN107273407 B CN 107273407B CN 201710290213 A CN201710290213 A CN 201710290213A CN 107273407 B CN107273407 B CN 107273407B
Authority
CN
China
Prior art keywords
constraint
mof
constraints
node
discovery
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
Application number
CN201710290213.6A
Other languages
Chinese (zh)
Other versions
CN107273407A (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.)
Electric Power Research Institute of State Grid Tianjin Electric Power Co Ltd
Original Assignee
Electric Power Research Institute of State Grid Tianjin Electric Power Co Ltd
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 Electric Power Research Institute of State Grid Tianjin Electric Power Co Ltd filed Critical Electric Power Research Institute of State Grid Tianjin Electric Power Co Ltd
Priority to CN201710290213.6A priority Critical patent/CN107273407B/en
Publication of CN107273407A publication Critical patent/CN107273407A/en
Application granted granted Critical
Publication of CN107273407B publication Critical patent/CN107273407B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • 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/25Integrating or interfacing systems involving database management systems
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/283Multi-dimensional databases or data warehouses, e.g. MOLAP or ROLAP

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a method for discovering MOF storage bank conflict operation based on constraint deduction, which is technically characterized by comprising the following steps of: defining internal activities that affect good format constraints and establishing their correspondence to MOF construction activities; simplifying good format constraints; establishing a discovery graph; marking the discovery map; obtaining internal activities; potential operations that violate the constraints are determined. The invention can deduce the constraint condition irrelevant to the given operation by deducing the internal activity which may violate the constraint condition and further deducing the potential operation which violates the constraint condition. The constraint conditions which are irrelevant to the given operation are removed from the constraint detection process after the operation is executed, so that the efficiency of the process can be obviously improved, and the method can be widely applied to the field of constraint detection.

Description

基于约束推演的MOF存储库冲突操作的发现方法A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction

技术领域technical field

本发明属于存储库系统技术领域,尤其是一种基于约束推演的MOF存储库冲突操作的发现方法。The invention belongs to the technical field of storage library systems, in particular to a method for discovering conflict operation of MOF storage library based on constraint deduction.

背景技术Background technique

如今,元对象设施MOF已经成为国际上普遍接受和采用的元数据存储库系统标准。作为MOF存储库系统的重要组成部分,基于对象约束语言OCL定义的良格式约束规定了系统所有状态都必须遵从的条件。存储库系统的内容会由于操作的执行而被改变,因此必须确保操作执行后存储库系统的状态不违背元层次中的良格式约束。Today, the Meta Object Facility (MOF) has become an internationally accepted and adopted metadata repository system standard. As an important part of the MOF repository system, well-formed constraints defined based on the Object Constraint Language OCL specify the conditions that all states of the system must comply with. The contents of the repository system can be changed by the execution of the operation, so it must be ensured that the state of the repository system after the operation is performed does not violate the well-formed constraints in the meta-level.

然而由于下面两个原因的存在使得这一任务变得相当困难:一方面,存储库系统中元数据的组织方式呈现出分层、多级并且动态变化的复杂结构。不同于数据库系统,存储库系统引入M3层允许用户对M2层进行定义。在运行时刻M2,M1和,M0层都可以被动态修改;另一方面,MOF标准对确保良格式约束规定得并不充分。MOF提供了几种机制用于保证存储库系统一致性,包括:首先,MOF定义了一组模型约束;其次,MOF为抽象映射定义了一组闭包规则和计算语义,JAVA元数据接口JMI为Jave映射定义了计算语义;再次,MOF为描述领域规则提供了constraint模型元素;最后,MOF和JMI定义了一组存储库界面。然而上述措施都是针对语法正确性的确保,而不是良格式约束。However, this task is quite difficult for two reasons: On the one hand, the organization of metadata in repository systems presents a complex structure that is hierarchical, multi-level, and dynamically changing. Unlike the database system, the repository system introduces the M3 layer to allow users to define the M2 layer. Layers M2, M1, and M0 can all be dynamically modified at runtime; on the other hand, the MOF standard does not specify enough constraints to ensure well-formedness. MOF provides several mechanisms for ensuring repository system consistency, including: first, MOF defines a set of model constraints; second, MOF defines a set of closure rules and computational semantics for abstract mappings, and the JAVA metadata interface JMI is Jave maps define computation semantics; thirdly, MOF provides constraint model elements for describing domain rules; finally, MOF and JMI define a set of repository interfaces. However, the above measures are aimed at ensuring grammatical correctness, not well-formed constraints.

经检索发现如下相关文献:Petrov等人(Petrov I,et al.On the notion ofconsistency in metadata repository systems,LNCS 3520:Proc of the16th Int Confon Advanced Information Systems Engineering.Berlin:Springer,2004:90-104)论述了基于MOF的元数据存储库系统中各种一致性的概念并提出了策略和算法用于增强操作执行以后的系统状态和良格式约束之间的一致性。然而在此过程中他们对所有约束条件进行检测,从而使得检测过程效率不高。相比之下,由于在检测过程中只需考虑实际可能被违背的约束,不相关的约束将被略去,我们的方法可以显著提高该过程的效率。Takeshi等人(Takeshi A,et al.Metabolonote:A wiki-based database for managing hierarchicalmetadata of metabolome analyses.Frontiers in Bioinformatics and ComputationalBiology,2015,15(38):1-12)在解决元数据交换问题时也将元数据组织到不同的层次中,其元数据层次不是按照元数据的语义级别而是按照不同的元数据的内容及相关程度进行组织的,各层次之间并无语义关联。其操作对存储库内容的修改不会影响到下面的层次使得约束的确保相对简单,但该框架难以适用于动态变化的复杂元数据结构。文献(Metadatabased management and sharing of distributed biomedical data.InternationalJournal of Metadata,Semantics and Ontologies,2014,9(1):42-57)中所提出的元数据框架也具有类似问题。The following relevant documents were found by searching: Petrov et al. (Petrov I, et al. On the notion of consistency in metadata repository systems, LNCS 3520: Proc of the 16th Int Confon Advanced Information Systems Engineering. Berlin: Springer, 2004: 90-104) discussed Various concepts of consistency in MOF-based metadata repository systems are presented, and strategies and algorithms are proposed to enhance the consistency between system states and well-formed constraints after operations are performed. However, they check all constraints in the process, making the detection process inefficient. In contrast, since only the constraints that may actually be violated are considered in the detection process, irrelevant constraints will be omitted, and our method can significantly improve the efficiency of the process. Takeshi et al. (Takeshi A, et al. Metabolonote: A wiki-based database for managing hierarchical metadata of metabolome analyses. Frontiers in Bioinformatics and Computational Biology, 2015, 15(38): 1-12) will also address the metadata exchange problem Metadata is organized into different levels, and its metadata levels are not organized according to the semantic level of metadata but according to the content and relevance of different metadata, and there is no semantic relationship between levels. The modification of the repository content by its operation will not affect the following layers, making the guarantee of constraints relatively simple, but the framework is difficult to apply to the dynamically changing complex metadata structure. The metadata framework proposed in the literature (Metadatabased management and sharing of distributed biomedical data. International Journal of Metadata, Semantics and Ontologies, 2014, 9(1): 42-57) also has similar problems.

据我们所知,在MOF存储库系统中推断给定约束的确切的潜在冲突构造活动PEA集合的问题在国际上还未有相关研究。类似的研究存在于演绎数据库和关系数据库领域,所采用的解决方法主要是将OCL约束转换为逻辑表达式或SQL表达式,而后在此基础上设计算法用以推断给定约束的确切PEA集合,比如Duboisset等人(Duboisset M,etal.Integrating the calculus-based method into OCL:Study of expressiveness andcode generation,Proc of the 18th Int Workshop on Database and Expert SystemsApplications.Piscataway,NJ:IEEE,2007:502-506)、Pinet等人(Pinet F,Duboisset M,Demuth B,et al.Constraints modeling in agricultural databases,Advances inModeling Agricultural Systems.Berlin:Springer,2009:1-11)、Donald等人(Donald C,Narayanaswamy K.Using first-order logic to query heterogeneous internet datasources,Proc of the 2015Int Conf on Soft Computing and SoftwareEngineering.Holand:Academic Press,Elsevier,2015:1-8)、Demuth等人(Demuth B,Hussmann H,Loecher S.OCL as a specification language for business rules indatabase applications,LNCS 2185:Proc of the 4th Conf on UML.Berlin:Springer,2006:104-117)、陈等人(陈良刚等.区间约束数据库查询语言:ISQL.计算机研究与发展,2000,37(6):677-683)的工作,但是,由于OCL约束包括了诸如否定、递归、包语义、聚合操作等很多复杂结构,所提出的算法的处理能力很难涵盖OCL约束的所有机制。尽管有的算法对此进行了改进以支持OCL约束的所有机制,但处理逻辑的高复杂性又导致了算法的效率不高(关于它们的局限性可以参考Siva等人的论述(Siva S,et al.Constraint processingin relational database systems:From theory to implementation,Proc of the 25thACM Symp on Applied Computing.New York:ACM,2010:2066-2070))。To our knowledge, the problem of inferring the exact set of potentially conflicting constructive active PEAs for a given constraint in a MOF repository system has not been studied internationally. Similar research exists in the fields of deductive and relational databases, and the solution adopted is mainly to convert OCL constraints into logical expressions or SQL expressions, and then design algorithms on this basis to infer the exact PEA set for a given constraint, For example, Duboisset et al. (Duboisset M, et al. Integrating the calculus-based method into OCL: Study of expressiveness and code generation, Proc of the 18th Int Workshop on Database and Expert Systems Applications. Piscataway, NJ: IEEE, 2007: 502-506), Pinet et al. (Pinet F, Duboisset M, Demuth B, et al. Constraints modeling in agricultural databases, Advances in Modeling Agricultural Systems. Berlin: Springer, 2009: 1-11), Donald et al. (Donald C, Narayanaswamy K. Using first -order logic to query heterogeneous internet datasources, Proc of the 2015 Int Conf on Soft Computing and Software Engineering. Holand: Academic Press, Elsevier, 2015: 1-8), Demuth et al. (Demuth B, Hussmann H, Loecher S. OCL as a specification language for business rules in database applications, LNCS 2185: Proc of the 4th Conf on UML. Berlin: Springer, 2006: 104-117), Chen et al. (Chen Lianggang et al. Interval Constrained Database Query Language: ISQL. Computer Research and Development, 2000, 37(6):677-683), however, since OCL constraints include many complex structures such as negation, recursion, package semantics, aggregation operations, etc., the processing power of the proposed algorithm is difficult to cover all OCL constraints. mechanism. Although some algorithms have improved this to support all mechanisms of OCL constraints, the high complexity of the processing logic results in inefficient algorithms (for their limitations, see Siva et al. (Siva S, et al.) al. Constraint processing in relational database systems: From theory to implementation, Proc of the 25th ACM Symp on Applied Computing. New York: ACM, 2010: 2066-2070)).

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有技术的不足,提供一种设计合理、性能稳定且效率高的基于约束推演的MOF存储库冲突操作的发现方法。The purpose of the present invention is to overcome the deficiencies of the prior art, and to provide a method for discovering the conflict operation of MOF repository based on constraint deduction with reasonable design, stable performance and high efficiency.

本发明解决现有的技术问题是采取以下技术方案实现的:The present invention solves the existing technical problems and adopts the following technical solutions to realize:

一种基于约束推演的MOF存储库冲突操作的发现方法,包括以下步骤:A method for discovering conflicting operations in MOF repository based on constraint deduction, comprising the following steps:

步骤1、定义影响良格式约束的内部活动并建立它们与MOF构造活动的对应关系;Step 1. Define internal activities that affect well-formed constraints and establish their correspondence with MOF construction activities;

步骤2:对良格式约束进行化简;Step 2: Simplify the well-formed constraints;

步骤3:建立发现图;Step 3: Create a discovery map;

步骤4:对发现图进行标记;Step 4: Mark the discovery map;

步骤5:获取内部活动;Step 5: Get the internal activity;

步骤6:确定违背约束的潜在操作。Step 6: Identify potential actions that violate constraints.

所述内部活动是根据实体类型和关系类型定义的包括建立实例和删除实例的八种内部活动关系。The internal activities are defined according to entity types and relationship types, including eight internal activity relationships including creating instances and deleting instances.

所述步骤2的具体实现方法为:首先使用定义在OCL标准库中的等价操作对出现在表达式中的操作数目进行约减;然后将表达式转换为等价的合取范式,转换的结果是每个约束被表示为析取项的合取;所得到的析取项的字面量包括forAll迭代子、算术比较、对象/集合等价比较、布尔属性、not操作符、oclIsTypeOf操作符以及oclIsKindOf操作符。The specific implementation method of step 2 is as follows: first, the equivalent operations defined in the OCL standard library are used to reduce the number of operations appearing in the expression; then the expression is converted into an equivalent conjunctive normal form, and the converted The result is that each constraint is represented as a conjunction of disjunctions; the resulting disjunct literals include forAll iterators, arithmetic comparisons, object/set equivalence comparisons, boolean properties, the not operator, the oclIsTypeOf operator, and oclIsKindOf operator.

所述步骤3是根据良格式约束与OCL元模型之间的内容——实例关系建立的发现图。The step 3 is a discovery graph established according to the content-instance relationship between the well-formed constraints and the OCL metamodel.

所述步骤4对发现图进行标记的方法为:为每个节点所作的标记指示出该节点与它的后继节点之间相互影响的信息,包括四种不同类型的标记信息:“+”表示表达式的值的增加或项目数量的增加可能导致约束的违背;“-”表示表达式的值的减少或项目数量的减少可能导致约束的违背;“m”表示表达式的值的改变或项目数量的改变可能导致约束的违背;“nr”表示该节点与其后继节点并无相互影响。The method of marking the discovery graph in the step 4 is: the marking for each node indicates the information of the mutual influence between the node and its successor nodes, including four different types of marking information: "+" means expressing An increase in the value of the expression or an increase in the number of items may lead to a constraint violation; "-" indicates that a decrease in the value of the expression or a decrease in the number of items may lead to a violation of the constraint; "m" indicates a change in the value of the expression or the number of items Changes in may lead to constraint violations; "nr" means that the node and its successors do not interact with each other.

所述步骤5的具体方法为:按自下而上逐级推断并汇总的过程进行获取,推断出每个约束条件的PIA集合。The specific method of the step 5 is: obtaining according to the bottom-up step-by-step inference and aggregation process, and infers the PIA set of each constraint condition.

所述步骤6的具体方法为:根据每个约束的PIA集合,转换为MOF标准的构造活动并得到PEA集合,最后检查每个操作是否存在违背的约束。。The specific method of the step 6 is: according to the PIA set of each constraint, convert it into the MOF standard construction activity and obtain the PEA set, and finally check whether each operation has a violated constraint. .

本发明的优点和积极效果是:The advantages and positive effects of the present invention are:

本发明通过定义一组比MOF的构造活动更精确和灵活的MOF内部活动并建立了二者之间的对应关系;推断可能违背约束条件的内部活动;最后通过比对与这些内部活动相对应的构造活动是否在操作规范中出现,能够推断违背约束条件的潜在操作。其原理是每个约束条件找到可能违背它的构造活动的集合,然后与操作规范进行对比,若其中的一个或多个构造活动与操作规范相关,则可断定该操作的执行可能会违背该约束条件。通过推断出与给定操作无关的约束条件并将之从该操作执行以后的约束检测过程中剔除,本发明可以显著提高这一过程的效率。本发明可广泛用于约束检测领域。The present invention defines a set of MOF internal activities that are more precise and flexible than MOF construction activities and establishes the corresponding relationship between the two; infers internal activities that may violate constraints; finally, compares the internal activities corresponding to these internal activities Whether or not the construction activity occurs in the operational specification can infer potential operations that violate constraints. The principle is that each constraint finds a set of construction activities that may violate it, and then compares it with the operation specification. If one or more construction activities are related to the operation specification, it can be concluded that the execution of the operation may violate the constraint. condition. By inferring constraints irrelevant to a given operation and removing them from the constraint detection process after the operation is performed, the present invention can significantly improve the efficiency of this process. The invention can be widely used in the field of constraint detection.

附图说明Description of drawings

图1是元数据模型的层次结构示例图;Fig. 1 is the hierarchical structure example diagram of the metadata model;

图2是MOF存储库系统M1层中的良格式约束示例图;Fig. 2 is an example diagram of a good format constraint in the M1 layer of the MOF repository system;

图3是修改存储库系统内容的操作示例图;Fig. 3 is the operation example diagram of modifying the content of the repository system;

图4是约束OldTeacher对应的发现图;Fig. 4 is the discovery graph corresponding to the constraint OldTeacher;

图5是约束OldTeacher对应的发现图标记后的结果图;Fig. 5 is the result graph after the discovery graph corresponding to constraint OldTeacher is marked;

图6是推断约束OldTeacher的潜在冲突内部活动PIA的过程示意图。Figure 6 is a schematic diagram of the process of inferring a potentially conflicting internal activity PIA that constrains OldTeacher.

具体实施方式Detailed ways

以下结合附图对本发明实施例做进一步详述:Embodiments of the present invention are described in further detail below in conjunction with the accompanying drawings:

一种基于约束推演的MOF存储库冲突操作的发现方法,包括以下步骤:A method for discovering conflicting operations in MOF repository based on constraint deduction, comprising the following steps:

步骤1:定义影响良格式约束的内部活动并建立它们与MOF构造活动的对应关系。Step 1: Define the internal activities that affect well-formed constraints and establish their correspondence with MOF construction activities.

为了推断OCL良格式约束的潜在冲突构造活动PEA的集合,我们需要研究哪些构造活动的执行可能违背约束条件。因此本步骤主要是定义内部活动并建立它们与MOF构造活动的对应关系。在推理过程中实际参与推断的是内部活动。之所以选择在内部活动而不是构造活动之上进行推理是基于以下二方面原因:首先,我们的方法是借助良格式约束是OCL元模型的实例这一特性,通过建立发现图实例并在其上进行推理从而实现PEA的推断,因而针对可能影响OCL元模型实例的活动进行推断是较方便的选择,相反,构造活动是面向MOF模型机制的,直接在其上进行推理(尽管理论上可实现)会带来诸多不便之处;其次,目前国际上现存的元数据存储库标准有MOF,IRDS,PCTE等多种,每种标准都定义了自己框架内的构造活动。而我们则希望提出一种推断PEA的通用方法,因为一旦建立了本发明提出的内部活动和其他存储库框架的构造活动之间的对应关系,就可以调整本发明的方法以适用于其他存储库框架。这将极大地提高我们所提出的方法的适用性。In order to infer the set of potentially conflicting construction activities PEA for OCL well-formed constraints, we need to investigate which construction activities may be executed in violation of the constraints. Therefore, this step is mainly to define internal activities and establish their corresponding relationship with MOF construction activities. It is the internal activities that actually take part in inference during the inference process. Reasoning on top of internal rather than constructive activities is chosen for two reasons: First, our approach leverages the property that well-formed constraints are instances of the OCL metamodel, by building discovery graph instances and building on them Inference to achieve PEA inference, so it is more convenient to infer activities that may affect OCL metamodel instances. Conversely, construction activities are oriented towards the MOF model mechanism, and inference is performed directly on it (although theoretically achievable) It will bring a lot of inconvenience; secondly, there are currently many international metadata repository standards such as MOF, IRDS, PCTE, etc. Each standard defines the construction activities within its own framework. Instead, we would like to propose a general method for inferring PEA, because once the correspondence between the internal activities proposed by the present invention and the construction activities of other repository frameworks is established, the method of the present invention can be adapted to other repositories frame. This will greatly improve the applicability of our proposed method.

下面对OCL元模型元素种类及特性进行分析。约束元模型元素包括实体类型和关系类型二类,其上分别有建立实例和删除实例二种活动可能导致约束的违背。此外对实体类型的泛化和特化以及修改实例属性及关联端的活动均可能导致约束的违背,因此共有8种内部活动。表1列出了这些内部活动及其与MOF构造活动的对应关系。尽管内部活动与MOF的构造活动之间并不一一对应,但它们较MOF构造活动更便于PEA的推断并且可以通过表2的简单映射转换为构造活动。例如,如果推断出某个实例之上的内部活动AssignObject可能违背约束条件,而该实例既不是关联类也不是由其他实例调整所得,则需将其转化为该实例之上的构造活动CreateObjectAction,若该AssignObject是关联端的变化所导致的,则还需加上该实例之上的构造活动AddStructuralFeatureAction。其他内部活动的转换与之类似,此处不再赘述。The following is an analysis of the element types and characteristics of the OCL metamodel. Constraint metamodel elements include entity type and relation type, on which there are two activities of creating an instance and deleting an instance, which may lead to the violation of constraints. In addition, the generalization and specialization of entity types and the activities of modifying instance attributes and association ends may lead to violation of constraints, so there are 8 kinds of internal activities. Table 1 lists these internal activities and their correspondence with MOF tectonic activities. Although there is no one-to-one correspondence between internal activities and MOF construction activities, they are more convenient for PEA inference than MOF construction activities and can be converted to construction activities through the simple mapping in Table 2. For example, if it is inferred that the internal activity AssignObject on an instance may violate constraints, and the instance is neither an associated class nor adjusted by other instances, it needs to be converted into the construction activity CreateObjectAction on the instance, if The AssignObject is caused by the change of the associated end, and the construction activity AddStructuralFeatureAction on the instance needs to be added. The transformation of other internal activities is similar and will not be repeated here.

表1内部活动及其与MOF构造活动的对应关系Table 1 Internal activities and their correspondence with MOF tectonic activities

Figure BDA0001281748570000051
Figure BDA0001281748570000051

Figure BDA0001281748570000061
Figure BDA0001281748570000061

步骤2:对良格式约束进行化简Step 2: Simplify the well-formed constraints

对定义良格式约束的OCL表达式进行等价化简。首先使用定义在OCL标准库中的等价操作对出现在表达式中的操作数目进行约减,接着将表达式转换为等价的合取范式。转换的结果是每个约束被表示为析取项的合取。所得到的析取项的字面量包括forAll迭代子、算术比较、对象/集合等价比较、布尔属性、not操作符、oclIsTypeOf操作符以及oclIsKindOf操作符等。显然要满足约束条件,存储库系统必须满足每个析取项。一个析取项被满足需要至少它的字面量之一被满足。Equivalent simplification of OCL expressions that define well-formed constraints. First reduce the number of operations appearing in the expression using equivalent operations defined in the OCL standard library, and then convert the expression to the equivalent conjunctive normal form. The result of the transformation is that each constraint is represented as a conjunction of disjunctive terms. The resulting disjunct literals include forAll iterators, arithmetic comparisons, object/set equivalence comparisons, Boolean properties, not operator, oclIsTypeOf operator, and oclIsKindOf operator, etc. Obviously to satisfy the constraints, the repository system must satisfy every disjunction. A disjunct is satisfied requires that at least one of its literals be satisfied.

对图2中的4个约束进行操作数目的约减之后,约束OldTeacher和UniqueName变为(其他约束保持不变):After reducing the number of operations for the 4 constraints in Figure 2, the constraints OldTeacher and UniqueName become (other constraints remain unchanged):

context School inv OldTeacher:context School inv OldTeacher:

self.teacher->select(t|t.age>60)->size()>0self.teacher->select(t|t.age>60)->size()>0

context Teacher inv UniqueName:context Teacher inv UniqueName:

Teacher.allInstances()->forAll(t1,t2|not t1=t2implies not t1.name=t2.name)Teacher.allInstances()->forAll(t 1 ,t 2 |not t 1 =t 2 implies not t 1 .name=t 2 .name)

进一步转换为合取范式之后,约束UniqueName变为(其他约束保持不变):After further conversion to conjunctive normal form, the constraint UniqueName becomes (other constraints remain the same):

context Teacher inv UniqueName:context Teacher inv UniqueName:

Teacher.allInstances()->forAll(t1,t2|t1=t2or not t1.name=t2.name)Teacher.allInstances()->forAll(t 1 ,t 2 |t 1 =t 2 or not t 1 .name=t 2 .name)

步骤3:根据良格式约束与OCL元模型之间的内容——实例关系建立发现图。Step 3: Build a discovery graph based on the content-instance relationship between the well-formed constraints and the OCL metamodel.

在本步骤中,发现图的每个节点作为OCL元模型中元类的实例,表示OCL表达式的一个原子子集。节点的第1个后继是OCL表达式位于该节点之前的部分。若该节点表示2元操作(如“>”,“+”等),则节点的第2个后继是操作的参数;若节点表示loop表达式(如forAll,select等),则节点的第2个后继是迭代子的体。In this step, each node of the graph is found as an instance of a metaclass in the OCL metamodel, representing an atomic subset of the OCL expression. The 1st successor of a node is the part of the OCL expression that precedes the node. If the node represents a binary operation (such as ">", "+", etc.), the second successor of the node is the parameter of the operation; if the node represents a loop expression (such as forAll, select, etc.), the second successor of the node A successor is the body of the iterator.

图4给出了根据约束OldTeacher(self.teacher->select(t|t.age>60)->size()>0)建立的发现图。与操作“>”相应的元类OperationCallExp的实例是初始节点,其第1个后继是位于“>”之前的表达式(self.teacher->select(t|t.age>60)->size())而下1个后继是操作的参数(整型常量0)。初始结点的第1个后继节点的第1个后继节点是操作size,它只有1个孩子select。节点select的第1个后继节点是关联端teacher而第2个后继节点是位于属性age和整型常量60之间的操作“>”。Figure 4 shows the discovery graph built according to the constraint OldTeacher(self.teacher->select(t|t.age>60)->size()>0). The instance of the metaclass OperationCallExp corresponding to the operation ">" is the initial node, and its 1st successor is the expression located before the ">" (self.teacher->select(t|t.age>60)->size( )) and the next successor is the parameter of the operation (integer constant 0). The 1st successor of the 1st successor of the initial node is the operation size, which has only 1 child select. The first successor of node select is the association end teacher and the second successor is the operation ">" between the attribute age and the integer constant 60.

步骤4:对发现图进行标记Step 4: Label the discovery map

为了推断给定约束的PEA集合,仅单独考虑OCL表达式的每个部分是不够的。例如为了推断约束OldTeacher是否可能被分配教师到学校或解除教学关系2种活动所违背,不能只考虑子表达式self.teacher->select(t|t.age>60)->size()。实际上这2种活动都可能改变该子表达式的值,然而由于size操作之后是“>”操作,因此只有解除教学关系才可能导致约束的违背,相反,如果size之后是“<=”操作,则只有分配教室到学校才可能导致约束的违背。上述分析表明只有综合考虑每个OCL原子子集的上下文信息才能正确推断出给定约束的PEA集合,因此需要利用发现图中每个节点的上下文信息对其进行标记。In order to infer a PEA set for a given constraint, it is not enough to consider each part of an OCL expression alone. For example, in order to infer whether the constraint OldTeacher may be violated by the two activities of assigning a teacher to a school or releasing a teaching relationship, one cannot just consider the subexpression self.teacher->select(t|t.age>60)->size(). In fact, both of these two activities may change the value of the subexpression. However, since the size operation is followed by the ">" operation, the constraint violation can only be caused by releasing the teaching relationship. On the contrary, if the size is followed by the "<=" operation , then only assigning classrooms to schools may result in a violation of constraints. The above analysis shows that the PEA set for a given constraint can be correctly inferred only by comprehensively considering the contextual information of each subset of OCL atoms, so it needs to be labeled with the contextual information of each node in the discovery graph.

为每个节点所作的标记指示出该节点与它的后继节点之间相互影响的信息。在全面分析OCL各种结构的基础上我们归纳出4种不同类型的标记信息:1)“+”表示表达式的值的增加或项目数量的增加可能导致约束的违背;2)“-”表示表达式的值的减少或项目数量的减少可能导致约束的违背;3)“m”表示表达式的值的改变或项目数量的改变可能导致约束的违背;4)“nr”表示该节点与其后继节点并无相互影响。Labels for each node indicate information about the interaction between that node and its successors. Based on a comprehensive analysis of various structures of OCL, we conclude four different types of tag information: 1) "+" indicates that an increase in the value of an expression or an increase in the number of items may lead to a violation of constraints; 2) "-" indicates that The reduction of the value of the expression or the reduction of the number of items may lead to the violation of the constraint; 3) "m" indicates that the change of the value of the expression or the change of the number of items may lead to the violation of the constraint; 4) "nr" indicates that the node and its successors Nodes do not affect each other.

下面对每种标记进行举例说明。对于“+”和“-”,考虑“>”操作,要违背约束A>B有2种情况:A值的减少或B值的增加,因此节点“>”的第1个后继节点之上应该标记为“-”,而第2个后继节点之上应该标记为“+”。对于标记“m”,考虑select操作,不仅向待选集合增加对象或删除对象可能影响select的结果,甚至等数量替换待选集合的某些对象也可能影响select的结果,因此节点select的后继节点之上应该标记为“m”。对于标记“nr”,考虑and操作,由于违背A and B的活动与单独违背A和违背B的活动相同,也就是说节点and与它的后继节点之间不存在相互影响,因此节点and的后继节点之上均应标记为“nr”。An example of each marker is given below. For "+" and "-", considering the ">" operation, there are 2 situations to violate the constraint A>B: the decrease of the value of A or the increase of the value of B, so the first successor node of the node ">" should be is marked with a "-", and above the 2nd successor node should be marked with a "+". For the mark "m", considering the select operation, not only adding objects to the set to be selected or deleting objects may affect the result of the select, but even replacing some objects in the set to be selected by the same quantity may also affect the result of the select, so the successor node of the node select Above should be marked "m". For the flag "nr", consider the and operation. Since the activities of violating A and B are the same as the activities of violating A and B alone, that is to say, there is no mutual influence between the node and and its successor, so the successor of the node and Above the node should be marked "nr".

由于标记发现图的过程需要首先考虑当前节点之上的标记信息以及节点的类型从而确定其后继节点之上的标记信息,因此标记的过程需要对发现图进行广度优先遍历。表2对各种节点类型的标记方法进行了汇总。表2的单元格中如果某个节点上的标记符号超过1个,则应分别应用每种标记以确定其后继节点上的标记。单元格的内容“×”表示不存在这种组合情况的约束条件。Since the process of labeling the discovery graph needs to first consider the label information on the current node and the type of the node to determine the label information on its successor nodes, the labeling process requires breadth-first traversal of the discovery graph. Table 2 summarizes the labeling methods for various node types. In the cells of Table 2, if there is more than 1 marker symbol on a node, each marker should be applied separately to determine the marker on its successor node. The content of the cell "X" indicates that there are no constraints for this combination.

表2发现图的标记信息汇总Table 2 Summary of marker information for discovery graphs

Figure BDA0001281748570000081
Figure BDA0001281748570000081

Figure BDA0001281748570000091
Figure BDA0001281748570000091

对约束OldTeacher对应的发现图进行标记的结果见图5。为了简明起见,我们略去了图4中与标记无关的内容.另外为每个节点添加了标记该节点所用到的表2单元格的信息,其中(X,Y)表示第X行第Y列的单元格.The result of labeling the discovery graph corresponding to the constraint OldTeacher is shown in Figure 5. For the sake of brevity, we omit the content that has nothing to do with marking in Figure 4. In addition, for each node, the information of the cells in Table 2 used to mark the node is added, where (X, Y) represents the Xth row and the Y column 's cells.

标记的过程首先从初始节点开始.由于“>”无前驱节点,因此其上无须标记.根据单元格(2,1),初始节点的第1个后继应标记为“-”而第2个后继应标记为“+”,因此节点size之上为“-”.再根据单元格(11,3),我们将节点size的后继(节点select)标记为“-”.按照单元格(10,3),节点select的第1个后继节点之上的标记是“-m”而第2个后继节点之上的标记是“nr”.再参考单元格(9,3)和(9,4),节点teacher的后继节点self应标记为“-m”。其他部分的标注以此类推,限于篇幅,此处不再赘述。The marking process starts with the initial node. Since ">" has no predecessor node, there is no need to mark it. According to cell (2, 1), the 1st successor of the initial node should be marked with "-" and the 2nd successor Should be marked "+", so above node size is "-". Then according to cell (11, 3), we mark the successor (node select) of node size as "-". According to cell (10, 3) ), the mark above the 1st successor of node select is "-m" and the mark above the 2nd successor is "nr". Referring again to cells (9, 3) and (9, 4), The successor node self of node teacher should be marked with "-m". The labeling of other parts is analogous, and it is not repeated here because of space limitations.

步骤5:获取内部活动Step 5: Get Internal Activities

发现图标记好以后,下一步就可以据此推断出给定约束的潜在冲突内部活动PIA。由于标记图已明确标示出OCL原子子集表达式的类型以及该表达式如何变化能够违背整个约束,因此推断PIA的过程就是自下而上逐级推断并汇总的过程,也就是对图进行广度优先遍历的逆过程。Once the discovery graph is marked, the next step is to infer the potential conflicting internal activity PIA for a given constraint. Since the labeling graph has clearly marked the type of the OCL atomic subset expression and how the expression changes can violate the entire constraint, the process of inferring the PIA is a bottom-up inference and summary process, that is, the breadth of the graph. Reverse process of priority traversal.

表3汇总了不同节点类型和标记信息的组合所对应的PIA的集合。c1+c2表示该节点的PIA集合是其后继节点的PIA集合的并集。c1适用于该节点只有1个后继节点的情形。空单元格意味着该节点并不影响PIA的推断汇总。需要特别说明的是c1+X和opp(X)。c1+X表示该节点向PIA集合中添加活动X。举例来说,如果关联端被标记为“+”,则其从属关联的链接实例的建立可能导致约束的违背,因此该节点应向PIA集合中添加AssignLink活动,即c1+AssignLink。opp(X)表示该节点的PIA是其后继节点返回的PIA的相反活动,例如not操作。内部活动的相反活动分别如下:opp(AssignObject)=RomoveObject,opp(ModifyProperty)=ModifyProperty,opp(RomoveObject)=AssignObject,opp(AssignLink)=RemoveLink,opp(RemoveLink)=AssignLink,opp(ModifyEnd)=ModifyEnd。Table 3 summarizes the set of PIAs corresponding to different combinations of node types and tag information. c1+c2 indicates that the PIA set of this node is the union of the PIA sets of its successor nodes. c1 is suitable for the situation that the node has only one successor node. An empty cell means that the node does not affect the inferred summary of the PIA. In particular, it is c 1 +X and opp(X). c 1 +X means that the node adds activity X to the PIA set. For example, if an association end is marked "+", the establishment of a link instance of its subordinate association may result in a constraint violation, so the node should add an AssignLink activity to the PIA set, ie c 1 +AssignLink. opp(X) indicates that the PIA of this node is the opposite activity of the PIA returned by its successor, such as a not operation. The opposite activities of the internal activities are as follows: opp(AssignObject)=RomoveObject, opp(ModifyProperty)=ModifyProperty, opp(RomoveObject)=AssignObject, opp(AssignLink)=RemoveLink, opp(RemoveLink)=AssignLink, opp(ModifyEnd)=ModifyEnd.

表3节点类型及标记信息所对应的PIA集合Table 3 PIA sets corresponding to node types and tag information

Figure BDA0001281748570000101
Figure BDA0001281748570000101

Figure BDA0001281748570000111
Figure BDA0001281748570000111

将表3应用于约束OldTeacher,得到的结果如图6所示。首先处理节点self。由于节点self之上的标记是“-”和“m”,按照表3的单元格(17,3),(17,4)可知该节点不添加任何PIA。然后参考单元格(9,3),(9,4)处理关联端teacher,向PIA的集合中添加活动AssignObject(School),RemoveLink(TeachesIn),ModifyEnd(TeachesIn-Teacher)。接着处理节点select的第2个后继(t.age>60),它添加了活动ModifyProperty(age)。在此之后处理节点select,参考单元格(10,3),节点select的PIA集合是它的后继节点的PIA集合的并集。随后处理节点size、整型常量节点0并以初始节点“>”结束,它们均不添加任何活动。最终由初始节点“>”返回的PIA集合即是整个约束表达式的PIA的集合。通过这一步骤,我们可知可能违背约束OldTeacher的内部活动有ModifyProperty(age),ModifyEnd(TeachesIn-Teacher),RemoveLink(TeachesIn),AssignObject(School)。Applying Table 3 to the constraint OldTeacher, the result is shown in Figure 6. Node self is processed first. Since the marks above the node self are "-" and "m", according to the cells (17, 3) and (17, 4) of Table 3, it can be known that this node does not add any PIA. Then refer to cells (9, 3), (9, 4) to process the associated end teacher, and add the activities AssignObject(School), RemoveLink(TeachesIn), and ModifyEnd(TeachesIn-Teacher) to the collection of PIA. Then process the 2nd successor of node select (t.age>60), which adds the activity ModifyProperty(age). After this node select is processed, referring to cell (10, 3), the PIA set of node select is the union of the PIA sets of its successor nodes. Then process node size, integer constant node 0 and end with initial node ">", none of which add any activity. Finally, the set of PIAs returned by the initial node ">" is the set of PIAs of the entire constraint expression. Through this step, we know that the internal activities that may violate the constraint OldTeacher include ModifyProperty(age), ModifyEnd(TeachesIn-Teacher), RemoveLink(TeachesIn), AssignObject(School).

步骤6:确定违背约束的潜在操作Step 6: Identify potential actions that violate constraints

按照步骤5推断出每个约束条件的PIA集合以后,需要将其转换为对应的PEA的集合,并检查它们是否在操作规范中出现。以OldTeacher为例,ModifyEnd(TeachesIn-Teacher)直接转化为关联端teacher之上的AddStructuralFeatureAction,ModifyProperty(age)直接转化为属性age之上的AddStructuralFeatureAction,RemoveLink(TeachesIn)转化为关联TeachesIn之上的DestroyLinkAction,对于AssighObject(School),由于School既不是关联类也不是由其他实例调整所得,而且AssignObject不是由关联端的变化所导致,因此只需将其转化为School之上的CreateObjectAction。After inferring the set of PIAs for each constraint according to step 5, it is necessary to convert them into sets of corresponding PEAs and check whether they appear in the operation specification. Taking OldTeacher as an example, ModifyEnd(TeachesIn-Teacher) is directly converted into AddStructuralFeatureAction on the associated end teacher, ModifyProperty(age) is directly converted into AddStructuralFeatureAction on the attribute age, and RemoveLink(TeachesIn) is converted into DestroyLinkAction on the associated TeachesIn. AssighObject(School), since School is neither an associated class nor adjusted by other instances, and AssignObject is not caused by changes at the associated end, it only needs to be converted into CreateObjectAction above School.

因此我们得到如下结果:So we get the following result:

(1)每个约束的PIA集合:(1) The set of PIAs for each constraint:

①OldTeacher—ModifyProperty(age),ModifyEnd(TeachesIn-Teacher),RemoveLink(TeachesIn),AssignObject(School);①OldTeacher—ModifyProperty(age), ModifyEnd(TeachesIn-Teacher), RemoveLink(TeachesIn), AssignObject(School);

②NotHeadmasterParttimeteacher—SubReclassify(Parttimeteacher),AssignLink(Manages),ModifyEnd(Manages-Headmaster);②NotHeadmasterParttimeteacher—SubReclassify(Parttimeteacher), AssignLink(Manages), ModifyEnd(Manages-Headmaster);

③UniqueName—AssignObject(Teacher),ModifyProperty(Name-Teacher);③UniqueName—AssignObject(Teacher), ModifyProperty(Name-Teacher);

④ValidWorkinghours—AssignObject(Parttimeteacher),ModifyProperty(Workinghours);④ValidWorkinghours—AssignObject(Parttimeteacher), ModifyProperty(Workinghours);

(2)转换为MOF标准的构造活动,所得的PEA集合:(2) Converted to MOF standard construction activities, the resulting PEA set:

①OldTeacher—属性age之上的AddStructuralFeatureAction,关联端teacher之上的AddStructuralFeatureAction,关联TeachesIn之上的DestroyLinkAction,School之上的CreateObjectAction;①OldTeacher—AddStructuralFeatureAction on the attribute age, AddStructuralFeatureAction on the associated teacher, DestroyLinkAction on the associated TeachersIn, and CreateObjectAction on the School;

②NotHeadmasterParttimeteacher—将全职教师所属类元修改为Parttimeteacher的ReclassifyObjectAction,Manages之上的CreateLinkAction,关联端headmaster之上的AddStructuralFeatureAction;②NotHeadmasterParttimeteacher—Modify the class element to which the full-time teacher belongs to ReclassifyObjectAction of Parttimeteacher, CreateLinkAction above Manages, and AddStructuralFeatureAction above headmaster of the associated end;

③UniqueName—Teacher之上的CreateObjectAction,Parttimeteacher之上的CreateObjectAction,属性name之上的AddStructuralFeatureAction;③UniqueName—CreateObjectAction above Teacher, CreateObjectAction above Parttimeteacher, AddStructuralFeatureAction above attribute name;

④ValidWorkinghours—Parttimeteacher之上的CreateObjectAction,属性workinghours之上的AddStructuralFeatureAction;④ValidWorkinghours—CreateObjectAction above Parttimeteacher, AddStructuralFeatureAction above attribute workinghours;

(3)每个操作可能违背的约束:(3) Constraints that each operation may violate:

①EmployParttimeteacher可能违背ValidWorkinghours和UniqueName,其他2个约束则不会违背;①EmployParttimeteacher may violate ValidWorkinghours and UniqueName, but the other two constraints will not be violated;

②DismissTeacher只可能违背OldTeacher;②DismissTeacher may only violate OldTeacher;

③DeleteAssociation只可能违背OldTeacher。③DeleteAssociation may only violate OldTeacher.

利用上述推断出的知识,在每个操作执行完以后就无需检测所有4个约束条件了,执行EmployParttimeteacher以后只需检测2个约束而执行DismissTeacher和DeleteAssociation以后只需检测1个约束。可以看到通过缩小待检测的约束的集合,我们的方法可以显著提高良格式约束检测的效率。Using the above inferred knowledge, there is no need to detect all 4 constraints after each operation is performed. After executing EmployParttimeteacher, only 2 constraints are required to be detected, and after DismissTeacher and DeleteAssociation are executed, only one constraint is detected. It can be seen that by narrowing the set of constraints to be detected, our method can significantly improve the efficiency of well-formed constraint detection.

为了评测本发明的有效性,以本发明所处理的元数据模型为例进行说明,它包括元数据的模型结构、位于M1层的4个OCL良格式约束以及修改存储库系统内容的3个操作。为了简明起见,我们忽略其他层中的约束。模型结构如图1所示。作为M2层元数据实例的M1层元数据描述了学校和教师的信息。教师分为全职教师和兼职教师。M1层中的4个约束条件如图2所示,分别用于确保:每个学校至少有1个60岁以上的教师(OldTeacher约束);校长不能是兼职教师(NotHeadmasterParttimeteacher约束);2个教师的名字不能相同(UniqueName约束);兼职教师的周工作时间必须介于10h和40h之间(ValidWorkinghours约束)。3个操作如图3所示。每个具体活动之后我们附加了等价的MOF构造活动。操作EmployPartimeteacher为给定的学校聘用1个新兼职教师。它建立类元Parttimeteacher的1个新对象实例,对其进行初始化赋值并将其关联到学校。操作DismissTeacher解聘1个教师(全职或兼职)并删除其与学校的关联。操作DeleteAssociation删除1个关联,同时删除它的关联端、关联与关联端之间的关系以及关联端与类之间的关系。EmployPartimeteacher和DismissTeacher仅修改M0层中的内容,而DeleteAssociation修改M1层中内容的同时将改变传播到M0层,即M0层中的内容也将被修改。(因为高层次中内容的改变必须传播到它下面的所有层次,例如删除1个类的同时必须删除下面所有层次中该类的所有实例。)In order to evaluate the effectiveness of the present invention, the metadata model processed by the present invention is taken as an example to illustrate, which includes the model structure of the metadata, four OCL good format constraints located at the M1 layer, and three operations to modify the content of the repository system . For brevity, we ignore constraints in other layers. The model structure is shown in Figure 1. The M1 layer metadata, which is an example of the M2 layer metadata, describes the information of schools and teachers. Faculty are divided into full-time faculty and part-time faculty. The four constraints in the M1 layer are shown in Figure 2, which are used to ensure that: each school has at least one teacher over 60 years old (OldTeacher constraint); the principal cannot be a part-time teacher (NotHeadmasterParttimeteacher constraint); Names cannot be the same (UniqueName constraint); part-time teachers must have weekly working hours between 10h and 40h (ValidWorkinghours constraint). The three operations are shown in Figure 3. After each concrete activity we append the equivalent MOF construction activity. Operate the EmployParttimeteacher to hire 1 new part-time teacher for a given school. It creates a new object instance of the classifier Parttimeteacher, initializes it and associates it with the school. Action DismissTeacher dismisses 1 teacher (full-time or part-time) and removes its association with the school. Operation DeleteAssociation deletes an association, and at the same time deletes its association end, the relationship between the association and the association end, and the relationship between the association end and the class. EmployPartimeteacher and DismissTeacher only modify the content in the M0 layer, while DeleteAssociation modifies the content in the M1 layer and propagates the changes to the M0 layer, that is, the content in the M0 layer will also be modified. (Because changes in content at a higher level must be propagated to all levels below it, for example deleting a class must delete all instances of that class in all levels below it.)

通过应用本方法,我们可以推断出EmployParttimeteacher只可能违背约束ValidWorkinghours和UniqueName,其它两个约束则不可能违背,而DismissTeacher和DeleteAssociation只可能违背约束OldTeacher,其它三个约束则不可能违背。因此在每个操作执行完以后就无需检测所有4个约束条件了,执行EmployParttimeteacher以后只需检测2个约束而执行DismissTeacher和DeleteAssociation以后只需检测1个约束即可。可以看到我们的方法可以大大提高良格式约束检测的效率。By applying this method, we can infer that EmployParttimeteacher can only violate the constraints ValidWorkinghours and UniqueName, while the other two constraints cannot be violated. DismissTeacher and DeleteAssociation can only violate the constraints OldTeacher, and the other three constraints cannot be violated. Therefore, there is no need to detect all 4 constraints after each operation is executed. After executing EmployParttimeteacher, only 2 constraints are required, and after DismissTeacher and DeleteAssociation are executed, only 1 constraint is required. It can be seen that our method can greatly improve the efficiency of well-formed constraint detection.

需要强调的是,本发明所述的实施例是说明性的,而不是限定性的,因此本发明包括并不限于具体实施方式中所述的实施例,凡是由本领域技术人员根据本发明的技术方案得出的其他实施方式,同样属于本发明保护的范围。It should be emphasized that the embodiments described in the present invention are illustrative rather than restrictive, so the present invention includes but is not limited to the embodiments described in the specific implementation manner. Other embodiments derived from the scheme also belong to the protection scope of the present invention.

Claims (6)

1.一种基于约束推演的MOF存储库冲突操作的发现方法,其特征在于包括以下步骤:1. a discovery method based on the MOF repository conflict operation of constraint deduction, is characterized in that comprising the following steps: 步骤1、定义影响良格式约束的内部活动并建立它们与MOF构造活动的对应关系;Step 1. Define internal activities that affect well-formed constraints and establish their correspondence with MOF construction activities; 步骤2:对良格式约束进行化简;Step 2: Simplify the well-formed constraints; 步骤3:建立发现图;Step 3: Create a discovery map; 步骤4:对发现图进行标记;Step 4: Mark the discovery map; 步骤5:获取内部活动;Step 5: Get the internal activity; 步骤6:确定违背约束的潜在操作;Step 6: Identify potential actions that violate constraints; 所述步骤2的具体实现方法为:首先使用定义在OCL标准库中的等价操作对出现在表达式中的操作数目进行约减;然后将表达式转换为等价的合取范式,转换的结果是每个约束被表示为析取项的合取;所得到的析取项的字面量包括forAll迭代子、算术比较、对象/集合等价比较、布尔属性、not操作符、oclIsTypeOf操作符以及oclIsKindOf操作符。The specific implementation method of step 2 is as follows: first, the equivalent operations defined in the OCL standard library are used to reduce the number of operations appearing in the expression; then the expression is converted into an equivalent conjunctive normal form, and the converted The result is that each constraint is represented as a conjunction of disjunctions; the resulting disjunct literals include forAll iterators, arithmetic comparisons, object/set equivalence comparisons, boolean properties, the not operator, the oclIsTypeOf operator, and oclIsKindOf operator. 2.根据权利要求1所述的基于约束推演的MOF存储库冲突操作的发现方法,其特征在于:所述内部活动是根据实体类型和关系类型定义的包括建立实例和删除实例的八种内部活动关系。2. the discovery method of the MOF repository conflict operation based on constraint derivation according to claim 1, is characterized in that: described internal activity is according to entity type and relation type definition and comprises the eight kinds of internal activities of establishing instance and deleting instance relation. 3.根据权利要求1所述的基于约束推演的MOF存储库冲突操作的发现方法,其特征在于:所述步骤3是根据良格式约束与OCL元模型之间的内容——实例关系建立的发现图。3. the discovery method of the MOF repository conflict operation based on constraint derivation according to claim 1, it is characterized in that: described step 3 is the discovery that according to the content between good format constraint and OCL metamodel---instance relationship is established picture. 4.根据权利要求1所述的基于约束推演的MOF存储库冲突操作的发现方法,其特征在于:所述步骤4对发现图进行标记的方法为:为每个节点所作的标记指示出该节点与它的后继节点之间相互影响的信息,包括四种不同类型的标记信息:“+”表示表达式的值的增加或项目数量的增加可能导致约束的违背;“-”表示表达式的值的减少或项目数量的减少可能导致约束的违背;“m”表示表达式的值的改变或项目数量的改变可能导致约束的违背;“nr”表示该节点与其后继节点并无相互影响。4. the discovery method of the MOF repository conflict operation based on constraint derivation according to claim 1, it is characterized in that: the method that described step 4 marks the discovery graph is: the mark made for each node indicates this node The information that interacts with its successor nodes, including four different types of tag information: "+" indicates that the increase in the value of the expression or the increase in the number of items may lead to a constraint violation; "-" indicates the value of the expression A decrease in the number of items or a decrease in the number of items may lead to a constraint violation; "m" indicates that a change in the value of the expression or a change in the number of items may lead to a constraint violation; "nr" indicates that the node and its successors do not interact with each other. 5.根据权利要求1所述的基于约束推演的MOF存储库冲突操作的发现方法,其特征在于:所述步骤5的具体方法为:按自下而上逐级推断并汇总的过程进行获取,推断出每个约束条件的PIA集合。5. the discovery method of the MOF repository conflict operation based on constraint deduction according to claim 1, it is characterized in that: the concrete method of described step 5 is: by the process of bottom-up inference and summary step by step, obtain, A set of PIAs for each constraint is inferred. 6.根据权利要求1所述的基于约束推演的MOF存储库冲突操作的发现方法,其特征在于:所述步骤6的具体方法为:根据每个约束的PIA集合,转换为MOF标准的构造活动并得到PEA集合,最后检查每个操作是否存在违背的约束。6. the discovery method of the MOF repository conflict operation based on constraint deduction according to claim 1, is characterized in that: the concrete method of described step 6 is: according to the PIA set of each constraint, be converted into the construction activity of MOF standard And get the PEA set, and finally check whether each operation has violated constraints.
CN201710290213.6A 2017-04-28 2017-04-28 A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction Active CN107273407B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710290213.6A CN107273407B (en) 2017-04-28 2017-04-28 A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710290213.6A CN107273407B (en) 2017-04-28 2017-04-28 A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction

Publications (2)

Publication Number Publication Date
CN107273407A CN107273407A (en) 2017-10-20
CN107273407B true CN107273407B (en) 2020-06-26

Family

ID=60073594

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710290213.6A Active CN107273407B (en) 2017-04-28 2017-04-28 A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction

Country Status (1)

Country Link
CN (1) CN107273407B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101377757A (en) * 2007-08-28 2009-03-04 国际商业机器公司 Method and device for performing restriction malfunction analysis based on restriction mode
CN101866406A (en) * 2010-06-18 2010-10-20 中国科学院软件研究所 A defense method for stack overflow attack
FR2968074B1 (en) * 2010-11-26 2012-12-21 Sncf FORCE MEASURING WHEEL FOR A RAILWAY VEHICLE, MEASURING DEVICE AND METHOD OF MANUFACTURING THE WHEEL
CN102760076B (en) * 2012-06-05 2015-01-21 华为技术有限公司 Policy conflict processing method for system and policy conflict processing system
CN103715692B (en) * 2014-01-14 2015-12-30 国家电网公司 A kind of 1000kV/500kV/220kV electromagnetic looped network unlinks choose opportunities method

Also Published As

Publication number Publication date
CN107273407A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
US8752005B2 (en) Concept-oriented software engineering system and method for identifying, extracting, organizing, inferring and querying software system facts
Li et al. Learning ontology from relational database
Baclawski et al. Extending the Unified Modeling Language for ontology development
Sevilla Ruiz et al. Inferring versioned schemas from NoSQL databases and its applications
US7693812B2 (en) Querying data and an associated ontology in a database management system
Xu et al. Automatic extraction of OWL ontologies from UML class diagrams: a semantics-preserving approach
US20080172360A1 (en) Querying data and an associated ontology in a database management system
Ma et al. Representing and reasoning on fuzzy UML models: A description logic approach
Cruz et al. Semi-automatic ontology alignment for geospatial data integration
WO2003069442A2 (en) Ontology frame-based knowledge representation in the unified modeling language (uml)
Lee et al. Ontology management for large-scale enterprise systems
Vogt et al. FAIR 2.0: Extending the FAIR guiding principles to address semantic interoperability
Vavliakis et al. An integrated framework for enhancing the semantic transformation, editing and querying of relational databases
Ferilli et al. LPG-based Ontologies as Schemas for Graph DBs.
Omollo et al. Data modeling techniques used for big data in enterprise networks
CN107273407B (en) A Discovery Method for Conflicting Operations in MOF Repository Based on Constraint Deduction
Zhang et al. Construction of fuzzy OWL ontologies from fuzzy EER models: A semantics-preserving approach
Lee et al. Ontology management for large-scale e-commerce applications
Vysniauskas et al. Mapping of OWL ontology concepts to RDB schemas
Poulovassilis Applications of flexible querying to graph data
Gogolla Tales of ER and RE Syntax and Semantics
Xu et al. A semantics-preserving approach for extracting OWL ontologies from UML class diagrams
Ma et al. Modeling and Management of Fuzzy Semantic RDF Data
Palmonari AER IA: Extending SKOS for the practical, yet well-founded, representation and integration of Web schemas in the large.
Orsi Context based querying of dynamic and heterogeneous information sources.

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
GR01 Patent grant