Data table automatic configuration method, code automatic generation method, device and equipment

Through the automatic data table configuration method, a data table with field enhancement notes is generated and populated into the code template, solving the problem of insufficient code integrity of existing automatic code generation tools, achieving higher code integrity and less secondary development workload.

CN120029602APending Publication Date: 2025-05-23CHONGQING ZUOSHIFU IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510109969.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The existing automatic code generation tools generate insufficient code integrity and cannot effectively support special types of data. It still requires a lot of manual development work during secondary modification, and lacks expansion capabilities such as paging queries and cascading queries.

Method used

Provides an automatic data table configuration method, which generates a data table with field enhancement notes by obtaining multiple different field names and determining the attribute information corresponding to each field name based on the preset attribute fill library, including field type, length, constraints and enhancement notes. Then, use the field names and attribute information in these data tables to populate them into the preset code template to generate the code for the target module.

Benefits of technology

Improves the completeness of the generated module code, reduces the workload of secondary development, and supports more data types and extension functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029602A_ABST
    Figure CN120029602A_ABST
Patent Text Reader

Abstract

The invention discloses a data table automatic configuration method, a code automatic generation method, a device and equipment. A data table is called to automatically generate a module code. The data table automatic configuration method comprises the steps of obtaining a plurality of different field names; each field name is determined based on a function scene of the module code; determining attribute information corresponding to each field name based on a preset attribute filling library; the preset attribute filling library is used for storing a corresponding relationship between the field name and attribute information, and the attribute information comprises a field type, a field length, a field constraint and a field enhancement remark; and automatically configuring the data table according to each field name and the attribute information corresponding to the field name. According to the method, the code generated by the code generator is higher in integrity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data table automatic configuration method, a code automatic generation method, a device and equipment. Background Art

[0002] With the widespread application of computer technology and information technology, all walks of life have fully entered the information age. Various business management systems (BOSS) and information management systems (MIS) have become an important part of the digital transformation of enterprises, and the development demand is growing. The common feature of such systems is that they involve a large number of operations such as query, addition, modification, and deletion of data, and each data operation involves coding development of the data access layer, service layer, control layer, model layer, and view layer. Therefore, related coding work often faces the problems of low technical content, large workload, strong repetitiveness, and low efficiency.

[0003] In order to meet this challenge, the application of template technology and object-relational mapping (ORM) database technology has received widespread attention. Automatic code generation tools based on ORM technology have emerged in the industry. These tools can automatically generate the add, delete, modify and query (CRUD) code of the data access layer and the service layer according to the entity mapping relationship, thereby greatly simplifying the development process and improving development efficiency. However, most of the current automatic code generation solutions still have some shortcomings. First, these tools are lacking in the supported data types and cannot effectively support special types of data such as amount, email, website, date, time, and enumeration drop-down boxes. Secondly, the generated code still requires a lot of manual development work when it is modified for the second time, and lacks expansion capabilities such as paging query and cascade query. That is, the code generated by the automatic code generation tool in the existing technology has low integrity, and manual secondary development of the generated code is required. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a data table automatic configuration method, a code automatic generation method, an apparatus, a device, a product and a storage medium to solve the problem of insufficient integrity of the code generated by the automatic code generation tool in the prior art.

[0005] In order to achieve the above-mentioned object, the first aspect of the present application provides a data table automatic configuration method, in which a data table is called to automatically generate module code, the method comprising:

[0006] Get multiple different field names; each field name is determined based on the functional scenario of the module code;

[0007] Based on the preset attribute filling library, determine the attribute information corresponding to each field name; the preset attribute filling library is used to save the correspondence between the field name and the attribute information, and the attribute information includes the field type, field length, field constraint and field enhancement remarks;

[0008] Generate a data table based on each field name and its corresponding attribute information.

[0009] In an embodiment of the present application, the data format of the enhanced notes for each field in the preset attribute filling library includes the JSON data format; the key content of the field enhanced notes in the JSON data format includes the Chinese name of the corresponding field name, the entity type, the alias of the corresponding field name, the prompt text of the corresponding field name and the custom option value of the corresponding field name, and the entity type and the corresponding field type correspond to each other.

[0010] Through the above technical solution, first, multiple different field names are obtained; each field name is determined based on the functional scenario of the module code; then, based on the preset attribute filling library, the attribute information corresponding to each field name is determined; the preset attribute filling library is used to save the correspondence between the field name and the attribute information, and the attribute information includes the field type, field length, field constraint, and field enhancement remarks; finally, a data table is generated according to each field name and its corresponding attribute information. Therefore, the automatically configured data table has field enhancement remarks, which describe the field more comprehensively, and the module code generated later based on the field name and the corresponding field enhancement remarks can be more complete.

[0011] A second aspect of the present application provides a method for automatically generating a code, the method comprising:

[0012] An instruction for generating code for a target module is detected; the instruction carries identification information of a corresponding target data table, and the target data table is generated based on the above-mentioned data table automatic configuration method;

[0013] According to the identification information of the target data table, obtain the corresponding target data table;

[0014] Fill each field name and its corresponding attribute information in the target data table into the preset code template to generate the code of the target module.

[0015] In an embodiment of the present application, the types of target modules include core service modules and background management modules; the core service modules include entity classes, service classes and data access object entity classes; the background management modules include view layers, control layers, list interfaces, new add interfaces and editing interfaces.

[0016] In an embodiment of the present application, the types of target modules also include internal service modules and external service modules; the internal service module includes an internal service interface, which is used to call data between target modules; and / or, the external service module includes a service object, a request object and a response object; the service object, the request object and the response object are used to implement the functions of adding, deleting, querying and modifying the entity class.

[0017] Through the above technical solution, first, the instruction for generating the code of the target module is detected; the instruction carries the identification information of the corresponding target data table, and the target data table is generated based on the above data table automatic configuration method; then, according to the identification information of the target data table, the corresponding target data table is obtained; finally, each field name in the target data table and its corresponding attribute information are filled into the preset code template to generate the code of the target module. Since the attribute information includes field type, field length, field constraint and field enhancement remarks, the field enhancement remarks describe the field name more comprehensively and completely. Therefore, filling the field name and attribute information into the preset code template can improve the completeness of the generated module code and reduce the workload of secondary development.

[0018] The third aspect of the present application provides a data table automatic configuration device, the data table is used to generate the code of the target module, and the device includes: an acquisition unit, used to obtain multiple different field names; each field name is determined based on the functional scenario of the module code; a determination unit, used to determine the attribute information corresponding to each field name based on a preset attribute filling library; the preset attribute filling library is used to save the correspondence between the field name and the attribute information, and the attribute information includes the field type, field length, field constraint and field enhancement remarks; a configuration unit, used to generate a data table according to each field name and its corresponding attribute information.

[0019] In a fourth aspect, the present application provides a device for automatically generating code, the device comprising: a detection unit for detecting instructions for generating code for a target module; the instructions carry identification information of a corresponding target data table, the target data table being generated based on the above-mentioned data table automatic configuration method; an acquisition unit for acquiring the corresponding target data table according to the identification information of the target data table; and a generation unit for filling each field name in the target data table and its corresponding attribute information into a preset code template to generate code for the target module.

[0020] A fifth aspect of the present application provides a computer device, including:

[0021] a memory configured to store instructions; and

[0022] The processor is configured to call instructions from the memory and implement the above method when executing the instructions.

[0023] A sixth aspect of the present application provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0024] A seventh aspect of the present application provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above method.

[0025] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0027] Figure 1 A flowchart of a data table automatic configuration method according to an embodiment of the present application is schematically shown;

[0028] Figure 2 A flowchart of a method for automatically generating code according to an embodiment of the present application is schematically shown;

[0029] Figure 3 A schematic diagram of a structure of a data table automatic configuration device according to an embodiment of the present application is shown;

[0030] Figure 4 A schematic diagram of a structure of a device for automatic code generation according to an embodiment of the present application is shown;

[0031] Figure 5 The structure diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0033] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0034] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0035] Figure 1 The flowchart of a data table automatic configuration method according to an embodiment of the present application is schematically shown. Figure 1 As shown, an embodiment of the present application provides a data table automatic configuration method, in which a data table is called to automatically generate module code, and the method may include the following steps.

[0036] Step 101: Obtain multiple different field names; each field name is determined based on a functional scenario of the module code.

[0037] In the embodiment of the present application, the field name may refer to the name of each column in the data table, which is used to identify the specific category of stored data, such as "user name", "age", "email", etc. It can be a short identifier, and at the same time, it needs to clearly express the meaning of the field content. The field name is the basis of data structure design. It is used to correspond to specific data content in the module code and is a bridge between the data table and the code logic. In the functional scenario, it ensures that the data table accurately matches the business requirements, which facilitates subsequent code generation and calling. The module code may refer to a specific module to be generated, which is usually designed to implement a certain functional scenario, such as "user management module" or "order processing module". The module code is the core of the system function implementation. The field name is determined based on the functional scenario, indicating that the fields required by the module fully serve the specific business needs, ensuring the high fit between the code and the data table, thereby improving the development efficiency and the maintainability of the code. The functional scenario is the basis for determining the field name. By analyzing the functional scenario and extracting the required fields, the generated data table accurately serves the actual needs, avoiding redundant design, and providing the necessary data support for module code generation. By obtaining multiple different field names and determining the field names based on the functional scenarios of the module code, it is possible to ensure that the design of the data table is closely integrated with the module code logic, thereby achieving the efficient goal of automatically generating code and table structure.

[0038] Step 102: Based on the preset attribute filling library, determine the attribute information corresponding to each field name; the preset attribute filling library is used to save the correspondence between the field name and the attribute information, and the attribute information includes the field type, field length, field constraint and field enhancement remarks.

[0039] In an embodiment of the present application, the preset attribute filling library can be a database or configuration file for storing field names and their corresponding attribute information, similar to a template library of a mapping relationship. It acts as a core tool in the automatic generation of field information. Through this library, the attribute information of the field (such as type, length, etc.) can be quickly determined, avoiding developers from manually setting one by one, improving efficiency and maintaining consistency. The field name is an input item of the preset attribute filling library, and the library matches its corresponding attribute information according to the field name to standardize the design of the data table. The field type specifies the storage format of the data, such as integer (int), text type (varchar), Boolean (boolean), etc. The field length specifies the maximum capacity of the field that can store data, such as the upper limit of the number of characters in a string field or the number of digits in a numeric field. Field constraints are a series of rules for field data, such as "cannot be null", "value unique" or "must conform to a certain format". Field enhancement notes can be supplementary information for field names and field attributes, stored in JSON or other formats, used to describe the specific purpose of the field, display name, etc. It can help developers quickly understand the business significance of the field and be used to generate comments in the code, prompt text on the front-end page, or other custom functions. By using the preset attribute filling library, field names can be quickly matched to corresponding attribute information, including field type, length, constraints, and enhanced notes. This mechanism standardizes and automates the process of data table design, greatly reduces errors caused by manual operations, improves development efficiency, and lays the foundation for code generation.

[0040] Step 103: Generate a data table based on each field name and its corresponding attribute information.

[0041] In an embodiment of the present application, the field name and the corresponding attribute information can generate a data table with field enhancement remarks, which can be used for subsequent automatic production of module codes.

[0042] Through the above technical solution, the automatically configured data table has field enhancement remarks, which describe the fields more comprehensively. Based on the field names and corresponding field enhancement remarks, the module code generated subsequently can be more complete, reducing the workload of secondary development of the generated code.

[0043] In an embodiment of the present application, the data format of the enhanced notes for each field in the preset attribute filling library may include the JSON data format; the key content of the field enhanced notes in the JSON data format includes the Chinese name of the corresponding field name, the entity type, the alias of the corresponding field name, the prompt text of the corresponding field name and the custom option value of the corresponding field name, and the entity type and the corresponding field type correspond to each other.

[0044] In the embodiment of the present application, JSON (JavaScript Object Notation) is a lightweight data exchange format that organizes data in the form of key-value pairs. As a storage format for field enhancement notes, JSON represents complex information in a structured manner, which is easy to parse, transmit and store. The JSON format makes field enhancement notes more flexible and can easily expand the multi-dimensional information of the field. The key content can be the field name defined in JSON, which is used to identify the corresponding value. The key content in the field enhancement note includes the Chinese name of the field name: the Chinese description of the field at the business level, which is easy to understand and display; entity type: the business entity type corresponding to the field type, and the entity type is the business abstraction of the field type. For example, if the field name is "completeness" and the corresponding entity type is "percent", the field type is "int"; the entity type is an extended expression of the field type, which ensures that the business semantics and data type of the field are consistent, and helps to generate business logic code and data validation rules. Alias ​​of field name: an alternative name for the field, an alias is another identifier for the field, which can be used to replace the original field name in specific scenarios, such as simplifying display or enhancing readability. Prompt text: Prompt text is a friendly prompt message to users, which is used to explain the filling requirements or expected input content of the field. For example, "Please enter your password"; Custom option value: The possible value range of the field, usually used to generate drop-down menus or preset options, and only needs to be configured when the entity type is "option". The key content provides specific dimension information for the field enhancement notes, which is used for various applications of the field in code generation, interface design, and business logic processing. By using the JSON data format to store the key content of the field enhancement notes, the preset attribute filling library comprehensively expands the semantic information of the field, covering the business description of the field (such as Chinese name and alias), user interaction design (such as prompt text) and restrictions (such as custom option values). The expressiveness of the field name is improved, providing strong support for subsequent automatic code generation, data verification, and front-end interaction.

[0045] Figure 2 The following schematically shows a flow chart of a method for automatically generating code according to an embodiment of the present application. Figure 2 As shown, an embodiment of the present application provides a method for automatic code generation, which may include the following steps.

[0046] Step 201: An instruction for generating code for a target module is detected; the instruction carries identification information of a corresponding target data table, and the target data table is generated based on the above-mentioned data table automatic configuration method.

[0047] In an embodiment of the present application, the target module can be a part of the system function, usually including specific business logic or service functions. For example, the "user management module" is responsible for processing user-related functions, and the "order module" is responsible for the creation and management of orders. The target module can be the target product of code generation, which directly affects the functional realization of the system. By generating the code of the target module through instructions, business needs can be met quickly and the development workload can be reduced. The instruction can serve as the starting point of the entire code generation process, which provides the identification information of the target data table as the input condition of the subsequent steps. Clear instruction design can ensure the accuracy and controllability of code generation. The identification information can be a unique mark of the target data table, which is used to indicate the data table to generate code. For example, it can be the name, ID, or path of the data table.

[0048] Step 202: Acquire the corresponding target data table according to the identification information of the target data table.

[0049] Step 203: Fill each field name in the target data table and its corresponding attribute information into the preset code template to generate the code of the target module.

[0050] In the embodiment of the present application, the target data table is used as the basis for generating the target module code, and its field names and attribute information determine the logical structure and function of the generated code. For example, a "user information" data table contains fields such as "user name", "password", and "email", and this information will be filled into the code template to generate the code of the target module.

[0051] Through the above technical solution, since the attribute information includes field type, field length, field constraint and field enhancement remarks, and the field enhancement remarks describe the field name more comprehensively and completely, therefore, filling the field name and attribute information into the preset code template can improve the completeness of the generated module code and reduce the workload of secondary development.

[0052] In an embodiment of the present application, the types of target modules may include a core service module and a background management module; the core service module includes an entity class, a service class and a data access object entity class; the background management module includes a view layer, a control layer, a list interface, a new addition interface and an editing interface.

[0053] In an embodiment of the present application, the core service module can be the business logic core of the system, responsible for data storage, processing and interaction with external interfaces. The core service module is the basis for the stable operation of the system, mainly focusing on business logic implementation and data management. The entity class (EntityClass) is a class used to map database tables in the core service module, which directly reflects the structure of the data table. The entity class is the carrier of data transmission. For example, the "User" entity class corresponds to the user table in the database, and defines fields such as id, userName and email for data storage and transmission. The service class (ServiceClass) is the business logic implementation layer in the core service module, which encapsulates the operation logic of the data. The service class cooperates with the entity class by calling the data access object to complete the implementation of complex business logic such as addition, deletion, modification and query. For example, a UserService class can provide createUser() and deleteUser() methods. The data access object entity class (DAO, DataAccessObjectClass) is a class in the core service module that directly interacts with the database and is used to execute SQL statements or database operations. The DAO class is a bridge for data operations, shielding the complexity of the underlying database and providing a unified interface for service classes to call. For example, a UserDAO class provides a getUserById(int id) method.

[0054] In an embodiment of the present application, the backend management module may be an interactive layer of the system, which is mainly for management personnel and is used to operate, monitor and maintain system functions. The backend management module provides an operation interface for administrators, supports functions such as addition, deletion, modification and query, and provides a user-friendly interaction method for the core service module. The view layer (ViewLayer) is an interface layer directly facing the user in the backend management module, which can be implemented through HTML, CSS, JavaScript or a front-end framework. The view layer is responsible for the display and interaction logic of the data. For example, the user sees a user list through the view layer and can click buttons to operate. The control layer (ControllerLayer) may be an intermediate layer connecting the view layer and the core service module, processing user requests and returning responses. The control layer coordinates the front-end and back-end data flows, parses user operations and calls the core service module. For example, a UserController class processes user addition or deletion requests. The list interface may be a view in the backend management module, showing a summary list of data in the system, such as a user list or an order list. The list interface provides an overall preview function of the data, usually with paging, search and filtering functions, which is convenient for managers to quickly find and operate. The new interface may be a view in the backend management module for creating new data, such as adding new users or adding new products. Through forms or input boxes, users are provided with an interactive way to enter data. After submission, the core service module will be called to implement the logic of adding new data. The editing interface can be a view in the background management module used to modify existing data, such as changing user information or updating product inventory. The editing interface provides the function of editing existing data, displaying the current data content through a pre-filled form, and the user submits the changes after modification.

[0055] In an embodiment of the present application, the types of target modules may also include internal service modules and external service modules; the internal service module includes an internal service interface, which is used to call data between target modules; and / or, the external service module includes a service object, a request object and a response object; the service object, the request object and the response object are used to implement the functions of adding, deleting, querying and modifying the entity class.

[0056] In the embodiment of the present application, the internal service module can be a module for logic and data interaction within the module, providing an interface and support for communication between modules. The internal service module ensures efficient collaboration between target modules, avoids direct dependence or coupling, and improves the flexibility and maintainability of the system. The internal service interface is an interface for data interaction between different components or sub-modules within the module, and defines a set of methods for internal module calls, such as obtaining data, triggering events, etc. The internal service interface is a bridge for internal module communication to avoid direct coupling. For example, in an order management module, the internal service interface can be used to obtain order details or check inventory status. The external service module is a module that provides a functional interface for an external system or other module, responsible for data input, processing and output. The external service module realizes the opening of the module's external functions through a standardized interface, supporting system expansion and external integration. The service object can be the main logical processing unit in the external service module, encapsulating the core functions related to the entity class, such as "user addition" or "order query". The request object can be an object in the external service module for receiving request data from a client or external system, usually containing request parameters and related meta information. The response object can be an object used to return processing results in an external service module, which usually includes return data, status code, and message prompt.

[0057] In one embodiment, the field name of data table A is "username", and its corresponding field type is "varchar", and its field length can be set according to the application scenario, and the field constraint can be set to "notnull" and non-primary key. The field enhancement note for the field name can be a json format data, for example: {title:'username', type:'account'}, where "title:'username'" is the Chinese name corresponding to the field name "username", and "type:'account'" corresponds to the field type "varchar".

[0058] In another embodiment, if the field name of data table B is "customer_type", the corresponding field type is "varchar", and the field length can be set according to the application scenario, and the field constraint can be set to "null" and non-primary key. The field enhancement note for the field name can be a json formatted data, for example: {title:'Customer type', alias:'Customer level', type:'option', options:{normal:'ordinary', vip:'member'}}. Among them, "title:'Customer type'" is the Chinese name corresponding to the field name "customer_type". Since "type" is set to "option", options:{normal:'ordinary', vip:'member'} custom option value is also set to enrich the description content of the field name. The code generator can generate more complete code based on the field name and the field enhancement notes in the attribute information.

[0059] Figure 3 The structure diagram of a data table automatic configuration device according to an embodiment of the present application is schematically shown. Figure 3 As shown, the present application also provides a data table automatic configuration device, the data table is used to generate the code of the target module, and the device may include: an acquisition unit 310, used to obtain multiple different field names; each field name is determined based on the functional scenario of the module code; a determination unit 320, used to determine the attribute information corresponding to each field name based on a preset attribute filling library; the preset attribute filling library is used to save the correspondence between the field name and the attribute information, and the attribute information includes the field type, field length, field constraint and field enhancement remarks; a configuration unit 330, used to generate a data table according to each field name and its corresponding attribute information.

[0060] Figure 4 The structure diagram of a code automatic generation device according to an embodiment of the present application is schematically shown. Figure 4 As shown, the present application also provides a code automatic generation device, which may include: a detection unit 410, used to detect instructions for generating code for a target module; the instructions carry identification information of a corresponding target data table, and the target data table is generated based on the above-mentioned data table automatic configuration method; an acquisition unit 420, used to acquire the corresponding target data table according to the identification information of the target data table; a generation unit 430, used to fill each field name in the target data table and its corresponding attribute information into a preset code template to generate code for the target module.

[0061] Figure 5 The structure diagram of a computer device according to an embodiment of the present application is schematically shown. Figure 5 As shown, the present application also provides a computer device, which may include:

[0062] Memory 510, configured to store instructions; and

[0063] The processor 520 is configured to call the instructions from the memory and implement the above method when executing the instructions.

[0064] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0065] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above method.

[0066] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0067] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0068] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0069] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0070] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0071] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0072] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0073] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0074] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A data table automatic configuration method, characterized in that: The data table is called to automatically generate module code, and the method includes: Obtain a plurality of different field names; each of the field names is determined based on a functional scenario of the module code; Based on a preset attribute filling library, determining the attribute information corresponding to each of the field names; the preset attribute filling library is used to store the correspondence between the field name and the attribute information, the attribute information including the field type, field length, field constraint and field enhancement remarks; The data table is generated according to each field name and its corresponding attribute information.

2. The method according to claim 1, characterized in that The data format of the enhanced remarks of each field in the preset attribute filling library includes JSON data format; The key content of the enhanced note for the field in JSON data format includes the Chinese name of the corresponding field name, the entity type, the alias of the corresponding field name, the prompt text of the corresponding field name and the custom option value of the corresponding field name, and the entity type corresponds to the corresponding field type.

3. A method for automatic code generation, characterized in that: The method comprises: An instruction for generating a code for a target module is detected; the instruction carries identification information of a corresponding target data table, and the target data table is generated based on the data table automatic configuration method according to claim 1 or 2; According to the identification information of the target data table, obtaining the corresponding target data table; Each field name in the target data table and its corresponding attribute information are filled into a preset code template to generate the code of the target module.

4. The method according to claim 3, characterized in that The types of target modules include core service modules and background management modules; The core service module includes entity class, service class and data access object entity class; The background management module includes a view layer, a control layer, a list interface, a new addition interface and an editing interface.

5. The method according to claim 4, characterized in that The types of the target module also include internal service modules and external service modules; The internal service module includes an internal service interface, and the internal service interface is used to call data between the target modules; And / or, the external service module includes a service object, a request object and a response object; the service object, the request object and the response object are used to implement the functions of adding, deleting, querying and modifying the entity class.

6. A data table automatic configuration device, characterized in that: The data table is called to automatically generate module code, including: An acquisition unit, used for acquiring a plurality of different field names; each of the field names is determined based on a functional scenario of the module code; A determination unit, configured to determine the attribute information corresponding to each of the field names based on a preset attribute filling library; the preset attribute filling library is configured to store the correspondence between the field name and the attribute information, wherein the attribute information includes the field type, field length, field constraint, and field enhancement remarks; The configuration unit is used to generate the data table according to each field name and its corresponding attribute information.

7. A code automatic generation device, characterized in that: include: A detection unit, used for detecting instructions for generating codes of a target module; The instruction carries identification information of a corresponding target data table, and the target data table is generated based on the data table automatic configuration method according to claim 1 or 2; An acquiring unit, configured to acquire a corresponding target data table according to the identification information of the target data table; A generating unit is used to fill each field name in the target data table and its corresponding attribute information into a preset code template to generate the code of the target module.

8. A computer device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the method according to any one of claims 1 to 5 when executing the instructions.

9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the method according to any one of claims 1 to 5.