CN115268880A - Code generation method and device, electronic equipment and storage medium - Google Patents

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

Info

Publication number
CN115268880A
CN115268880A CN202210817393.XA CN202210817393A CN115268880A CN 115268880 A CN115268880 A CN 115268880A CN 202210817393 A CN202210817393 A CN 202210817393A CN 115268880 A CN115268880 A CN 115268880A
Authority
CN
China
Prior art keywords
information
input
target
preset
target information
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
CN202210817393.XA
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.)
Hangzhou Tuya Information Technology Co Ltd
Original Assignee
Hangzhou Tuya Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Tuya Information Technology Co Ltd filed Critical Hangzhou Tuya Information Technology Co Ltd
Priority to CN202210817393.XA priority Critical patent/CN115268880A/en
Publication of CN115268880A publication Critical patent/CN115268880A/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
    • G06F8/33Intelligent editors

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a code generation method, a code generation device, electronic equipment and a storage medium. The method comprises the following steps: responding to information input operation of target information to be input through a command line tool, and acquiring current input information; the target information to be input is determined according to at least one preset information to be input; determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result; and if so, generating target information according to the current input information, and generating a target code according to the target information and a preset template. By operating the technical scheme provided by the embodiment of the invention, the problems that time and labor are wasted and the code generation efficiency is low if a user knows the implementation rules and the constraint conditions in advance when inputting the information required by code generation can be solved. If the user directly inputs information, the problem that the code cannot be correctly generated is possibly caused, and the beneficial effect of improving the accuracy and the efficiency of code generation is achieved.

Description

Code generation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to computer technologies, and in particular, to a code generation method and apparatus, an electronic device, and a storage medium.
Background
In software development, some basic modules and codes of general service functions are generated into a template, and a user inputs a small amount of information to complete generation of the whole basic module or a service function code file.
However, after the code generation is templated, some implementation rules or constraints may exist between the information that needs to be input, and if a user knows the implementation rules and constraints in advance when inputting the information, time and labor are wasted, and the code generation efficiency is low. If the user does not know the implementation rules or constraints to directly input information, the code may not be generated correctly.
Disclosure of Invention
The invention provides a code generation method, a code generation device, electronic equipment and a storage medium, and aims to improve the accuracy and efficiency of code generation.
According to an aspect of the present invention, there is provided a code generation method including:
responding to information input operation of target information to be input through a command line tool, and acquiring current input information; the target information to be input is determined according to at least one preset information to be input;
determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result;
and if so, generating the target information according to the current input information, and generating a target code according to the target information and a preset template.
According to another aspect of the present invention, there is provided a code generating apparatus including:
the current input information acquisition module is used for responding to the information input operation of the target information to be input through a command line tool and acquiring current input information; the target information to be input is determined according to at least one preset information to be input;
the target information generation determining module is used for determining a verification result of the current input information through a preset verification container and determining whether target information is generated according to the verification result;
and the target code generating module is used for generating the target information according to the current input information and generating a target code according to the target information and a preset template if the target information generating and determining module judges that the target information is positive.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the code generation method of any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a code generation method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, the current input information is acquired by responding to the information input operation of the target information to be input through a command line tool; the target information to be input is determined according to at least one preset information to be input; determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result; and if so, generating the target information according to the current input information, and generating a target code according to the target information and a preset template. The problem that if a user knows implementation rules and constraint conditions in advance when inputting information required by code generation, time and labor are wasted and the code generation efficiency is low is solved. If the user does not know the implementation rule or the constraint condition to directly input the information, the problem that the code cannot be correctly generated is possibly caused, and the beneficial effect of improving the accuracy and the efficiency of code generation is achieved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
Fig. 1 is a flowchart of a code generation method according to an embodiment of the present invention;
fig. 2 is a flowchart of a code generation method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a code generation apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," "object," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a code generation method according to an embodiment of the present invention, where this embodiment is applicable to a case where an entire code is generated according to user input information through a command line tool, and the method may be executed by a code generation apparatus according to an embodiment of the present invention, and the apparatus may be implemented by software and/or hardware. Referring to fig. 1, the code generation method provided in this embodiment includes:
step 110, responding to information input operation of target information to be input through a command line tool, and acquiring current input information; the target information to be input is determined according to at least one preset information to be input.
The information input operation may be an operation of inputting information by a user through a command line tool, an information input operation on the target information to be input, or an input operation performed according to an input requirement of the target information to be input. The information input method may be to fill current input information in an input position corresponding to the target information to be input, or to input an entire command line instruction including the current input information, which is not limited in this embodiment. The current input information is information currently input through an input operation.
The target information to be input is necessary information which needs to be input currently for generating the code, and the preset information to be input is necessary information which needs to be input actually for generating the code. For example, the generation of the code actually requires the user to input the preset information to be input ABC, and currently only requires the user to input the target information to be input D, where the target information to be input D may be determined by the preset information to be input ABC.
The target information to be input is determined according to at least one preset information to be input, for example, when the preset information to be input is multiple, the preset information to be input with the association relationship can be merged to obtain the target information to be input; for example, when the preset information to be input is a single piece, the fixed input content of the preset information to be input may be omitted, and only the part to be input, which may have a change, is retained, thereby obtaining the target information to be input.
Optionally, the information such as code generation implementation rules which need to be known by a user originally or constraint conditions between preset information to be input is displayed and shielded in advance through a command line tool, and only description information related to the target information to be input is retained, so that the neatness of the information input interface and the effectiveness of information display of the input interface are improved.
In this embodiment, optionally, before obtaining the current input information in response to an information input operation on the target information to be input through the command line tool, the method further includes:
acquiring an incidence relation between at least two pieces of preset information to be input;
and if the incidence relation meets a preset relation condition, determining incidence information among the preset input information, and determining the target information to be input according to the incidence information.
Acquiring an incidence relation between at least two pieces of preset information to be input, wherein the incidence relation can be determined according to the requirement relation of a preset template on each piece of preset information to be input, for example, if the preset template I and the preset template II both need to acquire preset information to be input A and B to generate codes, the preset information to be input A and B have the incidence relation; the association relationship may also be determined according to a preset relationship between preset information to be input, for example, a preset relationship exists between preset information to be input a and preset information to be input B, for example, a binding relationship exists between the preset information to be input a and the preset information to be input B, that is, the preset information to be input a is input, and the preset information to be input a and the preset information to be input B have an association relationship.
The preset relationship condition is a condition for judging whether the association relationship meets the requirement of extracting the association information among the preset input information, for example, whether the number of preset templates having a demand relationship for each preset information to be input is greater than a preset threshold value is judged, and if so, the association relationship meets the preset relationship condition; or judging whether the relationship type of the preset relationship among the preset information to be input belongs to the preset relationship type, for example, if the relationship type is a binding relationship, the preset relationship condition is satisfied.
And if the association relation meets the preset relation condition, determining association information among the preset input information, wherein the association information can be common information among the preset input information. The target information to be input is determined according to the association information, which may be directly determined as the target information to be input, or may be converted into the target information to be input through a preset rule, which is not limited in this embodiment.
The target information to be input is determined according to the association information between the at least two pieces of preset information to be input, wherein the association relation meets the preset relation condition, so that the obtained target information to be input is simplified information of the at least two pieces of preset information to be input, the effectiveness of generating the target information to be input is improved, a subsequent user does not need to pay attention to the association relation between the preset information to be input when inputting the target information to be input, and the information input efficiency and accuracy are improved.
And 120, determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result.
The verification container is used for verifying current input information needed for generating the target code and is arranged in the command line tool, and illustratively, target information DEF to be input needs to be input for generating the target code, so that the current input information DEF can be verified after a user inputs current input information DEF corresponding to the target information DEF to be input respectively.
Whether the information format, the information type and the like of the current input information are correct can be verified through the preset verification container.
After obtaining the verification result, the verification result may be fed back to the user, which is not limited in this embodiment.
The target information may be configuration information required by a preset template corresponding to the target code. And determining whether to generate the target information according to the verification result, wherein if the verification result is passed, the target information is generated according to the current input information.
And step 130, if yes, generating the target information according to the current input information, and generating a target code according to the target information and a preset template.
If the verification result is that the target information is passed, generating the target information according to the current input information, and converting the current input information into the target information according to the current input information and the preset conversion relation in order to obtain the preset conversion relation between the current input information and the target information. And combining the target information with a preset template to generate a target code, wherein the target code is a finally generated complete code.
In this embodiment, optionally, the generating the target information according to the current input information includes:
acquiring information characteristics of the target information associated with the current input information;
and generating the target information according to the information characteristics and the current input information.
And acquiring the information characteristic of the target information associated with the current input information, wherein the information characteristic of the target information can be the information characteristic specific to the target information. The current input information and the information characteristics can be directly combined to obtain the target information, and the current input information and the information characteristics can also be fused through a preset fusion rule to obtain the target information.
Therefore, a plurality of pieces of target information can be generated by combining one piece of current input information with different information characteristics, the information input efficiency is improved, and the information input experience of a user is improved.
According to the technical scheme provided by the embodiment, the current input information is acquired by responding to the information input operation of the target information to be input through a command line tool; the target information to be input is determined according to at least one piece of preset information to be input, when implementation rules or constraint conditions exist among the preset information to be input, the current input information can be directly input according to the input requirements of the target information to be input, a user does not need to know the implementation rules or the constraint conditions, and the information required to be input by the user is reduced or simplified, so that the information input experience of the user is improved, the accuracy of user information input is improved, and the efficiency of subsequent code generation is improved.
Determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result; and if so, generating target information according to the current input information, and generating a target code according to the target information and a preset template. Therefore, the current input information is checked to judge whether the subsequent code generation step can be carried out or not before the code is generated, the problem that whether the subsequent code generation step can be carried out or not is judged in the code generation process, and the code generation efficiency is reduced is solved.
Example two
Fig. 2 is a flowchart of a code generation method according to a second embodiment of the present invention, and this technical solution is supplementary explained for a process after generating an object code according to the object information and a preset template. Compared with the scheme, the scheme is specifically optimized in that after the target code is generated according to the target information and the preset template, the method further comprises the following steps:
judging whether the target code exists or not;
if yes, displaying the target code, and judging whether to receive the change operation of the target code;
and if so, updating the target code according to the change operation. Specifically, the flowchart of the code generation method is shown in fig. 2:
step 210, responding to an information input operation on target information to be input through a command line tool, and acquiring current input information; the target information to be input is determined according to at least one preset information to be input.
Step 220, determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result.
In this embodiment, optionally, after determining the verification result of the current input information through a preset verification container, the method further includes:
if the verification result is verification failure, acquiring and feeding back failure factors related to the verification result;
and determining the input mode of the next input information of the target information to be input according to the failure factor.
The failure factor may be a cause of failure of the verification result, such as an information format error of the currently input information. The failure factor can be fed back by displaying the failure factor to the user in a preset interface, and simultaneously displaying a correct input requirement, so that the user can input the next input information according to the prompt.
The next input information of the target information to be input may be information that is input again in response to an information input operation of the user on the target information to be input after the verification fails. And determining the input mode of the next input information according to the failure factor, and providing the input position of the target information to be input corresponding to the current input information which fails to be verified again for the user to input the next input information. Exemplarily, the user inputs the current input information ABC, wherein if the verification of the current input information a fails, an input position of the target information a to be input corresponding to the current input information a is provided, so that the user re-inputs the target information a to be input at the input position without re-inputting the target information B to be input and the target information C to be input, which are successfully verified.
When the error is checked, the check error is fed back in time, so that a user can know the check result in time, the input information can be corrected in time, and the efficiency of correcting the information error is improved. And determining the input mode of the next input information of the target information to be input according to the failure factor, and improving the pertinence of information modification, thereby improving the accuracy of information input.
And step 230, if yes, generating the target information according to the current input information, and generating a target code according to the target information and a preset template.
And step 240, judging whether the target code exists.
The determining whether the target code exists may be determining whether a code file identical to the target code exists in the system, and if the code file exists, it indicates that the target code already exists.
If not, judging whether a field editing request of the user for the target code is received, if so, opening a field editor for the user to edit a specific field to obtain a modified target code; if not, the object code in the default format can be directly created in the system. The created or changed target code can be displayed to a user in a preset interface, so that the user can confirm whether the target code is generated accurately.
And step 250, if the target code exists, displaying the target code, and judging whether to receive the change operation of the target code.
And if the object code exists, displaying the object code to the user in a preset interface. And judging whether to receive a change operation on the target code, where the change operation may be issued by clicking the displayed target code by a user, and this embodiment is not limited thereto.
If the change operation of the object code is not received, the existing object code can be directly multiplexed.
And step 260, if the target code is received, updating the target code according to the change operation.
If the change operation of the target code is received, the field editor can be opened for a user to edit a specific field in the target code, so that the content in the target code is changed to update the target code, and the updated target code can be displayed to the user in a preset interface for the user to confirm whether the target code is accurately generated.
The embodiment of the invention displays the existing target code so that the user can know the existence condition of the target code, avoids repeatedly generating the same target code and improves the effectiveness of target code generation. Judging whether to receive the change operation of the displayed object code; if the target code is received, the target code is updated according to the change operation, and the target code can be changed without searching the position of the target code by a user, so that the user can change the code in time when the user wants to change the code, and the change efficiency of the target code is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a code generation apparatus according to a third embodiment of the present invention. The device can be realized by hardware and/or software, can execute the code generation method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. As shown in fig. 3, the apparatus includes:
a current input information obtaining module 310, configured to obtain current input information in response to an information input operation on target information to be input through a command line tool; the target information to be input is determined according to at least one preset information to be input;
a target information generation determining module 320, configured to determine a verification result of the current input information through a preset verification container, and determine whether to generate target information according to the verification result;
and an object code generating module 330, configured to generate the object information according to the current input information if the object information generation determining module determines that the current input information is the input information, and generate an object code according to the object information and a preset template.
On the basis of the above technical solutions, optionally, the object code generating module includes:
an information characteristic acquiring unit configured to acquire an information characteristic of the target information associated with the current input information;
and the target information generating unit is used for generating the target information according to the information characteristics and the current input information.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the incidence relation acquisition module is used for acquiring the incidence relation between at least two pieces of preset information to be input before the current input information acquisition module;
and the target information to be input determining module is used for determining the association information among the preset input information if the association relation meets a preset relation condition, and determining the target information to be input according to the association information.
On the basis of the above technical solutions, optionally, the apparatus further includes:
the code existence judging module is used for judging whether the target code exists after the target code generating module;
a change operation receiving judging module, configured to display the object code and judge whether to receive a change operation on the object code if the code existence judging module judges that the code exists;
and the target code updating module is used for updating the target code according to the change operation if the change operation receiving judging module judges that the target code is received.
On the basis of the above technical solutions, optionally, the apparatus further includes: after the verification result of the current input information is determined through a preset verification container, the method further comprises the following steps:
a failure factor obtaining module, configured to, after the target information generation determination module performs determining of a verification result of the current input information through a preset verification container, obtain and feed back a failure factor associated with the verification result if the verification result is a verification failure;
and the input mode determining module is used for determining the input mode of the next input information of the target information to be input according to the failure factor.
Example four
FIG. 4 illustrates a block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The processor 11 performs the various methods and processes described above, such as the code generation method.
In some embodiments, the code generation method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the code generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the code generation method by any other suitable means (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of code generation, comprising:
responding to information input operation of target information to be input through a command line tool, and acquiring current input information; the target information to be input is determined according to at least one preset information to be input;
determining a verification result of the current input information through a preset verification container, and determining whether target information is generated according to the verification result;
and if so, generating the target information according to the current input information, and generating a target code according to the target information and a preset template.
2. The method of claim 1, wherein generating the target information from the current input information comprises:
acquiring information characteristics of the target information associated with the current input information;
and generating the target information according to the information characteristics and the current input information.
3. The method of claim 1, before acquiring current input information in response to an information input operation on target information to be input through a command line tool, further comprising:
acquiring an incidence relation between at least two pieces of preset information to be input;
and if the association relation meets a preset relation condition, determining association information among the preset input information, and determining the target information to be input according to the association information.
4. The method of claim 1, after generating object code according to the object information and a preset template, further comprising:
judging whether the target code exists or not;
if yes, displaying the target code, and judging whether to receive the change operation of the target code;
and if so, updating the target code according to the change operation.
5. The method of claim 1, after determining the verification result of the current input information through a preset verification container, further comprising:
if the verification result is verification failure, acquiring and feeding back failure factors related to the verification result;
and determining the input mode of the next input information of the target information to be input according to the failure factor.
6. A code generation apparatus, comprising:
the current input information acquisition module is used for responding to the information input operation of the target information to be input through a command line tool and acquiring current input information; the target information to be input is determined according to at least one preset information to be input;
the target information generation determining module is used for determining a checking result of the current input information through a preset checking container and determining whether to generate target information according to the checking result;
and the target code generation module is used for generating the target information according to the current input information and generating a target code according to the target information and a preset template if the target information generation determination module judges that the target information is positive.
7. The apparatus of claim 6, wherein the object code generation module comprises:
an information characteristic acquiring unit configured to acquire an information characteristic of the target information associated with the current input information;
and the target information generating unit is used for generating the target information according to the information characteristics and the current input information.
8. The apparatus of claim 6, further comprising:
the incidence relation acquisition module is used for acquiring the incidence relation between at least two pieces of preset information to be input before the current input information acquisition module;
and the target information to be input determining module is used for determining the association information among the preset input information if the association relation meets a preset relation condition, and determining the target information to be input according to the association information.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the code generation method of any one of claims 1-5.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the code generation method of any one of claims 1 to 5 when executed.
CN202210817393.XA 2022-07-12 2022-07-12 Code generation method and device, electronic equipment and storage medium Pending CN115268880A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210817393.XA CN115268880A (en) 2022-07-12 2022-07-12 Code generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210817393.XA CN115268880A (en) 2022-07-12 2022-07-12 Code generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115268880A true CN115268880A (en) 2022-11-01

Family

ID=83765797

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210817393.XA Pending CN115268880A (en) 2022-07-12 2022-07-12 Code generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115268880A (en)

Similar Documents

Publication Publication Date Title
CN113360144B (en) Auxiliary processing method, device, storage medium and program product for software development
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN115618777A (en) File generation method, device, equipment and storage medium
CN115934550A (en) Test method, test device, electronic equipment and storage medium
CN115268880A (en) Code generation method and device, electronic equipment and storage medium
CN115017047A (en) Test method, system, equipment and medium based on B/S architecture
CN115309658A (en) Test data derivation method, device, equipment and storage medium
CN115269431A (en) Interface testing method and device, electronic equipment and storage medium
CN115309730A (en) Data auditing method and device, electronic equipment and storage medium
CN115081429A (en) Instruction checking method, device, equipment and storage medium
CN115098405B (en) Software product evaluation method and device, electronic equipment and storage medium
CN112347095B (en) Data table processing method, device and server
CN114579438A (en) Interface information detection method, device, equipment and storage medium
CN115686479A (en) File creation method and related device
CN115794255A (en) Data processing method and device, electronic equipment and storage medium
CN116028946A (en) Method, device and equipment for reinforcing server baseline
CN117931155A (en) Code generation method, device, equipment and medium
CN115756575A (en) Submission record acquisition method, device, equipment and storage medium
CN115567624A (en) Message processing method and device, electronic equipment and medium
CN114238149A (en) Batch testing method of accounting system, electronic device and storage medium
CN115131137A (en) Operation risk checking method, device, equipment and storage medium
CN115794131A (en) Method and device for automatically generating thermal deployment program and electronic equipment
CN115525614A (en) Data access method, device, equipment, system and storage medium
CN116483601A (en) Fault diagnosis function version iteration method, device, equipment and storage medium
CN117896373A (en) File uploading method, device, equipment and 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