WO2023143151A1 - 一种代码开发方法、服务器及存储介质 - Google Patents
一种代码开发方法、服务器及存储介质 Download PDFInfo
- Publication number
- WO2023143151A1 WO2023143151A1 PCT/CN2023/072240 CN2023072240W WO2023143151A1 WO 2023143151 A1 WO2023143151 A1 WO 2023143151A1 CN 2023072240 W CN2023072240 W CN 2023072240W WO 2023143151 A1 WO2023143151 A1 WO 2023143151A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- model
- code
- domain
- user
- definition information
- Prior art date
Links
- 238000011161 development Methods 0.000 title claims abstract description 130
- 238000000034 method Methods 0.000 title claims abstract description 60
- 238000013507 mapping Methods 0.000 claims abstract description 52
- 238000013499 data model Methods 0.000 claims description 119
- 230000004044 response Effects 0.000 claims description 11
- 238000010586 diagram Methods 0.000 description 21
- 238000004891 communication Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 9
- 238000004590 computer program Methods 0.000 description 6
- 238000013461 design Methods 0.000 description 5
- 238000013500 data storage Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 2
- 238000013528 artificial neural network Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000013515 script Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/20—Software design
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/34—Graphical or visual programming
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
Definitions
- the embodiments of the present application relate to the technical field of programs, and in particular to a code development method, a server, and a storage medium.
- Low-code is a visual application development method. Using a low-code development platform for low-code development can reduce the code development pressure of non-technical developers, help them avoid code writing, and provide support for professional code developers.
- the embodiments of the present application provide a code development method, a server, and a storage medium, so as to improve the flexibility of low-code development.
- the embodiment of the present application provides a code development method, including:
- the user interface in the UI tool shows a bottom model component of the bottom model and a top model component of the top model
- the definition information of the bottom model and the definition information of the top model sent by the user terminal is determined based on the user's operation on the user interface;
- the embodiment of the present application provides a code development method, including:
- the code of the engineering structure is obtained after associating the codes of the bottom model and the top model based at least on the mapping relationship between the bottom model and the top model;
- Code development is performed based on the code of the engineering structure.
- the embodiment of the present application provides a server, including at least one memory and at least one processor, the memory stores one or more computer-executable instructions, and the processor invokes the one or more computer-executable instructions Instructions to execute the code development method described in the first aspect above.
- the embodiment of the present application provides a storage medium, the storage medium stores one or more computer-executable instructions, and when the one or more computer-executable instructions are executed, the above-mentioned first aspect is implemented.
- an embodiment of the present application provides a computer program, which implements the code development method as described in the first aspect above, or the code development method as described in the second aspect when the computer program is executed.
- the server can provide the user with a UI tool for defining the model, and the user interface of the UI tool shows the bottom model component of the bottom model and the top model component of the top model, thereby supporting user definition.
- Bottom model and top model After the user defines the bottom model and the top model, the server can obtain the definition information of the bottom model and the definition information of the top model sent by the user terminal; thus, the server can generate the bottom model based on the definition information of the bottom model, and generate the bottom model based on the definition information of the top model. , generating the top-level model.
- the server After the server generates the bottom model and the top model, it can generate the code of the bottom model and the code of the top model, and at least based on the mapping relationship between the bottom model and the top model, combine the bottom model and the The code of the top-level model is associated to obtain the code of the engineering structure.
- the code of the engineering structure can express the full code of the bottom model and the top model, covering the full code information of the application system from the top layer to the bottom layer, so the server provides the code of the engineering structure to the user, so that the user can use the full code
- the flexible development of low-code can be realized, and the deep customization of the application system can be realized. Code customization capabilities.
- the code development method provided by the embodiment of the present application supports user-defined bottom-level models and top-level models, and the server can generate bottom-level models and top-level models through user definition, and provide users with codes covering the top-level to bottom-level engineering structures of the application system, Therefore, the user can perform low-code development on the basis of the code of the project structure, which can enable the user to perform low-code development based on a more comprehensive model code, improve the flexibility of low-code development, and reduce the limitations of application depth customization requirements. Improve the ability of code customization to facilitate subsequent code debugging.
- Figure 1 is an example diagram of the process of low-code development.
- FIG. 2 is a schematic structural diagram of a code development system provided by an embodiment of the present application.
- FIG. 3 is a flow chart of the code development method provided by the embodiment of the present application.
- Fig. 4 is an example diagram of the code for obtaining the engineering structure provided by the embodiment of the present application.
- FIG. 5 is another flow chart of the code development method provided by the embodiment of the present application.
- FIG. 6A is an example diagram of a defined form model provided by the embodiment of the present application.
- FIG. 6B is an example diagram of defining a domain model provided by the embodiment of the present application.
- FIG. 6C is an example diagram of a defined data model provided by the embodiment of the present application.
- FIG. 7A is an example diagram of generating model codes and associated codes provided by the embodiment of the present application.
- Fig. 7B is an example of the code of the engineering structure provided by the embodiment of the present application.
- FIG. 7C is an example diagram of an application architecture with a form model, a domain model and a data model provided by the embodiment of the present application.
- FIG. 8A is a block diagram of a code development device provided by an embodiment of the present application.
- FIG. 8B is a block diagram of a server provided by an embodiment of the present application.
- FIG. 9 is another block diagram of a code development device provided by an embodiment of the present application.
- Low-code development can be completed through the interaction between the low-code development platform and users, and the users referred to here can be code developers.
- users with different code development experience can use the UI (User Interface) tools provided by the low-code development platform to define models and create web and mobile applications through model-driven logic.
- the low-code platform adopts a model-driven development model for code development, such as realizing software code design and generation through visual modeling, so low-code development can be traced back to the model Drive engineering (MDE, Model-Driven Engineering).
- MDE Model-Driven Engineering
- model-driven engineering is a branch of software engineering, which extends models and modeling to all aspects of software development, forming a modeling space, so that engineering activities are based on the mapping and conversion of models; model-driven engineering
- the basic principle of engineering is to treat the model as an entity, and treat all software products as models or model elements.
- FIG. 1 exemplarily shows an example diagram of the low-code development process.
- the low-code development platform can provide users with UI tools, thus, the user can define the model on the user interface of the UI tool; based on the user-defined model, the low-code development platform can generate the code corresponding to the model, and provide the code corresponding to the model to the user, so that the user can apply it through the code corresponding to the model Low-code development of the system.
- model-driven is usually based on only one model, and it is usually a top-level model (such as a form model).
- the code implementation mechanism is completely controlled by the low-code development platform, and it is impossible to optimize the special requirements of the application system (such as the optimization of the performance requirements of the application system); at the same time, the ability of code customization is also limited to a small range (such as code customization Capabilities are usually limited to forms such as scripts), which are difficult to debug.
- the form is oriented to specific usage and interaction scenarios; while the underlying domain model is the business itself, which has a higher degree of abstraction and reusability. Two form models, and the domain models corresponding to these two form models may be the same.
- the embodiment of the present application improves the code development scheme, so that the model drive is not only based on the top-level model (such as the form model), but also based on the bottom-level model (such as the domain model and data model), by opening the definition of the top-level model and the bottom-level model
- the top-level model such as the form model
- the bottom-level model such as the domain model and data model
- users can conduct low-code development based on the comprehensive model code of the application system, which improves the flexibility of low-code development, reduces the limitations of application depth customization requirements, and improves the ability of code customization to facilitate subsequent code debugging.
- FIG. 2 exemplarily shows an optional structural diagram of the code development system provided by the embodiment of the present application.
- the system may include: a low-code development platform 210 and a user terminal 220 .
- the low-code development platform 210 may be a service platform that provides low-code development services, such as a cloud service platform, and the low-code development platform may be formed by servers (such as a single server or a server group formed by multiple servers).
- the low-code development platform can be implemented based on the middle platform, for example, the low-code development platform provides external low-code development services through the services of the middle platform.
- the low-code development platform can provide users with UI tools, so that users can define models through model components in the user interface, and create applications through model-driven logic.
- the user interface provided by the low-code development platform to the user may include the top-level model component of the top-level model and the bottom-level model component of the bottom-level model, so that the user can define the top-level model and the bottom-level model and realize model-driven Not only based on the top-level model, but also on the underlying model.
- the user terminal 220 may be a terminal device used by a user (such as a code developer), such as a laptop computer, a tablet computer, and other user-side devices.
- FIG. 3 exemplarily shows a flow chart of the code development method provided by the embodiment of the present application.
- the method flow can be implemented interactively by a server (such as a server corresponding to a low-code development platform) and a user terminal, as shown in FIG. 3 As shown, the method flow may include the following steps.
- step S310 the server provides a UI tool to the user terminal, and the user interface of the UI tool displays the bottom model component of the bottom model and the top model component of the top model.
- step S311 the user terminal loads the UI tool provided by the server, and displays the user interface.
- the server may provide the user terminal with a UI tool, so that the user terminal loads the UI tool, so that the user using the user terminal can define the model on the low-code development platform through the UI tool.
- the UI tool can provide a user interface for the user to operate, so that the user can define the model through the user interface.
- the embodiment of the present application supports opening the definition of the top-level model and the bottom-level model to users. Therefore, in order to facilitate the user to define the top-level model and the bottom-level model through the user interface, the user The interface can display the top-level model components of the top-level model and the bottom-level model components of the bottom model.
- the top-level model of the embodiment of the present application may include a form model.
- the form model can be considered as the model corresponding to the form, and the form can be regarded as a collection of various form elements that collect user data information.
- the form model is the form information that the user is required to enter when an application system directly faces human-computer interaction. For example, when developing an attendance application system, the leave request form of the attendance application system will correspond to a form model, and the leave request form requires the user to enter applicant, time, reviewer and other information.
- the underlying model in this embodiment of the present application may include a domain model and/or a data model.
- the domain model focuses on domain knowledge, which is the core entity of the business domain, and embodies the key concepts in the problem domain and the connections between concepts. That is to say, in the code development process, the domain model is a model defined for the problem domain faced by the application system. For example, when developing an attendance application system, there are domain objects such as job relationship, vacation, and vacation application in the domain model. It should be noted that there is not necessarily a one-to-one correspondence between the domain model and the form model. For example, after a leave form is sent to the background, several corresponding domain models may be disassembled to call different domain services of the attendance application system.
- the data model focuses on data storage, and all businesses are inseparable from data. That is to say, in the process of code development, the data model faces data storage.
- the requirements of the domain model can be disassembled into the definitions of tables, fields, and attribute types in the database.
- the domain object of the domain model has a list of order items, and the data model is passed through The order ID in the order entry is associated.
- the user interface can provide the form model component of the form model, the domain model component of the domain model, and the data model component of the data model, so that the user can perform form model, domain model and Definition of the data model.
- step S312 the user terminal determines the target bottom model component for defining the bottom model and the target top model component for defining the top model from the model components displayed on the user interface in response to the user operation.
- the user can pass the top-level model components of the top-level model displayed in the user interface (such as the form model component of the form model) and the bottom model components of the bottom model (such as the domain model component of the domain model and/or data Model's Data Model Component), which defines the top-level model and the bottom-level model.
- the top-level model components of the top-level model displayed in the user interface such as the form model component of the form model
- the bottom model components of the bottom model such as the domain model component of the domain model and/or data Model's Data Model Component
- the model component displayed on the user interface may be a drag-and-drop component, which supports the user to select a target model component that defines the model through a drag-and-drop operation (for example, a drag-and-drop operation).
- the user interface may display different definition pages based on different models that need to be defined, so that users can define different models on different definition pages.
- the user interface can display the definition page of the top model so that the user can define the top model, for example, the user interface can display the definition page of the form model, so that User-defined form model.
- the user interface can display the definition page of the underlying model, so that the user can define the underlying model.
- the user interface can specifically display the definition page of the domain model so that the user can define the domain model, and display the definition page of the data model so that the user can define the data model .
- a model definition page can have a model component selection area and a model definition area.
- the model component selection area can display the model components of the model.
- the user can select from the model components displayed in the model component selection area , select the target model component used to define the model, and drag it to the model definition area, so as to realize the definition model through multiple target model components connected in the model definition area.
- the definition page of the top-level model can have a model component selection area and a model definition area.
- the model component selection area can display the top-level model components of the top-level model.
- the user can From the top-level model components displayed in the model component selection area, select the target top-level model component used to define the top-level model, and drag it to the model definition area, so as to realize the definition through multiple target top-level model components connected in the model definition area Top-level model; wherein, the connection relationship between the target top-level model components can be set by the user after dragging the target top-level model component to the model definition area.
- the definition page of the underlying model may have a model component selection area and a model definition area, and the model component selection area may display the underlying model components of the underlying model.
- the domain model definition page can have a model component selection area and a model definition area, and the model component selection area can display the domain model components of the domain model;
- the data model definition page can have a model component selection area and a model definition area, and the model The component selection area can display the data model components of the data model.
- the user can select the target underlying model component used to define the underlying model from the underlying model components displayed in the model component selection area, and drag it to the model definition area, so that through the connected A plurality of target underlying model components realize the definition of the underlying model; wherein, the connection relationship between the target underlying model components can be set by the user after dragging the target underlying model components to the model definition area.
- the user can display the definition page of the form model through the user interface, define the form model, and define the domain model page through the user interface , define the domain model, the definition page of the data model displayed through the user interface On the surface, define the data model. That is to say, when users define models on the low-code development platform, they can define three types of models through the definition pages of three different types of models.
- defining different models through different definition pages is only an optional implementation mode, and the embodiment of the present application can also support the user interface to define different models through a definition page, for example, a definition page can have different models The definition area and the model component selection area of different models, so that users can define different models on one definition page.
- model components corresponding to the model can be considered as the elements of building the model, and multiple connected model components can define the model; in an example, the model components of the domain model can include domain objects, attributes, methods, whether Aggregate roots (a domain-driven design term), etc.; model components of a data model can include data objects such as primary keys, etc.
- the model components corresponding to the form model, the domain model and the data model may be determined according to the specific conditions of the form model, the domain model and the data model, and the embodiments of the present application are not limited thereto.
- step S313 the user terminal sends the definition information of the bottom model and the definition information of the top model to the server.
- the definition information of the bottom model and the top model can be determined based on user operations on the user interface.
- the definition information of the bottom model may include: a plurality of target bottom model components and connection relationships defined by the user from the bottom model components through the user interface;
- the definition information of the top model may include: The user interface defines multiple target top-level model components and connection relationships from the top-level model components.
- the user can confirm the completion of the bottom model and Definition of the top model. For example, the user may click a submit button on the user interface to trigger confirmation to complete the definition of the bottom model and the top model. Therefore, the user terminal can send the definition information of the user-defined bottom model and the definition information of the top model to the server, so that the server generates the bottom model and the top model based on the user's definition information.
- the definition information of the top-level model may include definition information of the form model, for example, defining multiple target form model components of the form model and connection relationships of the multiple target form model components.
- the definition information of the underlying model may include definition information of the domain model and/or definition information of the data model.
- the definition information of the domain model for example, defines multiple target domain model components of the domain model and the connection relationship of the multiple target domain model components;
- the definition information of the data model for example, defines the multiple target data model components of the data model and the multiple target domain model components. The connection relationship of the target data model components.
- step S314 the server generates a bottom model according to the definition information of the bottom model; and generates a top model according to the definition information of the top model.
- the server can generate the bottom model and the top model through model driving based on the definition information of the bottom model and the top model respectively.
- the server based on the target top-level model components used by the top-level model and the connection relationships between them, the server The server can generate a top-level model through model driving, for example, based on the target form model components used by the form model and the connection relationship between them, the server can generate a form model.
- the server can generate the underlying model through model driving.
- the server can generate a domain model based on the target domain model components used by the domain model and the connections between them; based on the target data model components used by the data model and The connection relationship between them generates a data model.
- the underlying model generated by the server may only be a domain model or a data model.
- step S315 the server generates the code of the bottom model and the code of the top model, and at least based on the mapping relationship between the bottom model and the top model, the code of the bottom model and the top model Associated to get the code of the project structure.
- the server After the server generates the bottom model and the top model, it can generate codes for the bottom model and the top model respectively.
- the embodiment of the present application can determine the code of each target model component based on the multiple target model components used by the model, and based on the connection relationship between the multiple target model components , associate the codes of each target model component to realize code generation for the model.
- the embodiment of the present application can determine the code of each target underlying model component used by the underlying model, and based on the connection relationship between the target underlying model components, convert each target underlying model to The code of the model component is associated to get the code of the underlying model.
- the method of generating code for the top-level model can be realized in the same way, for example, determine the code of each target top-level model component used by the top-level model, and based on the connection relationship between the target top-level model components, associate the code of each target top-level model component to Get the code of the top model.
- the embodiment of the present application can at least associate the code of the bottom model and the top model based on the mapping relationship between the bottom model and the top model, so as to obtain the code of the engineering structure.
- the embodiment of the present application can generate the code of the mapping layer of the bottom model and the top model based on the mapping relationship between the bottom model and the top model, and the mapping layer of the bottom model and the top model can be, for example, an APP (application) layer, Used to communicate the top and bottom layers of the application system. Therefore, the embodiment of the present application can associate the code of the bottom model with the code of the top model through the code of the mapping layer, so as to realize the association of the code of the bottom model and the top model.
- Figure 4 exemplarily shows an example diagram of the code for obtaining the engineering structure.
- the embodiment of the present application can generate the code of the top-level model, generate the code of the bottom-level model, and based on the top-level model and the bottom-level
- the mapping relationship of the model generates the code of the APP layer (an implementation example of the mapping layer), so that the code of the top model and the bottom model are associated through the code of the APP layer.
- the embodiment of the present application can specifically generate the code of the domain model and the code of the data model for the underlying model, and combine the code of the domain model and the code of the data model Association is performed to realize the code internal association of the underlying model, and by associating the code of the domain model with the code of the form model (for example, through the APP layer), the code association of the underlying model and the top model is realized.
- step S316 the server sends the code of the engineering structure to the user terminal.
- step S317 the user terminal performs low-code development based on the code of the engineering structure.
- the code of the engineering structure can be regarded as the full code expressing the bottom model and the top model (for example, the full source code), covering the code information from the top layer to the bottom layer of the application system that needs to be developed.
- the server can provide the code of the engineering structure to the user by sending the code of the engineering structure to the user terminal, so that the user can perform low-code development on the source code of the application system on the basis of the full code, and use the application system from
- the top-to-bottom code information realizes the flexible development of low-code, and then realizes the in-depth customization of the application system and improves the ability of code customization.
- the server can provide the user with a UI tool for defining the model, and the user interface of the UI tool shows the bottom model component of the bottom model and the top model component of the top model, thereby supporting user definition.
- Bottom model and top model After the user defines the bottom model and the top model, the server can obtain the definition information of the bottom model and the definition information of the top model sent by the user terminal; thus, the server can generate the bottom model based on the definition information of the bottom model, and generate the bottom model based on the definition information of the top model. , generating the top-level model.
- the server After the server generates the bottom model and the top model, it can generate the code of the bottom model and the code of the top model, and at least based on the mapping relationship between the bottom model and the top model, combine the bottom model and the The code of the top-level model is associated to obtain the code of the engineering structure.
- the code of the engineering structure can express the full code of the bottom model and the top model, covering the full code information of the application system from the top layer to the bottom layer, so the server provides the code of the engineering structure to the user, so that the user can use the full code
- the flexible development of low-code can be realized, and the deep customization of the application system can be realized. Code customization capabilities.
- the code development method provided by the embodiment of the present application supports user-defined bottom-level models and top-level models, and the server can generate bottom-level models and top-level models through user definition, and provide users with codes covering the top-level to bottom-level engineering structures of the application system, Therefore, the user can perform low-code development on the basis of the code of the project structure, which can enable the user to perform low-code development based on a more comprehensive model code, improve the flexibility of low-code development, and reduce the limitations of application depth customization requirements. Improve the ability of code customization to facilitate subsequent code debugging.
- FIG. 5 exemplarily shows another optional flowchart of the code development method provided by the embodiment of the present application. Referring to FIG. 5 , the method flow may include the following steps.
- step S510 the server provides UI tools to the user terminal.
- step S511 the user terminal loads the UI tool provided by the server, and displays a user interface of the UI tool.
- step S512 the user terminal displays the definition page of the form model through the user interface, and in response to user operations on the definition page, determines the target form model component and connection relationship for defining the form model, so as to obtain the definition of the form model information.
- the user interface of the UI tool can provide the definition pages of the three different models of the form model, the domain model and the data model, so that the user can pass the form model
- the form model is defined on the definition page
- the domain model is defined through the definition page of the domain model
- the data model is defined through the definition page of the data model.
- FIG. 6A exemplarily shows an example diagram of defining a form model in this embodiment of the present application.
- the definition page of the form model can have a model component selection area and a model definition area; the model component selection area can display a plurality of form model components 611 to 61n of the form model (n represents the optional form model components of the form model The specific value can be set according to the actual design situation).
- the user can select the target form model component used to define the form model from the form model components 611 to 61n, drag and drop it to the model definition area, and set the connection relationship between the target form model components; for example, FIG. 6A
- a plurality of target form model components 61 and the connections among them form the definition information of the form model.
- step S513 the user terminal displays the definition page of the domain model through the user interface, and in response to user operations on the definition page, determines the target domain model components and connection relationships used to define the domain model, so as to obtain the definition of the domain model information.
- FIG. 6B exemplarily shows an example diagram of defining a domain model in this embodiment of the present application.
- the definition page of the domain model can have a model component selection area and a model definition area; the model component selection area can display a plurality of domain model components 621 to 62m of the domain model (m represents an optional domain model component of the domain model The specific value can be set according to the actual design situation).
- the user can select the target domain model component from the domain model components 621 to 62m, drag and drop it to the model definition area, and set the connection relationship between the target domain model components; for example, the model definition area shown in FIG. 6B
- the definition information of the domain model is formed by multiple target domain model components 62 and the connections among them.
- step S514 the user terminal displays the definition page of the data model through the user interface, and in response to user operations on the definition page, determines the target data model components and connection relationships used to define the domain model to obtain the definition of the data model information.
- FIG. 6C exemplarily shows an example diagram of defining a data model in this embodiment of the present application.
- the definition page of the data model can have a model component selection area and a model definition area; the model component selection area can display a plurality of data model components 631 to 63s of the data model (s represents an optional data model component of the data model The specific value can be set according to the actual design situation).
- the user can select the target data model component from the data model components 631 to 63s, drag it to the model definition area, and set the connection relationship between the target data model components; for example, the model definition area shown in FIG. 6C
- the definition information of the data model is formed by multiple target data model components 63 and the connection relationship between them.
- step S515 the user terminal sends the definition information of the form model, domain model and data model to the server.
- the user terminal can send the definition information of the three types of models to the server, so that the server can generate the form model, domain model and data model.
- step S5166 the server generates a form model based on the definition information of the form model, generates a domain model based on the definition information of the domain model, and generates a data model based on the definition information of the data model.
- the server After obtaining the definition information of the form model, the domain model and the data model, the server can generate each model based on the definition information of each model, thereby realizing the generation of the form model, the domain model and the data model.
- step S517 the server generates the code of the form model, the code of the domain model and the code of the data model; and, based on the mapping relationship between the form model and the domain model, generates the code of the mapping layer.
- step S5128 the server associates the codes of the form model and the domain model based on the code of the mapping layer; and associates the codes of the domain model and the data model based on the mapping relationship between the domain model and the data model to obtain the engineering structure code.
- the server can generate codes for the form model, domain model, and data model, and associate the codes of the form model, domain model, and data model in sequence to obtain the application system
- the full amount of code information from the top level to the bottom level that is, the code of the project structure.
- the embodiment of the present application since the bottom layer and the top layer of the application system need to communicate through mapping layers such as the APP layer, the embodiment of the present application also needs to generate a mapping layer that maps the form model and the domain model based on the mapping relationship between the form model and the domain model code (such as the code of the APP layer), so that when performing code association, the embodiment of the present application can associate the code of the form model with the code of the domain model based on the code of the mapping layer; meanwhile, since the domain model and the data model are both It belongs to the bottom layer of the application system, so the code of the domain model and the code of the data model can be associated through the mapping relationship between the domain model and the data model.
- a mapping layer that maps the form model and the domain model based on the mapping relationship between the form model and the domain model code (such as the code of the APP layer), so that when performing code association, the embodiment of the present application can associate the code of the form model with the code of the domain model based on the code of the mapping layer; meanwhile,
- mapping relationship between the information of the form model and domain objects and domain services of the domain model, and there may be a mapping relationship between the domain objects of the domain model and storage objects such as tables, fields, and attributes of the data model.
- the embodiment of the present application can generate the code of the form model by generating the component code for the form layer.
- the form layer can be the code layer corresponding to the form model.
- the form model can have a client ( Client) layer and entry (Entry) layer.
- component codes can be generated for the client layer and the entry layer respectively, so as to realize the code generation of the form model.
- the embodiment of the present application can generate the code of the APP layer by generating the component code for the APP layer; and, the embodiment of the present application can generate the code of the domain model by generating the component code for the domain (Domain) layer, the domain A layer may be a code layer corresponding to a domain model.
- the embodiment of the present application can associate the component codes of the client layer and the item layer with the component codes of the domain layer through the component codes of the APP layer, so as to realize the codes of associating the form model and the domain model. Further, the embodiment of the present application can generate the code of the data model by generating the component code for the infrastructure (Infrastructure) layer of the data model, so as to associate the component code of the domain layer with the component code of the infrastructure layer to Code that implements the associated domain model and data model.
- infrastructure infrastructure
- FIG. 7A exemplarily shows an example diagram of generating model codes and associated codes.
- the form model has a Client layer and an Entry layer, and the Client layer has components such as a structural object DTO (Data Transfer Object), an application service API (Application Programming Interface, application programming interface) and a business capability service API
- the Entry layer has a Controller (controller) component
- this application Embodiment can be multiple components of Client layer and the Controller component of Entry layer, respectively generate component code, to realize the code of generating form model
- the mapping relation of form model and domain model corresponds to APP layer, and APP layer has DTO Converter (converter ), application service implementation, business capability service implementation and other components, the embodiment of the present application can generate component codes for multiple components of the APP layer respectively, so as to realize the code generation of the APP layer
- the domain model has a Domain layer
- the Domain layer has domain objects, Components such as domain service, Repo (abbreviation of Repository, Repository means repository)
- the component code of the APP layer can be associated with the component codes of the Client layer and the Entry layer (the specific association relationship can refer to the dotted line with an arrow shown in FIG. 7A), and at the same time, the component code of the APP layer can be associated with
- the component code of the Domain layer is associated (for example, DTO Converter is associated with the domain object), so that the code of the APP layer can associate the code of the form model with the code of the domain model; and the component code of the Domain layer can be associated with the component code of the Infrastructure layer Association is performed (for specific association relationship, refer to the dotted line with arrow shown in FIG. 7A ), so as to realize the code of associating the domain model and the data model.
- the embodiment of the present application can obtain the code of the engineering structure, which can express the full amount of the application system from the form model to the domain model to the data model Code information, so as to provide a comprehensive model code of the application system, so that users can develop low-code flexibly.
- Figure 7B exemplarily shows an example of the code of the engineering structure, which can be referred to. It can be seen from Figure 7B that the code of the engineering structure can comprehensively express the form model to the domain model to the data model full code information.
- step S519 the server sends the code of the engineering structure to the user terminal.
- step S520 the user terminal performs low-code development based on the code of the engineering structure.
- the low-code development platform when it supports user-defined form models, domain models, and data models, it can generate the three types of models and the engineering structure of the three types of models based on the user's definition information for the three types of models code, thereby providing the code of the project structure to the user.
- Users can carry out low-code development of application systems based on the full amount of codes of the three types of models, and realize customized development of application systems. for reference.
- the three types of models can respectively meet the complex requirements of the application system at the three levels.
- the definition of the form model can meet the UI requirements of the application system
- the definition of the domain model can face the business nature of the application system
- the definition of the data model can face the data storage scheme of the application system. Therefore, the embodiment of the present application can provide users with a model definition with a higher degree of openness. Support for low-code development for application systems with higher requirements.
- the embodiments of the present application can improve the flexibility of low-code development, reduce the limitations of in-depth customization of application systems and customization limitations of code development, and can make low-code development more suitable for application systems with complex requirements.
- the following is an introduction to the code development device provided by the embodiment of the present application.
- the content of the device described below can be regarded as the functional modules that the server needs to set up to implement the code development method provided by the embodiment of the present application.
- the content of the device described below may be referred to in correspondence with the content described above.
- FIG. 8A exemplarily shows an optional block diagram of the code development apparatus provided by the embodiment of the present application.
- the device can be applied to a server (such as a server of a low-code development platform).
- a server such as a server of a low-code development platform.
- the device can include:
- the tool providing module 810 is used to provide a UI tool to the user terminal, and the user interface in the UI tool shows a bottom model component of the bottom model and a top model component of the top model;
- the definition information acquisition module 811 is configured to acquire the definition information of the bottom model and the definition information of the top model sent by the user terminal; the definition information of the bottom model and the top model is determined based on the user's operation on the user interface;
- a model generation module 812 configured to generate a bottom model according to the definition information of the bottom model; and generate a top model according to the definition information of the top model;
- the code obtaining module 813 is configured to generate the code of the bottom model and the code of the top model, and at least based on the mapping relationship between the bottom model and the top model, convert the code of the bottom model and the top model Correlate to get the code of the engineering structure;
- a code sending module 814 configured to send the code of the engineering structure to the user terminal, so that the user terminal can perform code development based on the code of the engineering structure.
- the definition information of the bottom model includes: multiple target bottom model components and connection relationships defined by the user from the bottom model components through the user interface;
- the definition information of the top model includes: The user defines a plurality of target top-level model components and connection relationships from the top-level model components through the user interface.
- the code obtaining module 813 configured to associate the codes of the bottom model and the top model based at least on the mapping relationship between the bottom model and the top model includes:
- the code of the underlying model is associated with the code of the top model through the code of the mapping layer.
- the top model includes a form model
- the bottom model includes a domain model and a data model.
- the underlying model components of the underlying model displayed on the user interface include: a domain model component of a domain model and a data model component of a data model;
- the model generating module 812 is configured to generate the underlying model according to the definition information of the underlying model including:
- the definition information of the domain model includes: a plurality of target domain model components and connection relationships defined by the user from the domain model components through the user interface;
- the data model is generated according to the definition information of the data model, wherein the definition information of the data model includes a plurality of target data model components and connection relationships defined by the user from the data model components through the user interface.
- the top-level model component of the top-level model displayed on the user interface includes: a form model component of a form model.
- the model generating module 812 is configured to generate the top-level model according to the definition information of the top-level model including:
- a form model is generated according to the definition information of the form model, wherein the definition information of the form model includes a plurality of target form model components and connection relationships defined by the user from the form model components through the user interface.
- the code obtaining module 813 is used to generate the code of the underlying model includes: generating code of the domain model and code of the data model.
- the code obtaining module 813 is used to generate the code of the top-level model includes: generating the code of the form model.
- the code obtaining module 813 is configured to associate the codes of the bottom model and the top model at least based on the mapping relationship between the bottom model and the top model, so as to obtain the code of the engineering structure including :
- the codes of the domain model and the data model are associated to obtain the code of the engineering structure.
- the code obtaining module 813, for generating the code of the form model includes: respectively generating component codes for the client layer and the entry layer;
- the code obtaining module 813, the code for generating the domain model includes: generating component code for the domain layer;
- the code obtaining module 813, the code for generating the data model includes: generating component code for the infrastructure layer;
- the code obtaining module 813 is used to generate the code of the application layer based on the mapping relationship between the form model and the top-level model, including: generating component codes for the application layer based on the mapping relationship between the form model and the top-level model;
- the code obtaining module 813 which is used to associate the code of the form model and the domain model through the code of the application layer includes: associating the component code of the client layer and the item layer with the component code of the domain layer through the component code of the application layer;
- the code obtaining module 813 is used to associate the codes of the domain model and the data model based on the mapping relationship between the domain model and the data model, including: based on the mapping relationship between the domain model and the data model, combining the component codes of the domain layer with the Component codes are associated.
- the embodiment of the present application further provides a server, which can implement the code development method executed on the server side provided in the embodiment of the present application by setting the above-mentioned code development device.
- FIG. 8B exemplarily shows an optional block diagram of the server provided by the embodiment of the present application.
- the server may include: at least one processor 801, at least one communication interface 802 , at least one memory 803 and at least one communication bus 804 .
- processor 801 there is at least one processor 801 , communication interface 802 , memory 803 , and communication bus 804 , and the processor 801 , communication interface 802 , and memory 803 communicate with each other through the communication bus 804 .
- the communication interface 802 may be an interface of a communication module for network communication.
- processor 801 may be CPU, GPU (Graphics Processing Unit, graphics processing unit), NPU (embedded neural network processor), FPGA (Field Programmable Gate Array, Field Programmable Logic Gate Array), TPU (Zhang Quantity processing unit), AI chip, specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application, etc.
- the memory 803 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
- the memory 803 stores one or more computer-executable instructions
- the processor 801 invokes the one or more computer-executable instructions to execute the code development method executed on the server side provided by the embodiment of the present application.
- the embodiment of the present application also provides a storage medium, which stores one or more computer-executable instructions.
- a storage medium which stores one or more computer-executable instructions.
- the embodiment of the present application further provides a computer program.
- the code development method executed on the server side as provided in the embodiment of the present application is implemented.
- the code development device provided by the embodiment of the present application is introduced below.
- the content of the device described below can be considered as the functional modules that the user terminal needs to set to implement the code development method provided by the embodiment of the present application.
- the content of the device described below may be referred to in correspondence with the content described above.
- FIG. 9 exemplarily shows another optional block diagram of the code development apparatus provided by the embodiment of the present application.
- the device can be applied to a user terminal.
- the device can include:
- the tool loading module 910 is used to load the UI tool, display the user interface in the UI tool, and the user interface shows the bottom model component of the bottom model and the top model component of the top model;
- a definition information determination module 911 configured to determine the definition information of the bottom model and the definition information of the top model in response to the user's operation on the user interface;
- a definition information sending module 912 configured to send the definition information of the bottom model and the definition information of the top model to the server, so that the server generates the bottom model and the top model;
- the code acquiring and displaying module 913 is configured to acquire and display the code of the engineering structure sent by the server; the code of the engineering structure is at least based on the mapping relationship between the underlying model and the top-level model, and the underlying model and the top-level model After the code of the model is associated, it is obtained;
- a code development module 914 configured to perform code development based on the code of the project structure.
- the definition information determination module 911 is configured to determine the definition information of the bottom model and the definition information of the top model in response to the user's operation on the user interface, including:
- the user interface displays a definition page of the bottom model and a definition page of the top model;
- the type definition page is used to define the multiple target bottom model components and connection relationships based on user operations;
- the top model definition page is used to define the multiple target top model components and connection relationships based on user operations.
- the top model includes a form model
- the bottom model includes a domain model and a data model.
- the embodiment of the present application also provides a user terminal, which can implement the code development method performed on the user terminal side provided in the embodiment of the present application by setting the above-mentioned code development device.
- the optional structure of the user terminal can be combined with that shown in FIG. 8B, including at least one memory and at least one processor, the memory stores one or more computer-executable instructions, and the processor calls the one or A plurality of computer-executable instructions to execute the code development method performed on the user terminal side as provided in the embodiment of the present application.
- the embodiment of the present application also provides a storage medium, which stores one or more computer-executable instructions.
- the code executed on the user terminal side as provided in the embodiment of the present application is realized. development method.
- the embodiment of the present application also provides a computer program.
- the code development method performed on the user terminal side as provided in the embodiment of the present application is implemented.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
本申请实施例提供一种代码开发方法、服务器及存储介质,其中方法包括:向用户终端提供UI工具,UI工具的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;获取用户终端发送的底层模型的定义信息以及顶层模型的定义信息;根据底层模型的定义信息,生成底层模型;以及根据顶层模型的定义信息,生成顶层模型;生成底层模型的代码和顶层模型的代码,并且至少基于底层模型和顶层模型的映射关系,将底层模型和顶层模型的代码进行关联,以得到工程结构的代码;将工程结构的代码发送给用户终端,以便用户终端基于工程结构的代码进行代码开发。本申请实施例可提升低代码开发的灵活性,降低应用深度定制需求的局限性和代码定制局限。
Description
本申请要求于2022年01月27日提交中国专利局、申请号为202210103277.1、申请名称为“一种代码开发方法、服务器及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请实施例涉及程序技术领域,具体涉及一种代码开发方法、服务器及存储介质。
低代码是一种可视化应用开发方法,使用低代码开发平台进行低代码开发,能够减轻非技术开发人员的代码开发压力,帮助其免去代码编写工作,同时也为专业的代码开发人员提供支持。
低代码开发需要具有较高的灵活性,因此如何对代码开发方案进行优化,以提升低代码开发的灵活性,成为了本领域技术人员亟需解决的技术问题。
发明内容
有鉴于此,本申请实施例提供一种代码开发方法、服务器及存储介质,以提升低代码开发的灵活性。
为实现上述目的,本申请实施例提供如下技术方案。
第一方面,本申请实施例提供一种代码开发方法,包括:
向用户终端提供UI工具,所述UI工具中的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;
获取用户终端发送的底层模型的定义信息以及顶层模型的定义信息;所述底层模型和顶层模型的定义信息基于用户在所述用户界面的操作确定;
根据所述底层模型的定义信息,生成底层模型;以及根据所述顶层模型的定义信息,生成顶层模型;
生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码;
将所述工程结构的代码发送给所述用户终端,以便所述用户终端基于所述工程结构的代码进行代码开发。
第二方面,本申请实施例提供一种代码开发方法,包括:
加载UI工具,显示所述UI工具中的用户界面,所述用户界面展示有底层模型的底
层模型组件和顶层模型的顶层模型组件;
响应于用户在所述用户界面的操作,确定底层模型的定义信息以及顶层模型的定义信息;
将所述底层模型的定义信息以及顶层模型的定义信息发送给服务器,以便服务器生成底层模型和顶层模型;
获取服务器发送的工程结构的代码并展示;所述工程结构的代码至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联后得到;
基于所述工程结构的代码进行代码开发。
第三方面,本申请实施例提供一种服务器,包括至少一个存储器和至少一个处理器,所述存储器存储一条或多条计算机可执行指令,所述处理器调用所述一条或多条计算机可执行指令,以执行如上述第一方面所述的代码开发方法。
第四方面,本申请实施例提供一种存储介质,所述存储介质存储一条或多条计算机可执行指令,所述一条或多条计算机可执行指令被执行时实现如上述第一方面所述的代码开发方法,或者,如上述第二方面所述的代码开发方法。
第五方面,本申请实施例提供一种计算机程序,所述计算机程序被执行时实现如上述第一方面所述的代码开发方法,或者,如上述第二方面所述的代码开发方法。
本申请实施例提供的代码开发方法中,服务器可向用户提供用于定义模型的UI工具,并且UI工具的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件,从而支持用户定义底层模型和顶层模型。在用户定义底层模型和顶层模型之后,服务器可获得用户终端发送的底层模型的定义信息以及顶层模型的定义信息;从而,服务器可基于底层模型的定义信息,生成底层模型,基于顶层模型的定义信息,生成顶层模型。服务器在生成底层模型和顶层模型之后,可以生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码。所述工程结构的代码可以表达底层模型和顶层模型的全量代码,涵盖了应用系统从顶层至底层的全量代码信息,因此服务器将工程结构的代码提供给用户,可使得用户可以在该全量代码的基础上,对应用系统进行源代码方面的低代码开发,并且在低代码开发过程中,通过应用系统从顶层至底层的代码信息,实现低代码的灵活开发,实现对应用系统的深度定制,提升代码订制的能力。
可见,本申请实施例提供的代码开发方法支持用户定义底层模型和顶层模型,并且服务器可通过用户定义生成底层模型和顶层模型,并且向用户提供涵盖应用系统的顶层至底层的工程结构的代码,从而用户在该工程结构的代码基础上进行低代码开发,可使得用户能够基于较为全面的模型代码进行低代码开发,提升了低代码开发的灵活性,能够降低应用深度定制需求的局限性,同时提升代码订制的能力,便于后续代码调试。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为低代码开发的过程示例图。
图2为本申请实施例提供的代码开发系统的结构示意图。
图3为本申请实施例提供的代码开发方法的流程图。
图4为本申请实施例提供的得到工程结构的代码的示例图。
图5为本申请实施例提供的代码开发方法的另一流程图。
图6A为本申请实施例提供的定义表单模型的示例图。
图6B为本申请实施例提供的定义领域模型的示例图。
图6C为本申请实施例提供的定义数据模型的示例图。
图7A为本申请实施例提供的生成模型代码和关联代码的示例图。
图7B为本申请实施例提供的工程结构的代码的示例。
图7C为本申请实施例提供的具有表单模型、领域模型和数据模型的应用架构的示例图。
图8A为本申请实施例提供的代码开发装置的框图。
图8B为本申请实施例提供的服务器的框图。
图9为本申请实施例提供的代码开发装置的另一框图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
低代码开发可通过低代码开发平台与用户的交互完成,此处所指的用户可以是代码开发人员。在进行低代码开发时,不同代码开发经验的用户,能够通过低代码开发平台提供的UI(User Interface,用户界面)工具,定义模型以及通过模型驱动逻辑来创建Web和移动应用。具体的,在低代码开发的过程中,低代码平台采用了模型驱动的开发模式来进行代码开发,例如通过可视化建模的方式来实现软件的代码设计和生成,因此低代码开发可以追溯到模型驱动工程(MDE,Model-Driven Engineering)。需要说明的是,模型驱动工程是软件工程的一个分支,其将模型与建模拓展到软件开发的所有方面,形成建模空间,从而将工程活动建立在模型的映射和转换之上;模型驱动工程的基本原则是将模型视为实体,将所有软件产物当做模型或模型要素。
为便于理解低代码开发的过程,图1示例性的示出了低代码开发的过程示例图。如图1所示,在基于模型驱动进行低代码开发时,低代码开发平台可以向用户提供UI工具,
从而用户可以在UI工具的用户界面上定义模型;基于用户定义的模型,低代码开发平台可以生成模型相应的代码,并将模型相应的代码提供给用户,从而用户可通过模型相应的代码进行应用系统的低代码开发。
然而,目前在进行低代码开发时,模型驱动通常只基于一种模型,并且通常是顶层模型(例如表单模型),这造成模型在深度订制和优化上的局限性,导致开发出来的应用系统的代码实现机制完全由低代码开发平台掌控,无法进行应用系统特殊需求的优化(例如应用系统性能方面需求的优化);同时,代码订制的能力也局限在较小的范围(例如代码订制能力通常局限在脚本等形式),较难进行调试。具体来说,表单是面向特定的使用和交互场景;而底层领域模型是业务的本身,具有更高的抽象度和复用度,比如手机交互界面和电脑网页交互界面存在不同时,就会有两种表单模型,而这两种表单模型对应的领域模型可能是相同的。在复杂的应用系统具有众多交互接口时,如果代码开发都是基于表单驱动实现,则后端非常难以复用,应用系统也无法向支持更多更灵活的业务演进。
可见,低代码开发时,如果模型驱动仅基于顶层模型,则用户只能在顶层模型相应的代码下进行低代码开发,这降低了低代码开发的灵活性,会导致应用订制需求难以优化,进而使得低代码开发无法适用较为复杂的应用系统,同时难以进行代码调试。
基于此,本申请实施例对代码开发方案进行改进,使得模型驱动不仅基于顶层模型(例如表单模型),还基于底层模型(例如领域模型和数据模型),通过将顶层模型和底层模型的定义开放给用户,使得用户能够基于应用系统全面的模型代码进行低代码开发,提升了低代码开发的灵活性,能够降低应用深度定制需求的局限性,同时提升代码订制的能力,便于后续代码调试。
基于上述思路,图2示例性的示出了本申请实施例提供的代码开发系统的可选结构示意图。如图2所示,该系统可以包括:低代码开发平台210和用户终端220。
其中,低代码开发平台210可以是提供低代码开发服务的服务平台,例如云服务平台,低代码开发平台可以由服务器形成(例如单一服务器或者多台服务器形成的服务器群组)。在一些实施例中,低代码开发平台可以基于中台实现,例如通过中台的服务实现低代码开发平台对外提供低代码开发服务。在一些实施例中,低代码开发平台可以通过向用户提供UI工具,使得用户能够通过用户界面中的模型组件定义模型,并且通过模型驱动逻辑来创建应用。在本申请实施例中,低代码开发平台向用户提供的用户界面中可以包括顶层模型的顶层模型组件,和底层模型的底层模型组件,以使得用户能够实现定义顶层模型和底层模型,实现模型驱动不仅基于顶层模型,还基于底层模型。
用户终端220可以是用户(例如代码开发人员)使用的终端设备,例如笔记本电脑、平板电脑等用户侧的设备。
作为可选实现,图3示例性的示出了本申请实施例提供的代码开发方法的流程图,该方法流程可由服务器(例如低代码开发平台对应的服务器)以及用户终端交互实现,如图3所示,该方法流程可以包括如下步骤。
在步骤S310中,服务器向用户终端提供UI工具,所述UI工具的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件。
在步骤S311中,用户终端加载服务器提供的UI工具,并显示所述用户界面。
在本申请实施例中,服务器可向用户终端提供UI工具,以便用户终端加载所述UI工具,从而使用用户终端的用户能够通过UI工具在低代码开发平台上进行模型定义。所述UI工具可以提供供用户操作的用户界面,从而用户可通过用户界面进行模型定义。区别于传统低代码开发平台仅向用户开放顶层模型定义的方式,本申请实施例支持向用户开放顶层模型和底层模型的定义,因此为便于用户通过用户界面定义顶层模型和底层模型,所述用户界面可展示顶层模型的顶层模型组件和底层模型的底层模型组件。
在一些实施例中,本申请实施例的顶层模型可以包括表单模型。表单模型可以认为是表单对应的模型,表单可以视为是收集用户数据信息的各种表单元素的集合。在代码(低代码)开发过程中,表单模型是一个应用系统直接面对人机交互时,要求用户录入的表单信息。例如,在开发一个考勤应用系统时,考勤应用系统的请假单会对应一个表单模型,请假单要求用户录入申请人、时间、审核人等信息。
在一些实施例中,本申请实施例的底层模型可以包括领域模型和/或数据模型。其中,领域模型关注的是领域知识,是业务领域的核心实体,体现了问题域里的关键概念以及概念之间的联系。也就是说,在代码开发过程中,领域模型是针对应用系统所面临的问题域所定义的模型。例如,在开发一个考勤应用系统时,领域模型中有职务关系、假期、假期申请等领域对象。需要说明的是,领域模型和表单模型并不一定是一一对应的关系,例如一个请假单发送到后台后,可能会拆解对应若干领域模型,以分别调用考勤应用系统的不同领域服务。
数据模型关注的是数据存储,所有的业务都离不开数据,也就是说,在代码开发过程中,数据模型面对的是数据存储。例如,领域模型的需求可拆解到数据库中的表、字段、属性类型的定义。需要说明的是,数据模型与领域模型或表单模型并不一定是一一对应的关系,比如在一个订单的应用系统中,领域模型的领域对象有一个订单条目的列表,而数据模型则是通过订单条目中的订单ID进行关联。
作为一种可选实现,用户界面可以提供表单模型的表单模型组件、领域模型的领域模型组件以及数据模型的数据模型组件,以便用户通过用户界面展示的这些模型组件分别进行表单模型、领域模型和数据模型的定义。
在步骤S312中,用户终端响应用户操作,从用户界面展示的模型组件中,确定用于定义底层模型的目标底层模型组件,以及用于定义顶层模型的目标顶层模型组件。
基于用户终端显示的用户界面,用户可通过用户界面中展示的顶层模型的顶层模型组件(例如表单模型的表单模型组件)和底层模型的底层模型组件(例如领域模型的领域模型组件和/或数据模型的数据模型组件),定义顶层模型和底层模型。
在一些实施例中,用户界面展示的模型组件可以是拖放式组件,支持用户通过拖放操作(例如拖拽操作)选择定义模型的目标模型组件。
在一些实施例中,用户界面可以基于需要定义的不同模型,展示不同的定义页面,以便用户在不同的定义页面定义不同的模型。可选的,在本申请实施例支持用户定义底层模型和顶层模型的情况下,用户界面可以展示顶层模型的定义页面,以便用户定义顶层模型,例如,用户界面可以展示表单模型的定义页面,以便用户定义表单模型。另外,用户界面可以展示底层模型的定义页面,以便用户定义底层模型。进一步的,在支持用户定义的底层模型包括领域模型和数据模型的情况下,用户界面可通过具体展示领域模型的定义页面,以便用户定义领域模型,展示数据模型的定义页面,以便用户定义数据模型。
作为可选实现,一个模型的定义页面可具有模型组件选择区和模型定义区,模型组件选择区可展示模型的模型组件,在进行模型定义时,用户可从模型组件选择区展示的模型组件中,选择用于定义模型的目标模型组件,并拖拽到模型定义区,从而通过模型定义区中相连接的多个目标模型组件,实现定义模型。
作为可选实现,在定义顶层模型时,顶层模型的定义页面可具有模型组件选择区和模型定义区,模型组件选择区可展示顶层模型的顶层模型组件,在进行顶层模型的定义时,用户可从模型组件选择区展示的顶层模型组件中,选择用于定义顶层模型的目标顶层模型组件,并拖拽到模型定义区,从而通过模型定义区中相连接的多个目标顶层模型组件,实现定义顶层模型;其中,目标顶层模型组件之间的连接关系可以由用户将目标顶层模型组件拖拽到模型定义区后,由用户操作设置。
作为可选实现,在进行底层模型的定义时,底层模型的定义页面可具有模型组件选择区和模型定义区,模型组件选择区可展示底层模型的底层模型组件。例如,领域模型的定义页面可以具有模型组件选择区和模型定义区,该模型组件选择区可展示领域模型的领域模型组件;数据模型的定义页面可以具有模型组件选择区和模型定义区,该模型组件选择区可展示数据模型的数据模型组件。在进行底层模型定义时,用户可从模型组件选择区展示的底层模型组件中,选择用于定义底层模型的目标底层模型组件,并拖拽到模型定义区,从而通过模型定义区中相连接的多个目标底层模型组件,实现定义底层模型;其中,目标底层模型组件之间的连接关系可以由用户将目标底层模型组件拖拽到模型定义区后,由用户操作设置。
在一个示例中,以顶层模型包括表单模型,底层模型包括领域模型和数据模型为例,用户可通过用户界面展示的表单模型的定义页面,定义表单模型,通过用户界面展示的领域模型的定义页面,定义领域模型,通过用户界面展示的数据模型的定义页
面,定义数据模型。也就是说,用户在低代码开发平台定义模型时,可以通过三类不同模型的定义页面,来实现定义三类模型。
需要说明的是,不同模型通过不同的定义页面进行定义仅是一种可选实现方式,本申请实施例也可支持用户界面通过一个定义页面定义不同的模型,比如一个定义页面中可具有不同模型的定义区和不同模型的模型组件选择区,从而便于用户在一个定义页面实现定义不同的模型。
作为可选实现,模型对应的模型组件可以认为是构建模型的要素,多个连接的模型组件可定义出模型;在一个示例中,领域模型的模型组件可以包括领域对象、属性、方法、是否是聚合根(领域驱动设计的术语)等;数据模型的模型组件可以包括数据对象,例如主键等。在本申请实施例中,表单模型、领域模型和数据模型对应的模型组件可根据表单模型、领域模型和数据模型的具体情况而定,本申请实施例并不设限。
在步骤S313中,用户终端将底层模型的定义信息,以及顶层模型的定义信息发送给服务器。
在一些实施例中,底层模型和顶层模型的定义信息可以基于用户在所述用户界面的操作确定。作为可选实现,底层模型的定义信息可以包括:用户通过所述用户界面从所述底层模型组件中,定义的多个目标底层模型组件以及连接关系;顶层模型的定义信息可以包括:用户通过所述用户界面从所述顶层模型组件中,定义的多个目标顶层模型组件以及连接关系。
用户在完成目标底层模型组件的选择,并设置目标底层模型组件之间的连接关系,同时完成目标顶层模型组件的选择,以及设置目标顶层模型组件之间的连接关系后,可确认完成底层模型和顶层模型的定义。例如,用户可点击用户界面的提交按钮等,以触发确认完成底层模型和顶层模型的定义。从而,用户终端可将用户定义底层模型的定义信息和定义顶层模型的定义信息,发送给服务器,以便服务器基于用户的定义信息生成底层模型和顶层模型。
在一些实施例中,顶层模型的定义信息可以包括表单模型的定义信息,例如定义表单模型的多个目标表单模型组件以及多个目标表单模型组件的连接关系。在一些实施例中,底层模型的定义信息可以包括领域模型的定义信息和/或数据模型的定义信息。其中,领域模型的定义信息例如定义领域模型的多个目标领域模型组件以及该多个目标领域模型组件的连接关系;数据模型的定义信息例如定义数据模型的多个目标数据模型组件以及该多个目标数据模型组件的连接关系。
在步骤S314中,服务器根据所述底层模型的定义信息,生成底层模型;以及根据所述顶层模型的定义信息,生成顶层模型。
用户终端在将底层模型和顶层模型的定义信息发送给服务器之后,服务器可分别基于底层模型和顶层模型的定义信息,通过模型驱动,生成底层模型和顶层模型。在一些实施例中,基于顶层模型使用的目标顶层模型组件以及它们之间的连接关系,服
务器可通过模型驱动,生成顶层模型,例如,基于表单模型使用的目标表单模型组件以及它们之间的连接关系,服务器可生成表单模型。
在一些实施例中,基于底层模型使用的目标底层模型组件以及它们之间的连接关系,服务器可通过模型驱动,生成底层模型。在一个示例中,以底层模型包括领域模型和数据模型为例,服务器可基于领域模型使用的目标领域模型组件以及它们之间的连接关系,生成领域模型;基于数据模型使用的目标数据模型组件以及它们之间的连接关系,生成数据模型。当然,服务器生成的底层模型也可能只是领域模型或者数据模型。
在步骤S315中,服务器生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码。
服务器在生成底层模型和顶层模型之后,可以分别为底层模型和顶层模型生成代码。在为一个模型生成代码的一种可选实现,本申请实施例可基于该模型使用的多个目标模型组件,确定各目标模型组件的代码,并基于该多个目标模型组件之间的连接关系,将各目标模型组件的代码进行关联,以实现为该模型生成代码。例如,在为底层模型生成代码的一种可选实现中,本申请实施例可确定底层模型使用的各目标底层模型组件的代码,并基于目标底层模型组件之间的连接关系,将各目标底层模型组件的代码进行关联,以得到底层模型的代码。为顶层模型生成代码的方式可同理实现,例如确定顶层模型使用的各目标顶层模型组件的代码,并基于目标顶层模型组件之间的连接关系,将各目标顶层模型组件的代码进行关联,以得到顶层模型的代码。
在得到底层模型的代码和顶层模型的代码之后,本申请实施例可至少基于底层模型和顶层模型的映射关系,将底层模型和顶层模型的代码进行关联,从而得到工程结构的代码。
在进一步的可选实现,本申请实施例可基于底层模型和顶层模型的映射关系,生成底层模型和顶层模型的映射层的代码,底层模型和顶层模型的映射层可以例如APP(应用)层,用于沟通应用系统的顶层和底层。从而本申请实施例可通过映射层的代码,将底层模型的代码与顶层模型的代码进行关联,以实现关联底层模型和顶层模型的代码。为便于理解,图4示例性的示出了得到工程结构的代码的示例图,如图4所示,本申请实施例可生成顶层模型的代码,生成底层模型的代码,并且基于顶层模型和底层模型的映射关系,生成APP层(映射层的一种实现示例)的代码,从而通过APP层的代码关联顶层模型和底层模型的代码。需要进一步说明的是,在底层模型包括领域模型和数据模型的情况下,本申请实施例可针对底层模型具体生成领域模型的代码和数据模型的代码,并且将领域模型的代码和数据模型的代码进行关联,以实现底层模型的代码内部关联,并且通过将领域模型的代码与表单模型的代码进行关联(例如通过APP层进行关联),以实现底层模型和顶层模型的代码关联。
在步骤S316中,服务器将工程结构的代码发送给用户终端。
在步骤S317中,用户终端基于所述工程结构的代码进行低代码开发。
在本申请实施例中,工程结构的代码可以视为是表达底层模型和顶层模型的全量代码(例如全量的源代码),涵盖了需要开发的应用系统从顶层至底层的代码信息。服务器通过将工程结构的代码发送给用户终端,可将工程结构的代码提供给用户,从而用户可以在该全量代码的基础上,对应用系统进行源代码方面的低代码开发,并且通过应用系统从顶层至底层的代码信息,实现低代码的灵活开发,进而实现对应用系统的深度定制,提升代码订制的能力。
本申请实施例提供的代码开发方法中,服务器可向用户提供用于定义模型的UI工具,并且UI工具的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件,从而支持用户定义底层模型和顶层模型。在用户定义底层模型和顶层模型之后,服务器可获得用户终端发送的底层模型的定义信息以及顶层模型的定义信息;从而,服务器可基于底层模型的定义信息,生成底层模型,基于顶层模型的定义信息,生成顶层模型。服务器在生成底层模型和顶层模型之后,可以生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码。所述工程结构的代码可以表达底层模型和顶层模型的全量代码,涵盖了应用系统从顶层至底层的全量代码信息,因此服务器将工程结构的代码提供给用户,可使得用户可以在该全量代码的基础上,对应用系统进行源代码方面的低代码开发,并且在低代码开发过程中,通过应用系统从顶层至底层的代码信息,实现低代码的灵活开发,实现对应用系统的深度定制,提升代码订制的能力。
可见,本申请实施例提供的代码开发方法支持用户定义底层模型和顶层模型,并且服务器可通过用户定义生成底层模型和顶层模型,并且向用户提供涵盖应用系统的顶层至底层的工程结构的代码,从而用户在该工程结构的代码基础上进行低代码开发,可使得用户能够基于较为全面的模型代码进行低代码开发,提升了低代码开发的灵活性,能够降低应用深度定制需求的局限性,同时提升代码订制的能力,便于后续代码调试。
下面以顶层模型包括表单模型,底层模型包括领域模型和表单模型为例,对本申请实施例提供的代码开发方案进行介绍。作为可选实现,图5示例性的示出了本申请实施例提供的代码开发方法的另一可选流程图。参照图5,该方法流程可以包括如下步骤。
在步骤S510中,服务器向用户终端提供UI工具。
在步骤S511中,用户终端加载服务器提供的UI工具,并显示UI工具的用户界面。
在步骤S512中,用户终端通过所述用户界面展示表单模型的定义页面,响应于该定义页面上的用户操作,确定用于定义表单模型的目标表单模型组件以及连接关系,以得到表单模型的定义信息。
本申请实施例在支持用户定义表单模型、领域模型和数据模型的情况下,UI工具的用户界面可以提供表单模型、领域模型和数据模型这三类不同模型的定义页面,从而用户可通过表单模型的定义页面定义表单模型,通过领域模型的定义页面定义领域模型,通过数据模型的定义页面定义数据模型。
作为定义表单模型的一个示例,图6A示例性的示出了本申请实施例定义表单模型的示例图。如图6A所示,表单模型的定义页面可以具有模型组件选择区和模型定义区;模型组件选择区可以展示表单模型的多个表单模型组件611至61n(n表示表单模型可选择的表单模型组件的数量,具体数值可根据实际设计情况设置)。用户在定义表单模型时,可从表单模型组件611至61n中选择定义表单模型使用的目标表单模型组件,并拖拽到模型定义区,并设置目标表单模型组件之间的连接关系;例如图6A所示模型定义区由多个目标表单模型组件61以及它们之间的连接关系,形成表单模型的定义信息。
在步骤S513中,用户终端通过所述用户界面展示领域模型的定义页面,响应于该定义页面上的用户操作,确定用于定义领域模型的目标领域模型组件以及连接关系,以得到领域模型的定义信息。
作为定义领域模型的一个示例,图6B示例性的示出了本申请实施例定义领域模型的示例图。如图6B所示,领域模型的定义页面可以具有模型组件选择区和模型定义区;模型组件选择区可以展示领域模型的多个领域模型组件621至62m(m表示领域模型可选择的领域模型组件的数量,具体数值可根据实际设计情况设置)。用户在定义领域模型时,可从领域模型组件621至62m中选择目标领域模型组件,并拖拽到模型定义区,并设置目标领域模型组件之间的连接关系;例如图6B所示模型定义区由多个目标领域模型组件62以及它们之间的连接关系,形成领域模型的定义信息。
在步骤S514中,用户终端通过所述用户界面展示数据模型的定义页面,响应于该定义页面上的用户操作,确定用于定义领域模型的目标数据模型组件以及连接关系,以得到数据模型的定义信息。
作为定义数据模型的一个示例,图6C示例性的示出了本申请实施例定义数据模型的示例图。如图6C所示,数据模型的定义页面可以具有模型组件选择区和模型定义区;模型组件选择区可以展示数据模型的多个数据模型组件631至63s(s表示数据模型可选择的数据模型组件的数量,具体数值可根据实际设计情况设置)。用户在定义数据模型时,可从数据模型组件631至63s中选择目标数据模型组件,并拖拽到模型定义区,并设置目标数据模型组件之间的连接关系;例如图6C所示模型定义区由多个目标数据模型组件63以及它们之间的连接关系,形成数据模型的定义信息。
在步骤S515中,用户终端将表单模型、领域模型和数据模型的定义信息,发送给服务器。
用户在确认完成表单模型、领域模型和数据模型的定义后,用户终端可将该三类模型的定义信息发送给服务器,以便服务器生成表单模型、领域模型和数据模型。
在步骤S516中,服务器基于表单模型的定义信息生成表单模型,基于领域模型的定义信息生成领域模型,基于数据模型的定义信息生成数据模型。
服务器在获取到表单模型、领域模型和数据模型的定义信息后,可分别基于各个模型的定义信息,生成各个模型,从而实现生成表单模型、领域模型和数据模型。
在步骤S517中,服务器生成表单模型的代码、领域模型的代码和数据模型的代码;以及,基于表单模型和领域模型的映射关系,生成映射层的代码。
在步骤S518中,服务器基于映射层的代码,将表单模型和领域模型的代码进行关联;并且基于领域模型和数据模型的映射关系,将领域模型和数据模型的代码进行关联,以得到工程结构的代码。
服务器在生成表单模型、领域模型和数据模型之后,可为表单模型、领域模型和数据模型分别生成代码,并且通过将表单模型、领域模型和数据模型的代码依次进行关联,以得到能够表达应用系统的顶层至底层的全量代码信息(即工程结构的代码)。在一些实施例中,由于应用系统的底层和顶层需要通过APP层等映射层进行沟通,因此本申请实施例还需基于表单模型和领域模型的映射关系,生成映射表单模型和领域模型的映射层的代码(例如APP层的代码),从而在进行代码关联时,本申请实施例可基于映射层的代码,将表单模型的代码和领域模型的代码进行关联;同时,由于领域模型和数据模型均属于应用系统的底层,因此领域模型的代码和数据模型的代码可通过领域模型和数据模型的映射关系进行关联。
在一些实施例中,表单模型的信息与领域模型的领域对象、领域服务可存在映射关系,领域模型的领域对象与数据模型的表、字段、属性等存储对象可存在映射关系。
在进一步的一些实施例中,本申请实施例可通过为表单层生成组件代码,以实现生成表单模型的代码,表单层可以为表单模型对应的代码层,例如表单模型可以具有客户端(Client)层和条目(Entry)层。作为可选实现,本申请实施例可通过为客户端层和条目层,分别生成组件代码,以实现生成表单模型的代码。同时,本申请实施例可通过为APP层生成组件代码,以实现生成APP层的代码;以及,本申请实施例可通过为领域(Domain)层生成组件代码,以实现生成领域模型的代码,领域层可以为领域模型对应的代码层。从而,本申请实施例可通过APP层的组件代码,将客户端层和条目层的组件代码与领域层的组件代码进行关联,以实现关联表单模型和领域模型的代码。进一步的,本申请实施例可通过为数据模型的基础设施(Infrastructure)层生成组件代码,以实现生成数据模型的代码,从而通过将领域层的组件代码与基础设施层的组件代码进行关联,以实现关联领域模型和数据模型的代码。
在一个实现示例中,图7A示例性的示出了生成模型代码和关联代码的示例图。如图7A所示,表单模型具有Client层和Entry层,Client层具有结构对象DTO(数据传输对象,Data Transfer Object)、应用服务API(Application Programming Interface,应用程序接口)和商业能力服务API等组件,Entry层具有Controller(控制器)组件,本申请
实施例可为Client层的多个组件和Entry层的Controller组件,分别生成组件代码,以实现生成表单模型的代码;表单模型和领域模型的映射关系对应APP层,APP层具有DTO Converter(转换器)、应用服务实现、商业能力服务实现等组件,本申请实施例可为APP层的多个组件分别生成组件代码,以实现生成APP层的代码;领域模型具有Domain层,Domain层具有领域对象、领域服务、Repo(Repository的缩写,Repository表示存储库)接口定义等组件,本申请实施例可为Domain层的多个组件分别生成组件代码,以实现生成领域模型的代码;数据模型具有Infrastructure层,Infrastructure层具有Repo实现、DO(Domain Object,领域对象)Converter、数据对象DO等组件,本申请实施例可为Infrastructure层的多个组件分别生成组件代码,以实现生成数据模型的代码。
进一步如图7A所示,APP层的组件代码可以与Client层和Entry层的组件代码进行关联(具体关联关系可参照图7A所示的带箭头的虚线),同时,APP层的组件代码可与Domain层的组件代码进行关联(例如DTO Converter与领域对象存在关联关系),从而APP层的代码可将表单模型和领域模型的代码进行关联;并且,Domain层的组件代码可与Infrastructure层的组件代码进行关联(具体关联关系可参照图7A所示的带箭头的虚线),以实现关联领域模型和数据模型的的代码。
在完成表单模型、领域模型、数据模型的代码生成以及实现代码关联后,本申请实施例可得到工程结构的代码,该工程结构的代码可以表达应用系统从表单模型至领域模型至数据模型的全量代码信息,从而提供应用系统全面的模型代码,以便用户灵活的进行低代码开发。为便于理解,图7B示例性的示出了工程结构的代码的一种示例,可进行参照,由图7B所示可以看出,工程结构的代码可以全面的表达表单模型至领域模型至数据模型的全量代码信息。
在步骤S519中,服务器将工程结构的代码发送给用户终端。
在步骤S520中,用户终端基于所述工程结构的代码进行低代码开发。
在本申请实施例中,低代码开发平台在支持用户定义表单模型、领域模型和数据模型的情况下,可基于用户对于三类模型的定义信息,生成三类模型以及三类模型的工程结构的代码,从而将该工程结构的代码提供给用户。用户可以基于该三类模型的全量代码来进行应用系统的低代码开发,实现应用系统的定制开发,图7C示例性的示出了具有表单模型、领域模型和数据模型的应用架构示例图,可进行参照。
本申请实施例在支持用户定义表单模型、领域模型和数据模型的情况下,三类模型可分别面对应用系统在三类层面的复杂需求,例如表单模型的定义可以面对应用系统的UI需求,领域模型的定义可以面对应用系统的业务本质,数据模型的定义可以面对应用系统的数据存储方案,从而本申请实施例在给用户提供更高开放度的模型定义的情况下,能够对需求复杂度更高的应用系统实现低代码开发的支持。
本申请实施例能够提升低代码开发的灵活性,降低应用系统的深度定制局限和代码开发的定制局限,能够使得低代码开发更为适合复杂需求的应用系统。
下面对本申请实施例提供的代码开发装置进行介绍,下文描述的装置内容可以认为是服务器为实现本申请实施例提供的代码开发方法所需设置的功能模块。下文描述的装置内容可与上文描述的内容相互对应参照。
作为可选实现,图8A示例性的示出了本申请实施例提供的代码开发装置的可选框图。该装置可应用于服务器(例如低代码开发平台的服务器),参照图8A,该装置可以包括:
工具提供模块810,用于向用户终端提供UI工具,所述UI工具中的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;
定义信息获取模块811,用于获取用户终端发送的底层模型的定义信息以及顶层模型的定义信息;所述底层模型和顶层模型的定义信息基于用户在所述用户界面的操作确定;
模型生成模块812,用于根据所述底层模型的定义信息,生成底层模型;以及根据所述顶层模型的定义信息,生成顶层模型;
代码得到模块813,用于生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码;
代码发送模块814,用于将所述工程结构的代码发送给所述用户终端,以便所述用户终端基于所述工程结构的代码进行代码开发。
在一些实施例中,所述底层模型的定义信息包括:用户通过所述用户界面从所述底层模型组件中,定义的多个目标底层模型组件以及连接关系;所述顶层模型的定义信息包括:用户通过所述用户界面从所述顶层模型组件中,定义的多个目标顶层模型组件以及连接关系。
在一些实施例中,代码得到模块813,用于至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联包括:
基于底层模型和顶层模型的映射关系,生成底层模型和顶层模型的映射层的代码;
通过映射层的代码将底层模型的代码与顶层模型的代码进行关联。
在一些实施例中,所述顶层模型包括表单模型,所述底层模型包括领域模型和数据模型。
在一些实施例中,所述用户界面展示的底层模型的底层模型组件包括:领域模型的领域模型组件和数据模型的数据模型组件;。
相应的,模型生成模块812,用于根据所述底层模型的定义信息,生成底层模型包括:
根据领域模型的定义信息,生成领域模型,其中,所述领域模型的定义信息包括:用户通过所述用户界面从所述领域模型组件中,定义的多个目标领域模型组件以及连接关系;
以及,根据数据模型的定义信息,生成数据模型,其中,所述数据模型的定义信息包括用户通过所述用户界面从所述数据模型组件中,定义的多个目标数据模型组件以及连接关系。
在一些实施例中,所述用户界面展示的顶层模型的顶层模型组件包括:表单模型的表单模型组件。
相应的,模型生成模块812,用于根据所述顶层模型的定义信息,生成顶层模型包括:
根据表单模型的定义信息,生成表单模型,其中,所述表单模型的定义信息包括用户通过所述用户界面从所述表单模型组件中,定义的多个目标表单模型组件以及连接关系。
在一些实施例中,代码得到模块813,用于生成所述底层模型的代码包括:生成领域模型的代码和数据模型的代码。
在一些实施例中,代码得到模块813,用于生成所述顶层模型的代码包括:生成表单模型的代码。
在一些实施例中,代码得到模块813,用于至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码包括:
基于表单模型和顶层模型的映射关系,生成应用层的代码;
通过应用层的代码将表单模型和领域模型的代码进行关联;
以及,基于领域模型和数据模型的映射关系,将领域模型和数据模型的代码进行关联,以得到工程结构的代码。
在一些实施例中,代码得到模块813,用于生成表单模型的代码包括:为客户端层和条目层,分别生成组件代码;
代码得到模块813,用于生成领域模型的代码包括:为领域层生成组件代码;
代码得到模块813,用于生成数据模型的代码包括:为基础设施层生成组件代码;
相应的,代码得到模块813,用于基于表单模型和顶层模型的映射关系,生成应用层的代码包括:基于表单模型和顶层模型的映射关系,为应用层生成组件代码;
代码得到模块813,用于通过应用层的代码将表单模型和领域模型的代码进行关联包括:通过应用层的组件代码,将客户端层和条目层的组件代码与领域层的组件代码进行关联;
代码得到模块813,用于基于领域模型和数据模型的映射关系,将领域模型和数据模型的代码进行关联包括:基于领域模型和数据模型的映射关系,将领域层的组件代码与基础设施层的组件代码进行关联。
本申请实施例还提供一种服务器,该服务器可以通过设置上述所述的代码开发装置,以实现本申请实施例提供的服务器侧执行的代码开发方法。作为可选实现,图8B示例性的示出了本申请实施例提供的服务器的可选框图,如图8B所示,该服务器可以包括:可以包括:至少一个处理器801,至少一个通信接口802,至少一个存储器803和至少一个通信总线804。
在本申请实施例中,处理器801、通信接口802、存储器803、通信总线804的数量为至少一个,且处理器801、通信接口802、存储器803通过通信总线804完成相互间的通信。
可选的,通信接口802可以为用于进行网络通信的通信模块的接口。
可选的,处理器801可能是CPU,GPU(Graphics Processing Unit,图形处理器),NPU(嵌入式神经网络处理器),FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列),TPU(张量处理单元),AI芯片,特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路等。
存储器803可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
其中,存储器803存储一条或多条计算机可执行指令,处理器801调用所述一条或多条计算机可执行指令,以执行本申请实施例提供的服务器侧执行的代码开发方法。
本申请实施例还提供一种存储介质,该存储介质存储一条或多条计算机可执行指令,该一条或多条计算机可执行指令被执行时实现如本申请实施例提供的服务器侧执行的代码开发方法。
本申请实施例还提供一种计算机程序,该计算机程序被执行时实现如本申请实施例提供的服务器侧执行的代码开发方法。
下面从用户终端的角度,对本申请实施例提供的代码开发装置进行介绍,下文描述的装置内容可以认为是用户终端为实现本申请实施例提供的代码开发方法所需设置的功能模块。下文描述的装置内容可与上文描述的内容相互对应参照。
作为可选实现,图9示例性的示出了本申请实施例提供的代码开发装置的另一可选框图。该装置可应用于用户终端,参照图9,该装置可以包括:
工具加载模块910,用于加载UI工具,显示所述UI工具中的用户界面,所述用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;
定义信息确定模块911,用于响应于用户在所述用户界面的操作,确定底层模型的定义信息以及顶层模型的定义信息;
定义信息发送模块912,用于将所述底层模型的定义信息以及顶层模型的定义信息发送给服务器,以便服务器生成底层模型和顶层模型;
代码获取并展示模块913,用于获取服务器发送的工程结构的代码并展示;所述工程结构的代码至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联后得到;
代码开发模块914,用于基于所述工程结构的代码进行代码开发。
在一些实施例中,定义信息确定模块911,用于响应于用户在所述用户界面的操作,确定底层模型的定义信息以及顶层模型的定义信息包括:
响应于用户在所述用户界面的操作,确定用户从所述底层模型组件中,定义的多个目标底层模型组件以及连接关系,以及从所述顶层模型组件中,定义的多个目标顶层模型组件以及连接关系;
其中,所述用户界面展示有底层模型的定义页面和顶层模型的定义页面;所述底层模
型的定义页面用于基于用户操作,定义所述多个目标底层模型组件以及连接关系;所述顶层模型的定义页面用于基于用户操作,定义所述多个目标顶层模型组件以及连接关系。
在一些实施例中,所述顶层模型包括表单模型,所述底层模型包括领域模型和数据模型。
本申请实施例还提供一种用户终端,该用户终端可以通过设置上述所述的代码开发装置,以实现本申请实施例提供的用户终端侧执行的代码开发方法。作为可选实现,用户终端的可选结构可以结合图8B所示,包括至少一个存储器和至少一个处理器,所述存储器存储一条或多条计算机可执行指令,所述处理器调用所述一条或多条计算机可执行指令,以执行如本申请实施例提供的用户终端侧执行的代码开发方法。
本申请实施例还提供一种存储介质,该存储介质存储一条或多条计算机可执行指令,该一条或多条计算机可执行指令被执行时实现如本申请实施例提供的用户终端侧执行的代码开发方法。
本申请实施例还提供一种计算机程序,该计算机程序被执行时实现如本申请实施例提供的用户终端侧执行的代码开发方法。
上文描述了本申请实施例提供的多个实施例方案,各实施例方案介绍的各可选方式可在不冲突的情况下相互结合、交叉引用,从而延伸出多种可能的实施例方案,这些均可认为是本申请实施例披露、公开的实施例方案。
虽然本申请实施例披露如上,但本申请并非限定于此。任何本领域技术人员,在不脱离本申请的精神和范围内,均可作各种更动与修改,因此本申请的保护范围应当以权利要求所限定的范围为准。
Claims (12)
- 一种代码开发方法,其中,包括:向用户终端提供用户界面UI工具,所述UI工具中的用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;获取用户终端发送的底层模型的定义信息以及顶层模型的定义信息;所述底层模型和顶层模型的定义信息基于用户在所述用户界面的操作确定;根据所述底层模型的定义信息,生成底层模型;以及根据所述顶层模型的定义信息,生成顶层模型;生成所述底层模型的代码和所述顶层模型的代码,并且至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码;将所述工程结构的代码发送给所述用户终端,以便所述用户终端基于所述工程结构的代码进行代码开发。
- 根据权利要求1所述的方法,其中,所述底层模型的定义信息包括:用户通过所述用户界面从所述底层模型组件中,定义的多个目标底层模型组件以及连接关系;所述顶层模型的定义信息包括:用户通过所述用户界面从所述顶层模型组件中,定义的多个目标顶层模型组件以及连接关系。
- 根据权利要求1所述的方法,其中,所述至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联包括:基于底层模型和顶层模型的映射关系,生成底层模型和顶层模型的映射层的代码;通过映射层的代码将底层模型的代码与顶层模型的代码进行关联。
- 根据权利要求1所述的方法,其中,所述顶层模型包括表单模型,所述底层模型包括领域模型和数据模型。
- 根据权利要求4所述的方法,其中,所述用户界面展示的底层模型的底层模型组件包括:领域模型的领域模型组件和数据模型的数据模型组件;所述用户界面展示的顶层模型的顶层模型组件包括:表单模型的表单模型组件;所述根据所述底层模型的定义信息,生成底层模型包括:根据领域模型的定义信息,生成领域模型,其中,所述领域模型的定义信息包括:用户通过所述用户界面从所述领域模型组件中,定义的多个目标领域模型组件以及连接关系;以及,根据数据模型的定义信息,生成数据模型,其中,所述数据模型的定义信息包括用户通过所述用户界面从所述数据模型组件中,定义的多个目标数据模型组件以及连接关系;所述根据所述顶层模型的定义信息,生成顶层模型包括:根据表单模型的定义信息,生成表单模型,其中,所述表单模型的定义信息包括用户通过所述用户界面从所述表单模型组件中,定义的多个目标表单模型组件以及连接关系。
- 根据权利要求4所述的方法,其中,所述生成所述底层模型的代码包括:生成领域模型的代码和数据模型的代码;所述生成所述顶层模型的代码包括:生成表单模型的代码;所述至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联,以得到工程结构的代码包括:基于表单模型和顶层模型的映射关系,生成应用层的代码;通过应用层的代码将表单模型和领域模型的代码进行关联;以及,基于领域模型和数据模型的映射关系,将领域模型和数据模型的代码进行关联,以得到工程结构的代码。
- 根据权利要求6所述的方法,其中,所述生成表单模型的代码包括:为客户端层和条目层,分别生成组件代码;所述生成领域模型的代码包括:为领域层生成组件代码;所述生成数据模型的代码包括:为基础设施层生成组件代码;所述基于表单模型和顶层模型的映射关系,生成应用层的代码包括:基于表单模型和顶层模型的映射关系,为应用层生成组件代码;所述通过应用层的代码将表单模型和领域模型的代码进行关联包括:通过应用层的组件代码,将客户端层和条目层的组件代码与领域层的组件代码进行关联;所述基于领域模型和数据模型的映射关系,将领域模型和数据模型的代码进行关联包括:基于领域模型和数据模型的映射关系,将领域层的组件代码与基础设施层的组件代码进行关联。
- 一种代码开发方法,其中,包括:加载UI工具,显示所述UI工具中的用户界面,所述用户界面展示有底层模型的底层模型组件和顶层模型的顶层模型组件;响应于用户在所述用户界面的操作,确定底层模型的定义信息以及顶层模型的定义信息;将所述底层模型的定义信息以及顶层模型的定义信息发送给服务器,以便服务器生成底层模型和顶层模型;获取服务器发送的工程结构的代码并展示;所述工程结构的代码至少基于所述底层模型和所述顶层模型的映射关系,将所述底层模型和所述顶层模型的代码进行关联后得到;基于所述工程结构的代码进行代码开发。
- 根据权利要求8所述的方法,其中,所述响应于用户在所述用户界面的操作,确定底层模型的定义信息以及顶层模型的定义信息包括:响应于用户在所述用户界面的操作,确定用户从所述底层模型组件中,定义的多个目标底层模型组件以及连接关系,以及从所述顶层模型组件中,定义的多个目标顶层模型组件以及连接关系;其中,所述用户界面展示有底层模型的定义页面和顶层模型的定义页面;所述底层模型的定义页面用于基于用户操作,定义所述多个目标底层模型组件以及连接关系;所述顶层模型的定义页面用于基于用户操作,定义所述多个目标顶层模型组件以及连接关系。
- 根据权利要求8或9所述的方法,其中,所述顶层模型包括表单模型,所述底层模型包括领域模型和数据模型。
- 一种服务器,其中,包括至少一个存储器和至少一个处理器,所述存储器存储一条或多条计算机可执行指令,所述处理器调用所述一条或多条计算机可执行指令,以执行如权利要求1-7任一项所述的代码开发方法。
- 一种存储介质,其中,所述存储介质存储一条或多条计算机可执行指令,所述一条或多条计算机可执行指令被执行时实现如权利要求1-7任一项所述的代码开发方法,或者,如权利要求8-10任一项所述的代码开发方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210103277.1A CN114564176B (zh) | 2022-01-27 | 2022-01-27 | 一种代码开发方法、服务器及存储介质 |
CN202210103277.1 | 2022-01-27 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023143151A1 true WO2023143151A1 (zh) | 2023-08-03 |
Family
ID=81714351
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/072240 WO2023143151A1 (zh) | 2022-01-27 | 2023-01-16 | 一种代码开发方法、服务器及存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114564176B (zh) |
WO (1) | WO2023143151A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093205A (zh) * | 2023-08-24 | 2023-11-21 | 武汉人云智物科技有限公司 | 一种软件开发全流程低代码工程构建方法 |
CN117850752A (zh) * | 2024-01-17 | 2024-04-09 | 湖南盛鼎科技发展有限责任公司 | 通过领域模型实例化生成器构建低代码平台的方法及系统 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114564176B (zh) * | 2022-01-27 | 2023-08-22 | 阿里云计算有限公司 | 一种代码开发方法、服务器及存储介质 |
CN116450682B (zh) * | 2023-03-23 | 2024-05-10 | 苏州峰之鼎信息科技有限公司 | 基于数据合并的模型生成方法、装置、设备及介质 |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100313182A1 (en) * | 2009-06-05 | 2010-12-09 | Microsoft Corporation | Extensible user interface generation |
CN110825362A (zh) * | 2019-11-04 | 2020-02-21 | 广东道一信息技术股份有限公司 | 低代码应用软件开发系统及方法 |
CN112698826A (zh) * | 2021-03-23 | 2021-04-23 | 杭州数式网络科技有限公司 | 低代码页面创建系统、方法及设备 |
CN112835560A (zh) * | 2021-03-04 | 2021-05-25 | 广州图创计算机软件开发有限公司 | Web多终端低代码智能软件开发平台 |
CN112988123A (zh) * | 2021-05-06 | 2021-06-18 | 北京宇信科技集团股份有限公司 | 面向ddd的软件设计方法及系统 |
CN113050934A (zh) * | 2019-12-26 | 2021-06-29 | 东软集团(上海)有限公司 | 表单驱动智能开发方法、装置以存储介质 |
CN114564176A (zh) * | 2022-01-27 | 2022-05-31 | 阿里云计算有限公司 | 一种代码开发方法、服务器及存储介质 |
Family Cites Families (16)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6578068B1 (en) * | 1999-08-31 | 2003-06-10 | Accenture Llp | Load balancer in environment services patterns |
US20050160104A1 (en) * | 2004-01-20 | 2005-07-21 | Datasource, Inc. | System and method for generating and deploying a software application |
EP1571547A1 (en) * | 2004-02-27 | 2005-09-07 | Research In Motion Limited | System and method for building wireless applications with intelligent mapping between user interface and data components |
US20100198844A1 (en) * | 2009-01-30 | 2010-08-05 | Thales-Raytheon Systems Company, LLC | Automatic Code Generation |
US9250883B2 (en) * | 2011-06-02 | 2016-02-02 | Open Invention Network, Llc | System and method for pervasive software platform-based model driven architecture application generator |
CN103761082A (zh) * | 2013-12-31 | 2014-04-30 | 湖南大唐先一科技有限公司 | 一种组件化研发模式与领域驱动模型相结合的应用开发系统及平台 |
WO2016113913A1 (ja) * | 2015-01-16 | 2016-07-21 | 株式会社日立製作所 | サービスを作成する管理システム |
US9547482B2 (en) * | 2015-06-02 | 2017-01-17 | Sap Portals Israel Ltd. | Declarative design-time experience platform for code generation |
US20170277520A1 (en) * | 2016-03-25 | 2017-09-28 | Pablo Daniel Palma Keller | System and methods for development of visual business applications |
JP6945481B2 (ja) * | 2018-03-23 | 2021-10-06 | 日立Astemo株式会社 | ソフトウェア開発装置 |
CN109032590B (zh) * | 2018-09-26 | 2021-11-16 | 山东鲁能软件技术有限公司 | 一种可视化开发环境的配置方法、装置、终端及存储介质 |
CN109614097A (zh) * | 2018-12-07 | 2019-04-12 | 北京金山云网络技术有限公司 | 平台代码的生成方法、装置及服务器 |
US20200311095A1 (en) * | 2019-03-29 | 2020-10-01 | Next Pathway Inc. | System and method for automated source code generation for database conversion |
CN112596706A (zh) * | 2020-12-15 | 2021-04-02 | 用友网络科技股份有限公司 | 模式化代码生成方法、装置和计算机可读存储介质 |
CN113076096B (zh) * | 2021-04-29 | 2024-04-23 | 成都星云智联科技有限公司 | 一种桌面应用程序开发方法、装置、设备及存储介质 |
CN113656031A (zh) * | 2021-08-20 | 2021-11-16 | 中国银行股份有限公司 | 移动端页面代码生成方法及装置 |
-
2022
- 2022-01-27 CN CN202210103277.1A patent/CN114564176B/zh active Active
-
2023
- 2023-01-16 WO PCT/CN2023/072240 patent/WO2023143151A1/zh unknown
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100313182A1 (en) * | 2009-06-05 | 2010-12-09 | Microsoft Corporation | Extensible user interface generation |
CN110825362A (zh) * | 2019-11-04 | 2020-02-21 | 广东道一信息技术股份有限公司 | 低代码应用软件开发系统及方法 |
CN113050934A (zh) * | 2019-12-26 | 2021-06-29 | 东软集团(上海)有限公司 | 表单驱动智能开发方法、装置以存储介质 |
CN112835560A (zh) * | 2021-03-04 | 2021-05-25 | 广州图创计算机软件开发有限公司 | Web多终端低代码智能软件开发平台 |
CN112698826A (zh) * | 2021-03-23 | 2021-04-23 | 杭州数式网络科技有限公司 | 低代码页面创建系统、方法及设备 |
CN112988123A (zh) * | 2021-05-06 | 2021-06-18 | 北京宇信科技集团股份有限公司 | 面向ddd的软件设计方法及系统 |
CN114564176A (zh) * | 2022-01-27 | 2022-05-31 | 阿里云计算有限公司 | 一种代码开发方法、服务器及存储介质 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117093205A (zh) * | 2023-08-24 | 2023-11-21 | 武汉人云智物科技有限公司 | 一种软件开发全流程低代码工程构建方法 |
CN117093205B (zh) * | 2023-08-24 | 2024-02-20 | 武汉人云智物科技有限公司 | 一种软件开发全流程低代码工程构建方法 |
CN117850752A (zh) * | 2024-01-17 | 2024-04-09 | 湖南盛鼎科技发展有限责任公司 | 通过领域模型实例化生成器构建低代码平台的方法及系统 |
Also Published As
Publication number | Publication date |
---|---|
CN114564176A (zh) | 2022-05-31 |
CN114564176B (zh) | 2023-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2023143151A1 (zh) | 一种代码开发方法、服务器及存储介质 | |
US8726176B2 (en) | Active business client | |
US8527313B2 (en) | Document instantiation triggering a business action | |
US8250169B2 (en) | Business context data companion tool | |
US20070276714A1 (en) | Business process map management | |
Elghaish et al. | Artificial intelligence-based voice assistant for BIM data management | |
US20070276715A1 (en) | Distributed activity management | |
US20100138268A1 (en) | Progress management platform | |
US20120233588A1 (en) | Blended service creation, test, and deployment environment for multiple service endpoints | |
US20120233589A1 (en) | Software development kit for blended services | |
Kazman et al. | The essential components of software architecture design and analysis | |
US20150082271A1 (en) | System and method for providing an editor for use with a business process design environment | |
Fill | SeMFIS: a flexible engineering platform for semantic annotations of conceptual models | |
CN106022007A (zh) | 面向生物组学大数据计算的云平台系统及方法 | |
WO2023093486A1 (zh) | 生成项目流的方法、装置、电子设备及存储介质 | |
US20120060141A1 (en) | Integrated environment for software design and implementation | |
US6407751B1 (en) | Method and apparatus of generating mobile objects and storage medium storing an object generating mobile objects | |
CN112337099A (zh) | 业务管理方法及装置 | |
US20240281731A1 (en) | Phase-Based Access Permissions for Multi-Phase Projects | |
CN114201144A (zh) | 基于领域驱动设计的微服务系统构建方法、设备及介质 | |
Petriu et al. | Software performance models from system scenarios | |
US8407663B2 (en) | Upgrading simple applications to full scale solutions | |
Blumendorf et al. | Multimodal user interfaces for smart environments: the multi-access service platform | |
CN108960433B (zh) | 用于运行机器学习建模过程的方法及系统 | |
Aspin | Supporting collaboration, in colocated 3D visualization, through the use of remote personal interfaces |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23746033 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |