[go: up one dir, main page]

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

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

Info

Publication number
CN117632101A
CN117632101A CN202311695219.3A CN202311695219A CN117632101A CN 117632101 A CN117632101 A CN 117632101A CN 202311695219 A CN202311695219 A CN 202311695219A CN 117632101 A CN117632101 A CN 117632101A
Authority
CN
China
Prior art keywords
target
code
file
template
domain
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
CN202311695219.3A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311695219.3A priority Critical patent/CN117632101A/en
Publication of CN117632101A publication Critical patent/CN117632101A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention discloses a code file generation method, a code file generation device, electronic equipment and a storage medium. The method comprises the following steps: the method comprises the steps of analyzing an instruction generated by a domain driving code triggered by a user to obtain target function information and target interface information corresponding to the instruction; determining an object code template corresponding to the object interface information; and determining a target domain driving code file based on the target interface information, the target code template and the target function information. By the technical scheme of the embodiment of the invention, the accurate selection of the required code template is realized, the modification rate of the code template is reduced, the code file is generated by the selected code template, the condition of manually writing the code file is avoided, and the code file generation efficiency is improved.

Description

Code file generation method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to computer technology, in particular to a code file generation method, a code file generation device, electronic equipment and a storage medium.
Background
As software becomes more diverse, the difficulty of software development becomes greater.
Currently, users typically write codes in a manual writing manner to realize software development. For example, a user writes a code according to his own experience, or the user refers to and references an existing code to modify the code to realize software development.
However, this manual writing method is time-consuming and laborious, and standardized writing of codes cannot be guaranteed, so that written codes cannot be applied.
Disclosure of Invention
The embodiment of the invention provides a code file generation method, a device, electronic equipment and a storage medium, which are used for realizing accurate selection of a required code template, reducing the modification rate of the code template, generating a code file through the selected code template, avoiding the condition of manually writing the code file and improving the code file generation efficiency.
In a first aspect, an embodiment of the present invention provides a code file generating method, including:
the method comprises the steps of analyzing an instruction generated by a domain driving code triggered by a user to obtain target function information and target interface information corresponding to the instruction;
determining an object code template corresponding to the object interface information;
and determining a target domain driving code file based on the target interface information, the target code template and the target function information.
In a second aspect, an embodiment of the present invention further provides a code file generating apparatus, where the apparatus includes:
the information acquisition module is used for acquiring target function information and target interface information corresponding to an instruction generated by a domain driving code triggered by a user through instruction analysis;
an object code template determining module, configured to determine an object code template corresponding to the object interface information;
and the target domain driving code file determining module is used for determining a target domain driving code file based on the target interface information, the target code template and the target function information.
In a third aspect, an embodiment of the present invention further provides an electronic device, including: one or more processors; and a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the code file generation method according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements a code file generating method according to any embodiment of the present invention.
According to the technical scheme, the target function information and the target interface information corresponding to the instruction are obtained by analyzing the instruction generated by the domain driving code triggered by the user; determining an object code template corresponding to the object interface information, thereby realizing accurate selection of the required code template and reducing the modification rate of the code template; and determining a target domain driving code file based on the target interface information, the target code template and the target function information, so that the code file is generated through the selected code template, the condition of manually writing the code file is avoided, and the code file generation efficiency is improved.
Drawings
FIG. 1 is a flowchart of a code file generating method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a code file generating method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a code file generating device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing a code file generating method according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise 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 1
Fig. 1 is a flowchart of a code file generating method according to an embodiment of the present invention, where the method may be performed by a code file generating device, and the code file generating device may be implemented in hardware and/or software, and the code file generating device may be configured in an electronic device. As shown in fig. 1, the method includes:
s110, analyzing the instruction generated by the domain driving code triggered by the user to obtain target function information and target interface information corresponding to the instruction.
The domain driver code may refer to code written based on a domain driver design, among other things. The Domain-Driven Design (DDD) may refer to a Design concept based on model driving, which may use a Domain as a core to analyze a problem in the Domain, divide the problem into a plurality of problem domains, and further abstract the problem domains into a plurality of objects, where the program code implements a program code function through cooperation and invocation between the problem domains and the objects. The target function information may refer to function information that the user needs to implement. The target interface information may refer to a transmission interface set by the user.
Specifically, the user may select or customize the functions to be implemented and the interfaces used to input the code, thereby generating and triggering instructions for domain-driven code generation. And obtaining target function information and target interface information corresponding to the instruction by analyzing the instruction generated by the domain driving code triggered by the user.
S120, determining an object code template corresponding to the object interface information.
Wherein the object code template may refer to a template encoding a function. The target code template may be a pre-set standard code template or a code template written as other functions. For example, in an integrated environment developed by the JAVA programming language, a large number of codes which need to be repeatedly written and pasted manually can be generated based on an object code template in the IDEA plug-in, and meanwhile, the generated code architecture accords with the field driving design, so that the IDEA plug-in can be embedded into the IDEA integrated development environment, the use is convenient, and the code writing efficiency and the research and development efficiency are improved.
Specifically, the target code template which needs to be called by the user is determined by analyzing the target interface information. For example, the target interface type in the target interface information can be resolved, and the target code template required to be called by the user is determined based on the corresponding relation between the preset interface type and the target code template and the target interface type. The target code template identification in the target interface information can be analyzed, and the target code template which needs to be called by the user is determined from the code template library through the identification. The code templates in the code template library may be preset standard code templates. The standard code template can also support a user-defined template, support a plurality of template formats such as XML, EXCEL, TXT and the like, enhance the flexibility of a code generation tool and promote the use experience of a user.
It should be noted that, before the instruction for triggering the code generation, the user may also select a new code, a code architecture migration, or a technology stack transfer. The process of adding code may determine an object code template from a code template library. The process of code architecture migration or technology stacking may determine an object code template from code templates that have been written as other functions. The templated code generation mode based on the IDEA plug-in is not only suitable for incremental code development, but also suitable for stock code migration, so that the stock code enables an output result to be more complete, and logic can be closed-loop.
Illustratively, the object code template includes: at least one of a target interface layer template, a target domain layer template, a target application layer template, and a target infrastructure layer template.
The target interface layer template may be an interface layer template that the user needs to call. The Interface layer (Interface) may be used to receive the information submitted by the user, and send the function execution command to the application layer, so that the application layer executes the function execution command of the user, implements the service logic or the function logic required by the user, and displays the execution result on the front page to feed back to the user. The Application layer (Application) defines the tasks to be completed by the software, is only related to the field, is irrelevant to the service (i.e. the function), and is also suitable for writing some log monitoring, applying pipeline records and the like. The Domain layer (Domain) may be responsible for representing business (i.e., function) concepts and business (i.e., function) rules. This layer implements almost all of the business (i.e., functional) logic, which is the core of the overall code program. An Infrastructure layer (Infrastructure) may be used to provide generic services to other layers, such as tool classes, database support, basic configuration information, etc.
S130, determining a target domain driving code file based on the target interface information, the target code template and the target function information.
The target domain driving code file may refer to a code file composed of a plurality of replaced target codes and having a function required by a user. Specifically, the target interface field is parsed based on the target interface information, and the target function field is parsed based on the target function information. And carrying out replacement processing on the corresponding replaceable target code fields in the target code template based on the target interface fields and the target function fields, determining target codes of which the fields are replaced and conform to functions required by users, and integrating and determining a target domain driving code file based on all the target codes.
According to the technical scheme, the target function information and the target interface information corresponding to the instruction are obtained through instruction analysis on the instruction generated by the domain driving code triggered by the user; determining an object code template corresponding to the object interface information, thereby realizing accurate selection of the required code template and reducing the modification rate of the code template; and determining the target domain driving code file based on the target interface information, the target code template and the target function information, so that the code file is generated through the selected code template, the condition of manually writing the code file is avoided, and the code file generation efficiency is improved.
Based on the technical scheme, the method further comprises the following steps: and storing each target file in the target domain driving code files based on the target file storage position information to generate a target directory for storing the target domain driving code files.
The target file storage location information may be a location preset by a user or a default location. The target file may refer to a code file corresponding to each layer. The target directory may refer to an index outline that facilitates search positioning. The target directory may user characterize the code architecture. The target code architecture corresponding to the target directory accords with the field driving design so as to facilitate the development and maintenance of programs in the future. For example, a directory structure appointed by a user is generated in a file directory appointed by the user, and target files are stored according to the target directory, so that the user can conveniently continue developing or perfecting codes based on the target directory and the stored target files, and further refine the required implementation functions. The target directory may store the packaged target file.
Example two
Fig. 2 is a flowchart of a code file generating method according to a second embodiment of the present invention, where a process of determining a target domain driving code file is described in detail on the basis of the foregoing embodiment. Wherein the explanation of the same or corresponding terms as those of the above embodiments is not repeated herein. As shown in fig. 2, the method includes:
s210, analyzing the instruction generated by the domain driving code triggered by the user to obtain target function information and target interface information corresponding to the instruction.
S220, determining an object code template corresponding to the object interface information.
S230, determining a target interface layer file and a target infrastructure layer file based on the target interface information, the target interface layer template and the target infrastructure layer template.
Specifically, the interface information in the target interface layer template is replaced and determined based on the target interface information to generate a control (Controller) file and a Controller function which accord with the functions required by the user for the interface, and a corresponding interface specification (Swagger) description is configured for the interface to define a request mode and a Uniform Resource Locator (URL). And replacing the interface information in the target infrastructure layer template based on the target interface information to determine a target infrastructure layer file. The benefit of this is that the corresponding common components are generated according to the interface information required by the user and serve as target infrastructure layer files, such as files with common codes, such as error code enumeration class and database-related DAO, entity, myBatis, and the like.
Illustratively, S230 may include: performing field extraction based on the target interface information, and determining a target uploading field and a target returning field; replacing an original interface field and an original function value in a target interface layer template based on a target uploading field and a target returning field to determine a target interface layer file; and replacing the universal interface field in the target infrastructure layer template based on the target upload field and the target return field to determine a target infrastructure layer file. Wherein the target upload field and the target return field may characterize the flow of data as the program code is executed. The original interface field, the original function value and the universal interface field are fields in the target code template which can be replaced based on the function or interface required by the user.
S240, determining a target domain layer file and a target application layer file based on the target function information, the target domain layer template and the target application layer template.
Specifically, the replaceable function information in the target domain layer template is replaced based on the target function information, and the target domain layer file is determined. And replacing the replaceable function information in the target application layer template based on the target function information to determine a target application layer file. And simultaneously, establishing a calling relationship between the target domain layer template and the target application layer template based on the target function information.
Illustratively, S240 may include: performing information analysis based on the target function information to determine target function logic; replacing domain variables, calling interfaces and domain variable functions in a target domain layer template based on target function logic to determine a target domain layer file; determining function call logic corresponding to the domain variable function based on the target function logic and the domain variable function; and replacing the original function calling logic in the target application layer file based on the function calling logic, and determining the target application layer file.
The Domain variable may be a Domain member variable, i.e., a Domain member variable. A member may refer to a sub-domain. The domain variable can realize all functions of the domain, so that definition of the domain variable is required to support not only complete functional flow, but also interaction with a background interface, a database and the like. The call interface may refer to a call interface between each layer and a call interface for accessing a database. The function for calling the interface to interact with the background can be generated according to the document template of the background interface, and the addition, deletion and modification of the database can be generated according to a database table or a DAO file. Domain variable functions may be used to characterize functions of links between domain variables. Function call logic provides services to the interface Controller.
It should be noted that, the user may configure one or more domain functions in the input instruction to determine whether the application layer makes a multi-domain call, or may customize log recording and pipelining at the application layer.
S250, determining a target domain driving code file based on the target interface layer file, the target infrastructure layer file, the target domain layer file and the target application layer file.
Specifically, the target interface layer file, the target infrastructure layer file, the target domain layer file and the target application layer file are built according to code mechanisms corresponding to domain driving designs, and the target domain driving code files are determined.
According to the technical scheme, the target interface layer file and the target infrastructure layer file are determined based on the target interface information, the target interface layer template and the target infrastructure layer template; determining a target domain layer file and a target application layer file based on the target function information, the target domain layer template and the target application layer template; the target domain driving code file is determined based on the target interface layer file, the target infrastructure layer file, the target domain layer file and the target application layer file, so that the target code file corresponding to each layer in the target domain driving code file can be independently generated, the information quantity in a user triggering instruction is minimized, the code file which is in full flow and accords with the domain driving design is generated according to the target code template, the writing of repeated codes is reduced, the maintainability of the codes is improved, and the user can concentrate on the functional logic of the domain layer to further improve the efficiency of code file generation.
Based on the technical scheme, the method further comprises the following steps: if the instructions generated by the domain driving code comprise interactive webpage creation instructions, determining a target page file based on the target page template, the target uploading field and the target returning field.
Wherein the interactive web page creation instruction may refer to a web page creation instruction that invokes a web page development technique (Asynchronous Javascript And XML, AJAX) to create an interactive web page application. AJAX-based users can create a direct, highly available, richer, more dynamic Web user interface that approaches the local desktop application.
Specifically, whether to generate the target page file is determined according to whether to call the AJAX call. The generated target page file may be preprocessed into pages that support the thyeleaf engine and receive the target upload field and the target return field for subsequent functional logic processing. Wherein, the thymeleaf is a modern server-side Java template engine suitable for web pages and independent environments.
It should be noted that, when determining the target page file, a request return Value Object (Value Object, VO) may be generated according to the target upload field and the target return field, and the field is preprocessed to be in hump format, a Swagger description is configured for the field, an attribute Value acquisition function (get function) and an attribute Value definition function (set function) are generated for the field, and a regular check is configured for the field, so as to ensure the accuracy of the field, and support the generation of files with granularity of file catalogues, files with multiple types, functions, and the like, so that the flexibility and the practicability are better. After the request return Value Object (VO) is generated separately, the function's upload and return parameters are generated. Meanwhile, whether the returned class object or the HTML page path is determined according to whether the AJAX call is called or not.
It should be noted that, in this embodiment, the generation of the configuration file and the single measurement file is also included. All functions required to be realized by a user can be integrated into one project, a plurality of configuration files exist in the project, and the configuration files also correspond to a set of general configuration templates, so that the embodiment is also suitable for generating the configuration files and generating the configuration files of environments such as local development, functions, tests, performances and the like, and repeated configuration is reduced. When the interface layer generates the Controller interface, the embodiment can also generate a single test file of the interface in a targeted way based on the target interface information, the target uploading field and the target returning field, thereby reducing the workload of a user and improving the code coverage rate.
The following is an embodiment of a code file generating apparatus provided in an embodiment of the present invention, which belongs to the same inventive concept as the code file generating method of each of the above embodiments, and reference may be made to the embodiment of the code file generating method for details that are not described in detail in the embodiment of the code file generating apparatus.
Example III
Fig. 3 is a schematic structural diagram of a code file generating device according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: an information acquisition module 310, an object code template determination module 320, and an object domain driver code file determination module 330.
The information obtaining module 310 is configured to obtain target function information and target interface information corresponding to an instruction by performing instruction analysis on the instruction generated by the domain driving code triggered by the user; an object code template determination module 320, configured to determine an object code template corresponding to the object interface information; the target domain driver code file determining module 330 is configured to determine a target domain driver code file based on the target interface information, the target code template and the target function information.
According to the technical scheme, the target function information and the target interface information corresponding to the instruction are obtained through instruction analysis on the instruction generated by the domain driving code triggered by the user; determining an object code template corresponding to the object interface information, thereby realizing accurate selection of the required code template and reducing the modification rate of the code template; and determining the target domain driving code file based on the target interface information, the target code template and the target function information, so that the code file is generated through the selected code template, the condition of manually writing the code file is avoided, and the code file generation efficiency is improved.
Optionally, the object code template includes: at least one of a target interface layer template, a target domain layer template, a target application layer template, and a target infrastructure layer template.
Optionally, the target domain driver code file determination module 330 may include:
a first file determination submodule for determining a target interface layer file and a target infrastructure layer file based on the target interface information, the target interface layer template and the target infrastructure layer template;
the second file determining submodule is used for determining a target field layer file and a target application layer file based on the target function information, the target field layer template and the target application layer template;
the target domain driving code file determining sub-module is used for determining the target domain driving code file based on the target interface layer file, the target infrastructure layer file, the target domain layer file and the target application layer file.
Optionally, the first file determination submodule is specifically configured to: performing field extraction based on the target interface information, and determining a target uploading field and a target returning field; replacing an original interface field and an original function value in a target interface layer template based on a target uploading field and a target returning field to determine a target interface layer file; and replacing the universal interface field in the target infrastructure layer template based on the target upload field and the target return field to determine a target infrastructure layer file.
Optionally, the second file determination submodule is specifically configured to: performing information analysis based on the target function information to determine target function logic; replacing domain variables, calling interfaces and domain variable functions in a target domain layer template based on target function logic to determine a target domain layer file; determining function call logic corresponding to the domain variable function based on the target function logic and the domain variable function; and replacing the original function calling logic in the target application layer file based on the function calling logic, and determining the target application layer file.
Optionally, the apparatus further comprises:
and the target page file determining module is used for determining the target page file based on the target page template, the target uploading field and the target returning field if the instructions generated by the domain driving code comprise the interactive webpage creating instructions.
Optionally, the apparatus further comprises:
and the target catalog generation module is used for carrying out storage processing on each target file in the target domain driving code file based on the target file storage position information to generate a target catalog for storing the target domain driving code file.
The code file generating device provided by the embodiment of the invention can execute the code file generating method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the code file generating method.
It should be noted that, in the above embodiment of code file generation, each unit and module included are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present invention.
Example IV
Fig. 4 shows a schematic diagram of the structure 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. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, 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, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may 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.
Various 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, etc.; 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 specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, for example, a code file generation method.
In some embodiments, the code file generation method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the 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 file generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the code file generation method in any other suitable way (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On 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, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out 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 implemented. The computer program may execute entirely on the 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. The 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 portable 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) through 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 may 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 input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background 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 background, 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. The client and server are typically 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 hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A code file generation method, comprising:
the method comprises the steps of analyzing an instruction generated by a domain driving code triggered by a user to obtain target function information and target interface information corresponding to the instruction;
determining an object code template corresponding to the object interface information;
and determining a target domain driving code file based on the target interface information, the target code template and the target function information.
2. The method of claim 1, wherein the object code template comprises: at least one of a target interface layer template, a target domain layer template, a target application layer template, and a target infrastructure layer template.
3. The method of claim 2, wherein the determining a target domain driver code file based on the target interface information, the target code template, and the target function information comprises:
determining a target interface layer file and a target infrastructure layer file based on the target interface information, the target interface layer template and the target infrastructure layer template;
determining a target domain layer file and a target application layer file based on the target function information, the target domain layer template and the target application layer template;
and determining a target domain driving code file based on the target interface layer file, the target infrastructure layer file, the target domain layer file and the target application layer file.
4. The method of claim 3, wherein the determining a target interface layer file and a target infrastructure layer file based on the target interface information, target interface layer template, and target infrastructure layer template comprises:
performing field extraction based on the target interface information, and determining a target uploading field and a target returning field;
replacing an original interface field and an original function value in a target interface layer template based on the target uploading field and the target returning field to determine a target interface layer file;
and replacing a universal interface field in the target infrastructure layer template based on the target uploading field and the target returning field to determine a target infrastructure layer file.
5. The method of claim 3, wherein determining a target domain layer file and a target application layer file based on the target function information, target domain layer template, and target application layer template comprises:
performing information analysis based on the target function information to determine target function logic;
replacing domain variables, calling interfaces and domain variable functions in a target domain layer template based on the target function logic to determine a target domain layer file;
determining function call logic corresponding to the domain variable function based on the target function logic and the domain variable function;
and replacing original function calling logic in the target application layer file based on the function calling logic, and determining the target application layer file.
6. The method according to claim 4, wherein the method further comprises:
if the instructions generated by the domain driving code comprise interactive webpage creation instructions, determining a target page file based on the target page template, the target uploading field and the target returning field.
7. The method according to claim 1, wherein the method further comprises:
and storing each target file in the target domain driving code files based on the target file storage position information to generate a target directory for storing the target domain driving code files.
8. A code file generating apparatus, comprising:
the information acquisition module is used for acquiring target function information and target interface information corresponding to an instruction generated by a domain driving code triggered by a user through instruction analysis;
an object code template determining module, configured to determine an object code template corresponding to the object interface information;
and the target domain driving code file determining module is used for determining a target domain driving code file based on the target interface information, the target code template and the target function information.
9. An electronic device, the electronic device comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the code file generation method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the code file generation method according to any of claims 1-7.
CN202311695219.3A 2023-12-11 2023-12-11 Code file generation method and device, electronic equipment and storage medium Pending CN117632101A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311695219.3A CN117632101A (en) 2023-12-11 2023-12-11 Code file generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311695219.3A CN117632101A (en) 2023-12-11 2023-12-11 Code file generation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117632101A true CN117632101A (en) 2024-03-01

Family

ID=90036231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311695219.3A Pending CN117632101A (en) 2023-12-11 2023-12-11 Code file generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117632101A (en)

Similar Documents

Publication Publication Date Title
WO2021184725A1 (en) User interface test method and apparatus, storage medium, and computer device
EP1622016A2 (en) Method, System, and Apparatus for Providing Access to Workbook Models Through Remote Function Calls
JP2023036681A (en) Task processing method, processing device, electronic equipment, storage medium, and computer program
CN115599769A (en) Data migration method and device, electronic equipment and storage medium
US20180150530A1 (en) Method, Apparatus, Computing Device and Storage Medium for Analyzing and Processing Data
CN117033249A (en) Test case generation method and device, computer equipment and storage medium
CN111444158A (en) Long-short term user portrait generation method, device, equipment and readable storage medium
CN114996557B (en) Service stability determination method, device, equipment and storage medium
CN111159227A (en) Data query method, device, equipment and storage medium
CN115469849B (en) Service processing system, method, electronic equipment and storage medium
CN117632101A (en) Code file generation method and device, electronic equipment and storage medium
CN115033634B (en) Data collection method, device, electronic device and medium
CN116185389A (en) Code generation method and device, electronic equipment and medium
CN115577689A (en) Table component generation method, device, equipment and medium
CN112434018B (en) Report generation method, report generation device, computer equipment and storage medium
CN118295894A (en) Script generation method, script generation device, computing device, script generation system and readable storage medium
CN115328891A (en) Data migration method and device, storage medium and electronic equipment
CN113687881A (en) Metadata calling method and device, electronic equipment and storage medium
CN113138760A (en) Page generation method and device, electronic equipment and medium
CN116301869B (en) Front-end page configuration management and control system, method, equipment and medium
CN118964067B (en) Interaction method, device, equipment and medium of content page and native controller
CN118760569B (en) A log recording method, device, equipment and storage medium
CN118568006B (en) Application interface awakening method, device, equipment, storage medium and program product
CN118796709B (en) UI page testing method, device, equipment, storage medium and product
CN116755684B (en) OAS Schema generation 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