Method and device for establishing specific domain modeling environment
By automatically instantiating and generating domain meta-models and implementing a dynamic verification mechanism, the problem of low efficiency in domain-specific modeling is solved. This enables a visual modeling tool and real-time verification without coding, thereby improving modeling efficiency and quality.
Patent Information
- Application Number
- CN202511979344.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-02-10
AI Technical Summary
Existing technologies suffer from problems such as long customization cycles, inability to dynamically expand, inability to verify in real time, and high computational overhead in modeling specific domains, resulting in low modeling efficiency and difficulty in guaranteeing model quality.
The system generates domain metamodels by automatically instantiating rules, constructs executable constraint data structures, dynamically generates a visual editor, performs incremental verification at runtime, identifies the impact of metamodel changes, and supports dynamic extensions without recompilation.
It enables the generation of visual modeling tools without coding development, supports runtime dynamic expansion and real-time incremental verification, and significantly improves the efficiency and quality of domain modeling.
Smart Images

Figure CN121501274A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model-driven development technology in computer software engineering, and in particular to a method and apparatus for constructing a domain-specific modeling (DSM) environment. Specifically, it provides a technical solution that supports the customization, management, dynamic expansion, incremental verification, and visualization of domain meta-models and their constraints. Background Technology
[0002] In the process of information system project development, it is necessary to build various types of models. Accurate modeling at each stage is an important link to ensure system quality and development efficiency. Universal Modeling Language (UML) is a widely used software modeling method, but because it is geared towards general domains, its expressive ability is limited when dealing with specific business semantics. Domain-Specific Modeling (DSM) can express business concepts more accurately by building modeling languages and tools for specific domains, but existing technologies still have the following problems: (1) Domain modeling tools need to rely on manual coding development, and the customization cycle is long; (2) After the metamodel is updated, it is impossible to verify the consistency of the existing domain model, which leads to the propagation of model errors; (3) The editor generation depends on recompilation and cannot dynamically expand the modeling capabilities; (4) The current verification mechanism is mostly based on full verification, which has a large computational overhead and cannot provide real-time feedback. Summary of the Invention
[0003] Purpose of the invention: To solve the above-mentioned technical problems, the present invention provides a method and apparatus for establishing a domain-specific modeling environment, which enables the generation of visual modeling tools without coding development, and supports runtime dynamic expansion, real-time incremental verification of constraints, and identification of the impact of meta-model changes, thereby significantly improving the efficiency and quality of domain modeling. Technical solution
[0004] A method for establishing a domain-specific modeling environment includes: (1) Generate a domain metamodel containing entity classes, relation classes and enumeration classes by executing automatic instantiation rules on the preset meta-metamodel; (2) Construct an executable constraint data structure based on the domain metamodel, including instance number limit, creation method constraint and relation consistency constraint; (3) Encapsulate the domain metamodel and constraint data into metamodel framework data with a unique identifier index; (4) The runtime parsing engine loads the framework data without recompiling and dynamically generates a visual domain model editor; (5) During the domain model construction process, perform operation-level triggered constraint incremental verification, only verify the affected model elements and output prompts; (6) When the metamodel framework is updated, identify the affected model elements based on the difference comparison algorithm and provide modification suggestions.
[0005] The specific domain modeling environment consists of three parts: domain metamodel customization, domain modeling metamodel standardization framework, and domain modeling.
[0006] Domain experts customize domain meta-models and construct standard meta-models and their constraint frameworks that conform to the characteristics of the domain. Ordinary modelers then build domain-specific models based on the meta-model framework constructed by domain experts.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a method for establishing a domain-specific modeling environment is provided. Based on the different levels of abstraction of the established models, the models are divided into domain models, domain meta-models, and meta-meta-models according to the level of abstraction from low to high.
[0008] The domain metamodel serves as a modeling element for constructing the domain model, and the domain model is constructed by instantiating the metamodel.
[0009] The meta-meta-model refers to the meta-model of the domain meta-model, which is constructed by instantiating the meta-meta-model.
[0010] The process of customizing and standardizing the domain metamodel involves view customization, model package customization, model type customization, and metamodel customization. The specific customization content and its relationships are represented by sets as follows: P = {view_1,view_2,…view_n} where P: framework project, view: view defined in the framework project, including but not limited to capability view, business view, system view, etc., which can be defined by domain experts themselves; view={package_1,package_2,…package_n} where package: model classification package, used to classify models of specific aspects; package={model_1,model_2,…model_n} where model: defines the required model type, common model categories include ordinary plots, tables, matrices, activity graphs, etc.; model={metaModel_1,metaModel_2,…metaModel_n} where metaModel: instantiated metamodel, serving as a domain-specific modeling element; metaModel={entityObject_1,entityObject_2…,relationObject_1,relationObject_2…, enumerationObject_1, enumerationObject_2…} where entityObject: entity class metamodel object, relationObject: relation class metamodel object, enumerationObject: enumeration class metamodel object; Based on the characteristics of a specific domain and modeling requirements, at least one modeling perspective is provided for configuration. A view model is built from this perspective, and optional view types are provided, including but not limited to business view, system view, service view, data and information view, etc.
[0011] Based on the provided modeling perspective, configure the type of domain model to be built. The provided domain model types include, but are not limited to, general diagrams, flowcharts, activity diagrams, state machine diagrams, sequence diagrams, evolution diagrams, various types of tables and matrices, etc.
[0012] When determining the metamodel for a specific domain, this is done by instantiating the meta-metamodel and selecting a modeling representation for it, where: First, meta-meta-models refer to the meta-models of meta-models. Their categories include entity-type meta-meta-models, relation-type meta-meta-models, and enumeration-type meta-meta-models. The meta-models of the domain model are established by instantiating the above meta-meta-models. Thus, the types of instantiated meta-models include entity-type meta-models, relation-type meta-models, and enumeration-type meta-models.
[0013] Secondly, by configuring the representation of various instantiated metamodels, modeling elements with different appearances can be presented when drawing domain models. Clearly, different types of domain model metamodels have different selectable representation options.
[0014] For a specific domain model, the required meta-model is created by instantiating a meta-meta-model, and meta-model constraints are configured, including but not limited to: First, configure the instance limit of the metamodel, including the maximum and minimum number of instances supported. This is mainly used when modeling the domain to limit the number of times the metamodel is instantiated.
[0015] Secondly, there are two ways to create a metamodel: direct creation and reference creation. Direct creation is suitable for creating the metamodel object for the first time, while reference creation is suitable for referencing an already created metamodel object. When creating a domain model, the data of a metamodel object created by reference can only come from other established models.
[0016] Furthermore, you can add attribute information to the metamodel and establish attribute associations between various entity class metamodels, attribute associations with other metamodel objects, and attribute associations with enumeration objects.
[0017] Finally, by using a custom relational metamodel, constraint relationships are established between entity metamodel objects.
[0018] By repeatedly executing the above method, all entity class metamodels, relation class metamodels, and their constraints required to complete a single domain model are created.
[0019] By analogy, entity class metamodels, relation class metamodels, and their metamodel relation constraints are constructed for all the required domain models from a specific perspective in a particular domain, forming a standardized metamodel framework for domain-specific modeling.
[0020] Ordinary modelers use the standardized metamodel framework for domain modeling to build projects. By loading and reading data such as views, model packages, model types, and metamodels and constraints contained in each model type from the metamodel framework, a visual domain model editor is formed for domain model construction, thereby improving the standardization and quality of modeling.
[0021] Secondly, an apparatus for establishing a domain-specific modeling environment is provided, comprising: The domain metamodel customization module is used to customize the views, model types, metamodels contained in the model and their constraints required for a specific domain model, and to encapsulate the data generated by the customization module according to standards to form standardized XML files and ZIP files. A custom data storage device for the domain metamodel is used to store standardized XML files and their associated supporting files on a disk; Domain Modeling Module: This module is used to parse and identify standardized meta-model framework data, and generate a visual domain model editor based on the identified configuration data.
[0022] Domain modeling data storage device, used to store completed domain-specific models on disk for easy reading, writing and sharing. Beneficial effects
[0023] This invention provides a method and apparatus for establishing a domain-specific modeling environment, solving the problems of low modeling efficiency and difficulty in guaranteeing the quality of domain models caused by the lack of targeted modeling tools and standards when modeling for a specific domain. Domain experts can use this modeling environment to efficiently configure the model types, meta-models, and constraint standards required for the domain, forming a domain modeling framework. Ordinary modelers can then use this framework for domain modeling work, thereby greatly improving the standardization of domain modeling and enhancing the quality of the resulting domain models. Attached Figure Description
[0024] The present invention will now be described in further detail with reference to the accompanying drawings and specific implementation methods.
[0025] Figure 1 This is a schematic diagram illustrating the instantiation relationship between different types of objects according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the composition structure of a specific domain modeling environment according to Embodiment 2 of the present invention; Figure 3 This is the domain meta-model and its constraint definition process according to Embodiment 3 of the present invention; Figure 4 This is a schematic diagram of the meta-model customization according to Embodiment 4 of the present invention; Figure 5 This is a flowchart of the domain model creation process according to Embodiment 5 of the present invention; Figure 6 This is a schematic diagram of the visual model editing interface according to Embodiment 6 of the present invention; Figure 7 This is the metamodel constraint change and verification process according to Embodiment 7 of the present invention; Figure 8 This is a schematic diagram of the structure of a domain-specific modeling environment processing device according to Embodiment 8 of the present invention. Detailed Implementation
[0026] To make the technical solution of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Example
[0027] Please refer to Figure 1 This is an instanced relationship diagram between different types of objects provided in Embodiment 1 of the present invention, applicable to the management of objects at different levels in a domain modeling environment. It provides an automatic instantiation method based on a meta-meta-model, which automatically generates entity, relation, and enumeration meta-model objects through structural constraints, and configures their attributes and representations.
[0028] When modeling for a specific domain, the first step is to define the primitives used for modeling, i.e., the meta-model. Then, domain modeling is performed based on the meta-model. The meta-model can be created using meta-meta-models. In this process, two modeling procedures and three types of models are mainly applied. The model hierarchy types include meta-meta-models, meta-models, and domain models. The modeling process includes two procedures: meta-modeling and domain modeling.
[0029] S110: Since the meta-meta-model belongs to the highest level of abstraction, its model categories are mainly composed of "entity class", "relation class", "enumeration class", etc. Then, based on these basic meta-models, a meta-model strongly related to a specific domain is instantiated, and basic attributes and representation forms are established for the meta-model.
[0030] For example, for a specific model, which includes multiple categories of meta-models, by establishing multiple meta-models and their relationships, the formal rules and structural specifications of a domain-specific model are constructed, and ultimately a domain-specific modeling framework is formed.
[0031] S120: The domain metamodel, as the modeling elements and constraints of the domain model, consists of various types of objects formed after the meta-metamodel is instantiated.
[0032] S130: The domain model layer creates a domain-specific model by using standardized views, model types, and metamodel constraints. Example
[0033] Please refer to Figure 2 The present invention provides embodiment 2, which uses an encapsulation module to generate standardized XML or JSON framework data of domain meta-model and constraint relationship. The encapsulated meta-model customized data serves as the framework data for modeling specific domains, and contains icon library, image library, standard library, data dictionary, etc., and is stored and transmitted in the form of ZIP compressed package. In the domain-specific modeling module, modeling work is carried out by creating projects, which need to be associated with a certain meta-model framework data. The domain-specific module will automatically load and generate view and model type data based on the meta-model framework data, serving as a modeling tool platform suitable for the current domain. This enables domain-specific modeling based on the meta-model framework and supports the inspection and verification of the modeled data, including basic verification work such as model data consistency checks and completeness checks. Example
[0034] Please refer to Figure 3 This invention provides a domain metamodel and its constraint definition process, as described in Embodiment 3 of the present invention. It offers a method for customizing and managing constraints of a domain-specific modeling metamodel, where the metamodel serves as a domain modeling element. After the runtime parsing engine loads the framework data, it dynamically generates a visual modeling editor, eliminating the need for system recompilation and achieving data-driven rendering.
[0035] S310: Before implementing the above-mentioned customization and constraint management methods, it is necessary to determine the domain modeling perspective based on the specific domain modeling requirements, and select the required domain model type based on the modeling perspective.
[0036] S320: Different domain model types have the same metamodel creation method, which includes normal creation and reference creation.
[0037] Different domain model types have different meta-model representations. The representation refers to the representation of the meta-model. Preferably, for ordinary wireframe domain models, the representation of meta-model entity objects includes, but is not limited to, rectangles, circles, rhombuses, etc., and the representation of relation objects includes, but is not limited to, various lines, curves, UML-type relations, etc.
[0038] S330: When constructing the metamodel and constraints of a domain model, first select the method for creating the metamodel, and then create the metamodel, metamodel relationships, metamodel constraints, and metamodel attributes based on this.
[0039] When creating a metamodel of a domain model, the domain metamodel is created by using a metamodel of a metamodel, that is, by creating a meta-metamodel. The meta-metamodel types include entity types, relation types, and enumeration types.
[0040] The specific methods for creating metamodel objects and their constraints are as follows: First, create a domain entity class metamodel object and configure its properties: In the human-computer graphical drawing interface, select the "Entity Class" meta-meta-model in the meta-meta-model selection panel and drag it to the drawing area to create an instance of the entity class meta-meta-model, which is the domain meta-model. Based on this, the attributes of the meta-model can be dynamically configured through the graphical interface.
[0041] Preferably, you can add attribute name, attribute type, specific attribute value, and other description and labeling information for the attribute.
[0042] Preferably, the attribute types include, but are not limited to, string, integer, floating-point, boolean, date, and time types.
[0043] Preferably, the description and marking information of the attribute mainly includes attribute-associated objects, attribute-associated relationships, attribute-associated attributes, and attribute-associated enumerations.
[0044] Secondly, create a domain relationship class metamodel object and configure its properties: In the graphical drawing interface, select the "Relationship Class" meta-meta-model in the meta-meta-model selection panel and drag it to the drawing area to create an instance of the relationship class meta-meta-model, which is an instance of the relationship between the domain meta-models. Based on this, the properties of the relationship meta-model can be dynamically configured through the graphical interface.
[0045] The configuration of object attributes in the relational metamodel is the same as that in the entity metamodel, and will not be elaborated here.
[0046] Next, establish the domain metamodel and the constraints between domain metamodels. Preferably, domain metamodel constraints are created through a graphical drawing interface. The constraints include, but are not limited to, the limit on the number of instances of the metamodel, including the maximum number of supported instances and the minimum number of required instances.
[0047] Note that the way a model is created also serves as a constraint on a domain metamodel. When creating a domain model, a metamodel created by referencing other metamodels will not be supported for independent creation; the data of this metamodel will originate from the original referenced metamodel object.
[0048] Before creating domain metamodel relation constraints, you need to draw two or more entity class metamodel objects and at least one relation class metamodel object in the graphical drawing interface.
[0049] Based on this, by drawing a relationship line connecting two entity class metamodels in the graphical drawing interface and configuring the established relationship class metamodels for this relationship line, relational constraints are configured for the entity class metamodels at both ends of the relationship line.
[0050] When building a domain model, if there are no relational constraints configured between entity class metamodels, the two entity class metamodels will not be able to establish any relationship. If a certain relational constraint is configured, only the corresponding relational constraint can be established.
[0051] By repeating the above three steps, all entity class metamodels, relation class metamodels, and their constraints required to complete a single domain model are created.
[0052] Similarly, by using the above method, for all the required domain models from a certain perspective within a specific domain context, all the required entity class metamodels, relation class metamodels, and their metamodel relation constraints can be created.
[0053] S340: This forms a predefined dataset framework containing meta-models and constraints for modeling specific domains, applicable to domain modeling. Example
[0054] Please refer to Figure 4 It is a visual editing of the system resource flow description (SV-2) model metamodel customization provided in Embodiment 4 of the present invention.
[0055] During domain modeling, the incremental verification mechanism is triggered by user operation events, identifies affected model elements through dependency tracking, performs only local verification, and provides real-time prompts.
[0056] For example, when customizing the metamodel of System Resource Flow Description (SV-2), four entity class metamodel objects such as "Communication System" and "Network" are defined, two enumeration class objects such as "System State Type" and "System Hierarchy Type" are defined, and four relationship class objects such as "System Link" and "System Interface Relationship" are defined. These four types of relationships are all custom relationships, which can be defined by configuring the connection lines between entity objects. Entity objects that are not connected are represented as having no mutual relationship when modeling. Example
[0057] Please refer to Figure 5 This is the domain model creation process provided in Embodiment 5 of the present invention. This framework data is associated with a specific domain modeling project. The domain model to be built is selected visually. After the model is selected and opened, the modeling elements used for drawing the model can be displayed in the graphical editing interface. The modeling elements come from the previously created metamodel objects, including entity class metamodel objects and relation class metamodel objects and the constraint relationships between the metamodels.
[0058] S510: Use the Domain Metamodel Framework to create domain modeling projects, which serves as a standard specification for domain-specific modeling. S520: Newly created projects read view data, model type data, and modeling element data of different types of models from the domain metamodel framework; S530: Utilize the modeling data read in the previous step to construct a visual domain model, enabling modeling of a specific domain model under meta-model constraints.
[0059] S540: Share and collaborate on completed modeling results using HTML / PDF format.
[0060] For example, when creating a domain model, if the limit on the number of metamodel instances is not met, a corresponding prompt will be given.
[0061] For example, a relationship between two domain metamodels can only be established if a certain predefined relationship exists between them.
[0062] For example, in the graphical drawing interface, you can select a metamodel and add specific attribute values to it, or you can associate an attribute value with other defined metamodel objects or defined enumeration variables. Example
[0063] Please refer to Figure 6 It is the system resource flow description (SV-2) model visualization model editing interface provided in Embodiment 6 of the present invention.
[0064] For example, in the domain-specific modeling module, domain-specific modeling is performed by creating a project and loading the domain-specific modeling meta-model standard framework. For the above System Resource Flow Description (SV-2) model, the tree structure on the left is the model category and its view defined in the domain-specific modeling meta-model framework, the middle part is the modeling element area, i.e. the meta-model area, and the right part is the modeling canvas, which supports the creation of domain models by custom modeling elements. Example
[0065] Please refer to Figure 7 In Embodiment 7 of this invention, when the domain metamodel framework is updated, the system identifies affected model elements based on a difference comparison algorithm and outputs modification suggestions to avoid consistency violations. Dynamic expansion of the domain metamodel is achieved through a plug-in loading mechanism, and new modeling capabilities take effect automatically at runtime without requiring a system restart or redeployment. The steps for changing and verifying the effectiveness of metamodel constraints are as follows: S710: In the metamodel customization module, modify the predefined dataset of the metamodel and regenerate the framework; S720: Replace the original project-related framework data with the updated metamodel framework; S730: After updating the framework associated with the domain modeling project, newly created models are processed according to the updated framework, while models that are being built will be given an immediate message reminder to reload the domain metamodel data.
[0066] S740: For existing models, modification suggestions are provided based on the changes made to the new model to assist modelers in modifying the domain model. Example
[0067] Please refer to Figure 8 This is a schematic diagram of a domain-specific modeling environment processing device provided in Embodiment 8 of the present invention, which mainly includes the following parts: S810: Automatic instantiation unit, used to execute automatic instantiation rules based on structural constraints in the meta-meta-model to generate the domain meta-model; S820: Constraint generation unit, used to construct an executable constraint data structure based on the domain meta-model; S830: Encapsulation unit, used to encapsulate the domain metamodel and the constraint data structure into metamodel framework data with a unique identifier index; S840: Parsing unit, used to load the metamodel framework data without recompiling and dynamically generate a visual domain model editor; S850: Incremental Validation Unit, used to perform operation-level triggered local validations when the user builds the domain model, and output prompts when constraints are violated.
[0068] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for establishing a domain-specific modeling environment, characterized in that, The method includes: generating a domain metamodel containing entity classes, relation classes, and enumeration class definitions by executing automatic instantiation rules on a preset meta-metamodel, wherein the automatic instantiation rules automatically configure attributes, relationships, and representations based on structural constraints in the meta-metamodel; constructing an executable constraint data structure based on the domain metamodel, wherein the constraint data structure includes instance quantity limits, creation method constraints, and relation consistency constraints; encapsulating the domain metamodel and the constraint data structure into metamodel framework data with a unique identifier index; loading the metamodel framework data by a runtime parsing engine without recompilation to dynamically generate a visual domain model editor; and performing operation-level triggered incremental verification based on the constraint data structure during the user's domain model construction process, performing local verification only on affected model elements, and outputting prompt information when constraints are violated; thereby solving the problem that existing domain modeling tools require manual coding customization, editor generation depends on recompilation, and cannot achieve real-time consistency verification after metamodel updates.
2. The method according to claim 1, characterized in that, The automatic instantiation rules include: storing the automatic instantiation rules in the form of a structured rule set, which includes template rules and derivation rules; at runtime, the instantiation engine matches and generates domain metamodel objects one by one for subsequent source tracing and impact analysis. Default attributes of entity class metamodels are automatically generated based on the cardinality and structural relationships defined in the meta-metamodel definition; reference relationships between entity class metamodels are automatically established based on association directions; and restricted value attributes are automatically generated based on the enumerated class meta-metamodel definition.
3. The method according to claim 1, characterized in that, The incremental verification includes: the incremental verification is triggered by the verification unit in response to user operation events; the verification unit determines the set of affected elements through the maintained dependency tracking structure, and performs local constraint verification only within the scope of this set, thereby achieving real-time verification and reducing computational overhead; verification is triggered based on user operation events, rather than performing full verification on the domain model; the dependency tracking mechanism is used to identify affected model elements; and the local verification strategy reduces irrelevant verification and computational overhead.
4. The method according to claim 1, characterized in that, The method also includes: loading new domain meta-models at runtime via plug-in, without modifying system code or redeploying; after loading the new domain meta-models, the runtime parsing engine automatically generates corresponding modeling capabilities based on the unique identifier index.
5. The method according to claim 1, characterized in that, The metamodel framework data is encapsulated in a structured file format that supports dynamic parsing, including XML, XMI, or JSON, and stored or transmitted in a ZIP package along with the accompanying resource files.
6. The method according to claim 1, characterized in that, After the metamodel framework data is updated, the method further includes: identifying affected domain model elements based on a difference comparison algorithm and outputting modification suggestions. The difference comparison algorithm performs a node-level comparison between the old and new metamodel frameworks, identifies newly added / deleted / modified metamodel definitions and constraints, and locates affected elements in the established domain model based on mapping relationships, generating an impact report and migration suggestions.
7. The method according to claim 1, characterized in that, The visualization domain model editor is dynamically generated through a configuration-based data-driven rendering method, without relying on pre-compiled interface components.
8. An apparatus for establishing a domain-specific modeling environment, characterized in that, The device includes: an automatic instantiation unit for automatically instantiating based on structural constraints in the meta-meta-model to generate a domain meta-model; a constraint generation unit for constructing an executable constraint data structure based on the domain meta-model; an encapsulation unit for encapsulating the domain meta-model and the constraint data structure into meta-model framework data with a unique identifier index; a parsing unit for loading the meta-model framework data without recompiling and dynamically generating a visual domain model editor; and an incremental verification unit for performing operation-level triggered local verification when the user constructs the domain model and outputting prompt information when constraints are violated.
9. The apparatus according to claim 8, characterized in that, The device also includes a plug-in loading unit, which loads newly added domain meta-models at runtime, and the parsing unit automatically generates the corresponding modeling capabilities.
10. The apparatus according to claim 8, characterized in that, The incremental verification unit identifies affected model elements through a dependency tracking mechanism and performs local verification only on related elements.
