WO2019024543A1 - Code generation method and apparatus, code generator and readable storage medium - Google Patents
Code generation method and apparatus, code generator and readable storage medium Download PDFInfo
- Publication number
- WO2019024543A1 WO2019024543A1 PCT/CN2018/083942 CN2018083942W WO2019024543A1 WO 2019024543 A1 WO2019024543 A1 WO 2019024543A1 CN 2018083942 W CN2018083942 W CN 2018083942W WO 2019024543 A1 WO2019024543 A1 WO 2019024543A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- code
- template
- user
- preset value
- repetitions
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Definitions
- the present application relates to the field of code generation, and in particular, to a code generation method, apparatus, code generator, and computer readable storage medium.
- programmers have a lot of repetitive program code to write during the process of developing a software project.
- it is generally written by a programmer, or generated by an existing code generator.
- the main purpose of the present application is to provide a code generation method, a code generation device, a code generator, and a computer readable storage medium, which are intended to solve the technical problem of long development cycle, complicated operation of generating code, and inflexible operation.
- the present application provides a code generating method, where the method includes:
- the code in the crawl code development system that repeats the number of times greater than or equal to the preset value, and the code whose repetition number is greater than or equal to the preset value is entered into the system, and the step of forming the code template further includes :
- Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- the method further includes:
- the number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- the code in the crawl code development system that repeats the number of times greater than or equal to the preset value, and the code whose repetition number is greater than or equal to the preset value is entered into the system, and the step of forming the code template further includes :
- the user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- the step of copying the code whose number of repetitions is less than a preset value into the generated code template includes:
- the present application further provides a code generating apparatus, where the apparatus includes:
- a capture module configured to capture a code whose number of repetitions is greater than or equal to a preset value in the code development system, and enter the code whose repetition number is greater than or equal to a preset value into the template system to form a code template;
- a receiving module configured to receive a code template path input by the user, extract a corresponding code template according to the code template path, and receive a code that the number of repetitions in the development system input by the user is less than a preset value
- a copy module configured to copy the code whose number of repetitions is less than a preset value into the code generated in the extracted code template.
- the present application further provides a code generator, the code generator comprising a processor and a memory, wherein the memory stores a code generation program; the processor is configured to execute the code generation program, To achieve the following steps:
- the processor is further configured to execute the code generating program to implement the following steps:
- Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- the processor is further configured to execute the code generating program to implement the following steps:
- the number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- the processor is further configured to execute the code generating program to implement the following steps:
- the user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- the processor is further configured to execute the code generating program to implement the following steps:
- the code generation method, the code generation method, the code generator and the computer readable storage medium provided by the application by capturing code in the code development system whose repetition times are greater than or equal to a preset value, and the number of repetitions is greater than or equal to
- the set value code is entered into the template system to form a code template to form a code template; then, the code template path input by the user is received, and the corresponding code template is extracted according to the code template path, and the number of repetitions in the development system receiving the user input is less than The code of the preset value; the code that repeats the number of repetitions less than the preset value is copied into the extracted code template to generate the code, and the user can generate the code without performing complicated operation steps, thereby saving the programmer's human input.
- Improve code generation efficiency and shorten software project development cycle by capturing code in the code development system whose repetition times are greater than or equal to a preset value, and the number of repetitions is greater than or equal to
- the set value code is entered into the template system to
- FIG. 1 is a schematic flow chart of a first embodiment of a code generating method according to the present application.
- FIG. 2 is a schematic flowchart of a second embodiment of a code generating method according to the present application.
- FIG. 3 is a schematic flowchart of a third embodiment of a code generating method according to the present application.
- FIG. 4 is a schematic flowchart of a fourth embodiment of a code generating method according to the present application.
- FIG. 5 is a schematic flowchart of the steps of copying the basic information of the generated required code to the generated code in the extracted code template in the fifth embodiment of the code generating method of the present application;
- FIG. 6 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present application.
- the main solution of the embodiment of the present application is: by crawling the code development system, the code whose repetition number is greater than or equal to the preset value, and the code whose repetition number is greater than or equal to the preset value is entered into the template system to form a code. Forming a code template; then receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code in the development system input by the user that is less than a preset value; and the repetition number is less than The code of the preset value is copied into the extracted code template to generate the code, and the user can generate the code without performing complicated operation steps, thereby saving the programmer's manpower investment, improving the code generation efficiency, and shortening the software project development cycle.
- the embodiment of the present application considers that in the prior art, it is generally written by a programmer, or generated by an existing code generator. Repeated writing by the programmer will lead to a longer software project development cycle, which will increase the programmer's programming burden, and the code generation through the existing code generator can only generate simple code and need to generate relatively complex code. The operation of generating code is complicated, and the operation is not flexible, which is not conducive to user operation.
- the embodiment of the present application provides a code generation method, by capturing a code whose number of repetitions is greater than or equal to a preset value in a code development system, and inputting the code whose repetition number is greater than or equal to a preset value into a template system.
- Forming a code template to form a code template then receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code whose number of repetitions in the development system input by the user is less than a preset value;
- the code that repeats the number of times less than the preset value is copied into the extracted code template to generate the code, and the user can generate the code without performing complicated operation steps, thereby saving the programmer's manpower investment, improving the code generation efficiency, and shortening the software. Project development cycle.
- FIG. 1 is a schematic flowchart of a first embodiment of a code generating method according to the present application.
- the method includes:
- Step S10 capturing a code whose number of repetitions is greater than or equal to a preset value in the code development system, and inputting the code whose repetition number is greater than or equal to the preset value into the template system to form a code template;
- the number of occurrences of each code may be counted in the software project development system, and then the code in the code development system whose repetition number is greater than or equal to the preset value may be captured, and the repetition number is greater than or equal to
- the preset value code is entered into the template system to form a code template; specifically, the generated code template can be a template for converting a string into a certain format, or a code template having a connection database function;
- the preset value can be determined according to the total number of program codes developed by each software project. When the total number of program codes developed by the software project is large, more programs need to be written, and the preset value can be set to a smaller value at this time.
- the process of extracting the code and forming the code template can be completed by the local development device, or can be completed on the external device, and then imported into the local development device.
- Step S20 receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code that the number of repetitions in the development system input by the user is less than a preset value;
- the user can directly input the code template path, and the system can extract the corresponding code template according to the code template path.
- the user can perform the function according to the functions required by the developed software project.
- the code that is not in the code template can be input into the system, and will be developed in the system.
- a code input system that repeats less than the preset value. Therefore, after the code template is extracted, it is also required to receive a code in which the number of repetitions in the development system input by the user is less than a preset value.
- the code template before extracting the code template, the code template can also be extracted by inputting the function to be realized by the developed project.
- Step S30 copying the code whose number of repetitions is less than a preset value to the code generated in the extracted code template.
- copying the code in the development system that is less than the preset value to the extracted code template may generate the code.
- the code generating method in this embodiment captures a code whose number of repetitions is greater than or equal to a preset value in a code development system, and records the code whose repetition number is greater than or equal to a preset value into a template system to form a code template.
- Forming a code template then receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code whose number of repetitions in the development system input by the user is less than a preset value;
- the code of the value is copied into the extracted code template to generate the code, and the user can generate the code without performing complicated operation steps, thereby saving the programmer's manpower investment, improving the code generation efficiency, and shortening the software project development cycle.
- a second embodiment of the code generating method of the present application is proposed based on the first embodiment of the code generating method of the present application.
- step after the step S10 further includes:
- Step S40 Receive a code specification input by a user in a formed code template, where the code specification includes a code vulnerability and a system vulnerability;
- Step S50 automatically generating code to avoid the code vulnerability and system vulnerability according to the code specification.
- the user may further input a code specification into the generated code template, where the code specification includes a code vulnerability and a system vulnerability, and the code vulnerability is a common code vulnerability that has been discovered,
- the latest discovered code vulnerabilities, etc., code vulnerabilities can be manifested in many aspects, the algorithm itself or the code itself may cause code loopholes.
- the specific manifestations of code vulnerabilities mainly include: (1) The validity of the input data is not checked or checked poorly, or the improper handling of buffer vulnerabilities is caused by this problem. For example, when entering a password, the user may enter a long password. If the program is not restricted, it may cause other problems to be overwritten when the password is stored. (2) Code logic design defects or errors are caused by programmers' care or inconsistency.
- the algorithm's own vulnerability algorithm is the premise of security.
- the loophole of the algorithm itself may lead to various problems. For example, using a simpler encryption algorithm may easily lead to information leakage, so it is necessary to prevent code vulnerabilities.
- a common code template for avoiding code vulnerabilities and system vulnerabilities may be extracted in the system, and then the developer needs to perform functions according to the current development project.
- Write personalized code to avoid code vulnerabilities and system vulnerabilities, and then upload them to the system.
- the system receives the personalized code to avoid code vulnerabilities and system vulnerabilities uploaded by users, and copies them to corresponding code vulnerabilities and system vulnerabilities.
- the code for avoiding the code vulnerabilities and system vulnerabilities for the current development project can be automatically generated, thereby preventing potential harm to the program itself, the system or the data due to the inconsistency of the programming itself.
- the code generation method of the embodiment by receiving a code specification input by a user in a generated code template, wherein the code specification includes a code vulnerability and a system vulnerability; and then automatically generating a code vulnerability and system according to the code specification Vulnerability code to prevent potential harm to the program itself, system or data due to poorly designed programming itself.
- a third embodiment of the code generating method of the present application is proposed based on the first embodiment of the code generating method of the present application.
- step after the step S30 further includes:
- Step S60 performing automatic testing on the generated code, and generating a test report
- Step S70 adjusting the code template according to the test report, and updating the adjusted code template
- Step S80 Perform statistics on the number of times the code template is used according to a preset period, generate a usage report, and use the usage report as a reference for generating the code template.
- the generated code may be further tested automatically, whether the test code has a problem, and then a test report is generated, so that the user knows whether the generated code has a problem, and if the generated code has a problem, There is a problem with the code for the user, so that the user can change it.
- the code template can be further adjusted according to the test report, and the adjusted code template is updated to make the code template more precise. Further, the number of times of using each code template may be counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- the code generation method proposed in this embodiment automatically tests the generated code and generates a test report, so that the user knows whether the generated code has a problem and the specific location where the problem occurs; and then performs the code template according to the test report. Adjust, and update the adjusted code template to make the code template more accurate; finally, the number of times the code template is used can be counted according to a preset period, and a usage report is generated to generate the usage report as a code template. reference.
- a fourth embodiment of the code generating method of the present application is proposed based on the first embodiment of the code generating method of the present application.
- step after the step S10 further includes:
- Step S90 receiving a keyword input by the user, and pushing the code template to the user according to the keyword;
- Step S100 monitoring the order in which the user uses the pushed code template, analyzing the relationship between the code templates according to the order in which the user uses the code template, and pushing the associated code template to the user.
- the user in addition to obtaining the code template by directly inputting the code template path, the user can also obtain the code template by inputting the function to be implemented by the developed software project. Therefore, after receiving the keyword input by the user, the received keyword can be matched with the retained code template, and the matched code template is pushed to the user. At the same time, in the process of using the pushed code template, the user can further monitor the order of the user using the pushed code template, and then analyze the relationship between the code templates according to the order of the user using the code template, and push the associated code template to the user to improve The experience of users using code templates.
- the code generating method provided in this embodiment can push the code template to the user according to the keyword by receiving the keyword input by the user; and then monitor the order of the user using the pushed code template, according to the order of the user using the code template. Analyze the relationship between each code template, push the associated code template to the user, and improve the user experience of using the code template.
- a fifth embodiment of the code generating method of the present application is proposed based on any one of the first to fourth embodiments of the code generating method of the present application.
- step S30 includes:
- Step S31 acquiring a corresponding location of the basic information of the generated required code in the code template
- Step S32 copying the basic information for generating the required code to the corresponding location generation code in the code template.
- the embodiment of the present application further provides a code generating apparatus, where the apparatus includes:
- a capture module configured to capture a code whose number of repetitions is greater than or equal to a preset value in the code development system, and enter the code whose repetition number is greater than or equal to a preset value into the template system to form a code template;
- a receiving module configured to receive a code template path input by the user, extract a corresponding code template according to the code template path, and receive a code that the number of repetitions in the development system input by the user is less than a preset value
- a copy module configured to copy the code whose number of repetitions is less than a preset value into the code generated in the extracted code template.
- the embodiment of the present application further provides a code generator.
- the code generator can include a processor 1001, such as a CPU, a network interface 1002, a user interface 1003, and a memory 1004. Connection communication between these components can be achieved via a communication bus.
- the network interface 1002 may optionally include a standard wired interface (for connecting to a wired network), a wireless interface (such as a WI-FI interface, a Bluetooth interface, an infrared interface, etc. for connecting to a wireless network).
- the user interface 1003 can include a display, an input unit such as a keyboard, and the optional user interface 1003 can also include a standard wired interface (eg, for connecting a wired keyboard, a wired mouse, etc.) and/or a wireless interface (eg, Used to connect a wireless keyboard, wireless mouse).
- the memory 1004 may be a high speed RAM memory or a stable memory (non-volatile) Memory), such as disk storage.
- the memory 1004 can also optionally be a storage device independent of the aforementioned processor 1001.
- code generator structure shown in FIG. 6 does not constitute a limitation to the code generator, and may include more or less components than those illustrated, or combine some components or different components. Arrangement.
- an operating system and a code generator program may be included in the memory 1002 as a computer storage medium.
- the operating system is a program that manages the hardware and software resources of the code generator, and supports the running of the code generator program and other software or programs.
- the processor 1001 can be used to execute a code generation program stored in the memory 1002 to implement the following steps:
- processor 1001 can also execute a code generation program stored in the memory 1002 to implement the following steps:
- Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- processor 1001 can also execute a code generation program stored in the memory 1002 to implement the following steps:
- the number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- processor 1001 can also execute a code generation program stored in the memory 1002 to implement the following steps:
- the user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- processor 1001 can also execute a code generation program stored in the memory 1002 to implement the following steps:
- the application provides a computer readable storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the following steps:
- the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
- Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
- the number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
- the user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- the one or more programs may be executed by the one or more processors, and the following steps are also implemented:
- the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
- Implementation Based on such understanding, the technical solution of the present application, which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
- the optical disc includes a number of instructions for causing a terminal device (which may be a cell phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the methods of various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Stored Programmes (AREA)
Abstract
Description
Claims (20)
- 一种代码生成方法,其特征在于,所述方法包括以下步骤: A code generation method, characterized in that the method comprises the following steps:抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到模板系统中,形成代码模板;Grab the code in the code development system that the number of repetitions is greater than or equal to the preset value, and enter the code whose repetition number is greater than or equal to the preset value into the template system to form a code template;接收用户输入的代码模板路径,根据所述代码模板路径,提取对应的代码模板,接收用户输入的开发系统中重复次数小于预设值的代码;Receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code that the number of repetitions in the development system input by the user is less than a preset value;将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码。Copying the code whose number of repetitions is less than the preset value to the code generated in the extracted code template.
- 如权利要求1所述的代码生成方法,其特征在于,所述抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到系统中,形成代码模板的步骤之后还包括:The code generating method according to claim 1, wherein the code in the crawl code development system repeats a number of times greater than or equal to a preset value, and the code whose number of repetitions is greater than or equal to a preset value is entered into In the system, after the step of forming a code template, the method further includes:接收用户在形成的代码模板中输入的代码规范,其中,所述代码规范包括代码漏洞及系统漏洞;Receiving a code specification entered by a user in a formed code template, wherein the code specification includes a code vulnerability and a system vulnerability;根据所述代码规范自动生成避免所述代码漏洞及系统漏洞的代码。Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- 如权利要求1所述的代码生成方法,其特征在于,所述将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码的步骤之后还包括:The code generating method according to claim 1, wherein the step of copying the code whose number of repetitions is less than a preset value to the code generated in the extracted code template further comprises:对生成的代码进行自动测试,并生成测试报告;Automatically test the generated code and generate a test report;根据所述测试报告对代码模板进行调整,并且将调整后的代码模板进行更新;Adjusting the code template according to the test report, and updating the adjusted code template;根据预设的周期对代码模板的使用次数进行统计,生成使用报告,并将所述使用报告作为代码模板生成的参考。 The number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- 如权利要求1所述的代码生成方法,其特征在于,所述抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到系统中,形成代码模板的步骤之后还包括:The code generating method according to claim 1, wherein the code in the crawl code development system repeats a number of times greater than or equal to a preset value, and the code whose number of repetitions is greater than or equal to a preset value is entered into In the system, after the step of forming a code template, the method further includes:接收用户输入的关键词,根据所述关键词向用户推送代码模板;Receiving a keyword input by the user, and pushing the code template to the user according to the keyword;监测用户使用推送的代码模板的先后顺序,根据用户使用代码模板的先后顺序分析各代码模板间的关系,向用户推送关联的代码模板。The user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- 如权利要求1所述的代码生成方法,其特征在于,所述将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码的步骤包括:The code generating method according to claim 1, wherein the step of copying the code whose number of repetitions is less than a preset value to the code generated in the extracted code template comprises:获取所述重复次数小于预设值的代码在代码模板中的对应位置;Obtaining a corresponding position of the code whose number of repetitions is less than a preset value in the code template;将所述重复次数小于预设值的代码复制至代码模板中的对应位置生成代码。Copying the code whose number of repetitions is less than the preset value to the corresponding location generation code in the code template.
- 一种代码生成装置,其特征在于,所述装置包括:A code generating device, characterized in that the device comprises:抓取模块,用于抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到模板系统中,形成代码模板;a capture module, configured to capture a code whose number of repetitions is greater than or equal to a preset value in the code development system, and enter the code whose repetition number is greater than or equal to a preset value into the template system to form a code template;接收模块,用于接收用户输入的代码模板路径,根据所述代码模板路径,提取对应的代码模板,接收用户输入的开发系统中重复次数小于预设值的代码;a receiving module, configured to receive a code template path input by the user, extract a corresponding code template according to the code template path, and receive a code that the number of repetitions in the development system input by the user is less than a preset value;复制模块,用于将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码。And a copy module, configured to copy the code whose number of repetitions is less than a preset value into the code generated in the extracted code template.
- 如权利要求6所述的代码生成装置,其特征在于,所述装置还包括:The code generating apparatus according to claim 6, wherein the apparatus further comprises:接收模块,用于接收用户在形成的代码模板中输入的代码规范,其中,所述代码规范包括代码漏洞及系统漏洞;a receiving module, configured to receive a code specification input by a user in a formed code template, where the code specification includes a code vulnerability and a system vulnerability;生成模块,用于根据所述代码规范自动生成避免所述代码漏洞及系统漏洞的代码。A generating module for automatically generating code to avoid the code vulnerability and system vulnerability according to the code specification.
- 如权利要求6所述的代码生成装置,其特征在于,装置还包括:The code generating apparatus according to claim 6, wherein the apparatus further comprises:自动测试模块,用于对生成的代码进行自动测试,并生成测试报告;An automatic test module for automatically testing the generated code and generating a test report;调整模块,用于根据所述测试报告对代码模板进行调整,并且将调整后的代码模板进行更新;An adjustment module, configured to adjust the code template according to the test report, and update the adjusted code template;统计模块,用于 根据预设的周期对代码模板的使用次数进行统计,生成使用报告,并将所述使用报告作为代码模板生成的参考。Statistics module for The number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- 如权利要求6所述的代码生成装置,其特征在于,所述接收模块还用于:The code generating apparatus according to claim 6, wherein the receiving module is further configured to:接收用户输入的关键词,根据所述关键词向用户推送代码模板;Receiving a keyword input by the user, and pushing the code template to the user according to the keyword;所述装置还包括:The device also includes:监测模块,用于监测用户使用推送的代码模板的先后顺序,根据用户使用代码模板的先后顺序分析各代码模板间的关系,向用户推送关联的代码模板。The monitoring module is configured to monitor the sequence of the user using the pushed code template, analyze the relationship between the code templates according to the order in which the user uses the code template, and push the associated code template to the user.
- 如权利要求6所述的代码生成装置,其特征在于,所述复制模块包括:The code generating apparatus according to claim 6, wherein said copying module comprises:获取单元,用于获取所述重复次数小于预设值的代码在代码模板中的对应位置;An obtaining unit, configured to acquire a corresponding position of the code whose number of repetitions is less than a preset value in a code template;复制单元,用于将所述重复次数小于预设值的代码复制至代码模板中的对应位置生成代码。And a copying unit, configured to copy the code whose number of repetitions is less than a preset value to a corresponding location generation code in the code template.
- 一种代码生成器,其特征在于,所述代码生成器包括处理器及存储器,所述存储器中存储有代码生成程序;所述处理器用于执行所述代码生成程序,以实现以下步骤:A code generator, comprising: a processor and a memory, wherein the memory stores a code generation program; the processor is configured to execute the code generation program to implement the following steps:抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到模板系统中,形成代码模板;Grab the code in the code development system that the number of repetitions is greater than or equal to the preset value, and enter the code whose repetition number is greater than or equal to the preset value into the template system to form a code template;接收用户输入的代码模板路径,根据所述代码模板路径,提取对应的代码模板,接收用户输入的开发系统中重复次数小于预设值的代码;Receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code that the number of repetitions in the development system input by the user is less than a preset value;将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码。Copying the code whose number of repetitions is less than the preset value to the code generated in the extracted code template.
- 如权利要求11所述的代码生成器,其特征在于,所述处理器还用于执行所述代码生成程序,以实现以下步骤:The code generator according to claim 11, wherein said processor is further configured to execute said code generating program to implement the following steps:接收用户在形成的代码模板中输入代码规范,其中,所述代码规范包括代码漏洞及系统漏洞;The receiving user enters a code specification in the formed code template, wherein the code specification includes a code vulnerability and a system vulnerability;根据所述代码规范自动生成避免所述代码漏洞及系统漏洞的代码。Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- 如权利要求11所述的代码生成器,其特征在于,所述处理器还用于执行所述代码生成程序,以实现以下步骤:The code generator according to claim 11, wherein said processor is further configured to execute said code generating program to implement the following steps:对生成的代码进行自动测试,并生成测试报告;Automatically test the generated code and generate a test report;根据所述测试报告对代码模板进行调整,并且将调整后的代码模板进行更新;Adjusting the code template according to the test report, and updating the adjusted code template;根据预设的周期对代码模板的使用次数进行统计,生成使用报告,并将所述使用报告作为代码模板生成的参考。The number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- 如权利要求11所述的代码生成器,其特征在于,所述处理器还用于执行所述代码生成程序,以实现以下步骤:The code generator according to claim 11, wherein said processor is further configured to execute said code generating program to implement the following steps:接收用户输入的关键词,根据所述关键词向用户推送代码模板;Receiving a keyword input by the user, and pushing the code template to the user according to the keyword;监测用户使用推送的代码模板的先后顺序,根据用户使用代码模板的先后顺序分析各代码模板间的关系,向用户推送关联的代码模板。The user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- 如权利要求11所述的代码生成器,其特征在于,所述处理器还用于执行所述代码生成程序,以实现以下步骤:The code generator according to claim 11, wherein said processor is further configured to execute said code generating program to implement the following steps:获取所述重复次数小于预设值的代码在代码模板中的对应位置;Obtaining a corresponding position of the code whose number of repetitions is less than a preset value in the code template;将所述重复次数小于预设值的代码复制至代码模板中的对应位置生成代码。Copying the code whose number of repetitions is less than the preset value to the corresponding location generation code in the code template.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有代码生成程序,所述代码生成程序被处理器执行时实现如下步骤:A computer readable storage medium, wherein the computer readable storage medium stores a code generation program, and when the code generation program is executed by the processor, the following steps are implemented:抓取代码开发系统中重复次数大于或等于预设值的代码,并将所述重复次数大于或等于预设值的代码录入到模板系统中,形成代码模板;Grab the code in the code development system that the number of repetitions is greater than or equal to the preset value, and enter the code whose repetition number is greater than or equal to the preset value into the template system to form a code template;接收用户输入的代码模板路径,根据所述代码模板路径,提取对应的代码模板,接收用户输入的开发系统中重复次数小于预设值的代码;Receiving a code template path input by the user, extracting a corresponding code template according to the code template path, and receiving a code that the number of repetitions in the development system input by the user is less than a preset value;将所述重复次数小于预设值的代码复制至提取到的代码模板中生成代码。Copying the code whose number of repetitions is less than the preset value to the code generated in the extracted code template.
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现以下步骤:The computer readable storage medium of claim 16 wherein said one or more programs are executable by one or more processors and further implementing the steps of:接收用户在形成的代码模板中输入的代码规范,其中,所述代码规范包括代码漏洞及系统漏洞;Receiving a code specification entered by a user in a formed code template, wherein the code specification includes a code vulnerability and a system vulnerability;根据所述代码规范自动生成避免所述代码漏洞及系统漏洞的代码。Code that avoids the code vulnerabilities and system vulnerabilities is automatically generated according to the code specification.
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现以下步骤:The computer readable storage medium of claim 16 wherein said one or more programs are executable by one or more processors and further implementing the steps of:对生成的代码进行自动测试,并生成测试报告;Automatically test the generated code and generate a test report;根据所述测试报告对代码模板进行调整,并且将调整后的代码模板进行更新;Adjusting the code template according to the test report, and updating the adjusted code template;根据预设的周期对代码模板的使用次数进行统计,生成使用报告,并将所述使用报告作为代码模板生成的参考。The number of times the code template is used is counted according to a preset period, a usage report is generated, and the usage report is used as a reference for generating the code template.
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现以下步骤:The computer readable storage medium of claim 16 wherein said one or more programs are executable by one or more processors and further implementing the steps of:接收用户输入的关键词,根据所述关键词向用户推送代码模板;Receiving a keyword input by the user, and pushing the code template to the user according to the keyword;监测用户使用推送的代码模板的先后顺序,根据用户使用代码模板的先后顺序分析各代码模板间的关系,向用户推送关联的代码模板。 The user is monitored by the sequence of the pushed code templates, and the relationship between the code templates is analyzed according to the order in which the user uses the code templates, and the associated code templates are pushed to the user.
- 如权利要求16所述的计算机可读存储介质,其特征在于,所述一个或者多个程序可被一个或者多个处理器执行,还实现以下步骤:The computer readable storage medium of claim 16 wherein said one or more programs are executable by one or more processors and further implementing the steps of:获取所述重复次数小于预设值的代码在代码模板中的对应位置;Obtaining a corresponding position of the code whose number of repetitions is less than a preset value in the code template;将所述重复次数小于预设值的代码复制至代码模板中的对应位置生成代码。 Copying the code whose number of repetitions is less than the preset value to the corresponding location generation code in the code template.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710656395.4 | 2017-08-01 | ||
CN201710656395.4A CN108345453A (en) | 2017-08-01 | 2017-08-01 | Code generating method, code generator and readable storage medium storing program for executing |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019024543A1 true WO2019024543A1 (en) | 2019-02-07 |
Family
ID=62963215
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/083942 WO2019024543A1 (en) | 2017-08-01 | 2018-04-20 | Code generation method and apparatus, code generator and readable storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN108345453A (en) |
WO (1) | WO2019024543A1 (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109254774A (en) * | 2018-08-30 | 2019-01-22 | 郑州云海信息技术有限公司 | The management method and device of code in software development system |
CN109255059A (en) * | 2018-08-31 | 2019-01-22 | 平安科技(深圳)有限公司 | Product basic algorithm determines method, apparatus, computer equipment and storage medium |
CN109375943A (en) * | 2018-10-18 | 2019-02-22 | 中国银行股份有限公司 | A kind of program file generation method and device |
CN110688103B (en) * | 2019-10-10 | 2023-07-04 | 望海康信(北京)科技股份公司 | Code writing method, device, electronic equipment and computer readable storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080313605A1 (en) * | 2007-06-14 | 2008-12-18 | Motorola, Inc. | Development framework for automated data throughput optimization |
CN103150165A (en) * | 2013-03-07 | 2013-06-12 | 中国农业大学 | Frame and method for building outdoor data acquisition program |
CN104267966A (en) * | 2014-10-15 | 2015-01-07 | 北京国双科技有限公司 | Method and device for generating program codes of software |
CN106354492A (en) * | 2016-08-23 | 2017-01-25 | 深圳Tcl智能家庭科技有限公司 | Automatic code generation method and system capable of rapidly adjusting transaction process connection |
CN106469064A (en) * | 2016-09-04 | 2017-03-01 | 深圳市云智易联科技有限公司 | Code generating method and code generating unit |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7392504B2 (en) * | 2002-06-06 | 2008-06-24 | International Business Machines Corporation | System and method for automated source code generation |
-
2017
- 2017-08-01 CN CN201710656395.4A patent/CN108345453A/en active Pending
-
2018
- 2018-04-20 WO PCT/CN2018/083942 patent/WO2019024543A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080313605A1 (en) * | 2007-06-14 | 2008-12-18 | Motorola, Inc. | Development framework for automated data throughput optimization |
CN103150165A (en) * | 2013-03-07 | 2013-06-12 | 中国农业大学 | Frame and method for building outdoor data acquisition program |
CN104267966A (en) * | 2014-10-15 | 2015-01-07 | 北京国双科技有限公司 | Method and device for generating program codes of software |
CN106354492A (en) * | 2016-08-23 | 2017-01-25 | 深圳Tcl智能家庭科技有限公司 | Automatic code generation method and system capable of rapidly adjusting transaction process connection |
CN106469064A (en) * | 2016-09-04 | 2017-03-01 | 深圳市云智易联科技有限公司 | Code generating method and code generating unit |
Also Published As
Publication number | Publication date |
---|---|
CN108345453A (en) | 2018-07-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019024543A1 (en) | Code generation method and apparatus, code generator and readable storage medium | |
WO2019024219A1 (en) | Automatic document generation method and apparatus, automatic document generator and medium | |
WO2018188342A1 (en) | Method, apparatus and device for generating script file, and computer-readable storage medium | |
WO2018107610A1 (en) | Service data processing method, system and device, and computer-readable storage medium | |
WO2018120429A1 (en) | Resource update method, terminal, computer readable storage medium and resource update device | |
WO2017143692A1 (en) | Smart television and voice control method therefor | |
WO2018120457A1 (en) | Data processing method, apparatus, device, and computer readable storage medium | |
WO2018149299A1 (en) | Method of identifying social insurance fraud, device, apparatus, and computer storage medium | |
WO2018149190A1 (en) | Component debugging method, device and apparatus, and computer readable storage medium | |
WO2019037396A1 (en) | Account clearing method, device and equipment and storage medium | |
WO2015158297A1 (en) | Method, apparatus, and system for controlling delivery task in social networking platform | |
WO2019000800A1 (en) | Credential preparation method, apparatus, and device and computer readable storage medium | |
WO2015158219A1 (en) | Remote debugging method and apparatus for mobile terminal | |
WO2019104876A1 (en) | Insurance product pushing method and system, terminal, client terminal, and storage medium | |
WO2017148112A1 (en) | Fingerprint entry method, and terminal | |
WO2018149300A1 (en) | Disease probability detection method, apparatus and device, and computer readable storage medium | |
WO2019100531A1 (en) | Digital signature generation method and device thereof, verification method and device thereof, and storage medium | |
WO2018076569A1 (en) | Electronic control unit-based program flashing method and apparatus | |
WO2019041851A1 (en) | Home appliance after-sales consulting method, electronic device and computer-readable storage medium | |
WO2018188196A1 (en) | Data version control method, data version controller, device and computer-readable storage medium | |
WO2019169814A1 (en) | Method, apparatus and device for automatically generating chinese annotation, and storage medium | |
WO2019000801A1 (en) | Data synchronization method, apparatus, and device, and computer readable storage medium | |
WO2023153818A1 (en) | Method of providing neural network model and electronic apparatus for performing the same | |
WO2019000466A1 (en) | Face recognition method and apparatus, storage medium, and electronic device | |
WO2017032122A1 (en) | Method and apparatus for detecting digital television set |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18842394 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18842394 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04.08.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18842394 Country of ref document: EP Kind code of ref document: A1 |