CN117406980A - Model drive development method, device, equipment and storage medium - Google Patents
Model drive development method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN117406980A CN117406980A CN202210807654.XA CN202210807654A CN117406980A CN 117406980 A CN117406980 A CN 117406980A CN 202210807654 A CN202210807654 A CN 202210807654A CN 117406980 A CN117406980 A CN 117406980A
- Authority
- CN
- China
- Prior art keywords
- model
- target
- architecture
- code
- target service
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/35—Creation or generation of source code model driven
- G06F8/355—Round-trip engineering
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/33—Intelligent editors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/70—Software maintenance or management
- G06F8/76—Adapting program code to run in a different environment; Porting
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the application provides a model driving development method, device, equipment and storage medium, which can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, vehicle-mounted and the like, and the method comprises the following steps: and responding to the triggering operation of the model element display area in the architecture development interface, obtaining a plurality of model elements, and then constructing and displaying a target model architecture corresponding to the target scene through the plurality of model elements, so that corresponding model architectures can be constructed through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the constructed model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development.
Description
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a model driving development method, device, equipment and storage medium.
Background
With rapid development of computer technology, requirements on efficiency and quality of software development are also higher and higher, and traditional software development modes (such as a structural development mode and an object-oriented development mode) are gradually difficult to meet development requirements.
To meet development requirements, model-driven development models have evolved as a model-oriented software development model, where model-driven development model refers to: a conceptual model associated with a particular problem is created and then converted into code by a generator to drive automated development. However, the model driving development mode relies on a fixed model architecture to obtain a conceptual model, so that the model driving development mode is only suitable for software development of specific application scenes, and if the model driving development mode needs to be extended to other application scenes, the model architecture needs to be redeveloped by adopting a designated programming language, so that the efficiency of model driving development is low.
Disclosure of Invention
The embodiment of the application provides a model driving development method, device, equipment and storage medium, which are used for improving the expandability and efficiency of model driving development.
In one aspect, an embodiment of the present application provides a model driving development method, which is applied to a terminal device, and includes:
displaying a framework development interface, wherein the framework development interface comprises a model element display area;
responding to the triggering operation aiming at the model element display area, obtaining a plurality of model elements, and displaying a target model framework corresponding to a target scene constructed by the model elements;
and responding to the operation triggered in the architecture development interface, sending the target model architecture to a server, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
In one aspect, an embodiment of the present application provides a model driven development method, which is applied to a server, and includes:
receiving a target model architecture corresponding to a target scene sent by a terminal device, wherein the target model architecture is sent by the terminal device in response to a triggering operation aiming at a model element display area in an architecture development interface, constructed according to a plurality of obtained model elements and in response to a running operation triggered in the architecture development interface;
Generating a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
In one aspect, an embodiment of the present application provides a model driven development apparatus, which is applied to a terminal device, including:
the display module is used for displaying a framework development interface, wherein the framework development interface comprises a model element display area;
the processing module is used for responding to the triggering operation of the model element display area, obtaining a plurality of model elements and displaying a target model architecture corresponding to a target scene constructed by the model elements;
the sending module is used for responding to the operation triggered in the architecture development interface and sending the target model architecture to a server, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
Optionally, the display module is further configured to:
responding to the operation triggered in the architecture development interface, and then, after the target model architecture is sent to a server, displaying a drive development interface, wherein the drive development interface contains indication information of the modeling tool;
the processing module is further configured to:
responding to the triggering operation aiming at the indication information in the drive development interface, and calling the modeling tool to create and display a target service model;
the sending module is further configured to:
and responding to model submitting operation triggered in the drive development interface, and sending the target service model to the server, so that the server generates target service codes corresponding to the target service model through the code generator.
Optionally, the architecture development interface further includes: a canvas area and an attribute definition area for model elements;
the processing module is further configured to:
after a plurality of model elements are obtained in response to the triggering operation for the model element display area, attribute information of the defined plurality of model elements is obtained in response to the triggering operation for the attribute definition area;
And displaying the target model architecture constructed through the plurality of model elements and attribute information of the plurality of model elements in the canvas area.
Optionally, the architecture development interface further includes: selecting a region by a model representation;
the processing module is further configured to:
before a plurality of model elements are obtained in response to the triggering operation of the model element display area, a target graphical representation is obtained in response to the triggering operation of the model representation selection area;
and displaying the target model architecture constructed through the model elements and the attribute information of the model elements in the canvas area according to the target graphical representation.
Optionally, the architecture development interface further includes a mode selection area;
the processing module is further configured to:
after the canvas area displays the target model architecture constructed through the model elements and the attribute information of the model elements, responding to the triggering operation aiming at the code mode in the mode selection area, analyzing the model elements and the attribute information of the model elements, obtaining first structured data corresponding to the target model architecture and displaying the first structured data.
In one aspect, an embodiment of the present application provides a model driven development device, which is applied to a server, including:
the receiving module is used for receiving a target model architecture corresponding to a target scene sent by the terminal equipment, wherein the target model architecture is sent by the terminal equipment in response to a triggering operation aiming at a model element display area in an architecture development interface, constructed according to a plurality of obtained model elements and in response to a running operation triggered in the architecture development interface;
the generation module is used for generating a corresponding modeling tool and a code generator based on the target model framework, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
Optionally, the receiving module is further configured to:
after generating a corresponding modeling tool and a code generator based on the target model architecture, receiving a target service model under the target scene sent by the terminal equipment, wherein the target service model is created by calling the modeling tool by the terminal equipment in response to a triggering operation of indicating information of the modeling tool in a drive development interface;
The generating module is further configured to:
and generating a target service code corresponding to the target service model through the code generator.
Optionally, the generating module is further configured to:
and implanting key information of the target service model into the target service code, wherein the key information of the target service model is used for indicating mapping from the target service code back to the target service model.
Optionally, the generating module is specifically configured to:
analyzing the target model architecture to obtain corresponding first structural data;
generating a modeling tool corresponding to the target model architecture based on the first structured data, and defining a model analysis component, a template processing component and a generating capability component corresponding to the target model architecture;
and constructing a code generator corresponding to the target model architecture based on the model analysis component, the template processing component and the generating capability component.
Optionally, the generating module is specifically configured to:
analyzing the target service model by using the model analysis component on the basis of the target model architecture to obtain second structural data corresponding to the target service model;
And rendering an object code template in the template processing component based on the second structured data and the set code generation parameters through the generation capability component to obtain the object service code.
In one aspect, embodiments of the present application provide a computer apparatus including a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the image processing method described above when executing the program.
In one aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program executable by a computer device, which when run on the computer device, causes the computer device to perform the steps of the above-described image processing method.
In one aspect, embodiments of the present application provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer device, cause the computer device to perform the steps of the above-described image processing method.
In the embodiment of the application, a plurality of model elements are obtained in response to triggering operation of a model element display area in an architecture development interface, then a target model architecture corresponding to a target scene is built through the plurality of model elements and displayed, so that corresponding model architectures can be built through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the built model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development. And secondly, the architecture development interface supports the self-defining of the model architecture according to actual needs, so that the granularity of the model architecture can be flexibly set and is effectively suitable for models with different expression levels.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments will be briefly described below, it will be apparent that the drawings in the following description are only some embodiments of the present invention, and that other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of a model driven development platform according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a model driven development method according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a model element display area according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of an architecture development interface according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an architecture development interface according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of an architecture development interface according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of an architecture development interface in a design mode according to an embodiment of the present application;
FIG. 8 is a schematic diagram of an architecture development interface in an operation mode according to an embodiment of the present application;
FIG. 9A is a schematic diagram of an architecture development interface in a code mode according to an embodiment of the present application;
FIG. 9B is a schematic diagram of a meta-model according to an embodiment of the present disclosure;
FIG. 10 is a schematic structural diagram of a model driven development platform according to an embodiment of the present disclosure;
fig. 11 is a flowchart of a method for generating a service code according to an embodiment of the present application;
FIG. 12 is a schematic structural diagram of a model driven development platform according to an embodiment of the present disclosure;
FIG. 13 is a flow chart of a model architecture generation stage according to an embodiment of the present application;
FIG. 14 is a flow chart of a code generator generation stage according to an embodiment of the present application;
fig. 15 is a schematic flow chart of a service code generation stage according to an embodiment of the present application;
fig. 16 is a schematic structural diagram of a model driving development device according to an embodiment of the present application;
FIG. 17 is a schematic diagram of a model driven development device according to an embodiment of the present disclosure;
fig. 18 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantageous effects of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
For ease of understanding, the terms involved in the embodiments of the present invention are explained below.
Model driver development (Model Driven Development): a software development method focuses on creating and utilizing a domain model, which is a conceptual model of all topics related to a particular problem. It emphasizes and targets abstract representations of knowledge and activity that govern a particular application domain, rather than computing (i.e., algorithmic) concepts.
Model representation: refers to a graphical or textual representation of a model, such as a series of illustrations provided by UML to represent the model.
Unified modeling language: UML-Unified Model Language, UML for short, is a modeling language which is accepted as a standard by OMG object management organization, combines the concepts of object modeling technology and object programming, merges various methods into a single and universal model, and can be widely used. UML has been validated in the software industry, particularly at the software architecture level.
Domain specific language: domain Specific Language, simply referred to as DSL, is a computer language specific to a particular application domain and may be in different expressions, such as graphical DSL, textual DSL.
The following describes the design ideas of the embodiments of the present application.
To meet development requirements, model-driven development models have evolved as a model-oriented software development model, where model-driven development model refers to: a conceptual model associated with a particular problem is created and then converted into code by a generator to drive automated development. However, the model driven development mode relies on a fixed model architecture to obtain a conceptual model, so that the model driven development mode is only suitable for software development of specific application scenes, and has poor universality and expansibility. If the model needs to be expanded to other application scenes, the model architecture needs to be redeveloped by adopting a designated programming language, so that the efficiency of model driving development is low.
It has been found by analysis that a conceptual model is generally composed of a plurality of underlying model elements. If all the basic model elements are abstracted into element diagrams, and then an interface for assembling the element diagrams is provided, so that a user can select the element diagrams of the basic model elements according to requirements, then the model architectures corresponding to specific scenes are obtained through self-defined assembly, further, service models suitable for the specific scenes and service codes corresponding to the service models are automatically generated based on the model frameworks, the rapid expansion of the models is realized, and meanwhile, the efficiency of model driving development is improved.
In view of this, an embodiment of the present application provides a model driver development method, applied to a terminal device, including: first, a framework development interface is displayed, wherein the framework development interface comprises a model element display area. And responding to the triggering operation aiming at the model element display area, obtaining a plurality of model elements, and displaying a target model architecture corresponding to a target scene constructed by the plurality of model elements. And then, responding to the operation triggered in the architecture development interface, sending the target model architecture to a server, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under a target scene, and the code generator is used for generating a target service code corresponding to the target service model.
In the embodiment of the application, a plurality of model elements are obtained in response to triggering operation of a model element display area in an architecture development interface, then a target model architecture corresponding to a target scene is built through the plurality of model elements and displayed, so that corresponding model architectures can be built through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the built model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development.
Referring to fig. 1, a schematic structural diagram of a model driven development platform applicable to the embodiment of the present application, where the model driven development platform at least includes a terminal device 101 and a server 102, the number of the terminal devices 101 may be one or more, and the number of the servers 102 may be one or more, and the number of the terminal devices 101 and the servers 102 is not specifically limited in the present application.
The model-driven development application is in advance in the terminal device 101, wherein the model-driven development application is a client application, a web page application, an applet application, or the like. The terminal device 101 may be, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart home appliance, a smart voice interaction device, a smart car-mounted device, and the like.
The server 102 is a background server for model driven development application, the server 102 may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligent platforms, and the like. The terminal device 101 and the server 102 may be directly or indirectly connected through wired or wireless communication, which is not limited herein.
The model driver development method in the embodiment of the present application may be executed by the terminal device 101, may be executed by the server 102, or may be executed interactively by the terminal device 101 and the server 102.
The model-driven development method in the embodiment of the present application is executed by the terminal device 101 interacting with the server 102, for example, and includes the following steps:
the terminal device 101 displays an architecture development interface in a model driven development application, wherein the architecture development interface includes a model element presentation area. The terminal device 101 obtains a plurality of model elements in response to a trigger operation for a model element display area, and displays a target model architecture corresponding to a target scene constructed by the plurality of model elements. The terminal device 101 transmits the target model architecture to the server 102 in response to the operation triggered in the architecture development interface. The server 102 generates corresponding modeling tools and code generators based on the target model architecture.
The terminal device 101 displays a driver development interface in the model driver development application, wherein the driver development interface contains the instruction information of the modeling tool. And in response to the triggering operation aiming at the indication information in the drive development interface, calling a modeling tool to create a target business model and displaying the target business model. The terminal device 101 transmits the target business model to the server 102 in response to a model submitting operation triggered in the drive development interface. The server 102 generates a target service code corresponding to the target service model through a code generator.
In practical application, the model driving development method in the embodiment of the application can be applied to software development of any application scene, such as a payment scene, a voice communication scene, a video image scene, a game scene and the like. The model driving development method in the embodiment of the application can be integrated into a product of cloud service on the Internet, and can also form a development platform with flexible expansion capability.
Based on the system architecture diagram shown in fig. 1, the embodiment of the present application provides a flow of a model driver development method, as shown in fig. 2, where the flow of the method is performed by a computer device, and the computer device may be the terminal device 101 and/or the server 102 shown in fig. 1, and includes the following steps:
in step S201, the terminal device displays the architecture development interface.
Specifically, the architecture development interface is a visual interface of model architecture development, and the visual interface comprises a model element display area, wherein the model element display area comprises a plurality of types of optional basic model elements. Such as model elements of node type, model elements of container type, model elements of relationship type, etc. And correspondingly providing element illustrations corresponding to the model elements aiming at the model elements of each type of foundation.
For example, referring to fig. 3, a schematic diagram of a model element display area provided in an embodiment of the present application includes a model element of a node type, a model element of a container type, and a model element of a relationship type, where an element diagram corresponding to each model element of the node type is displayed in the model element display area.
In some embodiments, the model element presentation area further comprises a model element custom area for presenting an element representation of a custom model element.
Step S202, the terminal equipment responds to the triggering operation of the model element display area to obtain a plurality of model elements and display a target model architecture corresponding to a target scene constructed by the plurality of model elements.
Specifically, the effect of the triggering operation for the model element presentation area is to select a plurality of model elements for building a target model architecture, wherein the triggering operation may be clicking on an element diagram of the model element, double clicking on an element diagram of the model element, dragging an element diagram of the model element, and so on.
In addition, the plurality of model elements used to construct the target model architecture may be from one or more classes of model elements. For example, in the ER (entity-relationship) model architecture, model elements are selected from model elements of node type as entities in the ER model architecture, and model elements are selected from model elements of relationship type as entity relationships.
In some embodiments, the architecture development interface further comprises: the canvas area and the attributes of the model element define an area. After a plurality of model elements are obtained in response to a trigger operation for a model element presentation area, attribute information of the defined plurality of model elements is obtained in response to a trigger operation for an attribute definition area. And then, displaying the constructed target model framework through the plurality of model elements and attribute information of the plurality of model elements in a canvas area.
Specifically, the trigger operation for the attribute definition area is attribute information for defining a plurality of model elements, wherein the attribute information of each model element includes an attribute name and an attribute value, and each model element can define any number of attribute information. In the attribute information corresponding to one model element, the attribute name corresponds to one or more attribute values, so that the attribute information of the model element can be single-item KV data or complex-item KV data. In addition, the architecture development interface further comprises an element description area, the element description area is used for displaying description information of the model elements, and a user can input relevant remarks of the model elements in the element description area according to actual needs so as to achieve the effect of describing the model elements more comprehensively.
In practical application, in response to a triggering operation for a model element display area, dragging element illustrations of a plurality of model elements from the model element display area to a canvas area, and then defining attribute information corresponding to each of the plurality of model elements in an attribute definition area of the model element. And assembling element illustrations of the model elements in the canvas area to obtain the target model framework.
For example, referring to fig. 4, a schematic diagram of an architecture development interface provided for an embodiment of the present application includes a model element display area 401, an attribute definition area 402 of a model element, and a canvas area 403, where the model element display area 401 includes a model element of a node type, a model element of a container type, a model element of a relationship type, and a custom model element.
In response to a triggering operation for the model element display area, sequentially selecting an element diagram 4011 of a model element A, an element diagram 4012 of a model element B, an element diagram 4013 of a model element C and an element diagram 4014 of a model element D from a model element list of a node type, and sequentially dragging the element diagrams of the model elements to a canvas area. And then selecting a connecting line from the model element list of the relation type, connecting the element diagram 4011 with the element diagram 4012 and the element diagram 4013 respectively through the connecting line in the canvas area, and connecting the element diagram 4012 and the element diagram 4013 with the element diagram 4014 respectively to obtain the drawn target model architecture.
In addition, after dragging each model element to the canvas area, correspondingly defining attribute information corresponding to the model element in an attribute definition area of the model element. Defining the attributes of model element a in the attribute definition area includes, in particular: element type (corresponding attribute value is node type), element diagram shape (corresponding attribute value is rectangle), element function (corresponding attribute value is task).
In the embodiment of the application, the canvas area, the model element display area and the attribute definition area of the model element are provided in the architecture development interface, so that a developer can select related model elements and define attribute information of the model elements according to actual needs, then draw the model architecture based on the model elements in the canvas area, improve the flexibility of model definition and improve the efficiency of model driving development.
In some embodiments, the architecture development interface further comprises: the model representation selects regions. And before the plurality of model elements are obtained in response to the triggering operation of the model element display area, the target graphical representation is obtained in response to the triggering operation of the model representation selection area. Attribute information of the defined plurality of model elements is then obtained in response to a trigger operation for the attribute definition area. And displaying the target model architecture constructed by the plurality of model elements and attribute information of the plurality of model elements in the canvas area according to the target graphical representation.
Specifically, the model representation selection area includes a model representation list, wherein the model representation list includes a plurality of alternative model representations. For example, the model representation list includes: flow chart representation, state diagram representation, architecture diagram representation, micro-service architecture representation, cloud architecture representation, etc., wherein model elements corresponding to the flow chart representation include: a start node, a task node, a selection node, an end node, and a node relationship; the model elements corresponding to the state diagram representation method comprise: state nodes, circulation relations, state machine nodes; the model elements corresponding to the architectural drawing representation comprise: nodes, node relationships, and remarks.
In response to a triggering operation for the model representation selection area, a target graphical representation is obtained. And then selecting a corresponding element diagram from the model element display area aiming at the model element triggered by the user in the target graphical representation, and dragging the selected element diagram to the canvas area. Attribute information of the model element is defined in an attribute definition area. And assembling element illustrations of the model elements in the canvas area, generating a target model framework and displaying the target model framework.
For example, referring to fig. 5, a schematic diagram of an architecture development interface provided for an embodiment of the present application includes a model representation selection area 501, a model element display area 502, an attribute definition area 503 of a model element, and a canvas area 504, where the model representation selection area 501 includes a flowchart representation, a state diagram representation, an architecture diagram representation, a microservice architecture representation, and a cloud architecture representation. Model element presentation area 502 includes model elements of node type, model elements of container type, model elements of relationship type, custom model elements. The attribute definition area 503 of the model element includes an attribute definition list.
The terminal device selects a flow chart representation and a start node in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, element diagram 5021 (representing the start node) is selected from the model element list of the node type, and the element diagram 5021 is dragged to the canvas area. Correspondingly, defining attribute information corresponding to the starting node in an attribute definition area of the model element.
The terminal device selects a task node in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, an element diagram 5022 (representing a task node 1), an element diagram 5023 (representing a task node 2), an element diagram 5024 (representing a task node 3) and an element diagram 5025 (representing a task node 4) are sequentially selected from the model element list of the node type, and the element diagram 5022, the element diagram 5023, the element diagram 5024 and the element diagram 5025 are dragged to the canvas area. Correspondingly, defining attribute information corresponding to the four task nodes in an attribute definition area of the model element.
The terminal device selects a selection node in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, an element diagram 5026 is selected from the model element list of node types (representing the selection of the node), and the element diagram 5026 is dragged to the canvas area. Correspondingly, defining attribute information corresponding to the selected node in an attribute definition area of the model element.
The terminal device selects an end node in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, an element diagram 5027 (representing an end node) is selected from the model element list of node types, and the element diagram 5027 is dragged to the canvas area. Correspondingly, defining the attribute information corresponding to the ending node in an attribute definition area of the model element.
The terminal device selects node relationships in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, element diagram 5028 (representing node relationships) is selected from the model element list of the relationship type, and the element diagram 5028 (representing node relationships) is dragged to the canvas area. Correspondingly, defining the attribute information corresponding to the node relation in an attribute definition area of the model element.
And the terminal equipment responds to the triggering operation aiming at the canvas area, and assembles the element diagrams 5021 to 5028 to obtain the drawn target model framework.
For another example, referring to fig. 6, a schematic diagram of an architecture development interface provided for an embodiment of the present application includes a model representation selection area 501, a model element display area 502, an attribute definition area 503 of a model element, and a canvas area 504, where the model representation selection area 501 includes a flowchart representation, a state diagram representation, an architecture diagram representation, a microservice architecture representation, and a cloud architecture representation. Model element presentation area 502 includes model elements of node type, model elements of container type, model elements of relationship type, custom model elements. The attribute definition area 503 of the model element includes an attribute definition list.
The terminal device selects the architecture diagram representation and nodes in the architecture diagram representation in response to a trigger operation for selecting an area for the model representation. Then in response to a trigger operation for the model element presentation area, the element diagram 601 (representing node 1), the element diagram 602 (representing node 2), the element diagram 603 (representing node 3), and the element diagram 604 (representing node 4) are customized. Correspondingly, defining attribute information corresponding to each node in an attribute definition area of the model element.
The terminal device selects node relationships in the flow chart representation in response to a trigger operation for selecting an area for the model representation. Then, in response to a trigger operation for the model element presentation area, element diagram 605 (representing node relationships) is selected from the list of model elements of the relationship type, and element diagram 605 (representing node relationships) is dragged to the canvas area. Correspondingly, defining the attribute information corresponding to the node relation in an attribute definition area of the model element.
And the terminal equipment responds to the triggering operation aiming at the canvas area, and assembles the element graphic 601 to the element graphic 605 to obtain the drawn target model framework.
In the embodiment of the application, the model representation selection area in the architecture development interface provides a plurality of alternative model representations, so that a user can select a corresponding model representation to construct a model architecture according to actual needs, and a business model is generated based on the model architecture to carry out model driving development, thereby improving the universality and the expandability of the model driving development.
In step S203, the terminal device sends the target model architecture to the server in response to the operation triggered in the architecture development interface.
In step S204, the server generates corresponding modeling tools and code generators based on the target model architecture.
Specifically, the modeling tool is used for constructing a target service model under a target scene, and the code generator is used for generating a target service code corresponding to the target service model. After the modeling tool and the code generator are generated, the modeling tool and the code generator can be integrated into a model driven development tool, and then the model driven development tool is delivered for use, wherein the modeling tool is provided to the terminal equipment in a Web end form, so that the limitation of the existing tool on an operating system and a technical environment is eliminated, and the constraint of the existing development modeling capability is eliminated. The code generator is deployed on a server (model driven development background), and model driven development can be realized through a modeling tool and the code generator.
In some embodiments, after obtaining the target model architecture corresponding modeling tool and code generator, the modeling tool may be delivered to the model architecture repository and then the code generator delivered to the code generator manager, thereby enabling the precipitation and multiplexing of the modeling tool and code generator.
In the embodiment of the application, a plurality of model elements are obtained in response to triggering operation of a model element display area in an architecture development interface, then a target model architecture corresponding to a target scene is built through the plurality of model elements and displayed, so that corresponding model architectures can be built through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the built model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development. And secondly, the architecture development interface supports the self-defining of the model architecture according to actual needs, so that the granularity of the model architecture can be flexibly set and is effectively suitable for models with different expression levels.
In some embodiments, the architecture development interface further includes a mode selection area, wherein the mode selection area includes a design mode, a code mode, and an operational mode.
The terminal device responds to user operation in a design mode, selects a target graphical representation method and a plurality of model elements, defines attribute information of the plurality of model elements, and then displays a target model framework constructed through the attribute information of the plurality of model elements and the plurality of model elements according to the target graphical representation method in a canvas area.
In step S203, the operation triggered in the architecture development interface refers to the operation triggered in the mode selection area for the operation mode. When switching to the operation mode, the terminal device sends the target model architecture to the server. The server generates a corresponding modeling tool and code generator based on the target model architecture, and then sends the indication information of the modeling tool to the terminal equipment. The terminal equipment displays a modeling toolbar on the architecture development interface, wherein the modeling toolbar comprises indication information of the modeling tool. In practical applications, the indication information of the modeling tool may be an element diagram of a plurality of model elements in the target model architecture.
Responding to triggering operation aiming at a code mode in a mode selection area, analyzing a plurality of model elements in a target model framework and attribute information of the plurality of model elements, and obtaining and displaying first structural data corresponding to the target model framework.
Specifically, the first structured data refers to machine-readable structured text corresponding to the target model architecture, and may be a text DSL, an elastic XML structure, a JSON structure, or the like. The model architecture is described in a structured text, so that the method can be suitable for reading and accessing various processing programs, and the model analysis and processing capacity is effectively expanded.
For example, referring to fig. 7, a schematic diagram of an architecture development interface under a design mode according to an embodiment of the present application includes a model representation selection area 501, a model element display area 502, an attribute definition area 503 of a model element, a canvas area 504, and a mode selection area 701, where the model representation selection area 501 includes a flowchart representation, a state diagram representation, an architecture diagram representation, a micro-service architecture representation, and a cloud architecture representation. Model element presentation area 502 includes model elements of node type, model elements of container type, model elements of relationship type, custom model elements. The attribute definition area 503 of the model element includes an attribute definition list. The mode selection area 701 includes a design mode, a code mode, and an operation mode, wherein the design mode has been triggered.
The constructed target model architecture is exposed in the canvas area, and includes, among other things, an element diagram 5021 (representing a start node), an element diagram 5022 (representing a task node 1), an element diagram 5023 (representing a task node 2), an element diagram 5024 (representing a task node 3), an element diagram 5025 (representing a task node 4), an element diagram 5026 (representing a select node), and an element diagram 5027 (representing an end node). And defining the attribute information corresponding to each node in an attribute definition area of the model element.
In response to a triggering operation for an operation mode in the mode selection area, an architecture development interface in the operation mode is exposed, as shown in fig. 8, including a model representation selection area 501, a model element exposure area 502, an attribute definition area 503 for model elements, a canvas area 504, a mode selection area 701, and a modeling toolbar 801, wherein the operation mode in the mode selection area 701 is triggered. The modeling toolbar 801 includes an element diagram 5021, an element diagram 5022, an element diagram 5023, an element diagram 5026, and an element diagram 5027. Other areas in the architecture development interface are the same as corresponding areas in the architecture development interface shown in fig. 7, and are not described here again.
In response to a trigger operation for a code pattern in the pattern selection area, an architecture development interface in the code pattern is presented, as shown in fig. 9A, including a model representation selection area 501, a model element presentation area 502, an attribute definition area 503 of a model element, a pattern selection area 701, a code display area 901. The code pattern in the pattern selection area 701 is triggered. The code display area 901 displays the texted DSL corresponding to the target model architecture. Other areas in the architecture development interface are the same as corresponding areas in the architecture development interface shown in fig. 7, and are not described here again.
In the embodiment of the application, the mode selection area in the architecture development interface provides three modes of a design mode, a code mode and an operation mode, so that the architecture development interface can generate and display a graphical target model architecture and also can generate and display a target model architecture in a structured text form, different development requirements are met, and the expansion capacity of a model driven development platform is improved.
Optionally, in the step S204, the embodiment of the present application generates the corresponding modeling tool and the code generator based on the target model architecture at least in the following manner, including the following steps:
And analyzing the target model framework to obtain corresponding first structured data. And then generating a modeling tool corresponding to the target model architecture based on the first structured data, and defining a model analysis component, a template processing component and a generating capability component corresponding to the target model architecture. And constructing a code generator corresponding to the target model architecture based on the model analysis component, the template processing component and the generating capability component.
Specifically, a plurality of model elements in a target model architecture and attribute information of the plurality of model elements are analyzed to obtain first structured data. For example, the first structured data of the model architecture corresponding to the entity relationship model is: the meta-Model corresponding to the first structured data includes a Model layer (Model), a Model Element layer (Element), an Element Relation layer (reference), an Element graphic layer (notification), and an Element attribute layer (Property), as shown in fig. 9B.
Based on the first structured data, a modeling tool is created. The server is preset with a basic model analysis component, a template processing component and a generating capability component, wherein the model analysis component is a parser supporting Json/Xml related structured data description language, and the template processing component provides a code template. The generating capability component is used for generating business codes by combining the structured data output by the model analysis component and the code templates in the template processing component. In addition, visual content of the first structured data to the API may also be specified.
The server defines a model parsing component, a template processing component and a generating capability component matched with the target model architecture based on first structured data corresponding to the target model architecture. And then assembling the model analysis component, the template processing component and the generating capability component to obtain a code generator corresponding to the target model architecture. After evaluating and verifying the code generator, the code generator is put on line.
For example, referring to fig. 10, a schematic structural diagram of a model driven development platform is provided in an embodiment of the present application, where the model driven development platform includes a model architecture development tool, a generator development tool, and a model repository, the model architecture development tool includes a visualization graph component and a model editor component, and the generator development tool includes a model parsing component, a template processing component, and a generating capability component.
And the terminal equipment displays the architecture development interface by calling the visual graphic component and the model editor component. And then, responding to the operation triggered by the model analyst in the architecture development interface, and constructing a target model architecture corresponding to the target scene. And submitting the target model architecture to a server, and generating a corresponding modeling tool Web end by the server based on the target model architecture.
The server defines a model analysis component, a template processing component and a generating capability component corresponding to the target model architecture through a generator development tool, wherein the template processing component comprises a defined code template. And then assembling the model analysis component, the template processing component and the generating capability component to obtain a code generator corresponding to the target model architecture. And delivering the modeling tool Web end and the code generator to a model warehouse.
The terminal equipment responds to the operation triggered by a service programmer in a drive development interface, a modeling tool Web end is called from a model warehouse to construct a target service model, then a code generator is called, a code template is adopted to generate a target service code corresponding to the target service model, then the target service code is adopted to perfect or construct a target system, and then the target system is delivered to a target running environment to run.
In the embodiment of the application, the code generator of the target model architecture is quickly constructed by defining and assembling the model analysis component, the template processing component and the generating capability component, and then the new code generating capability is quickly expanded through the code generator, so that the efficiency of model driving development is improved, and the adaptation and development of new services are also facilitated.
In some embodiments, in combination with the modeling tool and the code generator, the automatic generation of the service model and the service code corresponding to the service model in the target scene may be achieved, as shown in fig. 11, and the method includes the following steps:
in step S1101, the terminal device displays a driver development interface.
Specifically, after integrating the modeling tool and the code generator into the model driven development tool, the server automatically adds a tool menu of the model driven development tool at a functional portal of the model driven development platform. When the model driven development application is launched, the model driven development application presents a tool menu of the model driven development tool in a main interface. The terminal equipment responds to triggering operation aiming at a tool menu in the main interface, and displays a drive development interface, wherein the drive development interface contains indication information of a modeling tool. In practical applications, the indication information of the modeling tool refers to element illustrations of a plurality of model elements in the target model architecture.
In step S1102, the terminal device calls a modeling tool to create and display a target service model in response to a trigger operation for the indication information in the drive development interface.
Specifically, the driver development interface further includes a generation parameter setting area. The terminal device responds to the triggering operation aiming at the generation parameter setting area to acquire the set code generation parameters. The code generation parameters are related to a specific application scenario. For example, in a payment scenario, the target model architecture includes an order sending node, a deduction node, and a deduction receipt node, where the code generation parameters of the model include: order number corresponding to the order sending node, deduction account corresponding to the deduction node, collection account, and receipt number corresponding to the deduction receipt node.
In step S1103, the terminal device sends the target service model to the server in response to the model submitting operation triggered in the driver development interface.
Specifically, the terminal device simultaneously transmits the target service model and the code generation parameters to the server.
In step S1104, the server generates a target service code corresponding to the target service model through the code generator.
Specifically, the server inputs the target service model and the code generation parameters into a code generator, and the code generator outputs the corresponding target service code. In some embodiments, the target service model is parsed by a model parsing component in the code generator based on the target model architecture to obtain second structured data corresponding to the target service model. And then rendering the target code template in the template processing component through a generating capability component in the code generator based on the second structured data and the set code generating parameters to obtain the target service code. The business code is then integrated with the development framework of the target business system. And after test verification, the target service code delivery of the corresponding service module can be completed.
For example, referring to fig. 12, a schematic structural diagram of a model driven development platform according to an embodiment of the present application is provided, where the model driven development platform includes a model architecture development tool and a generator development tool. And developing a modeling tool for obtaining the target model architecture through a model architecture development tool, and developing a code generator for obtaining the target model architecture through a generator development tool, wherein the modeling tool is deployed at the front end in a Web end mode, and the code generator is deployed at the background.
The terminal equipment calls a modeling tool and displays a drive development interface. And responding to the operation triggered by the service programmer in the drive development interface, constructing a target service model and obtaining set code generation parameters. And the terminal equipment sends the target service model and the code generation parameters to the background. The model analysis component analyzes the target business model to obtain corresponding model metadata (structured data), and then inputs the model metadata and code generation parameters into the generation capability component. And the generating capability component renders the target code template in the template processing component according to the model metadata and the code generating parameters to obtain the target service code of the target programming language. And integrating the target service code with a development framework of the target service system. And testing and verifying to finish the code delivery of the corresponding service module.
In the embodiment of the application, corresponding model driving development tools are rapidly expanded according to development requirements under specific application scenes, then the model driving development tools are used for automatically generating service models under the specific application scenes, the service models are converted into corresponding service codes, and the service codes are delivered to a service system, so that development efficiency and development quality of the service system are effectively improved.
Alternatively, the related art only supports mapping from a service model to a corresponding service code, but cannot map back to the service model from the service code, resulting in that the service model cannot be effectively synchronized with the service code. In view of this, in the embodiment of the present application, the key information of the target service model is implanted in the target service code, where the key information of the target service model is implanted in the target service code with a specific identifier (such as an annotation, a tag, etc.). The key information of the target service model can be used for indicating the mapping from the target service code back to the target service model, and realizing the bidirectional synchronization of the service model and the service code, thereby bringing convenience to the software operation and maintenance and improving the efficiency of the software operation and maintenance.
For better explaining the embodiment of the present application, a model-driven development method provided by the embodiment of the present application is described below in connection with a specific implementation scenario, where the model-driven development method includes a model architecture generation phase, a code generator generation phase, and a service code generation phase, where the model architecture generation phase is interactively performed by a terminal device, a server, and a model architecture repository, as shown in fig. 13, and includes the following steps:
In step S1301, the terminal device displays the architecture development interface.
Specifically, the model analyst-side terminal device displays the architecture development interface in the model driven development application.
In step S1302, the terminal device selects a target graphical representation of the model in response to an operation of the model analyst on the architecture development interface.
In step S1303, the terminal device selects or customizes the element diagram of the model element in response to the operation of the model analyst on the architecture development interface.
In step S1304, the terminal device defines attribute information of the model element in response to an operation of the model analyst at the architecture development interface.
In step S1305, the terminal device draws the target model architecture using the above-described model elements in response to the operation of the model analyst in the architecture development interface.
In step S1306, the terminal device submits the target model architecture to the server.
In step S1307, the server parses the target model architecture to obtain first structured data.
In step S1308, the server generates a modeling tool web end corresponding to the target model architecture based on the first structured data.
In step S1309, the server adds the target model architecture to the model architecture repository.
Next, a code generator generation phase of the model-driven development method is described, which is interactively performed by the terminal device, the server, and the code generator manager, as shown in fig. 14, including the steps of:
In step S1401, the server receives definition information of the model parsing component transmitted from the terminal device.
Specifically, the definition information of the model parsing component is transmitted by the terminal device on the generator engineer side.
In step S1402, the server defines a model parsing component corresponding to the target model architecture based on the first structured data and the received definition information.
In step S1403, the server receives definition information of the template processing component transmitted by the terminal device.
In step S1404, the server defines a template processing component corresponding to the object model architecture based on the first structured data and the received definition information, where the template processing component includes the defined object code template.
In step S1405, the server receives definition information of the generation capability component transmitted by the terminal device.
In step S1406, the server defines a generating capability component corresponding to the target model architecture based on the first structured data and the received definition information.
In step S1407, the server integrates the model parsing component, the template processing component, and the generation capability component into a code generator.
In step S1408, after the server verifies the code generator, the code generator is delivered to the code generator manager.
In step S1409, the server integrates the modeling tool web side and the code generator to obtain a model driven development tool.
Next, a service code generation stage of the model-driven development method is described, which is interactively performed by the terminal device, the server, and the service system code repository, as shown in fig. 15, and includes the steps of:
in step S1501, the terminal device starts the model driver development tool, and displays a driver development interface (modeling tool Web end).
Specifically, the terminal device on the service programmer side starts the model driven development tool.
In step S1502, the terminal device obtains the target service model created based on the modeling tool and the set code generation parameters in response to the triggering operation of the service programmer in the driving development interface.
In step S1503, the terminal device submits the target service model and the code generation parameters to the server.
In step S1504, the server parses the target service model to obtain second structured data.
In step S1505, the server renders the target code template according to the second structured data and the code generation parameter, and obtains the target service code.
In step S1506, the server receives the code integration instruction sent by the terminal device.
In step S1507, the server integrates the target service code with the development framework of the target service system.
In step S1508, the server submits the target business code to the business system code repository.
In the embodiment of the application, a plurality of model elements are obtained in response to triggering operation of a model element display area in an architecture development interface, then a target model architecture corresponding to a target scene is built through the plurality of model elements and displayed, so that corresponding model architectures can be built through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the built model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development. And secondly, the architecture development interface supports the self-defining of the model architecture according to actual needs, so that the granularity of the model architecture can be flexibly set and is effectively suitable for models with different expression levels.
Based on the same technical concept, the embodiment of the present application provides a schematic structural diagram of a model driven development device, which is applied to a terminal device, as shown in fig. 16, the device 1600 includes:
a display module 1601, configured to display a framework development interface, where the framework development interface includes a model element display area;
a processing module 1602, configured to obtain a plurality of model elements in response to a triggering operation for the model element display area, and display a target model architecture corresponding to a target scene constructed by the plurality of model elements;
the sending module 1603 is configured to send the target model architecture to a server in response to an operation triggered in the architecture development interface, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, where the modeling tool is used to construct a target service model under the target scene, and the code generator is used to generate a target service code corresponding to the target service model.
Optionally, the display module 1601 is further configured to:
responding to the operation triggered in the architecture development interface, and then, after the target model architecture is sent to a server, displaying a drive development interface, wherein the drive development interface contains indication information of the modeling tool;
The processing module 1602 is also configured to:
responding to the triggering operation aiming at the indication information in the drive development interface, and calling the modeling tool to create and display a target service model;
the sending module 1603 is further configured to:
and responding to model submitting operation triggered in the drive development interface, and sending the target service model to the server, so that the server generates target service codes corresponding to the target service model through the code generator.
Optionally, the architecture development interface further includes: a canvas area and an attribute definition area for model elements;
the processing module 1602 is also configured to:
after a plurality of model elements are obtained in response to the triggering operation for the model element display area, attribute information of the defined plurality of model elements is obtained in response to the triggering operation for the attribute definition area;
and displaying the target model architecture constructed through the plurality of model elements and attribute information of the plurality of model elements in the canvas area.
Optionally, the architecture development interface further includes: selecting a region by a model representation;
the processing module 1602 is also configured to:
Before a plurality of model elements are obtained in response to the triggering operation of the model element display area, a target graphical representation is obtained in response to the triggering operation of the model representation selection area;
and displaying the target model architecture constructed through the model elements and the attribute information of the model elements in the canvas area according to the target graphical representation.
Optionally, the architecture development interface further includes a mode selection area;
the processing module 1602 is also configured to:
after the canvas area displays the target model architecture constructed through the model elements and the attribute information of the model elements, responding to the triggering operation aiming at the code mode in the mode selection area, analyzing the model elements and the attribute information of the model elements, obtaining first structured data corresponding to the target model architecture and displaying the first structured data.
Based on the same technical concept, the embodiment of the present application provides a schematic structural diagram of a model driven development device, which is applied to a server, as shown in fig. 17, the device 1700 includes:
a receiving module 1701, configured to receive a target model architecture corresponding to a target scenario sent by a terminal device, where the target model architecture is configured according to a plurality of obtained model elements and sent in response to a triggering operation triggered in an architecture development interface by the terminal device, where the triggering operation is performed on a model element display area in the architecture development interface;
The generating module 1702 is configured to generate a corresponding modeling tool and a code generator based on the target model architecture, where the modeling tool is configured to construct a target service model under the target scene, and the code generator is configured to generate a target service code corresponding to the target service model.
Optionally, the receiving module 1701 is further configured to:
after generating a corresponding modeling tool and a code generator based on the target model architecture, receiving a target service model under the target scene sent by the terminal equipment, wherein the target service model is created by calling the modeling tool by the terminal equipment in response to a triggering operation of indicating information of the modeling tool in a drive development interface;
the generating module 1702 is further configured to:
and generating a target service code corresponding to the target service model through the code generator.
Optionally, the generating module 1702 is further configured to:
and implanting key information of the target service model into the target service code, wherein the key information of the target service model is used for indicating mapping from the target service code back to the target service model.
Optionally, the generating module 1702 is specifically configured to:
analyzing the target model architecture to obtain corresponding first structural data;
generating a modeling tool corresponding to the target model architecture based on the first structured data, and defining a model analysis component, a template processing component and a generating capability component corresponding to the target model architecture;
and constructing a code generator corresponding to the target model architecture based on the model analysis component, the template processing component and the generating capability component.
Optionally, the generating module 1702 is specifically configured to:
analyzing the target service model by using the model analysis component on the basis of the target model architecture to obtain second structural data corresponding to the target service model;
and rendering an object code template in the template processing component based on the second structured data and the set code generation parameters through the generation capability component to obtain the object service code.
In the embodiment of the application, a plurality of model elements are obtained in response to triggering operation of a model element display area in an architecture development interface, then a target model architecture corresponding to a target scene is built through the plurality of model elements and displayed, so that corresponding model architectures can be built through assembling visualized model elements according to different application scenes, and corresponding modeling tools and code generators are generated based on the built model architectures. And then, automatically constructing service models under different application scenes by using a modeling tool and a code generator and generating corresponding service codes of the service models, thereby realizing the rapid expansion of the service models under different scenes and different requirements, rapidly adapting to the construction of new model driving solutions in specific fields and improving the efficiency and the universality of model driving development. And secondly, the architecture development interface supports the self-defining of the model architecture according to actual needs, so that the granularity of the model architecture can be flexibly set and is effectively suitable for models with different expression levels.
Based on the same technical concept, the embodiment of the present application provides a computer device, which may be a terminal device and/or a server shown in fig. 1, as shown in fig. 18, including at least one processor 1801, and a memory 1802 connected to the at least one processor, where a specific connection medium between the processor 1801 and the memory 1802 is not limited in the embodiment of the present application, and in fig. 18, a connection between the processor 1801 and the memory 1802 is exemplified by a bus. The buses may be divided into address buses, data buses, control buses, etc.
In the embodiment of the present application, the memory 1802 stores instructions executable by the at least one processor 1801, and the at least one processor 1801 may perform the steps of the model driver development method described above by executing the instructions stored in the memory 1802.
Where the processor 1801 is a control center of a computer device, various interfaces and lines may be utilized to connect various portions of the computer device, through execution or execution of instructions stored in the memory 1802, and invocation of data stored in the memory 1802, to thereby implement model architecture on-demand expansion. In the alternative, the processor 1801 may include one or more processing units, and the processor 1801 may integrate an application processor and a modem processor, wherein the application processor primarily processes an operating system, user interfaces, application programs, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1801. In some embodiments, processor 1801 and memory 1802 may be implemented on the same chip, and in some embodiments they may be implemented separately on separate chips.
The processor 1801 may be a general-purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, and may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
The memory 1802 serves as a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 1802 may include at least one type of storage medium, and may include, for example, flash Memory, a hard disk, a multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory), magnetic Memory, magnetic disk, optical disk, and the like. Memory 1802 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer device, but is not limited to such. The memory 1802 of the present embodiments may also be a circuit or any other device capable of implementing a memory function for storing program instructions and/or data.
Based on the same inventive concept, the embodiments of the present application provide a computer-readable storage medium storing a computer program executable by a computer device, which when run on the computer device, causes the computer device to perform the steps of the model-driven development method described above.
Based on the same inventive concept, embodiments of the present application provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer device, cause the computer device to perform the steps of the above-described model-driven development method.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer device or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer device or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer device or other programmable apparatus to produce a computer device implemented process such that the instructions which execute on the computer device or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
Claims (15)
1. A model-driven development method applied to a terminal device, comprising:
Displaying a framework development interface, wherein the framework development interface comprises a model element display area;
responding to the triggering operation aiming at the model element display area, obtaining a plurality of model elements, and displaying a target model framework corresponding to a target scene constructed by the model elements;
and responding to the operation triggered in the architecture development interface, sending the target model architecture to a server, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
2. The method of claim 1, wherein after the sending the target model architecture to a server in response to the run operation triggered in the architecture development interface, further comprising:
displaying a drive development interface, wherein the drive development interface comprises indication information of the modeling tool;
responding to the triggering operation aiming at the indication information in the drive development interface, and calling the modeling tool to create and display a target service model;
And responding to model submitting operation triggered in the drive development interface, and sending the target service model to the server, so that the server generates target service codes corresponding to the target service model through the code generator.
3. The method of claim 1, wherein the architecture development interface further comprises: a canvas area and an attribute definition area for model elements;
the method further comprises the following steps of after the plurality of model elements are obtained in response to the triggering operation of the model element display area:
obtaining attribute information of the defined plurality of model elements in response to a triggering operation for the attribute definition region;
the displaying the target model architecture corresponding to the target scene constructed by the plurality of model elements comprises the following steps:
and displaying the target model architecture constructed through the plurality of model elements and attribute information of the plurality of model elements in the canvas area.
4. The method of claim 3, wherein the architecture development interface further comprises: selecting a region by a model representation;
the method further comprises the following steps of, before the step of responding to the triggering operation of the model element display area to obtain a plurality of model elements:
Obtaining a target graphical representation in response to a triggering operation for the model representation selection area;
the displaying, in the canvas area, the target model architecture constructed by the plurality of model elements and attribute information of the plurality of model elements, including:
and displaying the target model architecture constructed through the model elements and the attribute information of the model elements in the canvas area according to the target graphical representation.
5. The method of claim 3, wherein the architecture development interface further comprises a mode selection area;
after the canvas area displays the target model architecture constructed by the model elements and the attribute information of the model elements, the method further comprises the following steps:
and responding to triggering operation aiming at a code mode in the mode selection area, analyzing the model elements and attribute information of the model elements, and obtaining and displaying first structural data corresponding to the target model architecture.
6. A model driven development method applied to a server, comprising:
receiving a target model architecture corresponding to a target scene sent by a terminal device, wherein the target model architecture is sent by the terminal device in response to a triggering operation aiming at a model element display area in an architecture development interface, constructed according to a plurality of obtained model elements and in response to a running operation triggered in the architecture development interface;
Generating a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
7. The method of claim 6, wherein after generating the respective modeling tools and code generators based on the target model architecture, further comprising:
receiving a target service model under the target scene sent by the terminal equipment, wherein the target service model is created by calling the modeling tool by the terminal equipment in response to the triggering operation of the indication information of the modeling tool in a driving development interface;
and generating a target service code corresponding to the target service model through the code generator.
8. The method as recited in claim 6, further comprising:
and implanting key information of the target service model into the target service code, wherein the key information of the target service model is used for indicating mapping from the target service code back to the target service model.
9. The method of any of claims 6 to 8, wherein the generating respective modeling tools and code generators based on the target model architecture comprises:
Analyzing the target model architecture to obtain corresponding first structural data;
generating a modeling tool corresponding to the target model architecture based on the first structured data, and defining a model analysis component, a template processing component and a generating capability component corresponding to the target model architecture;
and constructing a code generator corresponding to the target model architecture based on the model analysis component, the template processing component and the generating capability component.
10. The method of claim 9, wherein the generating, by the code generator, the target service code corresponding to the target service model comprises:
analyzing the target service model by using the model analysis component on the basis of the target model architecture to obtain second structural data corresponding to the target service model;
and rendering an object code template in the template processing component based on the second structured data and the set code generation parameters through the generation capability component to obtain the object service code.
11. A model-driven development apparatus applied to a terminal device, comprising:
The display module is used for displaying a framework development interface, wherein the framework development interface comprises a model element display area;
the processing module is used for responding to the triggering operation of the model element display area, obtaining a plurality of model elements and displaying a target model architecture corresponding to a target scene constructed by the model elements;
the sending module is used for responding to the operation triggered in the architecture development interface and sending the target model architecture to a server, so that the server generates a corresponding modeling tool and a code generator based on the target model architecture, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
12. A model-driven development device applied to a server, comprising:
the receiving module is used for receiving a target model architecture corresponding to a target scene sent by the terminal equipment, wherein the target model architecture is sent by the terminal equipment in response to a triggering operation aiming at a model element display area in an architecture development interface, constructed according to a plurality of obtained model elements and in response to a running operation triggered in the architecture development interface;
The generation module is used for generating a corresponding modeling tool and a code generator based on the target model framework, wherein the modeling tool is used for constructing a target service model under the target scene, and the code generator is used for generating a target service code corresponding to the target service model.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the method of any of claims 1-10 when the program is executed.
14. A computer readable storage medium, characterized in that it stores a computer program executable by a computer device, which program, when run on the computer device, causes the computer device to perform the steps of the method according to any one of claims 1-10.
15. A computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer device, cause the computer device to carry out the steps of the method according to any one of claims 1 to 10.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210807654.XA CN117406980A (en) | 2022-07-09 | 2022-07-09 | Model drive development method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210807654.XA CN117406980A (en) | 2022-07-09 | 2022-07-09 | Model drive development method, device, equipment and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN117406980A true CN117406980A (en) | 2024-01-16 |
Family
ID=89491330
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210807654.XA Pending CN117406980A (en) | 2022-07-09 | 2022-07-09 | Model drive development method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN117406980A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119668591A (en) * | 2024-11-28 | 2025-03-21 | 北京世冠金洋科技发展有限公司 | A code generation method, system and medium for SysML model |
-
2022
- 2022-07-09 CN CN202210807654.XA patent/CN117406980A/en active Pending
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119668591A (en) * | 2024-11-28 | 2025-03-21 | 北京世冠金洋科技发展有限公司 | A code generation method, system and medium for SysML model |
| CN119668591B (en) * | 2024-11-28 | 2025-11-07 | 北京世冠金洋科技发展有限公司 | Code generation method, system and medium for SysML model |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114064024B (en) | Micro-application development method, device, equipment, storage medium and program product | |
| CN113268226A (en) | Page data generation method and device, storage medium and equipment | |
| US20100287529A1 (en) | Systems and Methods for Generating Multimedia Applications | |
| CN108984388A (en) | A kind of method and terminal device generating automatic test cases | |
| CN111695827B (en) | Business process management method and device, electronic equipment and storage medium | |
| CN112337099A (en) | Service management method and device | |
| CN112395027A (en) | Widget interface generation method and device, storage medium and electronic equipment | |
| CN114266233A (en) | Form generation method, device, equipment and medium | |
| CN110928710B (en) | Information prompting method and device, electronic equipment and storage medium | |
| CN117406980A (en) | Model drive development method, device, equipment and storage medium | |
| US12499460B2 (en) | Information delivery method, apparatus, and device, and computer-readable storage medium | |
| CN112068895A (en) | Code configuration method and device, video playing equipment and storage medium | |
| CN113741868A (en) | Business calculation task processing method and device, computer equipment and storage medium | |
| CN116360735A (en) | Form generation method, device, equipment and medium | |
| CN111124386B (en) | Animation event processing method, device, equipment and storage medium based on Unity | |
| CN116521285A (en) | Application trial method and device, electronic equipment and storage medium | |
| CN118153931A (en) | Data processing method, device, equipment and storage medium | |
| CN117035664A (en) | Template-based trust approval standardized processing method, device, equipment and medium | |
| CN105450501A (en) | Method and apparatus for setting customized reply function | |
| CN113722341B (en) | Operation data processing method and related device | |
| CN117873597A (en) | Method and system for realizing API arrangement through visual configuration mode | |
| CN117055792A (en) | Interface presentation methods, devices, equipment, media and program products | |
| CN113806596A (en) | Operation data management method and related device | |
| CN114518925A (en) | Mobile application generation method, data processing method and related device | |
| CN119088437B (en) | Application configuration method, device, equipment and storage medium |
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 |