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

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

Info

Publication number
CN117667038A
CN117667038A CN202311370157.9A CN202311370157A CN117667038A CN 117667038 A CN117667038 A CN 117667038A CN 202311370157 A CN202311370157 A CN 202311370157A CN 117667038 A CN117667038 A CN 117667038A
Authority
CN
China
Prior art keywords
item
project
code
java
response
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
CN202311370157.9A
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202311370157.9A priority Critical patent/CN117667038A/en
Publication of CN117667038A publication Critical patent/CN117667038A/en
Pending legal-status Critical Current

Links

Abstract

The disclosure provides a code generation method, a device, equipment and a storage medium, and relates to the technical field of code generation. The method comprises the following steps: responding to the received operation information of a user, and requesting the node back end to create corresponding items and item files; requesting the java backend to create a data source in response to determining that the project and project file have been created; invoking a java back end to initialize project engineering and assemble codes; in response to determining that the code assembly has been completed, project verification and code export are performed. The code generation method provided by the disclosure realizes front-end and back-end code separation, and is beneficial to secondary development of developers.

Description

Code generation method, device, equipment and storage medium
Technical neighborhood
The disclosure relates to the technical field of code generation, and in particular relates to a code generation method, a code generation device and a storage medium.
Background
The evolution process of the software development technology is the process of continuously reducing the development threshold and improving the development efficiency. From assembly language to high-level language, from high-level language to low-code development platform, the software development threshold is becoming lower and lower. While low code development is an emerging form of development that can effectively remedy the inadequacies of non-professional programmers. With the rapid development of the low-code large screen in recent years, various implementation schemes exist in the industry, and different technical schemes are realized for the basic capabilities of configuration, deployment operation and data visualization of the core functional components.
Disclosure of Invention
The present disclosure provides a code generation method, apparatus, device, and storage medium.
According to a first aspect of the present disclosure, there is provided a code generation method including: responding to the received operation information of a user, and requesting the node back end to create corresponding items and item files; requesting the java backend to create a data source in response to determining that the project and project file have been created; invoking a java back end to initialize project engineering and assemble codes; in response to determining that the code assembly has been completed, project verification and code export are performed.
According to a second aspect of the present disclosure, there is provided a code generating apparatus comprising: the first request module is configured to request the node back end to create corresponding items and item files in response to receiving operation information of a user; a second request module configured to request the java backend to create a data source in response to determining that the project and project file have been created; the calling module is configured to call the java back end to initialize project engineering and assemble codes; and an export module configured to conduct project verification and code export in response to determining that the code assembly has been completed.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform a method as described in any one of the implementations of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements a method as described in any of the implementations of the first aspect.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram to which the present disclosure may be applied;
FIG. 2 is a flow chart of one embodiment of a code generation method according to the present disclosure;
FIG. 3 is a flow chart of another embodiment of a code generation method according to the present disclosure;
FIG. 4 is a flow chart of yet another embodiment of a code generation method according to the present disclosure;
FIG. 5 is a schematic illustration of an application scenario of a code generation method according to the present disclosure;
FIG. 6 is a schematic structural diagram of one embodiment of a code generating apparatus according to the present disclosure;
fig. 7 is a block diagram of an electronic device used to implement a code generation method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
It should be noted that, without conflict, the embodiments of the present disclosure and features of the embodiments may be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 to which embodiments of the code generation methods or code generation apparatus of the present disclosure may be applied.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or transmit information or the like. Various client applications can be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices including, but not limited to, smartphones, tablets, laptop and desktop computers, and the like. When the terminal devices 101, 102, 103 are software, they can be installed in the above-described electronic devices. Which may be implemented as a plurality of software or software modules, or as a single software or software module. The present invention is not particularly limited herein.
The server 105 may provide various services. For example, the server 105 may analyze and process the operation information of the user acquired from the terminal devices 101, 102, 103 and generate a processing result (e.g., code derivation).
The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster formed by a plurality of servers, or as a single server. When server 105 is software, it may be implemented as a plurality of software or software modules (e.g., to provide distributed services), or as a single software or software module. The present invention is not particularly limited herein.
It should be noted that, the code generating method provided in the embodiments of the present disclosure is generally executed by the server 105, and accordingly, the code generating apparatus is generally disposed in the server 105.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a code generation method according to the present disclosure is shown. The code generation method comprises the following steps:
in step 201, in response to receiving the operation information of the user, the node backend is requested to create a corresponding item and item file.
In this embodiment, the execution subject of the code generation method (e.g., the server 105 shown in fig. 1) requests the node backend to create the corresponding item and item file upon receiving the operation information of the user. That is, the front page will display the code generation buttons and the corresponding theme components for the user to click. When the user clicks the code generation button on the page, the execution body receives the operation information of the user, and at this time, the execution body requests the node back end to create the corresponding item and the item file. For example, when the user clicks the code on the front page to generate and select the theme component on the front page, the executing entity may request the node back end to create the item and the item file corresponding to the theme, where the theme represents the item theme, for example, the current item is a parking item, and then the current theme is the parking theme. Optionally, the project file herein generally includes a project topic and a project topic component.
It should be noted that, the node backend is a node. Js backend, which is a JavaScript running environment based on the Chrome V8 engine, and the node backend is used for providing services for the front end.
Step 202, requesting the java backend to create a data source in response to determining that the project and project file have been created.
In this embodiment, the execution body requests the java backend to create a data source when determining that the project and the project file have been created. When the execution body determines that the node back end has completed the creation of the project and the project file, the java back end is requested to create a data source. The java backend is used to provide services to the node backend.
When the execution body determines that the node back end has created and completed the current project and project file (such as project theme and project theme component), the execution body requests the java back end to create a data source, wherein the created data source is to configure the database. The related data of the project is configured in a database, optionally, before the execution main body performs database configuration, the created project, the project theme and the components of the project theme are respectively stored in a project table, a project theme table and a project theme component table corresponding to the java database, and corresponding mapping relations are maintained, so that the front end and the rear end correspond to each other.
And 203, invoking the java back end to initialize project engineering and assemble codes.
In this embodiment, the execution body may call the java backend to perform project engineering initialization and code assembly. The java back end generally performs project engineering initialization according to the project framework, and the java back end generally adopts maven as an engineering framework and an initialization tool, and can introduce dependent packages which are relied on by the front end and the back end through the maven, so that the initial environment is built. Maven is a money management tool software that provides advanced project management tools in addition to featuring program build capabilities. After the project engineering initialization is completed, the execution subject pulls the corresponding codes according to the generated hierarchical relationship, and after the code pulling is completed, the project codes are assembled.
In response to determining that the code assembly is complete, item verification and code export is performed, step 204.
In this embodiment, the execution entity performs project verification and code export when it determines that code assembly is complete. Finally, if the execution body determines that the project code assembly is completed, the execution body performs project verification, that is, the execution body invokes a service to verify an interface in the code, and the like, to verify whether the program code is valid, can run normally, and the like. If the item code is confirmed to pass verification, the item code is exported, and thus the generation and export of the code are completed.
The code generation method provided by the embodiment of the disclosure includes the steps of firstly, responding to receiving operation information of a user, and requesting a node rear end to create a corresponding item and an item file; then, in response to determining that the project and project file have been created, requesting the java backend to create a data source; then, invoking the java back end to initialize project engineering and assemble codes; finally, in response to determining that the code assembly has been completed, project verification and code export are performed. The code generation method in the embodiment can generate and export codes according to the demands of users, namely, front and back end code generation aiming at a privately-owned delivery scene is realized, and the front and back end codes are supported to be exported wholly or respectively.
With continued reference to fig. 3, fig. 3 illustrates a flow 300 of another embodiment of a code generation method according to the present disclosure. The code generation method comprises the following steps:
in response to determining that the user selects the subject component on the front-end page, the node back-end is requested to create a corresponding item and item file, step 301.
In this embodiment, an execution subject of the code generation method (e.g., the server 105 shown in fig. 1) requests a node backend to create a corresponding item and an item file in response to determining that a user selects a theme component on a front-end page, where the item file includes: project topics and components of project topics. That is, when the user clicks the code generation button on the page, the execution body receives the operation information of the user, and at this time, the execution body requests the node back end to create the corresponding item and the item file. Specifically, when the user clicks the code generation button on the front page and selects the theme component on the front page, the execution body requests the node back end to create a project file corresponding to the theme, where the theme represents the project theme, for example, the current project is a parking project, and then the current theme is the parking theme, and the execution body requests the node back end to create the project theme corresponding to the parking theme and the component of the project theme.
In some optional implementations of this embodiment, after step 301, the code generating method further includes: and respectively storing the created items, the item topics and the components of the item topics into corresponding item tables, item topic tables and item topic component tables in the java database.
In this implementation manner, after the executing body creates the item, the item theme and the component of the item theme corresponding to the theme, the created item, the item theme and the component of the item theme are respectively stored in the corresponding item table, the item theme table and the item theme component table in the java database, and the corresponding mapping relationship is maintained, so that the front end and the rear end correspond to each other.
Step 302, in response to determining that the project and project file have been created, generating an interface based on the project code in the front-end page to request the java back-end to perform database configuration.
In this embodiment, when determining that the creation of the project and the project file is completed, the executing host generates an interface based on the project code in the front-end page to request the java back-end to perform database configuration. That is, the executing host accesses the java database based on the interface in the front-end page, and configures the java database based on the item information, so as to configure the relevant data of the item into the database.
In some alternative implementations of the present embodiment, step 302 includes: generating an interface link java database based on item codes in the front-end page; and configuring the java database according to the information of the project.
In this implementation manner, the execution body generates an interface based on the item code in the front-end page to link the java database, that is, accesses the java database through the item code generation interface, configures the java database according to the information of the item, and writes the related information of the item into the java database.
And 303, the neighborhood information and the subdomain information of the project theme are stored in a corresponding neighborhood table and subdomain table in the java database.
In this embodiment, the executing entity may store the neighborhood information and the subdomain information of the project theme in a neighborhood table and a subdomain table corresponding to the java database. The data in the java database is maintained according to the neighborhood and subdomain hierarchical relationship of the project, and the accuracy of the mapping relationship is ensured.
And 304, invoking the java back end to initialize project engineering according to the engineering skeleton.
In this embodiment, the executing host may call the java backend to perform project engineering initialization according to the engineering skeleton. Here, the java backend generally uses maven as an engineering skeleton and an initialization tool, and a dependency package relied on by the front end and the rear end can be introduced through maven, so that the initial environment is built. Maven is a money management tool software that provides advanced project management tools in addition to featuring program build capabilities. The execution body also configures a back-end code template and generates codes by using a FreeMark (FreeMark) framework, wherein FreeMark is a template engine, namely a general tool based on the template and the data to be changed and used for generating output texts (web pages, emails, configuration files, source codes and the like).
Step 305, pulling the code of the item according to the relation among the components, and assembling the code of the item.
In this embodiment, the execution body pulls the code of the item according to the relationship between the components, and assembles the code of the item. After the project engineering initialization is completed, the execution subject pulls the corresponding codes according to the generated hierarchical relationship, and after the code pulling is completed, the project codes are assembled. Thereby ensuring the validity of the generated code.
In response to determining that the code assembly is complete, item verification and code export is performed, step 306.
In this embodiment, the execution entity performs project verification and code export when it determines that code assembly is complete. Step 306 is substantially identical to step 204 of the foregoing embodiment, and specific implementation may refer to the foregoing description of step 204, which is not repeated herein.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the code generating method in this embodiment provides services for the front-end page by the node back-end, and provides services for the node back-end by the java back-end, so that the back-end developer can quickly perform secondary development. In addition, aiming at the project delivery scene, front-end and back-end code is supported to be respectively led out, and the front-end and back-end code separation mode is more beneficial to customized development and code precipitation.
With continued reference to fig. 4, fig. 4 illustrates a flow 400 of yet another embodiment of a code generation method according to the present disclosure. The code generation method comprises the following steps:
in response to determining that the user selects the theme component at the front-end page, the node back-end is requested to create a corresponding item and item file, step 401.
In this embodiment, an execution subject of the code generation method (e.g., the server 105 shown in fig. 1) requests a node backend to create a corresponding item and an item file in response to determining that a user selects a theme component on a front-end page, where the item file includes: project topics and components of project topics. That is, when the user clicks the code generation button on the page, the execution body receives the operation information of the user, and at this time, the execution body requests the node back end to create the corresponding item and the item file. Specifically, when the user clicks the code generation button on the front page and selects the theme component on the front page, the execution body requests the node back end to create a project file corresponding to the theme, where the theme represents the project theme, for example, the current project is a parking project, and then the current theme is the parking theme, and the execution body requests the node back end to create the project theme corresponding to the parking theme and the project theme component.
Step 402, in response to determining that the project and project file have been created, generating an interface based on the project code in the front-end page to request the java backend to perform database configuration.
In this embodiment, when determining that the creation of the project and the project file is completed, the executing host generates an interface based on the project code in the front-end page to request the java back-end to perform database configuration. That is, the executing host accesses the java database based on the interface in the front-end page, and configures the java database based on the item information, so as to configure the relevant data of the item into the database.
And 403, the neighborhood information and the subdomain information of the project theme are stored in a corresponding neighborhood table and subdomain table in the java database.
In this embodiment, the executing entity may store the neighborhood information and the subdomain information of the project theme in a neighborhood table and a subdomain table corresponding to the java database. The data in the java database is maintained according to the neighborhood and subdomain hierarchical relationship of the project, and the accuracy of the mapping relationship is ensured.
Step 404, invoking the java back end to initialize project projects according to the project framework.
In this embodiment, the executing host may call the java backend to perform project engineering initialization according to the engineering skeleton. Here, the java backend generally uses maven as an engineering skeleton and an initialization tool, and a dependency package relied on by the front end and the rear end can be introduced through maven, so that the initial environment is built. Maven is a money management tool software that provides advanced project management tools in addition to featuring program build capabilities. The execution body also configures a back-end code template and generates code using a FreeMarker framework.
Step 405, partitioning the neighborhood table and the sub-domain table based on the relationships between the components.
In this embodiment, the execution body divides the neighborhood table and the sub-domain table based on the relationship between the respective components. That is, the common hierarchical interface may be divided into organization code with component granularity.
Step 406, pulling the codes of the items according to the relation between each component and the neighborhood and subdomain, and assembling the codes of the items.
In this embodiment, the executing body pulls the code of the item according to the relationship between each component and the neighborhood and subdomain, and assembles the code of the item. That is, the execution entity pulls the item codes according to the partitioned hierarchical relationship (i.e. the relationship between each component and the neighborhood, subdomain), and assembles the codes after the pulling is completed. Thereby realizing the pulling and assembling of codes.
In response to determining that the code assembly is complete, step 407, the target service is invoked to verify the running state of the code of the project.
In this embodiment, the executing entity may invoke the target service to verify the running state of the code of the item when determining that the code assembly is completed. That is, if the execution body determines that the project code assembly is completed, the execution body performs project verification, that is, the execution body invokes the target service to verify the interface and the like in the code, to verify whether the execution body is valid, can operate normally, and the like.
In response to determining that the operational status is verified, a code for the item is derived, step 408.
In this embodiment, the executing entity derives the code of the item when it determines that the running state is verified. That is, if the execution subject determines that the item code passes the verification, the execution subject exports the item code, thereby completing the generation and export of the code.
As can be seen from fig. 4, the code generation method in this embodiment highlights the project verification and export steps, thereby ensuring the validity of the exported project code, compared with the corresponding embodiment of fig. 3.
With continued reference to fig. 5, there is shown a schematic view of one application scenario of the code generation method according to the present disclosure. In the application scene, preparation work is firstly carried out, namely, business theme information, business component information, neighborhood information of the theme and subdomain information are placed in a neighborhood table and a subdomain table.
Then, the user performs visual configuration of the project code on the front-end page, including selection, dragging and page configuration of components, for example, the user selects a theme component and page layout, the node back-end creates the project and the components of the project theme and the project theme, stores the project and the components of the project theme into the project table, the project theme table and the project theme component table of the java database respectively, and requests the java back-end to create a data source, namely, performs database configuration, but does not include creating dbName (library name).
Then, the node back end requests a selective project code generation interface of the java back end so that the java back end can divide according to the relation between the neighborhood/subdomain and the project components, such as constructing a project subject BO (Business Object) list and constructing a Business subject BO list.
Then, the java backend performs project engineering initialization according to the skeleton, where multiple threads may be initialized, for example, initializing thread 1: initializing engineering 1; initializing thread 2: initializing engineering 2; initializing thread 3: and initializing engineering 3.
And pulling the component codes by the java back end according to the relation between the project components and the subdomain neighborhood for each initialization thread, and assembling the codes. After the code assembly is completed, project verification and code export are performed.
That is, initializing thread 1 corresponds to pulling thread 1: the subject 1 component code is pulled, then the code is assembled, project validated, and the code exported.
That is, initializing thread 2 corresponds to pulling thread 2: the subject 2 component code is pulled, then the code is assembled, project validated, and the code exported.
That is, initializing thread 3 corresponds to pulling thread 3: the subject 3 component code is pulled, then the code is assembled, project validated, and the code exported.
Thereby realizing the pulling and exporting of the code.
With further reference to fig. 6, as an implementation of the method shown in the foregoing figures, the present disclosure provides an embodiment of a code generating apparatus, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 6, the code generating apparatus 600 of the present embodiment includes: a first request module 601, a second request module 602, a calling module 603 and an exporting module 604. Wherein, the first request module 601 is configured to request the node back end to create a corresponding item and an item file in response to receiving operation information of a user; a second request module 602 configured to request the java backend to create a data source in response to determining that the project and project file have been created; the calling module 603 is configured to call the java back end to perform project engineering initialization and code assembly; the export module 604 is configured to perform project verification and code export in response to determining that the code assembly has been completed.
In the present embodiment, in the code generation apparatus 600: the specific processing and the technical effects of the first request module 601, the second request module 602, the calling module 603, and the deriving module 604 may refer to the relevant descriptions of steps 201 to 204 in the corresponding embodiment of fig. 2, and are not repeated herein.
In some optional implementations of the present embodiment, the first request module is further configured to: in response to determining that the user selects the theme component at the front-end page, requesting the node backend to create a corresponding item and item file, wherein the item file comprises: item topics and components of item topics; the code generating apparatus 600 further includes: and the storing module is configured to store the created items, the item topics and the components of the item topics into corresponding item tables, item topic tables and item topic component tables in the java database respectively.
In some optional implementations of this embodiment, the second request module includes: and the request submodule is configured to generate an interface based on the project codes in the front-end page to request the java back-end to perform database configuration in response to determining that the project and the project file are created.
In some alternative implementations of the present embodiment the requesting sub-module is further configured to: generating an interface link java database based on item codes in the front-end page; and configuring the java database according to the information of the project.
In some optional implementations of this embodiment, the code generating apparatus 600 further includes: the database falling module is further configured to fall neighborhood information and subdomain information of the project theme into a corresponding neighborhood table and subdomain table in the java database; the calling module comprises: the calling sub-module is configured to call the java back end to initialize project projects according to the project framework; and a pulling submodule configured to pull the code of the item according to the relation between the components and assemble the code of the item.
In some optional implementations of this embodiment, the code generating apparatus 600 further includes: a partitioning module configured to partition the neighborhood table and the sub-domain table based on a relationship between the respective components; and the pull submodule is further configured to: and pulling the codes of the items according to the relation between each component and the neighborhood and subdomain, and assembling the codes of the items.
In some optional implementations of the present embodiment, the export module is further configured to: in response to determining that the code assembly has been completed, invoking a target service to verify the running state of the code of the project; in response to determining that the operational state is verified, a code for the item is derived.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 7 illustrates a schematic block diagram of an example electronic device 700 that may be used to implement embodiments of the present disclosure. 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 processing, cellular telephones, smartphones, wearable devices, 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 disclosure described and/or claimed herein.
As shown in fig. 7, the apparatus 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 may also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in device 700 are connected to I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, etc.; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, an optical disk, or the like; and a communication unit 709 such as a network card, modem, wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The computing unit 701 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the respective methods and processes described above, for example, a code generation method. For example, in some embodiments, the code generation method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 700 via ROM 702 and/or communication unit 709. When a computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the code generation method described above may be performed. Alternatively, in other embodiments, the computing unit 701 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 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.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code 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 this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable 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. 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 a computer 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 pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. 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), and the internet.
Cloud computing (cloud computing) refers to a technical architecture that allows access to a shared physical or virtual resource pool that is elastically extensible through a network, where resources may include servers, operating systems, networks, software, applications, or storage devices, etc., and may be deployed and managed in an on-demand, self-service manner. Through cloud computing technology, high-efficiency and powerful data processing capability can be provided for technical application such as artificial intelligence and blockchain, and model training.
The computer system may include a client and a server. 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 may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
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 recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. Those skilled in the art will appreciate 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 disclosure are intended to be included within the scope of the present disclosure.

Claims (17)

1. A code generation method, comprising:
responding to the received operation information of a user, and requesting the node back end to create corresponding items and item files;
requesting the java backend to create a data source in response to determining that the project and the project file have been created;
invoking the java back end to initialize project engineering and assemble codes;
in response to determining that the code assembly has been completed, project verification and code export are performed.
2. The method of claim 1, wherein the requesting the node backend to create the corresponding item and item file in response to receiving the user's operation information comprises:
in response to determining that the user selects the theme component at the front-end page, requesting the node backend to create a corresponding item and item file, wherein the item file comprises: a project topic and a component of the project topic; and
the method further comprises the steps of:
and respectively storing the created items, the item topics and the components of the item topics into corresponding item tables, item topic tables and item topic component tables in the java database.
3. The method of claim 2, wherein the requesting the java backend to create a data source in response to determining that the project and the project file have been created comprises:
and in response to determining that the project and the project file are created, requesting the java backend to perform database configuration based on a project code generation interface in a front-end page.
4. The method of claim 3, wherein the generating an interface based on the item code in the front-end page requesting the java backend to perform database configuration comprises:
generating an interface link to the java database based on the item codes in the front-end page;
and configuring the java database according to the information of the item.
5. The method of claim 2, further comprising:
the neighborhood information and the subdomain information of the project theme are stored in a database in a corresponding neighborhood table and subdomain table in the java database; and
the step of calling the java backend to perform project engineering initialization and code assembly comprises the following steps:
invoking the java back end to initialize project engineering according to the engineering framework;
and pulling the codes of the items according to the relation among the components, and assembling the codes of the items.
6. The method of claim 5, further comprising:
dividing the neighborhood table and the subdomain table based on the relation among the components; and
the pulling the code of the item according to the relation among the components and assembling the code of the item comprises the following steps:
and pulling codes of the items according to the relation between each component and the neighborhood and subdomain, and assembling the codes of the items.
7. The method of claim 6, wherein the performing project verification and code export in response to determining that the code assembly has been completed comprises:
in response to determining that the code assembly has been completed, invoking a target service to verify the running state of the code of the item;
in response to determining that the operational state is verified, a code for the item is derived.
8. A code generating apparatus comprising:
the first request module is configured to request the node back end to create corresponding items and item files in response to receiving operation information of a user;
a second request module configured to request a java backend to create a data source in response to determining that the project and the project file have been created;
the calling module is configured to call the java back end to perform project engineering initialization and code assembly;
and an export module configured to conduct project verification and code export in response to determining that the code assembly has been completed.
9. The apparatus of claim 8, wherein the first request module is further configured to:
in response to determining that the user selects the theme component at the front-end page, requesting the node backend to create a corresponding item and item file, wherein the item file comprises: item topics and components of item topics; and
the apparatus further comprises:
and the storing module is configured to store the created items, the item topics and the components of the item topics into corresponding item tables, item topic tables and item topic component tables in the java database respectively.
10. The apparatus of claim 9, wherein the second request module comprises:
and the request submodule is configured to request the java back end to perform database configuration based on an item code generation interface in a front end page in response to determining that the item and the item file are created.
11. The apparatus of claim 10, wherein the request submodule is further configured to:
generating an interface link to the java database based on the item codes in the front-end page;
and configuring the java database according to the information of the item.
12. The apparatus of claim 9, further comprising:
the database falling module is further configured to fall neighborhood information and subdomain information of the project theme into a neighborhood table and a subdomain table corresponding to the java database; and
the calling module comprises:
the calling sub-module is configured to call the java back end to initialize project engineering according to the engineering framework;
a pull submodule configured to pull the code of the item according to the relation between the components and assemble the code of the item.
13. The apparatus of claim 12, further comprising:
a partitioning module configured to partition the neighborhood table and the sub-domain table based on a relationship between the respective components; and
the pull submodule is further configured to:
and pulling codes of the items according to the relation between each component and the neighborhood and subdomain, and assembling the codes of the items.
14. The apparatus of claim 13, wherein the export module is further configured to:
in response to determining that the code assembly has been completed, invoking a target service to verify the running state of the code of the item;
in response to determining that the operational state is verified, a code for the item is derived.
15. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-7.
17. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any of claims 1-7.
CN202311370157.9A 2023-10-20 2023-10-20 Code generation method, device, equipment and storage medium Pending CN117667038A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311370157.9A CN117667038A (en) 2023-10-20 2023-10-20 Code generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311370157.9A CN117667038A (en) 2023-10-20 2023-10-20 Code generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117667038A true CN117667038A (en) 2024-03-08

Family

ID=90079749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311370157.9A Pending CN117667038A (en) 2023-10-20 2023-10-20 Code generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117667038A (en)

Similar Documents

Publication Publication Date Title
CN113961351B (en) Distributed training method, device, equipment and storage medium for deep learning model
US11445008B2 (en) Data processing methods, electronic devices, and storage media
CN113342345A (en) Operator fusion method and device of deep learning framework
CN110727434B (en) Rendering method, rendering device, electronic equipment and storage medium
CN114816393B (en) Information generation method, device, equipment and storage medium
CN111709252A (en) Model improvement method and device based on pre-trained semantic model
US10459696B2 (en) Composable action flows
EP3992774A1 (en) Method and device for implementing dot product operation, electronic device, and storage medium
CN112817660B (en) Method, device, equipment and storage medium for expanding applet capability
CN111767059B (en) Deployment method and device of deep learning model, electronic equipment and storage medium
CN112925522A (en) Dependency graph generation method, dependency graph generation device, dependency graph generation apparatus, storage medium, and program product
CN114995719B (en) List rendering method, device, equipment and storage medium
CN117667038A (en) Code generation method, device, equipment and storage medium
US11941055B2 (en) Method and apparatus for graph computing, electronic device and storage medium
CN114661274A (en) Method and device for generating intelligent contract
CN113110920A (en) Operation method, device, equipment and storage medium of block chain system
CN113342413B (en) Method, apparatus, device, medium, and article for processing components
US9800692B2 (en) Expression based declarative data service execution chaining
CN114428646B (en) Data processing method and device, electronic equipment and storage medium
CN113760356B (en) Differential configuration method, device, equipment and medium of program product
CN116561075B (en) Method for generating dynamic link library file, method and device for calling operator
CN113157360B (en) Method, apparatus, device, medium, and article for processing an API
EP3951687A2 (en) Business content output method, apparatus, storage medium and program product
CN114416215A (en) Function calling method and device
CN117742891A (en) Virtual machine creation method, device and equipment with vDPA equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination