CN112114794A - Automatic generation method and device of website application program and computer storage medium - Google Patents

Automatic generation method and device of website application program and computer storage medium Download PDF

Info

Publication number
CN112114794A
CN112114794A CN202011038144.8A CN202011038144A CN112114794A CN 112114794 A CN112114794 A CN 112114794A CN 202011038144 A CN202011038144 A CN 202011038144A CN 112114794 A CN112114794 A CN 112114794A
Authority
CN
China
Prior art keywords
program
code
database
website
name
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.)
Granted
Application number
CN202011038144.8A
Other languages
Chinese (zh)
Other versions
CN112114794B (en
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.)
Shenzhen Tianji Data Co.,Ltd.
Original Assignee
Jiangxi Yiyuexin Network 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 Jiangxi Yiyuexin Network Technology Co ltd filed Critical Jiangxi Yiyuexin Network Technology Co ltd
Priority to CN202011038144.8A priority Critical patent/CN112114794B/en
Publication of CN112114794A publication Critical patent/CN112114794A/en
Application granted granted Critical
Publication of CN112114794B publication Critical patent/CN112114794B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Abstract

The invention discloses a method for automatically generating a website application program, which comprises the following steps: creating a database instance; defining an entity table in a database instance; configuring information of a data source and an entity table of a database instance; automatically generating a code program according to the information of the data source and the entity table; and running the code program to generate an application program interface code and a website interface document of a formal state transfer style. The invention also discloses a device and a computer readable storage medium, which solve the problem that a large amount of time and human resources are consumed when the application program codes of the website are written in the prior art.

Description

Automatic generation method and device of website application program and computer storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for automatically generating a website application program and a computer storage medium.
Background
The current mobile phone APP (application program) or WEB (world wide WEB) website program generally needs to interact with a back-end program to access a remote service-side WEB API (website application) program to complete access of various data, and the program processing logic of the WEB API often can be regularly followed, that is, generally, general access and processing logic needs to be performed on a database entity table. However, writing the WEB API program code generally consumes a lot of time and human resources. Therefore, the prior art also has the problem that a great deal of time and manpower resources are consumed when the website application program codes are written.
Disclosure of Invention
The invention mainly aims to provide a method and a device for automatically generating a website application program and a computer storage medium, and aims to solve the problem that a large amount of time and human resources are consumed when website application program codes are written in the prior art.
In order to achieve the above object, the present invention provides an automatic generation method of a website application, including the following steps:
creating a database instance;
defining an entity table in the database instance;
configuring the data source of the database instance and the information of the entity table;
automatically generating a code program according to the information of the data source and the entity table;
and running the code program to generate an application program interface code and a website interface document of a formal state transfer style.
In one embodiment, the step of defining an entity table in the database instance comprises:
setting a database table name; when the database table name consists of a plurality of words, the words are separated by using preset connectors;
setting a database field name; when multi-language support is not required and the database field name consists of a plurality of words, the words are separated by using preset connectors; when multi-language support is needed and internationalized fields need to be supported, the field names of the database adopt a preset connector to separate abbreviated codes of a language area and field real name fields;
the annotations for the database fields are set.
In an embodiment, the automatically generating a code program according to the information of the data source and the entity table includes:
refining the general functions; wherein the generic functions include: the method comprises the following steps of unifying an interface specification function, compiling a specification function, collecting a general type of equipment parameter data function and recording a website application log function;
applying the generic function into an automated code generation tool;
and the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table.
In one embodiment, the interface name, class name, and variable in the code program are automatically created from the database table name and the field name.
In one embodiment, the method further comprises:
the code program uniformly encodes the abnormity and maps the abnormity to resource files of multiple languages;
and configuring the resource files of the plurality of languages.
In one embodiment, the method further comprises:
the code program comprises addition, deletion, modification and query of the database entity table; wherein the query is performed in multiple languages.
In one embodiment, the method further comprises:
the code program is packaged by using a uniform request object and a uniform response object; wherein, the request object passes through the built-in optional parameters;
verifying the key configured according to the application program configuration table and the optional parameter data;
and identifying the illegal request according to the verification result.
In one embodiment, the method further comprises:
the code program comprises interface interceptor code generation, and the request object and the response object are uniformly stored in a preset database; wherein the optional parameters built in the request object comprise user end data.
In an embodiment, after the step of automatically generating the code program according to the information of the data source and the entity table, the method further includes:
automatically generating a storage path of the code program according to the project name of the code program configuration software, namely the service platform;
running the automatic code generation program to generate an application program interface code and a website interface document of a representational state transfer style;
opening the code program according to the storage path;
editing the code program, and confirming whether a new application program interface needs to be supplemented and adjusted and whether the port number of the website service in the configuration file needs to be modified;
running a software, namely a service platform program, and outputting software, namely service platform starting information by the console;
inputting the IP address of the software service platform, generating a readable online website application interface document on the software service platform, and performing online test.
In order to achieve the above object, the present invention further provides an apparatus, which includes a memory, a processor, and a website application automatic generation program stored in the memory and executable on the processor, wherein the website application automatic generation program, when executed by the processor, implements the steps of the method for determining the reason for the black screen of the display as described above.
In order to achieve the above object, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a website application automatic generation program, and the website application automatic generation program, when executed by a processor, implements the steps of the website application automatic generation method as described above.
The invention provides a method, a device and a computer storage medium for automatically generating a website application program, which are used for creating a database instance; then defining an entity table in the database instance; configuring a data source in the database instance, namely representing specific data in the database instance, and configuring information of an entity table, wherein the information includes but is not limited to a data table name, a field type and a field length; the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table; and then the generated code program is run to generate application program interface codes (REST WEB API) and website interface documents (WEB interface documents) of a formal state transfer style. Therefore, the problem that a large amount of time and human resources are consumed when the application program codes of the website are written in the prior art is solved.
Drawings
FIG. 1 is a schematic diagram of an apparatus according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for automatically generating a website application according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating the step S120 in the first embodiment of the present invention;
FIG. 4 is a flowchart illustrating the step S140 according to the first embodiment of the present invention;
FIG. 5 is a flowchart illustrating a method for automatically generating a website application according to a second embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: creating a database instance; then defining an entity table in the database instance; configuring a data source in the database instance, namely representing specific data in the database instance, and configuring information of an entity table, wherein the information includes but is not limited to a data table name, a field type and a field length; the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table; and then the generated code program is run to generate application program interface codes (REST WEB API) and website interface documents (WEB interface documents) of a formal state transfer style. Therefore, the problem that a large amount of time and human resources are consumed when the application program codes of the website are written in the prior art is solved.
As an implementation manner, fig. 1 may be shown, where fig. 1 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
Processor 1100 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 1100. The processor 1100 described above may be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 1200, and the processor 1100 reads the information in the memory 1200 and performs the steps of the above method in combination with the hardware thereof.
It will be appreciated that memory 1200 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile Memory may be a Read Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable PROM (EEPROM), or a flash Memory. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static random access memory (Static RAM, SRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic random access memory (Synchronous DRAM, SDRAM), Double Data Rate Synchronous Dynamic random access memory (ddr Data Rate SDRAM, ddr SDRAM), Enhanced Synchronous SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 1200 of the systems and methods described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
For a software implementation, the techniques described in this disclosure may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described in this disclosure. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
Based on the above structure, an embodiment of the present invention is proposed.
Referring to fig. 2, fig. 2 is a first embodiment of the method for automatically generating a website application according to the present invention, and the method for automatically generating a website application includes the following steps:
step S110, a database instance is created.
In the present embodiment, the WEB application (WEB API) is a WEB application interface. The network application can realize the capabilities of storage service, message service, computing service and the like through an API (application program interface), and can develop powerful WEB (world Wide Web) application by utilizing the capabilities. The automatic program generation, namely the automatic code generation, is to improve the research and development efficiency of developers by automatically generating a program through a code generation tool, and the processing logic of a website application program (WEB API) is usually regularly circulated, that is, a general access and processing logic needs to be performed on a database entity table, so the research and development efficiency of developers is improved by automatically generating the website application program (WEB API) in the present application.
A database is a set of data that are related to each other. The actual physical concept is that one or a stack of files on a disk contain data. However, the data is not available, and the database has many functions, such as accepting user connections and providing data to users, so that a "program" is required. So the closed state database is said to be the program file on disk, plus the data file. To use a database, it is opened and the "program" is run. Examples refer to database programs in a computer memory that are running, and some memory space allocated for these programs. Instances are in memory and only exist when the database is in a running state. The instance is responsible for realizing various functions of providing network connection, reading and writing data files and the like for users.
It may be preferable to create an instance of a relational database, which refers to a database that uses a relational model to organize data, and stores data in rows and columns for easy understanding by users, where a series of rows and columns of a relational database are called tables, and a set of tables constitutes a database. A user retrieves data in a database by a query, which is an executable code that defines certain areas in the database. The relational model can be simply understood as a two-dimensional table model, and a relational database is a data organization composed of two-dimensional tables and relations between them.
Step S120, defining an entity table in the database instance.
In the present embodiment, the entity table refers to a table in the database corresponding to an actual object, for example, a student table, a teacher-student table, or the like. It may be preferable to define entity tables in a relational database instance.
Step S130, configuring the data source of the database instance and the information of the entity table.
In this embodiment, the data source refers to a database or a database server used by the database application. Data Source (Data Source), as the name implies, the Source of Data is the device or original media that provides some desired Data. All information for establishing a database connection is stored in the data source. Just as a file can be found in a file system by specifying the file name, you can find the corresponding database connection by providing the correct data source name.
The information of the entity table includes, but is not limited to, data table name, field type, field length, etc.
And step S140, automatically generating a code program according to the information of the data source and the entity table.
In this embodiment, the automated code generation tool automatically generates the code program based on information from the data source and the entity table.
Step S150, running the code program, and generating an application program interface code and a website interface document in a form state transfer style.
In this embodiment, the representational state transfer style (REST style), REST is a software architecture style proposed by Roy Thomas Fielding in his doctrine of doctrines. The REST architecture style defines five necessary constraints of a client-server, a stateless state, a cache, a unified interface and a system hierarchy and an optional constraint of an on-demand code, and a software architecture style meeting the five necessary constraints can be called as the REST software architecture style. In practice, designers abstract all information, services, etc. in the system into resources, which may be a document, a series of documents on a server, or services on a server for providing data. These resources are assigned a unique identifier URI by which the client can operate as a uniform interface to access and to the resources, services, etc. on the server via the HTTP method. For some static resources, the server can suggest the client to cache the data when giving a response, thereby reducing the times of network access and improving the execution efficiency of the system.
And running the generated code program to generate application program interface codes (REST WEB API) and website interface documents (WEB interface documents) of a formal state transfer style.
In the technical scheme provided by the embodiment, a database instance is created; then defining an entity table in the database instance; configuring a data source in the database instance, namely representing specific data in the database instance, and configuring information of an entity table, wherein the information includes but is not limited to a data table name, a field type and a field length; the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table; and then the generated code program is run to generate application program interface codes (REST WEB API) and website interface documents (WEB interface documents) of a formal state transfer style. Therefore, the problem that a large amount of time and human resources are consumed when the application program codes of the website are written in the prior art is solved.
Referring to fig. 3, fig. 3 is a detailed flowchart illustrating step S120 in the first embodiment of the present invention, which includes:
step S210, setting a database table name; when the database table name consists of a plurality of words, the words are separated by using preset connectors.
In this embodiment, a database table name is set, when the database table name is composed of a plurality of words, the words are separated by using a preset connector, and the preset connector is preferably an underline, and here, a standard is set for unifying the format, and the format conforms to the habit of a developer, and of course, conforms to the grammatical requirements of the code.
Step S220, setting a database field name; when multi-language support is not required and the database field name consists of a plurality of words, the words are separated by using preset connectors; when multi-language support is needed and internationalized fields need to be supported, the field names of the database adopt the preset connectors to separate the abbreviated codes of the language areas and the field real name fields.
In the present embodiment, a database field name is set; when multi-language support is not required and the database field name is composed of a plurality of words, the words are separated by using preset connectors, namely, an underline is used for separating the words; when multi-language support is needed and internationalized fields are needed to be supported, the field names of the database adopt abbreviated codes and field real name fields of a double-underlined separated language area; for example, "zh __ name", "en __ user _ name", where "zh" denotes Chinese and "en" denotes English. Here, a standard is set for unifying the format, and the format conforms to the habit of developers, and certainly conforms to the grammatical requirement of the code. Because a uniform naming mode of the database entity table is provided, only different languages need to be input into the database after the processing of the automatic generation program, and the automatically generated codes can support the data response of the corresponding language and meet the requirement of supporting multiple languages.
In step S230, the comments of the database fields are set.
In the embodiment, the setting of the annotation of the database field also comprises the setting of the annotation of the database name, so that the subsequent developer can understand the use, because the programming habits may be different among different persons, and the setting of the annotation is convenient for understanding the use.
In the technical scheme provided by the embodiment, a database table name is set; when the database table name consists of a plurality of words, the words are separated by using preset connectors; setting a database field name; when multi-language support is not needed and the database field name is composed of a plurality of words, the words are separated by using preset connectors; when multi-language support is needed and internationalized fields are needed to be supported, the field names of the database adopt the default connectors to separate the abbreviated codes of the language areas and the field real name fields, so that the requirement of supporting the multi-language is met; the annotations for the database fields are set. The format standard is unified, the method is suitable for habits of developers, naturally accords with the grammatical requirements of codes, and the comments are set so as to facilitate understanding and use of the developers.
Referring to fig. 4, fig. 4 is a detailed flowchart illustrating step S140 in the first embodiment of the present invention, which includes:
step S310, refining general functions; wherein the generic functions include: the system has the functions of unifying interface specification, compiling specification, collecting general equipment parameter data and recording website application logs.
In this embodiment, general functions of a WEB application (WEB API) are abstracted, and include: the system has the functions of unifying the interface specification function, compiling the specification function, collecting the equipment parameter data of the general type and recording the website application log.
And step S320, applying the general functions to an automatic code generation tool.
In the embodiment, the code generation tool is an application program which realizes code writing through a programming mode. The code type written by the code generation tool is not limited, the code generation tool can be designed for any programming language, and meanwhile, the code generation tool can be developed through any programming language. No matter which development language is adopted by the code generation tool, no matter which type of code is generated by the code generation tool, the tool has the main function of generating the code, and the development efficiency is improved. Whether the development efficiency can be improved in a real sense depends on whether the generated code meets the requirements on quality, if the generated code cannot meet the grammatical requirements or has too many errors in operation, a developer needs to modify the generated code manually, and the modification process usually takes time compared with the modification process from zero, so that the development efficiency is not discussed; on the other hand, depending on whether the generated code meets the requirements of developers in the aspects of structure, hierarchy, flexibility and the like, if the generated code structure cannot meet the requirements of the developers, the developers inevitably spend more time to meet the requirements of the developers, and even the purpose of meeting the coding habits of the developers is achieved in a mode of damaging the code structure. The development efficiency is not improved, the development progress of the project is greatly hindered, and the working mood of developers is easily influenced. With the development of various technologies and the emergence of new mainstream technologies, the code generation tool should also be ready to incorporate these technologies into its own functionality at any time. Therefore, a good code generation tool must be studied in terms of quality, structure, flexibility, etc. of generated codes, and can provide a good expansion space for the future development of technology.
The unified interface standard function, the standard compiling function, the universal equipment parameter data collecting function and the website application log recording function are applied to an automatic code generating tool.
And step S330, the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table.
In this embodiment, the automated code generation tool integrated with the general-purpose function automatically generates a code program based on information of the data source and the entity table.
In the technical scheme provided by the embodiment, the unified interface specification function is extracted, the specification function is compiled, the general type equipment parameter data function is collected, the website application log function is recorded, and then the functions are applied to the automatic code generation tool, and the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table, so that better convenience is provided for developers, and various requirements of the developers are met to a certain extent.
In the above embodiment, the method further includes:
and the code program uniformly encodes the exception and maps the exception to resource files of multiple languages.
In this embodiment, when an exception occurs in a website application, the exception is uniformly encoded and then mapped to resource files in multiple languages.
And configuring the resource files of the plurality of languages.
In this embodiment, a uniform naming method for the database entity table is provided according to the above, so that after the processing of the automatic generation program, only the entry of different languages is required in the database, and the automatically generated code can support the return of the data response of the corresponding language. Then the resource files of multiple languages are configured through the code program, and the abnormal prompt of the corresponding language can be obtained.
In the technical scheme provided by the embodiment, when the website application program generates the abnormality, the abnormality is uniformly coded and then mapped to resource files of multiple languages; the resource files of multiple languages are configured through the code program, and then abnormal prompts of the corresponding languages can be obtained. The method and the device meet the requirement that the abnormal prompt of the corresponding language of the user can be provided under the abnormal condition of the website application program.
In the above embodiment, the method further includes:
the code program comprises addition, deletion, modification and query of the database entity table; wherein the query is performed in multiple languages.
In this embodiment, the addition, deletion, modification, and query of the database entity table can be realized by a code program, the query can be realized by a main key accurate query and a paging query method, and the data fields of the language of the database are returned according to the language code of the request, so as to provide multiple languages for query.
In the above embodiment, the method further includes:
the code program is packaged by using a uniform request object and a uniform response object; wherein, the request object passes through the built-in optional parameters.
In this embodiment, the code program is encapsulated using a unified request object and response object; the request object passes through the built-in mandatory parameters, such as version type, version number, token, data signature parameters, and the like of the application program.
And verifying the key configured according to the application program configuration table and the necessary parameter data.
In this embodiment, the code program checks the key configured according to the application configuration table with the parameter data.
And identifying the illegal request according to the verification result.
In this embodiment, an illegal request, for example, an illegal request forged by a human, is identified according to a verification result of the key configured in the application configuration table and the optional parameter data, so as to implement an anti-fraud function.
In the above embodiment, the method further includes:
the code program comprises interface interceptor code generation, and the request object and the response object are uniformly stored in a preset database; wherein the optional parameters built in the request object comprise user end data.
In this embodiment, the code program includes an auto-generation interface device intercepting code, and the request object and the response object can be uniformly formatted and stored in a preset database, which may preferably be mongoDB, and mongoDB is a database based on distributed file storage and is written in C + + language. The method aims to provide an extensible high-performance data storage solution for WEB application, and is mainly characterized in that the supported query language is very strong, the syntax of the supported query language is similar to an object-oriented query language, most functions of similar relation database single-table query can be almost realized, and the establishment of indexes on data is supported. The optional parameters built in the request object comprise user end data; including important user end data such as IP address, longitude, latitude, gyroscope, equipment electric quantity, can discern through gyroscope and equipment electric quantity whether equipment is in normal condition, for example, traditional "the machine is brushed", equipment is in the charged state always, and can judge the position of equipment through the gyroscope and be unchangeable always, and in normal use, equipment probably changes the position at any time, so through the data that draws the user end, can insert big data analysis platform, provide data for carrying out intelligent operation and wind control work.
On the basis of the above embodiments, referring to fig. 5, fig. 5 is a second embodiment of the method for automatically generating a website application according to the present invention, which includes:
step S410, a database instance is created.
In step S420, an entity table in the database instance is defined.
Step S430, configuring the data source of the database instance and the information of the entity table.
Step S440, automatically generating a code program according to the information of the data source and the entity table.
Compared with the first embodiment, the second embodiment includes step S450, step S470, step S480, and step S490, and other steps are the same as those of the first embodiment and are not repeated.
Step S450, according to the code program configuration software, namely the service platform project name, automatically generating the storage path of the code program.
In the present embodiment, a software as a service (SaaS) platform project name is configured according to a code program, and then a storage path of the code program is automatically generated. SaaS, an abbreviated name of Software-as-a-Service, means Software as a Service, that is, providing a Software Service through a network. The SaaS platform supplier uniformly deploys the application software on the server of the SaaS platform supplier, a client can order the required application software service from a manufacturer through the Internet according to the actual working requirement, pay the cost to the manufacturer according to the ordered service and the time, and obtain the service provided by the Saas platform supplier through the Internet.
Step S460, running the automatic code generation program, and generating an application program interface code and a website interface document in a representational state transfer style.
And step S470, opening the code program according to the storage path.
In the present embodiment, the code program is opened according to the storage path.
Step S480, editing the code program, and determining whether a new application program interface needs to be supplemented and adjusted, and whether a port number of the website service in the configuration file needs to be modified.
In this embodiment, the developer edits the code program, confirms whether a new Application Program Interface (API) needs to be supplemented and adjusted, and whether the port number of a WEB site (WEB) service in the configuration file needs to be modified.
Step S490 is to run the software, i.e., the service platform program, and the console will output the software, i.e., the service platform start-up information.
In this embodiment, a software as a service (SaaS) platform program is run, and the console outputs software as a service (SaaS) platform startup information.
Step S410, inputting the IP address of the software, namely the service platform, generating a readable online website application interface document on the software, namely the service platform, and carrying out online testing.
In this embodiment, it may be preferable to open a WEB site (WEB) browser, input an IP address of a software as a service (SaaS) platform, for example, input "http:// IP address of the SaaS platform: port number/swagger-ui. html" in an address field of the WEB browser, generate a readable online WEB site application interface document on the software as a service (SaaS) platform, and perform online testing.
In the technical solution provided in this embodiment, a storage path of a code program is automatically generated according to a code program configuration software as a service (SaaS) platform project name; opening a code program according to the storage path; a developer edits a code program, confirms whether a new Application Program Interface (API) needs to be supplemented and adjusted, and whether a port number of a Website (WEB) service in a configuration file needs to be modified; running a software as a service (SaaS) platform program, and outputting starting information of the software as a service (SaaS) platform by a control console; and opening a Website (WEB) browser, inputting an IP address of a software as a service (SaaS) platform, generating a readable online website application interface document on the software as a service (SaaS) platform, and performing online test. The method can be understood as providing a 'platform' on a software as a service (SaaS) platform, and a user can realize online test through the 'platform', so that the problem that a large amount of time and manpower resources are consumed when website application program codes are written in the prior art is further solved.
The invention also provides a device which comprises a memory, a processor and a website application program automatic generation program which is stored in the memory and can run on the processor, wherein the website application program automatic generation program realizes the steps of the website application program automatic generation method when being executed by the processor.
The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a website application automatic generation program, and when the website application automatic generation program is executed by a processor, the website application automatic generation program implements the steps of the website application automatic generation method.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. An automatic generation method of a website application program is characterized by comprising the following steps:
creating a database instance;
defining an entity table in the database instance;
configuring the data source of the database instance and the information of the entity table;
automatically generating a code program according to the information of the data source and the entity table;
and running the code program to generate an application program interface code and a website interface document of a formal state transfer style.
2. A method for automatic generation of a web application according to claim 1, wherein said step of defining an entity table in said database instance comprises:
setting a database table name; when the database table name consists of a plurality of words, the words are separated by using preset connectors;
setting a database field name; when multi-language support is not required and the database field name consists of a plurality of words, the words are separated by using preset connectors; when multi-language support is needed and internationalized fields need to be supported, the field names of the database adopt a preset connector to separate abbreviated codes of a language area and field real name fields;
the annotations for the database fields are set.
3. The method of claim 2, wherein the automatically generating a code program according to the information of the data source and the entity table comprises:
refining the general functions; wherein the generic functions include: the method comprises the following steps of unifying an interface specification function, compiling a specification function, collecting a general type of equipment parameter data function and recording a website application log function;
applying the generic function into an automated code generation tool;
and the automatic code generation tool automatically generates a code program according to the information of the data source and the entity table.
4. A method for automatically generating a web application according to claim 3, wherein an interface name, a class name, and a variable in said code program are automatically created based on said database table name and said field name.
5. The method for automatically generating a web application according to claim 4, further comprising:
the code program uniformly encodes the abnormity and maps the abnormity to resource files of multiple languages;
and configuring the resource files of the plurality of languages.
6. A method for automatic generation of a web application according to claim 5, characterized in that said code programs include additions, deletions, modifications and queries to said database entity table; wherein the query is performed in multiple languages.
7. The method for automatically generating a web application according to claim 6, further comprising:
the code program is packaged by using a uniform request object and a uniform response object; wherein, the request object passes through the built-in optional parameters;
verifying the key configured according to the application program configuration table and the optional parameter data;
and identifying the illegal request according to the verification result.
8. The method for automatically generating a website application according to claim 7, wherein after the step of automatically generating a code program according to the information of the data source and the entity table, the method further comprises:
automatically generating a storage path of the code program according to the project name of the code program configuration software, namely the service platform;
running the automatic code generation program to generate an application program interface code and a website interface document of a representational state transfer style;
opening the code program according to the storage path;
editing the code program, and confirming whether a new application program interface needs to be supplemented and adjusted and whether the port number of the website service in the configuration file needs to be modified;
running a software, namely a service platform program, and outputting software, namely service platform starting information by the console;
inputting the IP address of the software service platform, generating a readable online website application interface document on the software service platform, and performing online test.
9. An apparatus comprising a memory, a processor, and a website application auto-generation program stored in the memory and executable on the processor, the website application auto-generation program when executed by the processor implementing the steps of the website application auto-generation method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing an automatic website application generation program, which when executed by a processor implements the steps of the automatic website application generation method according to any one of claims 1 to 8.
CN202011038144.8A 2020-09-27 2020-09-27 Automatic generation method and device of website application program and computer storage medium Active CN112114794B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011038144.8A CN112114794B (en) 2020-09-27 2020-09-27 Automatic generation method and device of website application program and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011038144.8A CN112114794B (en) 2020-09-27 2020-09-27 Automatic generation method and device of website application program and computer storage medium

Publications (2)

Publication Number Publication Date
CN112114794A true CN112114794A (en) 2020-12-22
CN112114794B CN112114794B (en) 2021-11-09

Family

ID=73797178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011038144.8A Active CN112114794B (en) 2020-09-27 2020-09-27 Automatic generation method and device of website application program and computer storage medium

Country Status (1)

Country Link
CN (1) CN112114794B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883044A (en) * 2021-03-29 2021-06-01 浙江太美医疗科技股份有限公司 Data processing method and device for database and computer readable medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103501341A (en) * 2013-09-30 2014-01-08 乐视致新电子科技(天津)有限公司 Method and device for establishing Web service
CN103777944A (en) * 2013-12-25 2014-05-07 中软信息系统工程有限公司 MIPS platform integrated development environment based on Eclipse and implementation method thereof
US20140324765A1 (en) * 2008-05-01 2014-10-30 Primal Fusion Inc. Method, system, and computer program for user-driven dynamic generation of semantic networks and media synthesis
CN104793961A (en) * 2015-05-10 2015-07-22 黄伟 Quick JavaWeb development method and system using native Web codes
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN108108470A (en) * 2017-12-31 2018-06-01 浙江工业大学 A kind of automatic extraction of elevator data service and method for packing based on REST
US20190065155A1 (en) * 2017-08-30 2019-02-28 Salesforce.Com, Inc. Base editor component in a web application builder framework
US20190073388A1 (en) * 2016-03-02 2019-03-07 IntegrIT SA Improved Construction of Database Schema Models for Database Systems and Rest APIs
CN109471619A (en) * 2018-11-20 2019-03-15 北京千丁互联科技有限公司 Mybatis code generating method, device and terminal
CN111061475A (en) * 2019-12-13 2020-04-24 中国南方电网有限责任公司 Software code generation method and device, computer equipment and storage medium
CN111078205A (en) * 2019-11-22 2020-04-28 北京锐安科技有限公司 Modular programming method and device, storage medium and electronic equipment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140324765A1 (en) * 2008-05-01 2014-10-30 Primal Fusion Inc. Method, system, and computer program for user-driven dynamic generation of semantic networks and media synthesis
CN103501341A (en) * 2013-09-30 2014-01-08 乐视致新电子科技(天津)有限公司 Method and device for establishing Web service
CN103777944A (en) * 2013-12-25 2014-05-07 中软信息系统工程有限公司 MIPS platform integrated development environment based on Eclipse and implementation method thereof
CN104793961A (en) * 2015-05-10 2015-07-22 黄伟 Quick JavaWeb development method and system using native Web codes
US20190073388A1 (en) * 2016-03-02 2019-03-07 IntegrIT SA Improved Construction of Database Schema Models for Database Systems and Rest APIs
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
US20190065155A1 (en) * 2017-08-30 2019-02-28 Salesforce.Com, Inc. Base editor component in a web application builder framework
CN108108470A (en) * 2017-12-31 2018-06-01 浙江工业大学 A kind of automatic extraction of elevator data service and method for packing based on REST
CN109471619A (en) * 2018-11-20 2019-03-15 北京千丁互联科技有限公司 Mybatis code generating method, device and terminal
CN111078205A (en) * 2019-11-22 2020-04-28 北京锐安科技有限公司 Modular programming method and device, storage medium and electronic equipment
CN111061475A (en) * 2019-12-13 2020-04-24 中国南方电网有限责任公司 Software code generation method and device, computer equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
R.PADMANABAN等: ""Computability evaluation of RESTful API using Primitive Recursive Function"", 《JOURNAL OF KING SAUD UNIVERSITY - COMPUTER AND INFORMATION SCIENCES》 *
刘剑: ""IBM私有云的DaaS中REST风格数据访问服务的设计与实现"", 《中国优秀博硕士学位论文全文数据库(硕士) 信息科技辑》 *
陈亮 等: ""基于面向资源架构的REST方式Web服务的开发方法"", 《中国科技信息》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112883044A (en) * 2021-03-29 2021-06-01 浙江太美医疗科技股份有限公司 Data processing method and device for database and computer readable medium
CN112883044B (en) * 2021-03-29 2023-02-07 浙江太美医疗科技股份有限公司 Data processing method and device for database and computer readable medium

Also Published As

Publication number Publication date
CN112114794B (en) 2021-11-09

Similar Documents

Publication Publication Date Title
CN108319547B (en) Test case generation method, device and system
KR100661393B1 (en) Web site management system and method applying web programming environment
CN104158836A (en) Method for rendering mobile application interface through data
CN109308254B (en) Test method, test device and test equipment
CN106933887B (en) Data visualization method and device
CN110580147A (en) application program development method and device
CA2684822A1 (en) Data transformation based on a technical design document
CN106991100B (en) Data import method and device
CN113505082B (en) Application program testing method and device
CN104657274A (en) Method and device for testing software interface
CN107015903B (en) Interface test program generation method and device and electronic equipment
CN116560642A (en) Code generation method and device, electronic equipment and storage medium
CN112114794B (en) Automatic generation method and device of website application program and computer storage medium
Brdjanin et al. An online business process model-driven generator of the conceptual database model
CN103246605A (en) Method and system for collocating remote controller key values based on xml (extensive markup language)
CN111078529B (en) Client writing module testing method and device and electronic equipment
CN116541116A (en) Application interface rendering method, device, medium and equipment of cloud native system
CN111736812A (en) Document code execution method and device, computer equipment and storage medium
CN110704742B (en) Feature extraction method and device
CN113486637A (en) Intelligent dynamic custom contract generation method and device
CN113672233A (en) Server out-of-band management method, device and equipment based on Redfish
CN112169326A (en) Picture processing method and device, electronic equipment and storage medium
CN115934684B (en) Multi-source database data migration method and device, equipment and storage medium
CN117111902B (en) AI intelligent software development method and device
CN110618809B (en) Front-end webpage input constraint extraction method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210318

Address after: 2309, building 4, excellence Century Center and Huanggang business center, Southeast of the junction of Fuhua third road and Jintian Road, Fushan community, Futian street, Futian District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Tianji Data Co.,Ltd.

Address before: No.525 Yuanshan Middle Road, Yuanzhou District, Yichun City, Jiangxi Province

Applicant before: Jiangxi yiyuexin Network Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant