A website generation method, device, medium and product based on data model

By loading and mapping the data model to the target language, combined with pre-built code templates, the problem of slow construction speed of low-code platforms and incomparable codes is solved, and the rapid generation of multi-end source code is achieved, which improves the efficiency and versatility of website generation.

CN118069112BActive Publication Date: 2024-11-01BEIJING PROINSIGHT TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410472957.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-19
Publication Date
2024-11-01
Estimated Expiration
2044-04-19

AI Technical Summary

Technical Problem

The existing low-code platform is complex in operation, slow in construction, and the generated code is not universal, cannot support multi-terminal applications and migration, and is difficult to meet urgent needs and multi-language development.

Method used

By configuring data source information and project information, loading the data model and mapping it to the target language, combining pre-built object code templates, rendering the website source code, achieving rapid generation of multi-end source code, and supporting batch generation of documents such as markdown and csv.

Benefits of technology

It improves the efficiency and versatility of website generation, reduces the user's manual construction steps, supports multi-end applications and multi-language development, and saves developers time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118069112B_ABST
    Figure CN118069112B_ABST
Patent Text Reader

Abstract

The present invention discloses a website generation method, device, medium and product based on a data model, which relates to the field of low-code platforms. The method includes configuring data source information and project information; the data source information includes a data source name, a database connection method, a database account and a database password; the project information includes a project name, a template path, an output file path and a data source; loading a data model based on the data source information, and mapping the data type in the data model to the data type of a target language to obtain a target data model; the data model is a database pre-built according to project requirements; loading a target code template based on project information; the target code template is a pre-built template for generating project code; and rendering the target code template using the target data model to obtain the source code of the website. In the present invention, users do not need to add pages and fields one by one to build a website, which improves the efficiency and versatility of website generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of low-code platforms, and in particular to a website generation method, device, medium and product based on a data model. Background Art

[0002] Low-code platforms are mainly used for the development of enterprise applications, such as Aishuda, which has the advantages of ease of use, high customizability, rich functionality and powerful scalability, and is favored by many enterprises and developers; Yida provides a complete set of tools and solutions to help enterprises quickly build applications and reduce development and maintenance costs.

[0003] However, the low-code platforms in the existing technology are complex to operate and slow to build websites. Users need to add fields one by one page to gradually build a website. For building a complex management system, the construction speed is very slow and cannot meet the needs of users with urgent needs. In addition, most low-code platforms can only run on this platform after they are built and cannot be migrated to other platforms. Most low-code platforms only support web sites or h5, and do not support the generation of various APP languages ​​such as vue, iOS, Android, flutter, react native, etc. The generated code has poor versatility.

[0004] Based on the above problems, a new low-code platform is urgently needed to improve the efficiency of website construction and the versatility of code. Summary of the invention

[0005] The purpose of the present invention is to provide a website generation method, device, medium and product based on a data model, which can improve the efficiency and versatility of website generation.

[0006] To achieve the above object, the present invention provides a website generation method based on a data model, comprising the following steps.

[0007] Configure data source information and project information; the data source information includes data source name, database connection method, database account and database password; the project information includes project name, template path, output file path and data source.

[0008] The data model is loaded based on the data source information, and the data types in the data model are mapped to the data types of the target language to obtain the target data model; the data model is a database constructed in advance according to project requirements.

[0009] A target code template is loaded based on the project information; the target code template is a pre-built template for generating project code.

[0010] The target data model is used to render the target code template to obtain the source code of the website.

[0011] To achieve the above objectives, the present invention also provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above data model-based website generation method.

[0012] To achieve the above objectives, the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned website generation method based on the data model are implemented.

[0013] To achieve the above object, the present invention also provides a computer program product, including a computer program, which implements the steps of the above data model-based website generation method when executed by a processor.

[0014] According to the specific embodiment provided by the present invention, the present invention discloses the following technical effects: based on the data source information configured by the user, a data model is loaded, and the data type in the data model is mapped to the data type of the target language to obtain a target data model, and the target data model can be applied to the code generation process of different target languages, thereby improving the versatility of website generation. Based on the predefined project information, a target code template is loaded, and the target code template is a pre-built template for generating project code. The target code template is rendered using the target data model to obtain the source code of the website. The present invention can directly generate the source code of the website according to the data model, without the user having to add pages and fields one by one to build the website, thereby improving the efficiency of website generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0016] Figure 1 The present invention provides a flowchart of a website generation method based on a data model.

[0017] Figure 2 This is a technical architecture diagram of the website generation method based on the data model provided by the present invention.

[0018] Figure 3 A schematic diagram of the relationship between objects in the database.

[0019] Figure 4 The following is a workflow diagram for the data model parser.

[0020] Figure 5 The following is a flowchart of the code generator workflow.

[0021] Figure 6 Flowchart for custom code templates. DETAILED DESCRIPTION

[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0023] The purpose of the present invention is to provide a website generation method, device, medium and product based on a data model, which converts the data model into a complex website source code through a code generator, helping users to directly generate a complete set of multi-terminal source code or documents from natural language requirements, thereby improving the efficiency of website creation. At the same time, it supports batch generation of technical documents such as markdown and csv, which is more universal.

[0024] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0025] like Figure 1 As shown, the website generation method based on the data model provided by the present invention includes steps 100 to 400.

[0026] Step 100: Configure data source information and project information, that is, configure the existing designed database into the system for creating a project.

[0027] Data source information includes data source name, database connection method (such as jdbcUrl), database account and database password. Project information includes project name, template path, output file path and data source. In addition, project information also includes project English name, unique identifier, table name prefix, package name, database name, short name extraction rule, basic application programming interface (API) path and server port.

[0028] Step 200: Load the data model based on the data source information, and map the data types in the data model to the data types of the target language to obtain the target data model. The data model is a database pre-built according to project requirements.

[0029] Specifically, step 200 includes steps 201 to 204 .

[0030] Step 201: Based on the data source information, a database connection pool is started to connect to the corresponding database, and a data model is loaded from the database. Different projects use different database connection pools. Multiple data tables are stored in the data model. Each data table has one or more fields, and each data table has zero or more relationships with other data tables. Fields contain zero or more validation rules.

[0031] First, you need to read the database configuration IP, port number, username and password to create a connection pool and connect to the remote database.

[0032] Step 202: Map the data type in the data model to the data type of the target language, and store the mapping relationship in the data type mapping table. As a specific implementation, the target language is Java, Vue or JS. The data type mapping table is shown in Table 1. Then convert the data type mapping table into a triple object in the target language (such as a Map object in Java). The first layer of the triple object is the database type, the second layer is the target language, the third layer is the database data type, and the value is the target language data type, which is convenient for converting the fields of the data model into the data type of the target language. The structure of the triple object is shown in Table 2.

[0033] Table 1 Data type mapping table.

[0034] .

[0035] Table 2 Structure of triple object.

[0036] .

[0037] Step 203: Read the table relationship in the data model and store the table relationship in the query field association table, as shown in Table 3. The data type mapping table and the query field association table are both data tables in the data model. Then the query field association table is converted into an object in the target language. Specifically, the query field association table is converted into many-to-many and one-to-many Map objects in the Java language to facilitate querying the association relationship of each table, as shown in Table 4.

[0038] Table 3 Query field association table.

[0039] .

[0040] Table 4 Many-to-many and one-to-many Map objects.

[0041] .

[0042] Step 204: Read the fields of each data table in the data model, convert the fields of each data table into objects of the target language, store them in the field list attribute corresponding to each data table in the form of an array, and obtain the target data model.

[0043] Specifically, there is a data table in the database that stores all table information. First, query this data table to obtain all table information (including database name, table name and table comment). The query method is: add like'_%' in the condition to filter out some unnecessary tables in the database, and is the table prefix defined in the project.

[0044] Then loop through all the table information, remove the fixed prefix for each table, generate a short table name, and avoid carrying too long names in the generated code. For example, if the table name is a_s_user, after matching the regular expression ^a_[az]_(\w+)$, the short table name user is generated; if the table name is a_s_role, after matching the regular expression ^a_[az]_(\w+)$, the short table name role is generated.

[0045] In the data model, the data table a_s_user and the data table a_s_role are in a many-to-many relationship, so there must be a data table a_r_user_role as an associated table. However, a_r_user_role is not the main table, so there is no need to generate a corresponding Model class.

[0046] Then name each data table according to CamelCase, PascalCase, and SnakeCase for use in code templates.

[0047] Based on the table name of each traversed data table as a condition, all field definitions of each data table are found (including field name, field data type, field comment, length, whether it is empty, whether it is a primary key, etc.). Then the found fields are converted into objects and stored in the field list property of each data table in array form.

[0048] Furthermore, step 200 also includes: adding extended attributes to each field of each data table in the data model.

[0049] Since the field attributes in the data model are fixed, the present invention adds some extended attributes to the fields to meet the needs of the subsequent code generation, and stores these fields separately in another data table. The extended attributes include whether the name column is unique, whether sorting is supported, whether it is displayed in the list, whether export is supported, whether it is required, display field components, add field components, edit field components, and delete field components. These fields are used to control the final interface presentation effect of the generated code.

[0050] In addition, step 200 also includes: finding the primary key of each table: looping through all fields to find the field marked with the primary key, and setting the field to the primary key field attribute of the table, so as to facilitate the use as an input parameter in the modification, deletion, and query of a single data interface in the code template. Read the association relationship between tables, such as one-to-many and many-to-many; traverse all table names, substitute the table names into the generated Map respectively, obtain the parent table, child table and associated table relationship associated with this table, and store them in the table attributes for use in the code template. Associate the field objects of the association relationship with each other, read the verification rules of each field, such as whether the field is required, the default value, the minimum and maximum length, and the regular verification rules, and fill them into the verification rule list in the field object.

[0051] Step 300: Loading a target code template based on the project information. The target code template is a pre-built template for generating project code.

[0052] Specifically, step 300 includes step 301 to step 304 .

[0053] Step 301: Read the code template according to the template path.

[0054] Step 302: Traverse the paths of all files under the template path level by level to determine the path variables, as shown in Table 5.

[0055] Table 5 Path variables.

[0056] .

[0057] The code template includes static files, global variable templates and data model template files. The static files are files with a suffix other than .ftl. The global variable templates are files with a suffix of .ftl. The data model template files are files whose paths in the global variable templates include specific strings. The specific strings are pre-set strings for identifying table names, such as TableName, tableName, table_name, table-name. The three files in the code template are shown in Table 6.

[0058] Table 6 Three types of files in the code template.

[0059] .

[0060] Step 303: Replace the character string containing the path variable in the path of the static file with the corresponding path variable in the output file path to obtain a target code template. The target code template is a target static code template path list.

[0061] Step 304: Copy the files in the target code template to the target file path. The target file path is the file path for storing the source code of the website.

[0062] Furthermore, the project information further includes file overwrite information. The file overwrite information indicates whether it is allowed to overwrite existing files or not.

[0063] Before step 304, step 300 further includes: determining whether the file overwrite information is that it is allowed to overwrite existing files. If so, copy the files in the target code template to the target file path. If not, determine whether the target file path exists. If it exists, skip the step of copying the files in the target code template to the target file path. If it does not exist, copy the files in the target code template to the target file path.

[0064] Step 400: Render the target code template using the target data model to obtain the source code of the website.

[0065] Specifically, when rendering the target code template using the target data model, it is first necessary to set template variables, as shown in Table 7.

[0066] Table 7 Template variables.

[0067] Variable Name Variable Value Scope For example packagePath Replace the package name specified in the project with / Global test.a.com test / a / com ProjectEnName Project name in English Global CrmT TablePrefix Project specifies the matching table name prefix Global CrmT table_prefix Project specifies the matching table name prefix Global Crm_tb projectName Project Chinese Name Global Customer Relationship Management System packageName The package name specified in the project Global test.a.com baseApiPath The interface base path specified in the project Global / crmApi serverPort The server listening port number specified in the project Global 8080 pascal Template extension method to convert string to Pascal naming Global camel Template extension method, convert string to camelCase Global cvar Template extension method to convert string to snake case Global nodup Template extension method, remove duplicates from array and concatenate them into a string Global tableMap Data model dictionary, key is the table name, used to obtain the table structure by name Global createTime The time of code generation is filled in by the user when generating the code. If not filled in, the current time is used Global 2023-12-06 18:29:00 author Author of the code Global tableBean Table structure of the data model Local 'table_name','admin_user','columns': admin_user table field list...}

[0068] Example of the rendering process: hello.java.ftl is a data model template file, written in the template language of the template engine, and its content is "Hello ${name}". Among them, ${name} is variable content. Java fills the data model as follows: cfg.getTemplate("hello.java.ftl").process(new HashMap(){{this.put("name","张三");}},out). When substituting the data variables with Java and then passing through the template rendering engine to replace the corresponding positions according to the variable name, the final output code is hello.java, and its content is "Hello 张三".

[0069] Loop through all the template file paths, and then loop through the data models. When importing the data models into the tableBean local variable of the code template and substituting the global variables in the variable table together into the template file of a specific data model, the template engine will render the source code corresponding to the data model.

[0070] Then write the source code to the specified named file and put the related dependent files in the specified location of the project. Specifically, replace the variables in the .ftl file path, such as packagePath, TableName, etc. Determine whether overwriting is allowed. If overwriting is allowed, overwrite the old file directly. If overwriting is prohibited, the old file can be overwritten if the path contains / base / , otherwise the old file will not be overwritten.

[0071] In addition, the website generation method based on the data model provided by the present invention also includes: based on the generated website source code, using the template editor to adjust the existing template content, and after saving, giving priority to the customized template in the general code template. Thus, the code template can be customized, and the customization of the code template is customized for a certain table, and the differences between modules can be finely controlled.

[0072] The technical architecture of the present invention is introduced below.

[0073] like Figure 2 As shown, the technical architecture of the present invention is divided into five parts: project management, data model parser, template, code generator and template editor.

[0074] Project management mainly adds, modifies, queries, and deletes projects, mainly to set basic information for subsequent code generation, including the Chinese and English names of the project, unique identifiers, databases, table name matching rules, API paths, port numbers, etc. It also provides a template editor entry for secondary development.

[0075] The data model parser is responsible for loading the table structure and the relationship between tables in the database, such as Figure 3 The workflow of the data model parser is as follows Figure 4 As shown, first connect to the database, read all table structures, remove fixed prefixes for each table, generate short table names, and avoid carrying too long names in the generated code; then find the primary key of each table, extract each field as an object, and read the association between tables, such as one-to-many and many-to-many; then associate the field objects of the association relationship with each other, and read the verification rules for each field, such as whether the field is required, the default value, the minimum and maximum length, and the regular verification rules.

[0076] The main function of the template is to carry the specific business functions of the program and to build the project structure. Templates are divided into project structure templates, general code templates and custom code templates.

[0077] Since different development languages ​​and different development architectures have their own directory structures, and the directory structures vary with the names and number of data models, a project structure template rule is needed to arrange the directory structure of the project. The project structure template is responsible for building the project. The project structure template replaces the variables on the path and file name with the corresponding values ​​in the data model, and converts the file paths and file names ending with .tpl in the paths contained in the directory template in a unified manner according to the common naming method. For example, ${packagePath} in the file path in the directory template is replaced with "com / example / test", and ${tableName} is replaced with "admin_user".

[0078] The common code template is responsible for outputting source code.

[0079] Customized code templates are templates generated by users through secondary development based on the generated code. They have a higher priority than general code templates. Customized code templates use a visual template editor to load the general code template + data model to intuitively display the screen. Users can edit the screen, delete unnecessary fields, adjust the field entry method, adjust the page layout, etc., and finally save it to the database and associate it with the corresponding data model.

[0080] The code generator is used to render templates, output code, attach user role permissions, and convert naming rules. Among them, rendering the template is to substitute the data model into the code template to render the source code, put the source code into the corresponding file according to the project structure template, and attach a part of the user role permission code. The code generator loads the project information into the template variable, fills it into the general code template, loads the data model in the data model parser, loops and outputs code according to the data model, traverses all template directories in the project template directory, and loops related to the data model output files according to the project structure template name. If it is not related, the file is copied according to the project structure template name. Finally, user role permissions and login and logout functions are attached to complete the entire project. The workflow of the code generator is as follows: Figure 5 shown.

[0081] The template editor is to use the general code template to preview on a data model, edit the general code template to adjust the function interface, and finally save it to the database to generate a custom code template. When rendering the template, the custom code template is used first for the data model. The process of customizing the code template is as follows Figure 6 shown.

[0082] The present invention loads the data model from the database, executes the code template, generates source code or documents in various languages ​​on multiple terminals, and converts the database into a universal data model of table->table association->field->field extension->field verification, thereby improving the versatility of the website generation method. In addition, the present invention supports generating code from the data model, thereby saving a lot of time for web front-end engineers, back-end software engineers, and APP developers, and improving the efficiency of website generation.

[0083] In one embodiment, a computer device is provided, which may be a database. The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a website generation method based on a data model is implemented.

[0084] In one embodiment, a computer device is also provided, including a memory and a processor to store a computer program in the memory and run on the processor, and the processor implements the steps in the above-mentioned website generation method based on the data model when executing the computer program.

[0085] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned website generation method based on the data model are implemented.

[0086] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above-mentioned website generation method based on the data model when executed by a processor.

[0087] It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards.

[0088] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0089] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A website generation method based on a data model, characterized in that: The website generation method based on the data model comprises: Configure data source information and project information; the data source information includes data source name, database connection method, database account and database password; the project information includes project name, template path, output file path and data source; Loading a data model based on the data source information and mapping the data types in the data model to the data types of the target language to obtain a target data model specifically includes: Based on the data source information, a database connection pool is started to connect to the corresponding database, and a data model is loaded from the database; the data model stores multiple data tables; Mapping the data types in the data model to the data types of the target language, and storing the mapping relationship in a data type mapping table; Reading the table relationship in the data model and storing the table relationship in the query field association table; the data type mapping table and the query field association table are both data tables in the data model; Read the fields of each data table in the data model, and convert the fields of each data table into objects of the target language, and store them in the field list attribute of each data table in the form of an array to obtain the target data model; specifically, there is a data table in the database that stores all table information, and first obtain all table information by querying this data table; wherein, the query method is: add like'_%' in the condition to filter out some unnecessary tables in the database, is the table prefix defined in the project; then loop all table information, for each table, remove the fixed prefix, and generate a short table name; then name each data table according to the camel case naming method, Pascal naming method, and snake case naming method; find out all field definitions of each data table based on the table name of each traversed data table as a condition; then convert the found fields into objects and store them in the field list attribute of each data table in the form of an array; the data model is a database pre-built according to project requirements; Loading a target code template based on the project information; the target code template is a pre-built template for generating project code; Rendering the target code template using the target data model to obtain the source code of the website; Based on the generated website source code, use the template editor to adjust the existing template content. After saving, give priority to the customized template in the general code template.

2. The website generation method based on data model according to claim 1, characterized in that: The target language is Java.

3. The website generation method based on data model according to claim 1, characterized in that: The data model is loaded based on the data source information, and the data types in the data model are mapped to the data types of the target language to obtain the target data model, further comprising: The data type mapping table and the query field association table are converted into objects in the target language.

4. The website generation method based on data model according to claim 1, characterized in that: The data model is loaded based on the data source information, and the data types in the data model are mapped to the data types of the target language to obtain the target data model, further comprising: Add extended properties to each field of each data table in the data model; the extended properties include whether it is a unique name column, whether sorting is supported, whether it is displayed in a list, whether export is supported, whether it is required, display field components, add new field components, edit field components and delete field components.

5. The website generation method based on data model according to claim 1, characterized in that: Loading the target code template based on the project information specifically includes: The code template is read according to the template path; the code template includes a static file, a global variable template and a data model template file; the static file is a file whose suffix is ​​not .ftl; the global variable template is a file whose suffix is ​​.ftl; the data model template file is a file whose path in the global variable template includes a specific string; the specific string is a pre-set string used to identify a table name; Traverse the paths of all files under the template path level by level to determine the path variables; Replace the character string containing the path variable in the path of the static file with the corresponding path variable in the output file path to obtain a target code template; the target code template is a target static code template path list; Copy the files in the target code template to the target file path; the target file path is the file path for storing the source code of the website; The target data model is used to render the target code template to obtain the source code of the website, specifically including: rendering the variables in the global variable template file and the data model template file through the target data model, generating code and writing it into the corresponding target file.

6. The method for generating a website based on a data model according to claim 5, characterized in that: The project information also includes file overwriting information; the file overwriting information is to allow overwriting of existing files or not to allow overwriting of existing files; Before copying the files in the target code template to the target file path, loading the code template based on the project information further includes: Determine whether the file overwriting information allows overwriting an existing file; If yes, copy the file in the target code template to the target file path; If not, determine whether the target file path exists. If so, skip the step of copying the files in the target code template to the target file path. If not, copy the files in the target code template to the target file path.

7. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the website generation method based on the data model as described in any one of claims 1 to 6.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for generating a website based on a data model described in any one of claims 1 to 6 are implemented.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method for generating a website based on a data model described in any one of claims 1 to 6 are implemented.