CN104317604A - Program code generating method and device - Google Patents
Program code generating method and device Download PDFInfo
- Publication number
- CN104317604A CN104317604A CN201410641389.8A CN201410641389A CN104317604A CN 104317604 A CN104317604 A CN 104317604A CN 201410641389 A CN201410641389 A CN 201410641389A CN 104317604 A CN104317604 A CN 104317604A
- Authority
- CN
- China
- Prior art keywords
- program code
- transaction information
- template
- mark
- code template
- 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
Links
Abstract
The invention provides a program code generating method and a program code generating device. The program code generating method comprises the steps of: firstly, in response to a received program code generation request, calling a pre-set program code template (the program code template includes a common part and at least one personalized content tab) corresponding to the type of a file carried by the program code generation request, then obtaining transaction information respectively corresponding to each tab, then adopting each piece of transaction information to replace the corresponding tab generation program code in the program code template, and thereby achieving automatic generation of program codes; according to the program code generating method and device, the problem that in the prior art the development efficiency is low due to the effect that every development step of each transaction in a business system in the prior art needs to be gradually completed.
Description
Technical field
The application relates to technical field of software development, particularly relates to a kind of program code generation method and device.
Background technology
For the developer of operation system, want the exploitation of finishing service systemic-function, general is all in specific development platform, the development process specified according to development platform and step, the business function code writing each business function of this application system step by step.
As a rule, in the process realizing a business function, need this business function to be decomposed into several transaction and develop.Wherein, transaction refers to request process (as: transmission processing request, operation system completes respective handling according to this process request and returns result) once complete in operation system.
Prior art, mainly through the manual each development procedure completing each transaction one by one of developer, therefore, the number of transaction that usually can exist because of operation system is numerous, causes the problem that development efficiency reduces.
Summary of the invention
In view of this, the application provides a kind of program code generation method and device, to avoid prior art because needing each development procedure of each transaction in artificial finishing service system one by one, and then the problem causing development efficiency to reduce.
To achieve these goals, the technical scheme that provides of the embodiment of the present invention is as follows:
A kind of program code generation method, comprising:
Respond the program code that receives and generate request, call pre-set generate program code template corresponding to the file type entrained by asking with described program code; Described program code template comprises the mark of common segment and at least one individualized content;
Obtain and describedly mark corresponding Transaction Information with each respectively;
Respectively each described Transaction Information is replaced mark generator program code corresponding with it in described program code template.
Preferably, pre-set Transaction Information table, store in described Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of concluding the business corresponding,
Described acquisition describedly marks corresponding Transaction Information with each and comprises respectively:
Obtain the Transaction Information of each described mark instruction respectively according to described storage rule in described Transaction Information table.
Preferably, described acquisition describedly marks corresponding Transaction Information with each and comprises respectively:
The address information of each described mark instruction is utilized to obtain the Transaction Information corresponding with this mark respectively.
Preferably, described program code template is profile template.
Preferably, described program code template is parameter file of database template.
A kind of program code generating apparatus, comprising:
Call unit, generates request for responding the program code that receives, call pre-set generate program code template corresponding to the file type entrained by asking with described program code; Described program code template comprises the mark of common segment and at least one individualized content;
Acquiring unit, describedly marks corresponding Transaction Information with each respectively for obtaining;
Generation unit, for replacing mark generator program code corresponding with it in described program code template by each described Transaction Information respectively.
Preferably, pre-set Transaction Information table, store in described Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of concluding the business corresponding,
Described acquiring unit obtains the Transaction Information of each described mark instruction respectively in described Transaction Information table according to described storage rule.
Preferably, described acquiring unit utilizes the address information of each described mark instruction to obtain the Transaction Information corresponding with this mark respectively.
Preferably, described program code template is profile template.
Preferably, described program code template is parameter file of database template.
The application provides a kind of program code generation method and device, first respond the program code received and generate request, call pre-set generate program code template corresponding to the file type entrained by asking (this program code template comprises the mark of common segment and at least one individualized content) with program code, then obtain and mark corresponding Transaction Information with each respectively, and then respectively each Transaction Information is replaced mark generator program code corresponding with it in program code template, to realize the automatic generation of program code, effectively prevent prior art because needing each development procedure of each transaction in artificial finishing service system one by one, and the problem that the development efficiency caused reduces.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to the accompanying drawing provided.
A kind of program code that Fig. 1 provides for the embodiment of the present application one generates method flow diagram;
The structural representation of a kind of program code generating apparatus that Fig. 2 provides for the embodiment of the present application two.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiment one:
A kind of program code that Fig. 1 provides for the embodiment of the present application one generates method flow diagram.
As shown in Figure 1, the method comprises:
S101, respond the program code that receives and generate request, call pre-set generate program code template corresponding to the file type entrained by asking with program code; Program code template comprises the mark of common segment and at least one individualized content.
Concrete, at least one program code template is previously provided with in a kind of program code generation method that the embodiment of the present application provides, user the program code template different according to the demand utilization of oneself can generate different program codes automatically, also namely different program's code files.As: when user need generate the configuration file corresponding with this transaction for certain transaction, the program code template then needing selection and arrangement file corresponding, when user need generate corresponding with this transaction parameter file of database for certain transaction, the program code template corresponding with parameter file of database need be selected.
Concrete, program code template comprises the mark of common segment and at least one individualized content.Wherein, common segment is common segment code.As: when generating configuration file need be distinguished for transaction 1 and transaction 2, at this moment need to utilize the program code template corresponding with configuration file pre-set in the embodiment of the present application, the code of the common ground of the transaction 1 that this program code template comprises and the configuration file of transaction 2 is common segment code, and conclude the business 1 and the different piece of configuration file of transaction 2 be individualized content in program code template, each different piece all arranges the mark of property content one by one.
Concrete, after the program code receiving user's input generates request, need call pre-set with this program code generate ask in program code template corresponding to the file type of carrying, wherein, file type is: utilize the program's code file of this program code template generation to be which kind of type, as: configuration file, parameter file of database etc.
S102, acquisition mark corresponding Transaction Information with each respectively.
Concrete, the program code generation method provided in the embodiment of the present application can be utilized automatically to generate and corresponding program code of concluding the business, also namely generate the program's code file corresponding with transaction, as: configuration file, parameter file of database etc.
Concrete, the program code generation method provided in a embodiment of the present application is provided, then generates a program's code file corresponding with transaction.Now be introduced with 1 corresponding configuration file of concluding the business to generate: when need generate with conclude the business 1 corresponding configuration file time, first need to call the program code template corresponding with configuration file (configuration file is the one of file type), and then obtain and each Transaction Information marking corresponding transaction 1 in this program code template respectively.
S103, respectively each Transaction Information is replaced mark generator program code corresponding with it in program code template.
Concrete, when get respectively with each mark corresponding Transaction Information after, mark corresponding with it in the program code template called before respectively each Transaction Information being replaced it, program code template after all having replaced is program's code file, also represents and automatically generates program code.
Concrete, in the program code generation method provided in the embodiment of the present application, step S102 and step S103 can perform once for each mark, what pre-set as called as complete step S101 generates after program code template corresponding to the file type entrained by asking with program code, first the Transaction Information corresponding with it is obtained for a mark in this program code template, and this Transaction Information is replaced this mark, and then obtaining the Transaction Information corresponding with it for next one mark, and this Transaction Information is replaced this mark, repeat said process, until all marks in this program code template are all replaced by corresponding Transaction Information, program code template is now program's code file, also just represent program code automatically to generate.
Concrete, a kind of program code generation method provided in the embodiment of the present application often performs and once all can generate the program code corresponding with transaction with, and then the program code generation method to provide when the embodiment of the present application performs repeatedly, the Mass production of program code can be realized, that is: the program code corresponding with it is generated for different transaction, and also can be different file type for the program code that each exchange generates, and as: configuration file, parameter file of database etc.
Concrete, program code template is profile template.
Concrete, program code template is parameter file of database template.
Below be only the optimal way of the embodiment of the present application, inventor can also arrange arbitrarily the type of this program code template according to the demand of oneself, do not limit at this.
Concrete, step S102, acquisition can be two kinds of modes with each process marking corresponding Transaction Information respectively, specifically refer to following description.
Mode one:
Pre-set Transaction Information table, store in this Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of concluding the business corresponding.
In a kind of program code generation method that the embodiment of the present application provides, be arranged on the mark instruction Transaction Information in program code template, when obtaining with when marking corresponding Transaction Information, only in Transaction Information table, need obtain according to its storage rule the Transaction Information indicated with this mark.
Concrete, the content stored in the Transaction Information table pre-set in the embodiment of the present application is the optimal way of the embodiment of the present application, inventor also can arrange arbitrarily according to the demand of oneself content stored in Transaction Information table, as stored for Transaction Information corresponding to current transaction to be developed according to the storage rule pre-set in the Transaction Information table that only pre-sets at this, do not limit at this.
Mode two:
In a kind of program code generation method that the embodiment of the present application provides, be arranged on the mark instruction address information in program code template, when obtaining with when marking corresponding Transaction Information, only need obtain the Transaction Information corresponding with this mark according to the address information of mark instruction, namely, address information according to mark instruction finds corresponding address, and then obtains the Transaction Information in this address.
The application provides a kind of program code generation method, first the method responds the program code received and generates request, call pre-set generate program code template corresponding to the file type entrained by asking (this program code template comprises the mark of common segment and at least one individualized content) with program code, then obtain and mark corresponding Transaction Information with each respectively, and then respectively each Transaction Information is replaced mark generator program code corresponding with it in program code template, to realize the automatic generation of program code, effectively prevent prior art because needing each development procedure of each transaction in artificial finishing service system one by one, and the problem that the development efficiency caused reduces.
Embodiment two:
The structural representation of a kind of program code generating apparatus that Fig. 2 provides for the embodiment of the present application two.
As shown in Figure 2, this device comprises the call unit 1, acquiring unit 2 and the generation unit 3 that are connected successively, wherein:
Call unit 1, generates request for responding the program code that receives, call pre-set generate program code template corresponding to the file type entrained by asking with program code; Program code template comprises the mark of common segment and at least one individualized content.
Acquiring unit 2, marks corresponding Transaction Information with each respectively for obtaining.
Generation unit 3, for replacing mark generator program code corresponding with it in program code template by each Transaction Information respectively.
Concrete, in a kind of program code generating apparatus that the embodiment of the present application provides, pre-set Transaction Information table, store in Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of conclude the business corresponding, acquiring unit obtains respectively according to storage rule and eachly marks the Transaction Information indicated in Transaction Information table.
Concrete, program code template is profile template.
Concrete, program code template is parameter file of database template.
The application provides a kind of program code generating apparatus, first this device responds the program code received and generates request, call pre-set generate program code template corresponding to the file type entrained by asking (this program code template comprises the mark of common segment and at least one individualized content) with program code, then obtain and mark corresponding Transaction Information with each respectively, and then respectively each Transaction Information is replaced mark generator program code corresponding with it in program code template, to realize the automatic generation of program code, effectively prevent prior art because needing each development procedure of each transaction in artificial finishing service system one by one, and the problem that the development efficiency caused reduces.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For device disclosed in embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates see method part.
Below be only the preferred implementation of the application, those skilled in the art understood or realizes the application.To be apparent to one skilled in the art to the multiple amendment of these embodiments, General Principle as defined herein when not departing from the spirit or scope of the application, can realize in other embodiments.Therefore, the application can not be restricted to these embodiments shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (10)
1. a program code generation method, is characterized in that, comprising:
Respond the program code that receives and generate request, call pre-set generate program code template corresponding to the file type entrained by asking with described program code; Described program code template comprises the mark of common segment and at least one individualized content;
Obtain and describedly mark corresponding Transaction Information with each respectively;
Respectively each described Transaction Information is replaced mark generator program code corresponding with it in described program code template.
2. method according to claim 1, is characterized in that, pre-sets Transaction Information table, store in described Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of concluding the business corresponding,
Described acquisition describedly marks corresponding Transaction Information with each and comprises respectively:
Obtain the Transaction Information of each described mark instruction respectively according to described storage rule in described Transaction Information table.
3. method according to claim 1, is characterized in that, described acquisition describedly marks corresponding Transaction Information with each and comprises respectively:
The address information of each described mark instruction is utilized to obtain the Transaction Information corresponding with this mark respectively.
4. the method according to claim 1-3 any one, is characterized in that, described program code template is profile template.
5. the method according to claim 1-3 any one, is characterized in that, described program code template is parameter file of database template.
6. a program code generating apparatus, is characterized in that, comprising:
Call unit, generates request for responding the program code that receives, call pre-set generate program code template corresponding to the file type entrained by asking with described program code; Described program code template comprises the mark of common segment and at least one individualized content;
Acquiring unit, describedly marks corresponding Transaction Information with each respectively for obtaining;
Generation unit, for replacing mark generator program code corresponding with it in described program code template by each described Transaction Information respectively.
7. device according to claim 6, is characterized in that, pre-sets Transaction Information table, store in described Transaction Information table according to the storage rule that pre-sets store respectively with each each Transaction Information of concluding the business corresponding,
Described acquiring unit obtains the Transaction Information of each described mark instruction respectively in described Transaction Information table according to described storage rule.
8. device according to claim 6, is characterized in that, described acquiring unit utilizes the address information of each described mark instruction to obtain the Transaction Information corresponding with this mark respectively.
9. the device according to claim 6-8 any one, is characterized in that, described program code template is profile template.
10. the device according to claim 6-8 any one, is characterized in that, described program code template is parameter file of database template.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410641389.8A CN104317604A (en) | 2014-11-13 | 2014-11-13 | Program code generating method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410641389.8A CN104317604A (en) | 2014-11-13 | 2014-11-13 | Program code generating method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104317604A true CN104317604A (en) | 2015-01-28 |
Family
ID=52372839
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410641389.8A Pending CN104317604A (en) | 2014-11-13 | 2014-11-13 | Program code generating method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104317604A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354492A (en) * | 2016-08-23 | 2017-01-25 | 深圳Tcl智能家庭科技有限公司 | Automatic code generation method and system capable of rapidly adjusting transaction process connection |
CN107918863A (en) * | 2017-10-19 | 2018-04-17 | 阿里巴巴集团控股有限公司 | Preposition processing and collocation method, device and equipment based on financial product |
CN108153897A (en) * | 2018-01-10 | 2018-06-12 | 中国银行股份有限公司 | A kind of PLSQL program codes generation method and system |
CN109255059A (en) * | 2018-08-31 | 2019-01-22 | 平安科技(深圳)有限公司 | Product basic algorithm determines method, apparatus, computer equipment and storage medium |
CN110851209A (en) * | 2019-11-08 | 2020-02-28 | 北京字节跳动网络技术有限公司 | Data processing method and device, electronic equipment and storage medium |
CN112016912A (en) * | 2020-07-08 | 2020-12-01 | 广州乐摇摇信息科技有限公司 | Service access method, device, storage medium and electronic device |
CN113448642A (en) * | 2020-03-11 | 2021-09-28 | 成都鼎桥通信技术有限公司 | System file access method and device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1864132A (en) * | 2003-08-20 | 2006-11-15 | 日本烟草产业株式会社 | Program generation system, program generation program, and program generation module |
US20080244510A1 (en) * | 2007-03-27 | 2008-10-02 | Microsoft Corporation | Visual creation of object/relational constructs |
CN101446971A (en) * | 2008-12-17 | 2009-06-03 | 腾讯科技(深圳)有限公司 | Method for building content management system and device thereof |
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN103412749A (en) * | 2013-07-29 | 2013-11-27 | 福建联迪商用设备有限公司 | Relational database based code generation method and code generator |
CN103473108A (en) * | 2013-08-12 | 2013-12-25 | 福建富士通信息软件有限公司 | Java code generating method |
-
2014
- 2014-11-13 CN CN201410641389.8A patent/CN104317604A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1864132A (en) * | 2003-08-20 | 2006-11-15 | 日本烟草产业株式会社 | Program generation system, program generation program, and program generation module |
US20080244510A1 (en) * | 2007-03-27 | 2008-10-02 | Microsoft Corporation | Visual creation of object/relational constructs |
CN101446971A (en) * | 2008-12-17 | 2009-06-03 | 腾讯科技(深圳)有限公司 | Method for building content management system and device thereof |
CN103135976A (en) * | 2011-11-30 | 2013-06-05 | 阿里巴巴集团控股有限公司 | Code automatic generation method and device |
CN103412749A (en) * | 2013-07-29 | 2013-11-27 | 福建联迪商用设备有限公司 | Relational database based code generation method and code generator |
CN103473108A (en) * | 2013-08-12 | 2013-12-25 | 福建富士通信息软件有限公司 | Java code generating method |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106354492A (en) * | 2016-08-23 | 2017-01-25 | 深圳Tcl智能家庭科技有限公司 | Automatic code generation method and system capable of rapidly adjusting transaction process connection |
CN107918863A (en) * | 2017-10-19 | 2018-04-17 | 阿里巴巴集团控股有限公司 | Preposition processing and collocation method, device and equipment based on financial product |
CN108153897A (en) * | 2018-01-10 | 2018-06-12 | 中国银行股份有限公司 | A kind of PLSQL program codes generation method and system |
CN109255059A (en) * | 2018-08-31 | 2019-01-22 | 平安科技(深圳)有限公司 | Product basic algorithm determines method, apparatus, computer equipment and storage medium |
CN110851209A (en) * | 2019-11-08 | 2020-02-28 | 北京字节跳动网络技术有限公司 | Data processing method and device, electronic equipment and storage medium |
CN110851209B (en) * | 2019-11-08 | 2023-07-21 | 北京字节跳动网络技术有限公司 | Data processing method and device, electronic equipment and storage medium |
CN113448642A (en) * | 2020-03-11 | 2021-09-28 | 成都鼎桥通信技术有限公司 | System file access method and device and electronic equipment |
CN112016912A (en) * | 2020-07-08 | 2020-12-01 | 广州乐摇摇信息科技有限公司 | Service access method, device, storage medium and electronic device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104317604A (en) | Program code generating method and device | |
CN103412868B (en) | Document generates method and device | |
CN110489437A (en) | Distributed transaction processing method, device, computer equipment and storage medium | |
CN104516908A (en) | Database access method and device | |
CN104317749A (en) | Information writing method and device | |
CN104484353A (en) | Data imaging method, data imaging device and database server | |
CN107220376B (en) | Data query method and device | |
CN111767144B (en) | Transaction route determination method, device, equipment and system for transaction data | |
CN102831104A (en) | Method, device and terminal for adjusting terminal word | |
CN104021219A (en) | Method and device for generating data template | |
CN103577165A (en) | Form generation method and form generator | |
CN103677814A (en) | Procedure acquiring method, procedure acquiring device and procedure acquiring system | |
CN105450684A (en) | Cloud computing resource scheduling method and system | |
CN111158800B (en) | Method and device for constructing task DAG based on mapping relation | |
CN109032614A (en) | A kind of system and method for Internet of Things application development and maintenance | |
CN105069059A (en) | Database synchronization method and apparatus | |
CN105094959A (en) | Method and device for providing account checking document | |
CN106375382A (en) | Data distribution method and system, control server and node client | |
CN109697281A (en) | The online method, apparatus and electronic equipment for merging document | |
CN105447068A (en) | SAP system based dynamic report generation method and system | |
CN102752332A (en) | Service activation method and device | |
CN111402058A (en) | Data processing method, device, equipment and medium | |
CN105068793A (en) | Method and apparatus for generating business logic relation diagram and realizing business application | |
CN104199675A (en) | System capable of quick system development based on database parameter utilization | |
CN104735072A (en) | Method and device for logging in user account |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
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: 20150128 |