Code generation method and device based on domain model, equipment and medium

By using a domain model-based code generation method, the code generation engine automatically generates project code, solving the problem of low efficiency in traditional manual initialization and achieving efficient and standardized project startup.

CN121832908APending Publication Date: 2026-04-10SHENZHEN COMTOP INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Traditional project initialization methods rely heavily on developers manually creating project structures, writing configuration files, and defining dependencies between modules, leading to inefficiency, error-proneness, and difficulty in ensuring project standardization and architectural consistency.

Method used

By using a domain model-based code generation method, the code generation engine parses the target domain engineering model, automatically generates the target engineering code, and pushes it to the target code repository, reducing development preparation time.

Benefits of technology

It improves project startup efficiency, reduces initialization costs, ensures the consistency and standardization of the generated project code structure, and frees developers from repetitive work.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121832908A_ABST
    Figure CN121832908A_ABST
Patent Text Reader

Abstract

The invention discloses a code generation method and device based on a domain model, equipment and a medium, and the method comprises the steps: obtaining a target domain engineering model selected by a target user, and the target domain engineering model comprises an engineering structure model, an engineering component model and an engineering configuration model; analyzing the target domain engineering model based on a code generation engine, and generating a target engineering code corresponding to a target domain; and determining a target code warehouse corresponding to the target user, and pushing the target engineering code to the target code warehouse. Based on the technical scheme, the target domain engineering model is analyzed through the code generation engine, and the target engineering code is automatically generated, so that the preparation time required in the development process is shortened, the project starting efficiency is improved, and the initialization cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software architecture technology, and in particular to a code generation method, apparatus, device, and medium based on a domain model. Background Technology

[0002] In the current enterprise application development field, Java continues to hold a mainstream position due to its excellent stability, mature ecosystem, and powerful cross-platform capabilities. To effectively manage the increasing complexity of software, adopting a layered architecture (e.g., presentation layer, business logic layer, data access layer) and combining it with tools such as Maven or Gradle for multi-module project management has become a widely recognized best practice in the industry.

[0003] However, traditional project initialization methods rely heavily on developers manually creating project structures, writing configuration files, and defining dependencies between modules. This not only places high demands on developers' technical skills and experience but also suffers from inefficiency and error-proneness, making it difficult to effectively guarantee project standardization and architectural consistency during long-term iterations. Summary of the Invention

[0004] This invention provides a code generation method, apparatus, device, and medium based on a domain model. By using a code generation engine to parse the target domain engineering model and automatically generate the target engineering code, the preparation time required during development is reduced, thereby improving project startup efficiency and reducing initialization costs.

[0005] According to one aspect of the present invention, a code generation method based on a domain model is provided, comprising:

[0006] Obtain the target domain engineering model selected by the target user, wherein the target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model;

[0007] The code generation engine is used to parse the target domain engineering model and generate target engineering code corresponding to the target domain.

[0008] Identify the target code repository corresponding to the target user, and push the target project code to the target code repository.

[0009] According to another aspect of the present invention, a code generation apparatus based on a domain model is provided, comprising:

[0010] The engineering model acquisition module is used to acquire the target domain engineering model selected by the target user, wherein the target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model;

[0011] The engineering code generation module is used to parse the target domain engineering model based on the code generation engine and generate target engineering code corresponding to the target domain.

[0012] The code push module is used to determine the target code repository corresponding to the target user and push the target project code to the target code repository.

[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0014] At least one processor; and

[0015] A memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the domain model-based code generation method according to any embodiment of the present invention.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the domain model-based code generation method according to any embodiment of the present invention.

[0018] The technical solution of this invention involves obtaining a target domain engineering model selected by a target user; parsing the target domain engineering model using a code generation engine to generate target engineering code corresponding to the target domain; determining a target code repository corresponding to the target user; and pushing the target engineering code to the target code repository. Based on this technical solution, by parsing the target domain engineering model and automatically generating target engineering code using a code generation engine, the preparation time required during development is reduced, thereby improving project startup efficiency and lowering initialization costs.

[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a flowchart of a code generation method based on a domain model provided in an embodiment of the present invention;

[0022] Figure 2 This is a schematic diagram of a standard directory page with a hierarchical architecture provided in an embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of the code push page provided in an embodiment of the present invention;

[0024] Figure 4 This is a flowchart of a code generation method based on a domain model provided in an embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of the engineering template selection page provided in an embodiment of the present invention;

[0026] Figure 6 This is a schematic diagram of the engineering information configuration page provided in an embodiment of the present invention;

[0027] Figure 7 A schematic diagram of the structure of a version control device for a class model provided in an embodiment of the present invention;

[0028] Figure 8 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0030] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0031] Figure 1 This is a flowchart illustrating a domain model-based code generation method provided in an embodiment of the present invention. This embodiment is applicable to situations where initial code is automatically generated based on a target domain engineering model during the engineering development process of a target domain. This method can be executed by a domain model-based code generation device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method specifically includes the following steps:

[0032] S110. Obtain the target domain engineering model selected by the target user.

[0033] The target users can be developers who are engaged in engineering development within the target domain. The target domain engineering model can be an engineering model corresponding to the target domain, established through visual modeling. The target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model.

[0034] Specifically, the process involves acquiring the target domain engineering model selected by the target user. For example, when the target user needs to conduct engineering development in a target domain, they can select the target domain engineering model through a visual interface. This can involve displaying at least two engineering models corresponding to the target domain in the visual interface, with the user-selected model serving as the target domain engineering model. It should be noted that the target domain can be the target user's development business domain, such as the power grid management business domain.

[0035] S120. Based on the code generation engine, the target domain engineering model is parsed to generate target engineering code corresponding to the target domain.

[0036] The code generation engine can be a pre-developed tool used to parse a domain engineering model to obtain engineering code. The target engineering code can be understood as the initialization code used for engineering development; it includes all the code modules and components required to implement the developed functions.

[0037] Specifically, the code generation engine parses the target domain engineering model to generate target engineering code corresponding to the target domain. For example, for the input target domain engineering model, the code generation engine identifies the structure, components, and configuration information in the model. For the engineering structure model, the hierarchical relationship between the modules in the model is parsed; for the engineering component model, data such as component attributes and interfaces are extracted; and the configuration data corresponding to the development project is determined by parsing the engineering configuration model. After parsing, a template is selected according to the model, and the parsed data is filled into it to generate target engineering code corresponding to the target domain.

[0038] It's important to note that the code generation engine can automatically generate target code based on user input and predefined templates. The engine parses placeholders and logical statements in the template file, fills in the user-input data, and generates the final code file. For example, during development, the user defines a template file containing placeholders such as class names and method names. The code generation engine then fills in the template with the user-input class name (e.g., MyClass) to generate the target code file (MyClass.java).

[0039] Based on the above technical solution, the target domain engineering model is parsed using a code generation engine to generate target engineering code corresponding to the target domain. This includes: parsing the engineering structure model using the code generation engine to determine the code sub-modules and module hierarchy relationships of the target domain engineering model; establishing a hierarchical architecture directory corresponding to the target domain based on the code sub-modules and module hierarchy relationships; and generating target engineering code based on the hierarchical architecture directory and the target domain engineering model.

[0040] The code submodules can be the various modules required to constitute the project. For example, they can include startup modules, module modules, and general information modules, such as `test-mutil-engineer`, `test-mutil-engineer-common`, `test-mutil-engineer-module`, and `test-mutil-engineer-start`. The module hierarchy describes the dependencies between modules in the current project. The layered architecture directory can be the code's architectural pattern, dividing the code into multiple unidirectional dependency levels based on hierarchical decomposition theory.

[0041] Specifically, the code generation engine analyzes the engineering structure model to identify the code sub-modules corresponding to the target domain's engineering model. It also determines the position and role of each sub-module within the overall architecture. Based on the code sub-modules and module hierarchy, a layered architecture directory corresponding to the target domain is established. It should be noted that, for example... Figure 2 As shown, the hierarchical architecture directory is presented in a tree structure with clear hierarchy, showing the inclusion relationship of different levels of sub-modules. Target project code can then be generated based on the hierarchical architecture directory and the target domain engineering model.

[0042] Based on the above technical solution, the step of generating target project code based on the hierarchical architecture directory and the target domain engineering model includes: parsing the engineering configuration model based on the code generation engine to determine the module configuration information of the code sub-module and the engineering configuration information of the target project; extracting the target project component corresponding to the target project from the engineering component model; and generating the target project code according to the module configuration information of the code sub-module, the engineering configuration information of the target project, the hierarchical architecture directory, and the target project component.

[0043] The project configuration information can be the required configuration information corresponding to the target project, or the configuration information of the database corresponding to the project. Module configuration information can be the configuration information of each code module, such as the configuration information of startup items. Target project components can be the required components corresponding to the target project, determined based on the components selected by the user.

[0044] Specifically, the code generation engine parses the project configuration model to determine the module configuration information of the code sub-modules, which may include parameter types, value ranges, etc.; and determines the overall project configuration information of the target project, such as the runtime environment and performance requirements. Then, it extracts the target project components corresponding to the target project from the project component model. Based on the module configuration information of the code sub-modules, the project configuration information of the target project, the pre-established hierarchical architecture directory, and the extracted target project components, the code generation engine converts various information into code statements to obtain the target project code.

[0045] S130. Determine the target code repository corresponding to the target user, and push the target project code to the target code repository.

[0046] The target code repository can be a database used to store the project development code, such as a Git code repository, which can be set up by the user during the process of setting up the domain model.

[0047] Specifically, the target code repository corresponding to the target user is determined, and the target project code is pushed to the target code repository. For example, the target code repository corresponding to the target user can be determined based on the target user's identity. After determining the target code repository, a version control tool, such as Git, is used to establish a connection between the local code and the target code repository. Then, by executing a push command, the target project code is uploaded to the specified branch of the target code repository. For example, as shown... Figure 3As shown, the generated multi-module project source code is directly pushed to the specified Git repository and supports online preview. Users can obtain the code through a Git client and directly import it into their local IDE (Integrated Development Environment) to immediately begin subsequent business function development, without having to worry about the tedious project initialization work.

[0048] Based on the above technical solution, after pushing the target project code to the target code repository, the method further includes: in response to the target user's development operation on the target project, obtaining the target project code from the target code repository; and loading the target project code into the local development environment corresponding to the target user, so that the target user can perform functional development through the local development environment.

[0049] Here, development operations can refer to development tasks performed by the target user on a target project. A local development environment can be understood as an integrated development environment set up on the user's local machine.

[0050] Specifically, when a target user initiates development operations on the target project, the system locates the branch and directory containing the target project code in the target code repository based on the relevant identification information of the target project. Then, using the pull function of the version control tool, the system downloads the target project from the target code repository to the specified local storage location. After the download is complete, the system automatically identifies the target user's pre-configured local development environment, such as an integrated development environment (IDE) or a specific code editor, and automatically loads the downloaded target project code into that local development environment, completing the environment configuration and code initialization.

[0051] The technical solution of this invention involves obtaining a target domain engineering model selected by a target user; parsing the target domain engineering model using a code generation engine to generate target engineering code corresponding to the target domain; determining a target code repository corresponding to the target user; and pushing the target engineering code to the target code repository. Based on this technical solution, by parsing the target domain engineering model and automatically generating target engineering code using a code generation engine, the preparation time required during development is reduced, thereby improving project startup efficiency and lowering initialization costs.

[0052] In one possible implementation of the present invention Figure 4 A flowchart of a code generation method based on a domain model provided in an embodiment of the present invention is shown below. Figure 4 As shown, this embodiment further includes the following steps before obtaining the target domain engineering model selected by the target user:

[0053] S410. Obtain the engineering model settings operation of the target user for the target domain.

[0054] Among them, the engineering model setting operation can be a model configuration operation performed by the user on the visual interface.

[0055] Specifically, when the target user interacts with the interface, a front-end event listener mechanism is used to capture every user action in real time, such as clicking, inputting, and dragging, and the captured actions and related data are transmitted to the back-end server in real time. It should be noted that, for example... Figure 5 As shown, select a preset technology stack and project structure template from the template library in the visual editing interface. For example, the TSF multi-level project (springboot2.7.18) template defines a standard structure for modules such as multi-level root projects, startup projects, module projects, and common projects.

[0056] S420. Based on the engineering model settings operation, determine the target domain engineering model corresponding to the target domain.

[0057] Specifically, after the data is captured after the setting operation is completed in the front-end interactive interface, the data is transmitted to the back-end server in a structured format, such as JSON. After receiving the data, the server extracts the setting parameters from the engineering model setting operation, including the number of layers and the size of each layer in the engineering structure model, the component types and performance indicators in the engineering component model, and the running mode and association rules in the engineering configuration model. Based on the extracted parameters, the server searches for matching rules in the rule base to determine the specific characteristics and structure of the target domain engineering model, and then establishes the corresponding target domain engineering model.

[0058] Based on the above technical solution, the step of determining the target domain engineering model corresponding to the target domain based on the engineering model setting operation includes: determining the engineering model template corresponding to the target domain based on the engineering model setting operation; determining template setting data according to the engineering model setting operation; and establishing the target domain engineering model according to the template setting data and the engineering model template.

[0059] The engineering model templates can be pre-built templates corresponding to different business domains. These templates include structural model templates, component model templates, and configuration model templates. Template settings data can be configuration data entered by the user in the visual interface, which may include information such as the project name, code, and whether to create a common project.

[0060] Specifically, based on the target domain characteristics reflected in the settings operation, such as project type and scale, the most suitable structural model template, component model template and configuration model template are selected from the template library. Then, the template settings data are extracted from the project model settings operation, and the parameters input by the user are cleaned and converted in format. The template settings data are used as the filling content of the project model template to determine the final target domain project model.

[0061] Based on the above technical solution, the step of establishing the target domain engineering model according to the template setting data and the engineering model template includes: extracting hierarchical relationship setting data, component model setting data and configuration model setting data from the template setting data; and filling the hierarchical relationship setting data, component model setting data and configuration model setting data into the corresponding engineering model templates to determine the target domain engineering model.

[0062] The hierarchy setting data is editable data used to define the hierarchical relationships between various code modules. The component model setting data can be used to set information about components corresponding to the project. The configuration model setting data can be configuration data for the project and code modules entered by the user.

[0063] Specifically, hierarchical relationship setting data is extracted from the setting data. This hierarchical relationship setting data represents the inclusion and association relationships of each level in the engineering structure. Component model setting data is extracted, including information such as component type, attributes, and interfaces. Configuration model setting data is extracted, including configuration data such as operating rules and parameter thresholds. These three types of extracted data are then filled into pre-defined engineering model templates. For example, for the structural model template, the hierarchical relationship setting data is filled according to preset hierarchical architecture rules to construct a complete engineering structure framework. The configuration model setting data is filled into the configuration model template to define the operating rules and parameters of each component. Finally, the three types of engineering models are aggregated to obtain a target domain engineering model corresponding to the target domain. For example,... Figure 6 As shown, users can configure project component information, package paths, data connection information, etc. through a visual interface, and save these configurations together with the domain model as structured metadata. Users can also select the components required for the project on the interface, and configure the code repository link corresponding to the user. After the code is generated, the target project code can be automatically pushed to the code repository corresponding to the target user.

[0064] The technical solution of this invention, through engineering structure model and technology stack configuration, solidifies excellent architectural design ideas and team specifications into the template, ensuring that all generated projects maintain consistency and best practices in structure, dependency management, and code layering. This solves the problem of architecture drift and discrepancies that may occur when manually creating projects, and completely liberates developers from repetitive, tedious, and error-prone project initialization work. Through visual modeling and one-click generation, it improves project startup efficiency and reduces initialization costs. Developers do not need to deeply understand all the details of Gradle multi-module aggregation, dependency transitivity, and complex layered architecture to obtain a well-structured and correctly configured "out-of-the-box" project, lowering the technical threshold for initializing complex projects and facilitating the rapid replication of team capabilities and overall controllability of project quality.

[0065] Figure 7 This is a schematic diagram of a code generation device based on a domain model, provided as an embodiment of the present invention. Figure 7 As shown, the device includes: an engineering model acquisition module 710, an engineering code generation module 720, and a code push module 730.

[0066] The engineering model acquisition module 710 is used to acquire the target domain engineering model selected by the target user, wherein the target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model;

[0067] The engineering code generation module 720 is used to parse the target domain engineering model based on the code generation engine and generate target engineering code corresponding to the target domain;

[0068] The code push module 730 is used to determine the target code repository corresponding to the target user and push the target project code to the target code repository.

[0069] Based on the above technical solution, the device further includes: an engineering model establishment module, used to acquire the engineering model setting operation of the target user on the target domain; and to determine the target domain engineering model corresponding to the target domain based on the engineering model setting operation.

[0070] Based on the above technical solution, the engineering model building module is used to determine an engineering model template corresponding to the target domain based on the engineering model setting operation, wherein the engineering model template includes a structural model template, a component model template, and a configuration model template; determine template setting data according to the engineering model setting operation, and build the target domain engineering model according to the template setting data and the engineering model template.

[0071] Based on the above technical solution, the engineering model establishment module is used to extract hierarchical relationship setting data, component model setting data and configuration model setting data from the template setting data; and to fill the hierarchical relationship setting data, component model setting data and configuration model setting data into the corresponding engineering model templates to determine the target domain engineering model.

[0072] Based on the above technical solution, the engineering code generation module is used to parse the engineering structure model based on the code generation engine, determine the code sub-modules and module hierarchy relationships with the target domain engineering model; establish a hierarchical architecture directory corresponding to the target domain based on the code sub-modules and module hierarchy relationships; and generate target engineering code based on the hierarchical architecture directory and the target domain engineering model.

[0073] Based on the above technical solution, the engineering code generation module is used to parse the engineering configuration model based on the code generation engine, determine the module configuration information of the code sub-module and the engineering configuration information of the target project; extract the target project component corresponding to the target project from the engineering component model; and generate the target project code according to the module configuration information of the code sub-module, the engineering configuration information of the target project, the hierarchical architecture directory and the target project component.

[0074] Based on the above technical solution, the code push module is used to, after pushing the target project code to the target code repository, in response to the target user's development operation on the target project, retrieve the target project code from the target code repository; and load the target project code into the local development environment corresponding to the target user, so that the target user can perform functional development through the local development environment.

[0075] The technical solution of this invention involves obtaining a target domain engineering model selected by a target user; parsing the target domain engineering model using a code generation engine to generate target engineering code corresponding to the target domain; determining a target code repository corresponding to the target user; and pushing the target engineering code to the target code repository. Based on this technical solution, by parsing the target domain engineering model and automatically generating target engineering code using a code generation engine, the preparation time required during development is reduced, thereby improving project startup efficiency and lowering initialization costs.

[0076] The domain model-based code generation apparatus provided in this embodiment of the invention can execute the domain model-based code generation method provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0077] Figure 8 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0078] like Figure 8 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0079] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0080] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a domain model-based code generator.

[0081] In some embodiments, the domain model-based code generator may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the domain model-based code generator described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the domain model-based code generator by any other suitable means (e.g., by means of firmware).

[0082] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0083] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0084] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0085] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0086] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0087] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0088] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0089] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A code generation method based on a domain model, characterized in that, include: Obtain the target domain engineering model selected by the target user, wherein the target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model; The code generation engine is used to parse the target domain engineering model and generate target engineering code corresponding to the target domain. Identify the target code repository corresponding to the target user, and push the target project code to the target code repository.

2. The method according to claim 1, characterized in that, Before obtaining the target domain engineering model selected by the target user, the following steps are also included: Obtain the target user's engineering model settings operations for the target domain; Based on the engineering model settings, a target domain engineering model corresponding to the target domain is determined.

3. The method according to claim 2, characterized in that, The step of determining the target domain engineering model corresponding to the target domain based on the engineering model setting operation includes: Based on the engineering model setting operation, an engineering model template corresponding to the target domain is determined, wherein the engineering model template includes a structural model template, a component model template, and a configuration model template; The template setting data is determined according to the engineering model setting operation, and the target domain engineering model is established according to the template setting data and the engineering model template.

4. The method according to claim 3, characterized in that, The step of establishing the target domain engineering model based on the template setting data and the engineering model template includes: Extract hierarchical relationship setting data, component model setting data, and configuration model setting data from the template setting data; The hierarchical relationship setting data, component model setting data, and configuration model setting data are respectively filled into the corresponding engineering model templates to determine the target domain engineering model.

5. The method according to claim 1, characterized in that, The code generation engine parses the target domain engineering model to generate target engineering code corresponding to the target domain, including: The code generation engine is used to analyze the engineering structure model and determine the code sub-modules and module hierarchy relationships with the target domain engineering model. Based on the code sub-modules and the module hierarchy, establish a hierarchical architecture directory corresponding to the target domain; Target project code is generated based on the hierarchical architecture directory and the target domain engineering model.

6. The method according to claim 5, characterized in that, The generation of target project code based on the hierarchical architecture directory and the target domain engineering model includes: Based on the code generation engine, the project configuration model is parsed to determine the module configuration information of the code submodule and the project configuration information of the target project; Extract the target engineering components corresponding to the target project from the engineering component model; The target project code is generated based on the module configuration information of the code submodule, the project configuration information of the target project, the layered architecture directory, and the target project components.

7. The method according to claim 1, characterized in that, After pushing the target project code to the target code repository, the process also includes: In response to the target user's development operation on the target project, the target project code is obtained from the target code repository; The target project code is loaded into the local development environment corresponding to the target user, so that the target user can develop functions through the local development environment.

8. A code generation device based on a domain model, characterized in that, include: The engineering model acquisition module is used to acquire the target domain engineering model selected by the target user, wherein the target domain engineering model includes an engineering structure model, an engineering component model, and an engineering configuration model; The engineering code generation module is used to parse the target domain engineering model based on the code generation engine and generate target engineering code corresponding to the target domain. The code push module is used to determine the target code repository corresponding to the target user and push the target project code to the target code repository.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the domain model-based code generation method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the domain model-based code generation method according to any one of claims 1-7.