CN110955418A - Code generation method and device, computer equipment and storage medium - Google Patents

Code generation method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110955418A
CN110955418A CN201911281397.5A CN201911281397A CN110955418A CN 110955418 A CN110955418 A CN 110955418A CN 201911281397 A CN201911281397 A CN 201911281397A CN 110955418 A CN110955418 A CN 110955418A
Authority
CN
China
Prior art keywords
code
template
filling
target
generating
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
CN201911281397.5A
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.)
China Southern Power Grid Digital Grid Technology Guangdong Co ltd
Original Assignee
China Southern Power Grid Co Ltd
Southern Power Grid Digital Grid Research Institute 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 China Southern Power Grid Co Ltd, Southern Power Grid Digital Grid Research Institute Co Ltd filed Critical China Southern Power Grid Co Ltd
Priority to CN201911281397.5A priority Critical patent/CN110955418A/en
Publication of CN110955418A publication Critical patent/CN110955418A/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

Abstract

The application relates to a code generation method, a code generation device, a computer device and a storage medium. The method comprises the following steps: firstly, determining candidate functional components according to a component selection instruction input by a user on a current interface; then, according to the candidate functional component, a code template list corresponding to the candidate functional component is displayed; wherein the code template list comprises a plurality of code filling templates; finally, generating a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system. The method can greatly improve the efficiency of developing software products.

Description

Code generation method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a code generation method and apparatus, a computer device, and a storage medium.
Background
In the field of computer technology, more and more versatile software products, such as business systems in different fields, have been developed. When different business systems are developed, a large number of similar components (such as tables) and functions (such as save buttons) need to be developed for front-end pages, and the front-end code structures related to the similar components and functions are similar, so that some codes with the same functions can be frequently appeared. Because the codes with the same function are basically the same in the programming logic and the programming method, developers need to repeatedly write a large number of codes with the same logic when writing the codes of the front-end page.
Therefore, the conventional technology is inefficient in developing software products.
Disclosure of Invention
In view of the above, it is necessary to provide a code generation method, apparatus, computer device and storage medium capable of improving efficiency.
In a first aspect, a method for generating a code is provided, the method including:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
generating an object code according to an object code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
In one embodiment, the generating object code according to an object code filling template selected by a user based on the list of code templates includes:
according to the target code filling template, acquiring a template code corresponding to the target code filling template from a template code library;
and generating the object code according to the template code.
In one embodiment, after the obtaining the template code corresponding to the target code filling template from the template code library, the method further includes:
and displaying the template code corresponding to the target code filling template.
In one embodiment, the method further comprises:
and according to the corresponding relation between the different target code filling template identifications and different template codes, establishing the template code base.
In one embodiment, the object code fill template includes a code parameter fill field; the generating of the object code according to the object code filling template selected by the user based on the code template list comprises:
acquiring a code parameter input by a user in the code parameter filling bar;
and generating the object code according to the object code filling template and the code parameter.
In one embodiment, the method further comprises:
and acquiring an object code editing instruction input by a user, wherein the object code editing instruction is used for updating the object code.
In one embodiment, after generating object code according to an object code fill template selected by a user based on the list of code templates, the method further comprises:
and displaying the effect graph of the candidate functional component corresponding to the target code.
In a second aspect, there is provided a code generation apparatus, the apparatus comprising:
the determining module is used for determining candidate functional components according to a component selection instruction input on the current interface by a user;
the first display module is used for displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
the generating module is used for generating target codes according to target code filling templates selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
In a third aspect, a computer device is provided, comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
generating an object code according to an object code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
generating an object code according to an object code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
According to the code generation method, the code generation device, the computer equipment and the storage medium, firstly, candidate functional components are determined according to component selection instructions input by a user on a current interface; then, according to the candidate functional component, a code template list corresponding to the candidate functional component is displayed; wherein the code template list comprises a plurality of code filling templates; finally, generating a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system. According to the code generation method, when a developer writes codes, the developer can obtain the target codes of the corresponding functions only by selecting the code filling templates of the corresponding functions, and repeated writing work is not needed. Therefore, the code generation method provided by the application can greatly improve the efficiency of developing software products.
Drawings
FIG. 1 is a diagram of an application scenario of a code generation method in one embodiment;
FIG. 2 is a flow diagram that illustrates a method for code generation in one embodiment;
FIG. 3 is an interface diagram showing a component selection instruction in one embodiment;
FIG. 4 is an interface diagram that illustrates a list of code templates, a parameter fill bar, and object code, in one embodiment;
FIG. 5 is a flowchart illustrating a method of code generation in one embodiment;
FIG. 6 is a flowchart illustrating a code generation method according to another embodiment;
FIG. 7 is a block diagram showing the structure of a code generating apparatus according to one embodiment;
FIG. 8 is a block diagram showing the construction of a code generating apparatus in another embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The code generation method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 101 communicates with the server 102 via a network. The terminal 101 may send the acquired component selection instruction triggered by the user on the current interface to the server 102, then the server 102 determines a candidate functional component according to the component selection instruction, sends a code template list corresponding to the candidate functional component to the terminal 101, and displays the code template list to the user through the terminal 101. Then, the terminal 101 may send the target code filling template selected by the user based on the code template list to the server 102, and then the server 102 may query the template code library for the target code corresponding to the target code filling template and send the target code to the terminal 101, so that the terminal 101 may present the target code to the user.
It should be noted that the implementation environment related to the present application may only include the terminal 101, and in the case that the implementation environment only includes the terminal 101, the terminal 101 may store a template code library, and after acquiring the component selection instruction input on the current interface by the user, the terminal 101 may determine the candidate functional component according to the component selection instruction. The terminal 101 may then present a code template list corresponding to the candidate functional component to the user, where the code template list includes a plurality of code-filling templates. Next, the terminal 101 may query the corresponding object code from the template code library according to the object code filling template selected by the user based on the code template list, and finally, the terminal 101 may present the object code to the user.
The terminal 101 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 102 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In an embodiment of the present application, as shown in fig. 2, there is provided a code generation method, where an execution subject of the method may be a computer device, including the following steps:
step 201, according to the component selection instruction input by the user on the current interface, determining candidate functional components.
Wherein a component may be understood as an element or an object. In front-end programming, a component may be an element in an interface, e.g., a table, a button, a dialog box, or a clickable link in a front-end interface, etc., may all be referred to as a component. Typically, the basic functions performed by the various components will be different.
In this step, when developing the software application, a developer may preliminarily determine a required component according to an actually required function to be implemented, and use the required component as a candidate functional component. For example, a developer may need to insert a button in the front-end interface, and then may preliminarily determine that the desired function is a button function, and then may input a component selection instruction regarding the button on the current interface of the computer device.
Alternatively, referring to fig. 3, the manner of inputting the component selection instruction by the developer may be directly inputting the corresponding component name in the search box (as indicated by a in fig. 3), or selecting the corresponding component name in the candidate component list (as indicated by C in fig. 3) provided by the computer device, and finally, the developer may confirm the component selection instruction by clicking a confirmation button (as indicated by B in fig. 3).
Step 202, according to the candidate functional component, a code template list corresponding to the candidate functional component is displayed.
In this step, the code template list includes a plurality of code-filling templates. After the user initially selects the candidate functional component, the computer device presents the code template list corresponding to the candidate functional component for the user to further select. Specifically, after the user selects the button assembly, the computer device may present the user with a code template list with more detailed functions corresponding to the button assembly, which is referred to as D in fig. 4, for example, the code template list of the button assembly may include code templates with different functions, such as a save data button code template, a confirm button code template, a return button code template, or a delete button code template.
Optionally, the code template list may show identifiers of different code templates, or may also show keywords of the code templates, as long as the different code templates can be distinguished, which is not limited in this embodiment.
Step 203, generating a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
In this step, after the user selects the corresponding object code filling template from the code template list, the computer device displays the object code corresponding to the object code filling template to the user. In the code template list, a plurality of code filling templates are included, which already include the backbone logical structure of the code. Optionally, an editable part can be reserved in the target code filling template for a user to further edit the code filling template according to actual requirements; default parameter values may also be set for the editable portion without requiring the user to edit again.
In the embodiment of the application, the user can directly utilize the generated target code, and can further edit the generated target code, so that the target code further meets the requirements in actual use.
In practical applications, the object code may be used to implement business functions of the power information system. For example, the object code may be used to generate various page components in a grid status analysis page, a power demand prediction page, a power electricity balance page, an investment estimation and economic evaluation page, a planning project atlas management page, a planning project library management page, a substation location aided design page, and a line selection aided design page in a power information system.
In the code generation method, firstly, candidate functional components are determined according to a component selection instruction input by a user on a current interface; then, according to the candidate functional component, a code template list corresponding to the candidate functional component is displayed; wherein the code template list comprises a plurality of code filling templates; finally, generating a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system. According to the code generation method, when a developer writes codes, the developer can obtain the target codes of the corresponding functions only by selecting the code filling templates of the corresponding functions, and repeated writing work is not needed. Therefore, the code generation method provided by the application can greatly improve the efficiency of developing software products.
In an embodiment of the present application, please refer to fig. 5, further providing a code generating method, which relates to a specific process of generating an object code according to an object code filling template, where an execution subject of the method may be a computer device, and the method includes:
step 301, according to the object code filling template, obtaining a template code corresponding to the object code filling template from a template code library.
In this step, optionally, after the user selects a corresponding target code filling template from the code template list, the computer device may query a template code corresponding to the target code filling template from a pre-stored template code library.
The template code base stores template codes of different functions. Generally, the logic of corresponding code of the same functional component is substantially the same. For example, for a data saving button, the logical structure of the code is generally that data to be saved is checked first, then a background method is called to implement persistence on the data, then a result is fed back to a user operation, and finally a front-end page is refreshed or closed. Therefore, different template codes can be established according to different functions.
Regarding the establishment of the template code base, optionally, the template code base may be established according to the correspondence between different target code filling template identifications and different template codes. The template codes can be classified according to different code functions, and then the backbone logic structure is written for the template codes with different functions. Optionally, when writing the backbone logic structure of the template code, the variables in the template code may be set to be editable, and a vacancy may also be reserved in the template code, so that a user may fill the content according to actual needs. Then, different object codes are set for different template codes to fill in the template identification. And finally, storing the corresponding relation between the different target code filling template identifications and the different template codes into a template code library. Optionally, the user can add a new characteristic template to the template code library in a template self-defining manner, so that more and more templates are continuously expanded into the template code library, and the effect of software asset precipitation is achieved.
Step 302, generating the object code according to the template code.
In the embodiment of the application, the template code base with clear function classification is pre-made, so that when a user selects the target code in the code selection list to fill the template, the template code required by the user can be selected more accurately and clearly.
In this embodiment of the present application, after obtaining the template code corresponding to the target code filling template from the template code library, the method further includes: and displaying the template code corresponding to the target code filling template. Specifically, referring to fig. 4, the computer device may present the template code corresponding to the object code filling template in the area indicated by E in fig. 4.
In the embodiment of the application, the target code filling template comprises a code parameter filling column; referring to fig. 6, step 203 may include:
step 401, acquiring a code parameter input by a user in the code parameter filling bar;
in this step, optionally, a code parameter padding field (indicated as H in fig. 4) may be set in advance for the user to input the code parameter. The user can fill in the parameter fill-in bar with some specific parameters needed for writing the object code.
Step 402, generating the object code according to the object code filling template and the code parameter.
In this step, after the user has filled the corresponding parameters, the target code filling template with the parameters filled is used as the final target code.
Based on the above embodiment, optionally, the user may edit the generated object code. Specifically, the computer device may obtain an object code editing instruction input by a user, where the object code editing instruction is used to update the object code.
Please refer to the reserved blank lines denoted by F and G in fig. 4. Optionally, some blank lines may be reserved in the object code generated by the computer device, so that the user may further edit the generated object code. For example, the user can perform various forms of editing instructions such as whole line insertion or deletion, multiple line insertion or deletion, and blank filling on the reserved blank line of the target code.
In the embodiment of the application, the parameter filling column and the reserved blank line are preset for the user, so that the user can change specific parameters and code details in the target code filling template according to actual requirements, and further, the finally generated target code can better meet the requirements in actual use.
In the embodiment of the application, after the target code is generated according to the target code filling template selected by the user based on the code template list, the effect graph of the candidate functional component corresponding to the target code can be displayed.
In the embodiment of the application, when the target code is displayed, the component effect graph of the front-end page corresponding to the target code can be displayed together. Optionally, based on the above description in the embodiments, the user may fill in the parameters of the object code or edit the generated object code. The method and the device for displaying the component effect diagram of the front-end page can also display the component effect diagram of the front-end page corresponding to the current code in real time when the user fills the parameters of the target code or edits the generated target code.
In the embodiment of the application, the effect diagram of the candidate functional component is displayed in real time, so that the purposes of online arrangement, online operation, real-time presentation of complete front-end service effect and synchronization of development and operation are achieved.
It should be understood that, although the steps in the flowcharts of fig. 2 to 6 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-6 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performing the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
In an embodiment of the present application, as shown in fig. 7, there is provided a code generation apparatus 700 including: a determining module 701, a first displaying module 702 and a generating module 703, wherein:
a determining module 701, configured to determine a candidate functional component according to a component selection instruction input by a user on a current interface;
a first display module 702, configured to display, according to the candidate functional component, a code template list corresponding to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
a generating module 703, configured to generate a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
In this embodiment of the application, the generating module 703 is specifically configured to, according to the target code filling template, obtain a template code corresponding to the target code filling template from a template code library; and generating the object code according to the template code.
In this embodiment of the present application, please refer to fig. 8, another code generating apparatus 800 is provided, where the code generating apparatus 800 includes, in addition to the modules included in the code generating apparatus 700, optionally, the code generating apparatus 800 further includes: a second presentation module 704, a code template library establishing module 705, an obtaining module 706 and a third presentation module 707, wherein:
the second displaying module 704 is configured to display the template code corresponding to the object code filling template after obtaining the template code corresponding to the object code filling template from the template code library.
In this embodiment of the present application, the module library establishing module 705 is configured to establish the template code library according to the correspondence between different object code filling template identifiers and different template codes.
In the embodiment of the application, the target code filling template comprises a code parameter filling column; the generating module 703 is specifically configured to obtain a code parameter input by the user in the code parameter filled column; and generating the object code according to the object code filling template and the code parameter.
In this embodiment of the application, the obtaining module 706 is configured to obtain an object code editing instruction input by a user, where the object code editing instruction is used to update the object code.
In this embodiment of the application, the third presenting module 707 is configured to, after generating an object code according to an object code filling template selected by a user based on the code template list, present an effect diagram of a candidate functional component corresponding to the object code.
For specific limitations of the code generation apparatus, reference may be made to the above limitations of the code generation method, which are not described herein again. The modules in the code generation apparatus can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In the embodiment of the present application, a computer device is provided, where the computer device may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a code generation method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment of the present application, there is provided a computer device including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
generating an object code according to an object code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
The implementation principle and technical effect of the computer device provided in this embodiment are similar to those of the method embodiments described above, and are not described herein again.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
according to the target code filling template, acquiring a template code corresponding to the target code filling template from a template code library; and generating the object code according to the template code.
In this embodiment of the present application, after the template code corresponding to the target code filling template is obtained from the template code library, the processor executes the computer program to further implement the following steps:
and displaying the template code corresponding to the target code filling template.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
and according to the corresponding relation between the different target code filling template identifications and different template codes, establishing the template code base.
In the embodiment of the application, the target code filling template comprises a code parameter filling column; the processor, when executing the computer program, further performs the steps of:
acquiring a code parameter input by a user in the code parameter filling bar; and generating the object code according to the object code filling template and the code parameter.
In the embodiment of the present application, the processor, when executing the computer program, further implements the following steps:
and acquiring an object code editing instruction input by a user, wherein the object code editing instruction is used for updating the object code.
In an embodiment of the application, after generating object code according to an object code filling template selected by a user based on the list of code templates, the processor executes the computer program to further implement the following steps:
and displaying the effect graph of the candidate functional component corresponding to the target code.
In an embodiment of the application, a computer-readable storage medium is provided, on which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the code template list comprises a plurality of code filling templates;
generating an object code according to an object code filling template selected by a user based on the code template list; the object code is used for realizing the business function of the electric power information system.
The implementation principle and technical effect of the computer-readable storage medium provided by this embodiment are similar to those of the above-described method embodiment, and are not described herein again.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
according to the target code filling template, acquiring a template code corresponding to the target code filling template from a template code library; and generating the object code according to the template code.
In the embodiment of the present application, after the template code corresponding to the target code filling template is obtained from the template code library, the computer program further implements the following steps when executed by the processor:
and displaying the template code corresponding to the target code filling template.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
and according to the corresponding relation between the different target code filling template identifications and different template codes, establishing the template code base.
In the embodiment of the application, the target code filling template comprises a code parameter filling column; the computer program when executed by the processor further realizes the steps of:
acquiring a code parameter input by a user in the code parameter filling bar; and generating the object code according to the object code filling template and the code parameter.
In an embodiment of the application, the computer program when executed by the processor further performs the steps of:
and acquiring an object code editing instruction input by a user, wherein the object code editing instruction is used for updating the object code.
In an embodiment of the application, after generating the object code according to the object code filling template selected by the user based on the list of code templates, the computer program when executed by the processor further implements the steps of:
and displaying the effect graph of the candidate functional component corresponding to the target code.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of code generation, the method comprising:
determining candidate functional components according to a component selection instruction input by a user on a current interface;
displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the list of code templates comprises a plurality of code fill templates;
generating a target code according to a target code filling template selected by a user based on the code template list; the object code is used for realizing the service function of the electric power information system.
2. The method of claim 1, wherein generating object codes according to object code populating templates selected by a user based on the list of code templates comprises:
according to the target code filling template, acquiring a template code corresponding to the target code filling template from a template code library;
and generating the target code according to the template code.
3. The method according to claim 2, wherein after the obtaining of the template code corresponding to the target code filling template from the template code library, the method further comprises:
and displaying the template codes corresponding to the target code filling template.
4. A method according to claim 2 or 3, characterized in that the method further comprises:
and according to the corresponding relation between different target code filling template identifications and different template codes, establishing the template code base.
5. The method of claim 1, wherein the object code fill template includes a code parameter fill field; generating the target code according to the target code filling template selected by the user based on the code template list comprises the following steps:
acquiring code parameters input by a user in the code parameter filling bar;
and generating the target code according to the target code filling template and the code parameter.
6. The method of claim 5, further comprising:
and acquiring a target code editing instruction input by a user, wherein the target code editing instruction is used for updating the target code.
7. The method of claim 1, wherein after generating object code according to an object code populating template selected by a user based on the list of code templates, the method further comprises:
and displaying the effect graph of the candidate functional component corresponding to the target code.
8. An apparatus for generating code, the apparatus comprising:
the determining module is used for determining candidate functional components according to a component selection instruction input on the current interface by a user;
the first display module is used for displaying a code template list corresponding to the candidate functional component according to the candidate functional component; wherein the list of code templates comprises a plurality of code fill templates;
the generating module is used for generating target codes according to target code filling templates selected by a user based on the code template list; the object code is used for realizing the service function of the electric power information system.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN201911281397.5A 2019-12-13 2019-12-13 Code generation method and device, computer equipment and storage medium Pending CN110955418A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911281397.5A CN110955418A (en) 2019-12-13 2019-12-13 Code generation method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911281397.5A CN110955418A (en) 2019-12-13 2019-12-13 Code generation method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110955418A true CN110955418A (en) 2020-04-03

Family

ID=69981430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911281397.5A Pending CN110955418A (en) 2019-12-13 2019-12-13 Code generation method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110955418A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111506299A (en) * 2020-04-22 2020-08-07 东莞市盟大塑化科技有限公司 Front-end data verification method and device and computer equipment
CN112130814A (en) * 2020-08-06 2020-12-25 亿存(北京)信息科技有限公司 Project construction method and device and electronic equipment
CN112130829A (en) * 2020-08-25 2020-12-25 广州华多网络科技有限公司 Program development method, device, equipment and storage medium
CN112162743A (en) * 2020-08-24 2021-01-01 西安广和通无线软件有限公司 Driver generation method, device, computer equipment and storage medium
CN112631565A (en) * 2020-12-25 2021-04-09 深圳云之家网络有限公司 Service fusion method and device, computer equipment and storage medium
CN113535141A (en) * 2020-04-16 2021-10-22 浙江大搜车软件技术有限公司 Database operation code generation method and device
CN113626050A (en) * 2021-07-22 2021-11-09 北京金山云网络技术有限公司 Updating method and device of medical application, electronic equipment and storage medium
CN116009852A (en) * 2023-01-18 2023-04-25 深圳前海环融联易信息科技服务有限公司 Code construction method, device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168934A1 (en) * 2005-11-22 2007-07-19 International Business Machines Corporation Integrated code generation for adapter-specific property template
CN108153520A (en) * 2018-03-20 2018-06-12 上海屹通信息科技发展有限公司 Software development methodology and device
CN108345456A (en) * 2018-03-07 2018-07-31 平安普惠企业管理有限公司 Page code generation method, device, computer equipment and storage medium
CN110286896A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Visualizing editing method, device, equipment and storage medium
CN110442329A (en) * 2019-06-26 2019-11-12 平安科技(深圳)有限公司 Generation method, device, storage medium and the computer equipment of code segment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070168934A1 (en) * 2005-11-22 2007-07-19 International Business Machines Corporation Integrated code generation for adapter-specific property template
CN108345456A (en) * 2018-03-07 2018-07-31 平安普惠企业管理有限公司 Page code generation method, device, computer equipment and storage medium
CN108153520A (en) * 2018-03-20 2018-06-12 上海屹通信息科技发展有限公司 Software development methodology and device
CN110442329A (en) * 2019-06-26 2019-11-12 平安科技(深圳)有限公司 Generation method, device, storage medium and the computer equipment of code segment
CN110286896A (en) * 2019-06-28 2019-09-27 百度在线网络技术(北京)有限公司 Visualizing editing method, device, equipment and storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113535141A (en) * 2020-04-16 2021-10-22 浙江大搜车软件技术有限公司 Database operation code generation method and device
CN111506299A (en) * 2020-04-22 2020-08-07 东莞市盟大塑化科技有限公司 Front-end data verification method and device and computer equipment
CN111506299B (en) * 2020-04-22 2023-11-17 东莞盟大集团有限公司 Front-end data verification method and device and computer equipment
CN112130814A (en) * 2020-08-06 2020-12-25 亿存(北京)信息科技有限公司 Project construction method and device and electronic equipment
CN112162743A (en) * 2020-08-24 2021-01-01 西安广和通无线软件有限公司 Driver generation method, device, computer equipment and storage medium
CN112130829A (en) * 2020-08-25 2020-12-25 广州华多网络科技有限公司 Program development method, device, equipment and storage medium
CN112631565A (en) * 2020-12-25 2021-04-09 深圳云之家网络有限公司 Service fusion method and device, computer equipment and storage medium
CN113626050A (en) * 2021-07-22 2021-11-09 北京金山云网络技术有限公司 Updating method and device of medical application, electronic equipment and storage medium
CN116009852A (en) * 2023-01-18 2023-04-25 深圳前海环融联易信息科技服务有限公司 Code construction method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110955418A (en) Code generation method and device, computer equipment and storage medium
CN109901834B (en) Document page generation method, device, computer equipment and storage medium
CN109543162B (en) Multi-chart display method and device for data, computer equipment and storage medium
CN111061475A (en) Software code generation method and device, computer equipment and storage medium
CN109828809B (en) Information visualization method and device for billboard, computer equipment and storage medium
CN109597979B (en) List table generation method and device, computer equipment and storage medium
WO2017063389A1 (en) Document generation method and device
CN112486828A (en) Test case generation method and device, computer equipment and storage medium
CN111666740A (en) Flow chart generation method and device, computer equipment and storage medium
CN109766158A (en) Methods of exhibiting, device, computer equipment and the storage medium of user interface
CN111045707B (en) Method, apparatus, computer device and storage medium for updating applet
CN111596911A (en) Method and device for generating control, computer equipment and storage medium
CN111739136B (en) Rendering method, computer device, and storage medium
CN111309991A (en) Query statement generation method and device and data query method and system
CN110727777A (en) Knowledge graph management method and device, computer equipment and storage medium
CN109542962B (en) Data processing method, data processing device, computer equipment and storage medium
CN109542558B (en) Information visualization method and device for billboard, computer equipment and storage medium
CN112001615A (en) Process creation method, system, computer device, and storage medium
CN110597552B (en) Configuration method, device, equipment and storage medium of project continuous integrated pipeline
CN109871214B (en) Program code generation method, program code generation device, computer device, and storage medium
CN109542559B (en) Billboard card processing method and device, computer equipment and storage medium
CN109656549B (en) Construction method and device of monitoring system, computer equipment and storage medium
CN109213785B (en) List making method and device, computer equipment and storage medium
CN111190574B (en) Method, device, equipment and storage medium for selecting options of multi-stage linkage assembly
CN112162743A (en) Driver generation method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 510000 No. 11 Kexiang Road, Science City, Luogang District, Guangzhou City, Guangdong Province

Applicant after: CHINA SOUTHERN POWER GRID Co.,Ltd.

Applicant after: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

Address before: 510000 No. 11 Kexiang Road, Science City, Luogang District, Guangzhou City, Guangdong Province

Applicant before: CHINA SOUTHERN POWER GRID Co.,Ltd.

Country or region before: China

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.

TA01 Transfer of patent application right

Effective date of registration: 20240325

Address after: Full Floor 14, Unit 3, Building 2, No. 11, Middle Spectra Road, Huangpu District, Guangzhou, Guangdong 510700

Applicant after: China Southern Power Grid Digital Grid Technology (Guangdong) Co.,Ltd.

Country or region after: China

Address before: 510000 No. 11 Kexiang Road, Science City, Luogang District, Guangzhou City, Guangdong Province

Applicant before: CHINA SOUTHERN POWER GRID Co.,Ltd.

Country or region before: China

Applicant before: Southern Power Grid Digital Grid Research Institute Co.,Ltd.