CN110806862A - System for automatically generating interface program code based on configuration model - Google Patents

System for automatically generating interface program code based on configuration model Download PDF

Info

Publication number
CN110806862A
CN110806862A CN201910966332.8A CN201910966332A CN110806862A CN 110806862 A CN110806862 A CN 110806862A CN 201910966332 A CN201910966332 A CN 201910966332A CN 110806862 A CN110806862 A CN 110806862A
Authority
CN
China
Prior art keywords
interface
template
configuration
template file
model
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
CN201910966332.8A
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.)
Shanghai Weichi Information Technology Co Ltd
Original Assignee
Shanghai Weichi Information 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 Shanghai Weichi Information Technology Co Ltd filed Critical Shanghai Weichi Information Technology Co Ltd
Priority to CN201910966332.8A priority Critical patent/CN110806862A/en
Publication of CN110806862A publication Critical patent/CN110806862A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a system for automatically generating an interface program code based on a configuration model, which comprises a system assembly, wherein the system assembly comprises an interface model configuration module, a template file analysis module and a code generation module, the interface model configuration module adopts a self-defined configuration model and forms an interface template file by filling in an interface name, a parameter name and a parameter type, the template file analysis module reads and analyzes the interface template file generated by the interface model configuration module to obtain the interface name, the parameter name and the parameter type in the interface template file, and transmits the values as input parameters to the code generation module, and the code generation module generates a specific interface program code by means of a template engine tool. Compared with the prior art, the invention has the advantages that: the method and the system can enable business personnel to maintain the interface configuration model, automatically generate most interface program codes, help to save software development cost and shorten software development period.

Description

System for automatically generating interface program code based on configuration model
Technical Field
The invention relates to a computer technology, in particular to a system for automatically generating an interface program code based on a configuration model.
Background
With the development of network information technology and the popularization of electronic commerce application, the internet banking business taking the internet technology as a core is rapidly developed, and the requirement of software development is more and more increased. In the trend of software development in the present society, independent operation of a single piece of software is no longer mainstream, but gradually becomes that a plurality of pieces of software jointly create an ecosystem and provide services to the outside, even a plurality of software providers only provide a software platform and a platform interface, and other software partners are connected through the interface.
The traditional interface development has many defects, and the efficiency is low and the code writing time is too long in practical use.
Therefore, it is imperative to design a system for automatically generating interface program code based on a configuration model.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: (1) most program codes need to be finished by a programmer through handwriting, and the efficiency is low; (2) the quality of program development is difficult to guarantee and completely depends on the own programming level of a programmer; (3) the style of the program is greatly differentiated, and a uniform programming style does not exist; (4) each time different interfaces are faced, they need to be re-developed, and no generalized mechanism can be reused.
In order to solve the technical problems, the technical scheme provided by the invention is as follows: a system for automatically generating an interface program code based on a configuration model comprises a system assembly, wherein the system assembly comprises an interface model configuration module, a template file analysis module and a code generation module.
Compared with the prior art, the invention has the advantages that: compared with the existing interface program development mode, the invention can obviously improve the development efficiency of the interface butt joint of the software platform, the program can be repeatedly utilized, the butt joint of different interfaces only needs to modify the interface template file and rewrite the template engine file, the realization method and the mechanism for automatically generating the interface program code based on the configuration model are universal, the traditional development means generally adopted by the prior art has the problems of low interface development efficiency, great difference of programming style, difficult guarantee of development quality, no reusable mechanism and the like, and the invention has the advantages of high interface development efficiency, uniform automatically generated program style, stable and reliable development quality, reusable automatically generated code mechanism and the like.
As an improvement, the interface model configuration module adopts a self-defined configuration model and forms an interface template file by filling in an interface name, a parameter name and a parameter type.
As an improvement, the template file parsing module reads and parses an interface template file generated by the interface model configuration module to obtain an interface name, a parameter name and a parameter type in the interface template file, and transmits the values as input parameters to the code generation module.
As an improvement, the code generation module generates specific interface program code by means of a template engine tool.
As an improvement, the template engine tool comprises a JAVA template, a C + + template, a Python template and a JS template.
Drawings
FIG. 1 is a block diagram of a system for automatically generating interface program code based on a configuration model.
FIG. 2 is a schematic diagram of a system for automatically generating interface program code based on a configuration model in an operating state.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings.
When the system is implemented in detail, the system for automatically generating the interface program code based on the configuration model comprises a system assembly, wherein the system assembly comprises an interface model configuration module, a template file analysis module and a code generation module.
The interface model configuration module adopts a self-defined configuration model and forms an interface template file by filling in an interface name, a parameter name and a parameter type.
The template file analysis module reads and analyzes the interface template file generated by the interface model configuration module to obtain the interface name, the parameter name and the parameter type in the interface template file, and transmits the values serving as input parameters to the code generation module.
The code generation module generates specific interface program codes by means of a template engine tool.
The template engine tool comprises a JAVA template, a C + + template, a Python template and a JS template.
The working principle of the invention is as follows: the interface model configuration module is provided with an interface configuration model which can describe all characteristics of the interface, including interface name, interface input parameters and parameter types, interface output parameters and output parameter types and the like, and fills in specific interface name, interface input parameters and parameter types, interface output parameters and output parameter types according to specific interface definition and description to form a specific interface template file.
And the template file analysis module can read and analyze the template file generated by the interface model configuration module to obtain an interface name, an interface input parameter and parameter type, an interface output parameter and an output parameter type required by generating an interface program code.
And the code generation module can read the information returned by the template file analysis module, select the type of the target code to be generated by means of a template engine tool such as freemarker and generate interface codes such as Java, C + +, Python, JavaScript and the like.
The working steps of the invention are as follows: s1, customizing the format of the configuration model;
s2, filling data including interface names, parameter types and the like into the custom configuration model to form an interface template file;
s3, reading the interface template file by adopting a template file analyzing module, and analyzing and reading parameter information such as an interface name, a parameter type and the like in the interface template file;
s4, the template file analysis module takes the parameters obtained by analysis as input parameters and transmits the input parameters to the code generation module;
s5, the code generator generates corresponding object program code by means of a template engine tool such as freemarker or the like.
The invention can enable business personnel to maintain the interface configuration model, automatically generate most interface program codes, help to save software development cost and shorten software development period.
Example (b): a system for automatically generating an interface program code based on a configuration model comprises a system assembly, wherein the system assembly comprises an interface model configuration module, a template file analysis module and a code generation module.
The interface model configuration module adopts a self-defined configuration model and forms an interface template file by filling in an interface name, a parameter name and a parameter type.
The template file analysis module reads and analyzes the interface template file generated by the interface model configuration module to obtain the interface name, the parameter name and the parameter type in the interface template file, and transmits the values serving as input parameters to the code generation module.
The code generation module generates specific interface program codes by means of a template engine tool.
The template engine tool comprises a JAVA template, a C + + template, a Python template and a JS template.
The interface model configuration module may define a configuration model describing an interface, for example, an excel file may be used to describe the configuration model of the interface, and the specific definition manner is as follows:
parameter name Type of parameter Note
Parameter 1 int
Parameter 2 String
Parameter n String
The Excel file name corresponds to a database name, the Excel sheet page name corresponds to a table name, and the content of each page corresponds to a specific field name and type and other attributes.
The template file analysis module can read and analyze the configuration model, for example, a JAVA language can call a POI tool class to analyze the configuration model in the Excel format, and can obtain a file name of the Excel file, a name of each Sheet page of the Excel file, and contents of each Sheet page.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the invention, "plurality" means two or more unless explicitly defined otherwise.
In the present invention, unless otherwise specifically stated or limited, the terms "mounted," "connected," "fixed," and the like are to be construed broadly and may, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, "above" or "below" a first feature means that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact with each other via another feature therebetween. Also, the first feature being "on," "above" and "over" the second feature includes the first feature being directly on and obliquely above the second feature, or merely indicating that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature includes the first feature being directly above and obliquely above the second feature, or simply meaning that the first feature is at a lesser level than the second feature.
In the description herein, reference to the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention.

Claims (5)

1. A system for automatically generating interface program code based on a configuration model, comprising a system assembly, wherein: the system assembly comprises an interface model configuration module, a template file analysis module and a code generation module.
2. The system for automatically generating interface program code based on configuration model according to claim 1, wherein: the interface model configuration module adopts a self-defined configuration model and forms an interface template file by filling in an interface name, a parameter name and a parameter type.
3. The system for automatically generating interface program code based on configuration model according to claim 1, wherein: the template file analysis module reads and analyzes the interface template file generated by the interface model configuration module to obtain the interface name, the parameter name and the parameter type in the interface template file, and transmits the values serving as input parameters to the code generation module.
4. The system for automatically generating interface program code based on configuration model according to claim 1, wherein: the code generation module generates specific interface program codes by means of a template engine tool.
5. The system for automatically generating interface program code based on configuration model according to claim 4, wherein: the template engine tool comprises a JAVA template, a C + + template, a Python template and a JS template.
CN201910966332.8A 2019-10-12 2019-10-12 System for automatically generating interface program code based on configuration model Pending CN110806862A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910966332.8A CN110806862A (en) 2019-10-12 2019-10-12 System for automatically generating interface program code based on configuration model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910966332.8A CN110806862A (en) 2019-10-12 2019-10-12 System for automatically generating interface program code based on configuration model

Publications (1)

Publication Number Publication Date
CN110806862A true CN110806862A (en) 2020-02-18

Family

ID=69488228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910966332.8A Pending CN110806862A (en) 2019-10-12 2019-10-12 System for automatically generating interface program code based on configuration model

Country Status (1)

Country Link
CN (1) CN110806862A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324343A (en) * 2020-02-20 2020-06-23 支付宝(杭州)信息技术有限公司 Code generation method and device
CN111459466A (en) * 2020-03-31 2020-07-28 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
CN112256325A (en) * 2020-10-14 2021-01-22 北京康惠达科技有限公司 Interface data adaptation method, equipment, server and storage medium
CN112783486A (en) * 2020-12-24 2021-05-11 中国航发控制系统研究所 Aero-engine software overall process evidence chain multiplexing generation method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105242914A (en) * 2015-09-06 2016-01-13 江苏马上游科技股份有限公司 Model driven code generation method and system
CN105260189A (en) * 2015-11-02 2016-01-20 江苏马上游科技股份有限公司 Code generating method and system based on model driving
US20160357520A1 (en) * 2015-06-02 2016-12-08 Sap Portals Israel Ltd. Data binding for model-based code generation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160357520A1 (en) * 2015-06-02 2016-12-08 Sap Portals Israel Ltd. Data binding for model-based code generation
CN105242914A (en) * 2015-09-06 2016-01-13 江苏马上游科技股份有限公司 Model driven code generation method and system
CN105260189A (en) * 2015-11-02 2016-01-20 江苏马上游科技股份有限公司 Code generating method and system based on model driving

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111324343A (en) * 2020-02-20 2020-06-23 支付宝(杭州)信息技术有限公司 Code generation method and device
CN111324343B (en) * 2020-02-20 2022-03-25 蚂蚁财富(上海)金融信息服务有限公司 Code generation method and device
CN111459466A (en) * 2020-03-31 2020-07-28 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
CN111459466B (en) * 2020-03-31 2023-10-20 广州酷狗计算机科技有限公司 Code generation method, device, equipment and storage medium
CN112256325A (en) * 2020-10-14 2021-01-22 北京康惠达科技有限公司 Interface data adaptation method, equipment, server and storage medium
CN112256325B (en) * 2020-10-14 2021-08-17 北京康惠达科技有限公司 Interface data adaptation method, equipment, server and storage medium
CN112783486A (en) * 2020-12-24 2021-05-11 中国航发控制系统研究所 Aero-engine software overall process evidence chain multiplexing generation method and system
CN112783486B (en) * 2020-12-24 2023-10-31 中国航发控制系统研究所 Method and system for generating whole-process evidence chain multiplexing of aeroengine software

Similar Documents

Publication Publication Date Title
CN110806862A (en) System for automatically generating interface program code based on configuration model
CN101122899B (en) Report generation method and device
US9430455B2 (en) Methods and systems for intelligent form-filling and electronic document generation
CN106325969B (en) The reversely tracing system of demand change
CN101661512A (en) System and method for identifying traditional form information and establishing corresponding Web form
CN111309313A (en) Method for quickly generating HTML (hypertext markup language) and storing form data
CN112464632B (en) Dynamic storage and conversion method for table style under excel report
CN109445771A (en) A kind of off line network layers block code Auto-Generation Tool of CS framework and method
CN110688830B (en) Credit investigation template conversion method and device
CN111158687B (en) Interface generation method and device of JAVA plugin, computer equipment and storage medium
CN113312033A (en) Template protocol generation and management method
CN111124380A (en) Front-end code generation method
CN108959230B (en) Method and device for generating report template
CN106776779B (en) Method for generating entity file by JSON data based on Mac platform
CN111090976B (en) Method and device for generating inspection document based on dynamic data
CN107122961A (en) Excel nested report data processing methods based on SAP system
JP7064680B1 (en) Program code automatic generation system
CN113590115B (en) Automatic generation method and device for service system codes
CN114297994A (en) Method, system, device and storage medium for generating parameterized report
CN113971044A (en) Component document generation method, device, equipment and readable storage medium
CN113435160A (en) Data processing method and device
CN110502735B (en) Method and system for quickly manufacturing universal process file of electronic equipment
CN104378362A (en) Method and device for carrying out conversion of message interfaces
CN113239016B (en) Database design assistance apparatus and method
CN115659920A (en) Method and device for converting Excel process into cxp process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200218