Movatterモバイル変換


[0]ホーム

URL:


CN110989999A - Code generation method and device, electronic equipment and medium - Google Patents

Code generation method and device, electronic equipment and medium
Download PDF

Info

Publication number
CN110989999A
CN110989999ACN201911219388.3ACN201911219388ACN110989999ACN 110989999 ACN110989999 ACN 110989999ACN 201911219388 ACN201911219388 ACN 201911219388ACN 110989999 ACN110989999 ACN 110989999A
Authority
CN
China
Prior art keywords
code
entity class
codes
entity
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911219388.3A
Other languages
Chinese (zh)
Inventor
史先澳
娄景军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wanghai Kangxin Beijing Technology Co Ltd
Original Assignee
Wanghai Kangxin Beijing Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wanghai Kangxin Beijing Technology Co LtdfiledCriticalWanghai Kangxin Beijing Technology Co Ltd
Priority to CN201911219388.3ApriorityCriticalpatent/CN110989999A/en
Publication of CN110989999ApublicationCriticalpatent/CN110989999A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the application provides a code generation method, a code generation device, electronic equipment and a medium. The method comprises the following steps: the method comprises the steps of determining first entity class codes corresponding to all database tables respectively based on a first entity class code template edited in advance and at least one database table, determining first entity class names corresponding to all database tables respectively based on the first entity class codes corresponding to all database tables respectively, and generating at least one processing code based on a processing code template edited in advance and the first entity class names. According to the embodiment of the application, the at least one processing code is automatically generated based on the at least one database table, the processing code can be automatically generated when the number of the database tables is large, and the problem that manual code compiling consumes more human resources and time resources is solved, so that the workload of manual code compiling is reduced, the cost of developing new services is reduced, and the user experience is improved.

Description

Code generation method and device, electronic equipment and medium
Technical Field
The present application relates to the field of software development technologies, and in particular, to a code generation method, apparatus, electronic device, and medium.
Background
With the continuous development of internet technology, informatization has been integrated into the aspects of our lives, more and more people participate in the information technology industry and in programming work, and programmers realize certain functions on corresponding development tools by writing codes.
In the prior art, when a programmer develops a new service, at least one database table is designed according to requirements, and for each database table, the programmer needs to manually write codes corresponding to the database table to realize functions such as addition, deletion, modification, search and the like. Generally, when a programmer manually writes codes corresponding to a database table, the programmer is required to manually write at least one processing code of a data access layer code, a business layer code, a micro-service layer code and a controller layer code, and when the number of the database tables is large, manually writing any processing code of the data access layer code, the business layer code, the micro-service layer code and the controller layer code consumes more human resources and time resources, and the workload of manually writing the codes is large, so that the cost of developing new services is high, and the user experience is poor.
Disclosure of Invention
The application provides a code generation method, a code generation device, an electronic device and a medium, which can solve at least one technical problem.
In a first aspect, a code generation method is provided, and the method includes:
determining first entity class codes respectively corresponding to the database tables based on a first entity class code template edited in advance and at least one database table;
determining each first entity class name based on the first entity class codes respectively corresponding to each database table;
at least one processing code is generated based on the pre-edited processing code template and each first entity class name.
In a second aspect, there is provided a code generation apparatus, the apparatus comprising:
the first determining module is used for determining a first entity class code corresponding to each database table based on a first entity class code template edited in advance and at least one database table;
the second determining module is used for determining each first entity class name based on the first entity class codes respectively corresponding to each database table;
and the generating module is used for generating at least one processing code based on the pre-edited processing code template and each first entity class name.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: and executing the corresponding operation according to the code generation method shown in the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the code generation method shown in the first aspect.
The beneficial effect that technical scheme that this application provided brought is:
compared with the prior art, the code generation method, the code generation device, the electronic equipment and the medium have the advantages that the first entity class codes corresponding to the database tables are determined based on the first entity class code template edited in advance and at least one database table, the first entity class names are determined based on the first entity class codes corresponding to the database tables, and at least one processing code is generated based on the processing code template edited in advance and the first entity class names.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a code generation method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a code generation apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present application provides a code generation method, which may be executed by a terminal device or a server, as shown in fig. 1, where the method includes:
step S101, determining first entity class codes respectively corresponding to each database table based on a first entity class code template edited in advance and at least one database table.
For the embodiment of the application, a one-to-one mapping relationship exists between the first entity class code and the database table, that is, one database table corresponds to one first entity class code. In the embodiment of the application, a first entity class code corresponding to any database table is determined by using a first entity class code template edited in advance and the database table.
Step S102, determining each first entity class name based on the first entity class code corresponding to each database table.
For the embodiment of the application, the first entity class name corresponding to any database table can be determined based on the first entity class code corresponding to the any database table. In the embodiment of the application, the table name of any database table is the first entity class name corresponding to the database table.
Step S103, generating at least one processing code based on the processing code template edited in advance and each first entity class name.
For the embodiment of the present application, the processing code may be generated based on a pre-edited processing code template and any entity class name, or the processing code may be generated based on a pre-edited processing code template and at least two entity class names, that is, the processing code and the entity class name may have a one-to-one mapping relationship or a one-to-many mapping relationship, which is not limited in the embodiment of the present application.
For the embodiment of the application, abstract and generic technologies are used to write abstract class codes with functions of add operation, delete operation, modify operation, and search operation, that is, a pre-edited processing code template includes an interface of add operation and its implementation code, an interface of delete operation and its implementation code, an interface of modify operation and its implementation code, and an interface of search operation and its implementation code. In the embodiment of the application, the generated processing code has the processing functions of performing addition operation, deletion operation, modification operation and search operation on the database table.
Compared with the prior art, the code generation method has the advantages that the first entity class codes corresponding to the database tables are determined based on the first entity class code templates edited in advance and the at least one database table, the first entity class names are determined based on the first entity class codes corresponding to the database tables, and the at least one processing code is generated based on the processing code templates edited in advance and the first entity class names.
In another possible implementation manner of the embodiment of the present application, step S101 may specifically include: determining replaceable codes in the first entity code template, respectively extracting metadata information of each database table from at least one database table, and respectively replacing the replaceable codes in the first entity code template by the metadata information of each database table to obtain the first entity code corresponding to each database table.
For the embodiment of the application, a plurality of database tables can be determined based on preconfigured database link information, at least one database table is determined based on a selection operation of a user for the plurality of database tables, and metadata information of each database table is extracted from the at least one database table respectively, wherein the metadata information of any database table includes a table name of the any database table, description information of the database table, a field name, a field type, field description information, primary key information, and the like. In the embodiment of the application, the metadata information of any database table is used for replacing the replaceable codes in the first entity class code template, so that the first entity class code corresponding to the any database table is obtained.
Further, after the above steps S101 and S102 are executed, step S103 may be executed as follows:
in another possible implementation manner of the embodiment of the present application, if the processing code includes a data access layer code, step S103 may include: and determining replaceable codes in the pre-edited data access layer code template, and replacing the replaceable codes in the data access layer code template by using each first entity class name to obtain at least one data access layer code.
For the embodiment of the application, the code template of the data access layer comprises an interface for adding operation and a realization code thereof, an interface for deleting operation and a realization code thereof, an interface for modifying operation and a realization code thereof, and an interface for searching operation and a realization code thereof. In the embodiment of the application, a template rendering technology is used for performing template rendering on each first entity class and the data access layer code template to generate the data access layer code, that is, each first entity class name is used for replacing a replaceable code in the data access layer code template to obtain at least one data access layer code. In the embodiment of the application, a one-to-one mapping relationship or a one-to-many mapping relationship exists between the data access layer code and the first entity class name.
For the embodiment of the application, the data access layer code is used for reading data in the database table and transferring the data to the business layer code.
For the embodiment of the present application, the processing code may include a service layer code in addition to a data access layer code, and the manner of determining the service layer code is as follows:
in another possible implementation manner of the embodiment of the present application, if the processing code may further include a service layer code, before step S103, the method may further include: a class name for each data access layer code is determined based on at least one data access layer code.
Wherein, step S103 may further include: and determining replaceable codes in a service layer code template edited in advance, and replacing the replaceable codes in the service layer code template by using each first entity class name and the class name of each data access layer code to obtain at least one service layer code.
For embodiments of the present application, when the processing code includes a data access layer code and a business layer code, a class name of each data access layer code may be determined based on at least one data access layer code. The method may include generating at least one data access layer code in the manner of the above-described embodiment of the present application, or obtaining at least one data access layer code in a manner of the prior art, so as to determine a class name of each data access layer code according to the at least one data access layer code.
For the embodiment of the application, the service layer code template includes an interface for adding operation and a realization code thereof, an interface for deleting operation and a realization code thereof, an interface for modifying operation and a realization code thereof, and an interface for searching operation and a realization code thereof. In the embodiment of the application, a template rendering technology is used to perform template rendering on each first entity class and a service layer code template to generate a service layer code, that is, each first entity class name and the class name of each data access layer code are used to replace a replaceable code in the service layer code template to obtain at least one service layer code. In the embodiment of the application, a one-to-one mapping relationship or a one-to-many mapping relationship exists between the service layer code and the data access layer class name; a one-to-one mapping relationship or a one-to-many mapping relationship exists between the business layer code and the first entity class name.
For the embodiment of the application, the business layer code is used for processing and converting the data in the database table.
For the embodiment of the present application, the processing code may include a controller layer code in addition to a data access layer code and a service layer code, and the manner of determining the controller layer code is as follows:
in another possible implementation manner of the embodiment of the present application, if the processing code further includes a controller layer code, before step S103, the method may further include:
and determining second entity class codes corresponding to the database tables respectively based on the pre-edited second entity class code template and at least one database table, determining second entity class names based on the second entity class codes corresponding to the database tables respectively, and determining the class names of the business layer codes based on at least one business layer code.
And the attribute name of the second entity class code is different from the attribute name of the first entity class code.
For the embodiment of the present application, the replaceable codes in the second entity type code template may be determined, the metadata information of each database table is extracted from at least one database table, and the metadata information of each database table is used to replace the replaceable codes in the second entity type code template, so as to obtain the second entity type codes corresponding to each database table.
Further, the second entity class names are determined based on the second entity class codes respectively corresponding to the database tables, and the class names of the business layer codes are determined based on at least one business layer code.
Wherein, step S103 may further include: determining replaceable codes in a pre-edited controller layer code template; and replacing the replaceable codes in the controller layer code template by using the first entity class names, the second entity class names and the class names of the service layer codes to obtain at least one controller layer code.
For the embodiment of the present application, when the processing code includes a data access layer code, a service layer code, and a controller layer code, at least one service layer code may be generated by using the method of the above embodiment of the present application, or at least one service layer code may be obtained by using a method in the prior art, so as to determine the class name of each service layer code according to the at least one service layer code.
For the embodiment of the application, the controller layer code template includes an interface for adding operation and a realization code thereof, an interface for deleting operation and a realization code thereof, an interface for modifying operation and a realization code thereof, and an interface for searching operation and a realization code thereof. In the embodiment of the present application, a template rendering technology is used to perform template rendering on each first entity class, each second entity class and a controller layer code template, so as to generate a controller layer code, that is, a replaceable code in the controller layer code template is replaced by using each first entity class name, each second entity class name and a class name of each service layer code, so as to obtain at least one controller layer code. In the embodiment of the application, a one-to-one mapping relationship or a one-to-many mapping relationship exists between the controller layer code and the service layer class name; one-to-one mapping relation or one-to-many mapping relation exists between the controller layer codes and the first entity class names; and a one-to-one mapping relation or a one-to-many mapping relation exists between the controller layer codes and the second entity class names.
The controller layer code template comprises a mapping relation between the attribute name in the first entity class and the attribute name in the second entity class.
For the embodiment of the application, the controller layer code is used for data interaction between the back end and the back end.
For the embodiment of the present application, the processing code may include a microservice layer code in addition to a data access layer code, a business layer code, and a controller layer code, and the manner of determining the microservice layer code is as follows:
in another possible implementation manner of the embodiment of the present application, if the processing code further includes a microservice layer code, before step S103, the method may further include: and determining third entity class codes corresponding to the database tables respectively based on the pre-edited third entity class code template and at least one database table, and determining third entity class names based on the third entity class codes corresponding to the database tables respectively.
The attribute name of the third entity class code is different from the attribute name of the first entity class code, and the attribute name of the third entity class code is different from the attribute name of the second entity class code.
For the embodiment of the present application, the replaceable codes in the third entity type code template may be determined, the metadata information of each database table is respectively extracted from at least one database table, and the metadata information of each database table is used to respectively replace the replaceable codes in the third entity type code template, so as to obtain the third entity type codes corresponding to each database table.
Step S103 may further include: determining replaceable codes in a micro service layer code template edited in advance; and replacing the replaceable codes in the micro-service layer code template by using each first entity class name, each third entity class name and the class name of each service layer code to obtain at least one micro-service layer code.
For the embodiment of the present application, when the processing code includes a data access layer code, a service layer code, a micro service layer code, and a controller layer code, at least one service layer code may be generated in the manner of the above embodiment of the present application, or at least one service layer code may be obtained in the manner of the prior art, so as to determine the class name of each service layer code according to the at least one service layer code.
For the embodiment of the application, the micro service layer code template comprises an interface for adding operation and a realization code thereof, an interface for deleting operation and a realization code thereof, an interface for modifying operation and a realization code thereof, and an interface for searching operation and a realization code thereof. In the embodiment of the application, a template rendering technology is used to perform template rendering on each first entity class, each third entity class and a controller layer code template to generate a controller layer code, that is, each first entity class name, each third entity class name and the class name of each service layer code are used to replace a replaceable code in a micro service layer code template to obtain at least one micro service layer code. In the embodiment of the application, a one-to-one mapping relationship or a one-to-many mapping relationship exists between the micro service layer code and the business layer class name; a one-to-one mapping relation or a one-to-many mapping relation exists between the micro service layer codes and the first entity class names; and a one-to-one mapping relation or a one-to-many mapping relation exists between the microservice layer code and the third entity class name.
The micro service layer code template comprises a mapping relation between the attribute name in the first entity class and the attribute name in the third entity class.
For the embodiment of the application, the micro service layer code is used for data interaction between the back end and the front end.
For the embodiment of the present application, when the processing code includes a data access layer code, a service layer code, a microservice layer code, and a controller layer code, the manner of determining the controller layer code is as follows:
another possible implementation manner of the embodiment of the present application, after obtaining at least one microservice layer code, may further include: determining a class name of each micro service layer code based on at least one micro service layer code; and replacing the replaceable codes in the controller layer code template by using the class name, the second entity class name and the third entity class name of each microservice layer code to obtain at least one controller layer code.
For the embodiment of the present application, when the processing code includes a data access layer code, a business layer code, a microservice layer code, and a controller layer code, at least one microservice layer code may be generated in the manner of the above-described embodiment of the present application, or at least one microservice layer code may be obtained in the manner of the prior art, so as to determine the class name of each microservice layer code according to the at least one microservice layer code.
For the embodiment of the application, the controller layer code template includes an interface for adding operation and a realization code thereof, an interface for deleting operation and a realization code thereof, an interface for modifying operation and a realization code thereof, and an interface for searching operation and a realization code thereof. In the embodiment of the present application, a template rendering technology is used to perform template rendering on each second entity class, each third entity class, and the controller layer code template, so as to generate a controller layer code, that is, a class name of each microservice layer code, each second entity class name, and each third entity class name are used to replace a replaceable code in the controller layer code template, so as to obtain at least one controller layer code. In the embodiment of the application, a one-to-one mapping relationship or a one-to-many mapping relationship exists between the controller layer code and the class name of the micro service layer; one-to-one mapping relation or one-to-many mapping relation exists between the controller layer codes and the second entity class names; and a one-to-one mapping relation or a one-to-many mapping relation exists between the controller layer codes and the third entity class names.
The controller layer code template comprises a mapping relation between the attribute name in the second entity class and the attribute name in the third entity class.
The code generation method is specifically set forth from the perspective of the method steps, and the following introduces the code generation apparatus from the perspective of the virtual module or the virtual unit, specifically as follows:
an embodiment of the present application provides a code generation apparatus, and as shown in fig. 2, thecode generation apparatus 20 may include: a first determiningmodule 201, a second determiningmodule 202, and agenerating module 203, wherein,
the first determiningmodule 201 is configured to determine, based on a first entity class code template edited in advance and at least one database table, first entity class codes corresponding to the database tables respectively.
The second determiningmodule 202 is configured to determine each first entity class name based on the first entity class code corresponding to each database table.
And thegenerating module 203 is used for generating at least one processing code based on the pre-edited processing code template and each first entity class name.
In another possible implementation manner of the embodiment of the present application, the first determiningmodule 201 includes a first determining unit, an extracting unit, and a first replacing unit, wherein,
a first determining unit for determining the replaceable codes in the first entity class code template.
And the extraction unit is used for respectively extracting the metadata information of each database table from at least one database table.
And the first replacing unit is used for replacing the replaceable codes in the first entity code template by utilizing the metadata information of each database table to obtain the first entity codes corresponding to each database table.
In another possible implementation manner of the embodiment of the present application, when the processing code includes a data access layer code, thegenerating module 203 includes a second determining unit and a second replacing unit, wherein,
and the second determining unit is used for determining the replaceable codes in the pre-edited data access layer code template.
And the second replacing unit is used for replacing the replaceable codes in the data access layer code template by using the first entity class names to obtain at least one data access layer code.
In another possible implementation manner of this embodiment of the application, when the processing code further includes a service layer code, thecode generation apparatus 20 further includes a third determining module, wherein,
and the third determining module is used for determining the class name of each data access layer code based on at least one data access layer code.
Wherein thegenerating module 203 further comprises a third determining unit and a third replacing unit, wherein,
and the third determining unit is used for determining the replaceable codes in the service layer code template edited in advance.
And the third replacing unit is used for replacing the replaceable codes in the service layer code template by using the class names of the first entity classes and the data access layer codes to obtain at least one service layer code.
In another possible implementation manner of the embodiment of the present application, when the processing code further includes a controller layer code, thecode generation apparatus 20 further includes a fourth determination module, a fifth determination module, and a sixth determination module, wherein,
and the fourth determining module is used for determining the second entity class codes corresponding to the database tables respectively based on the pre-edited second entity class code template and at least one database table.
And the attribute name of the second entity class code is different from the attribute name of the first entity class code.
And the fifth determining module is used for determining each second entity class name based on the second entity class codes respectively corresponding to each database table.
And the sixth determining module is used for determining the class name of each service layer code based on at least one service layer code.
Wherein thegenerating module 203 further comprises a fourth determining unit and a fourth replacing unit, wherein,
and the fourth determination unit is used for determining the replaceable codes in the pre-edited controller layer code template.
And the fourth replacing unit is used for replacing the replaceable codes in the controller layer code template by using the first entity class names, the second entity class names and the class names of the service layer codes to obtain at least one controller layer code.
In another possible implementation manner of the embodiment of the present application, when the processing code further includes a micro service layer code, thecode generation apparatus 20 further includes a seventh determining module and an eighth determining module, wherein,
and the seventh determining module is used for determining the third entity class codes corresponding to the database tables respectively based on the pre-edited third entity class code template and at least one database table.
The attribute name of the third entity class code is different from the attribute name of the first entity class code, and the attribute name of the third entity class code is different from the attribute name of the second entity class code.
And the eighth determining module is used for determining each third entity class name based on the third entity class code corresponding to each database table.
Wherein thegenerating module 203 further comprises a fifth determining unit and a fifth replacing unit, wherein,
and the fifth determining unit is used for determining replaceable codes in the micro service layer code template edited in advance.
And the fifth replacing unit is used for replacing the replaceable codes in the micro-service layer code template by using each first entity class name, each third entity class name and the class name of each service layer code to obtain at least one micro-service layer code.
In another possible implementation manner of the embodiment of the present application, thecode generation apparatus 20 further includes a ninth determining module and a replacing module, wherein,
and the ninth determining module is used for determining the class name of each micro service layer code based on at least one micro service layer code.
And the replacing module is used for replacing the replaceable codes in the controller layer code template by using the class names of the micro service layer codes, the second entity class names and the third entity class names to obtain at least one controller layer code.
For the embodiment of the application, the first determining module, the second determining module, the third determining module, the fourth determining module, the fifth determining module and the sixth determining module, the seventh determining module, the eighth determining module, and the ninth determining module may be the same determining module, or different determining modules, or may be combined into the same determining module at will, the second determining unit, the third determining unit, the fourth determining unit, and the fifth determining unit may be the same determining unit, or different determining units, or may be combined into the same determining unit at will, and the second replacing unit, the third replacing unit, the fourth replacing unit, and the fifth replacing unit may be the same replacing unit, or different replacing units, or may be combined into the same replacing unit at will, which is not limited in this embodiment of the application.
Thecode generation apparatus 20 of this embodiment can execute the code generation method shown in any of the above embodiments of this application, and the implementation principles thereof are similar and will not be described herein again.
Compared with the prior art, the code generation device determines the first entity class codes corresponding to the database tables respectively based on the first entity class code template edited in advance and the at least one database table, determines the first entity class names based on the first entity class codes corresponding to the database tables respectively, and generates the at least one processing code based on the processing code template edited in advance and the first entity class names, so that the automatic generation of the processing code based on the database tables is realized, the defect that more human resources and time resources are consumed when the processing code is manually written in the prior art is overcome, the workload of manually writing the code is greatly reduced, the cost of developing a new service is reduced, and the efficiency of developing the new service is improved.
The code generation apparatus of the present application is described above from the perspective of a virtual module or a virtual unit, and the electronic device of the present application is described below from the perspective of a physical device.
An embodiment of the present application provides an electronic device, as shown in fig. 3, anelectronic device 4000 shown in fig. 3 includes: aprocessor 4001 and amemory 4003.Processor 4001 is coupled tomemory 4003, such as viabus 4002. Optionally, theelectronic device 4000 may further comprise atransceiver 4004. In addition, thetransceiver 4004 is not limited to one in practical applications, and the structure of theelectronic device 4000 is not limited to the embodiment of the present application.
Processor 4001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. Theprocessor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components.Bus 4002 may be a PCI bus, EISA bus, or the like. Thebus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
Memory 4003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
Thememory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by theprocessor 4001.Processor 4001 is configured to execute application code stored inmemory 4003 to implement what is shown in any of the foregoing method embodiments.
An embodiment of the present application provides an electronic device, where the electronic device includes: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: according to the method and the device, the first entity class codes corresponding to the database tables are determined based on the first entity class code templates edited in advance and the at least one database table, the first entity class names are determined based on the first entity class codes corresponding to the database tables, and the at least one processing code is generated based on the processing code templates edited in advance and the first entity class names.
The electronic device of the present application is described above from the perspective of a physical device, and the computer-readable storage medium of the present application is described below from the perspective of a storage medium.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the method and the device have the advantages that the first entity type codes corresponding to the database tables are determined based on the first entity type code templates edited in advance and the at least one database table, the first entity type names are determined based on the first entity type codes corresponding to the database tables, and the at least one processing code is generated based on the processing code templates edited in advance and the first entity type names.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

CN201911219388.3A2019-12-032019-12-03Code generation method and device, electronic equipment and mediumPendingCN110989999A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201911219388.3ACN110989999A (en)2019-12-032019-12-03Code generation method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201911219388.3ACN110989999A (en)2019-12-032019-12-03Code generation method and device, electronic equipment and medium

Publications (1)

Publication NumberPublication Date
CN110989999Atrue CN110989999A (en)2020-04-10

Family

ID=70089686

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201911219388.3APendingCN110989999A (en)2019-12-032019-12-03Code generation method and device, electronic equipment and medium

Country Status (1)

CountryLink
CN (1)CN110989999A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111666073A (en)*2020-06-122020-09-15远光软件股份有限公司Graphical model construction method and device based on domain-driven design
CN112463135A (en)*2020-12-112021-03-09中国人寿保险股份有限公司Code generation method, code generator, electronic device, and storage medium
CN112711405A (en)*2020-12-282021-04-27山东浪潮通软信息科技有限公司Method, equipment and storage medium for generating add-delete-modify-check application program interface
CN118733055A (en)*2024-09-032024-10-01潍坊华创信息技术有限公司 A method and system for generating code for an open interface

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109359112A (en)*2018-10-152019-02-19行吟信息科技(上海)有限公司A kind of automatic generation method and code generator of code

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109359112A (en)*2018-10-152019-02-19行吟信息科技(上海)有限公司A kind of automatic generation method and code generator of code

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111666073A (en)*2020-06-122020-09-15远光软件股份有限公司Graphical model construction method and device based on domain-driven design
CN111666073B (en)*2020-06-122023-09-29远光软件股份有限公司Graphical model construction method and device based on field driving design
CN112463135A (en)*2020-12-112021-03-09中国人寿保险股份有限公司Code generation method, code generator, electronic device, and storage medium
CN112711405A (en)*2020-12-282021-04-27山东浪潮通软信息科技有限公司Method, equipment and storage medium for generating add-delete-modify-check application program interface
CN118733055A (en)*2024-09-032024-10-01潍坊华创信息技术有限公司 A method and system for generating code for an open interface

Similar Documents

PublicationPublication DateTitle
CN110989999A (en)Code generation method and device, electronic equipment and medium
CN112036736A (en)Workflow creating method and device
CN111124379B (en)Page generation method and device, electronic equipment and storage medium
CN108334585A (en)A kind of spiders method, apparatus and electronic equipment
CN106528165A (en)Code generation method and code generation system
CN111061475B (en)Software code generating method, device, computer equipment and storage medium
CN113094125B (en)Business process processing method, device, server and storage medium
CN105528418B (en)A kind of design documentation generation method and device
CN110955410A (en)Automatic code generation method, device, equipment and medium
CN113076096A (en)Desktop application program development method, device, equipment and storage medium
CN108762743A (en)Data table operation code generation method and device
CN112394930A (en)Method, electronic device, and medium for automatically constructing front-end interface
CN113672204A (en)Interface document generation method, system, electronic equipment and storage medium
CN110543450A (en) Electronic document generation method, device, computer equipment and storage medium
CN104731588A (en)Page layout file generation method and device
CN112035230A (en)Method and device for generating task scheduling file and storage medium
CN117035639A (en)Business form and process automatic association processing method for process engine
CN111338614A (en) Application program interface development method, device, device and storage medium
CN110515653B (en)Document generation method and device, electronic equipment and computer readable storage medium
CN116185389A (en)Code generation method and device, electronic equipment and medium
CN108845857A (en)A kind of icon management method and device based on cloud platform
CN109857380B (en)Workflow file compiling method and device
CN113886241A (en)Brain graph use case set generation method and device
CN115270731A (en) Method and device for collaborative editing of mixed documents
CN114781029A (en) A method, system and storage medium for converting a three-dimensional information model into a two-dimensional image

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20200410


[8]ページ先頭

©2009-2025 Movatter.jp