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

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

Info

Publication number
CN117420992A
CN117420992A CN202311481764.2A CN202311481764A CN117420992A CN 117420992 A CN117420992 A CN 117420992A CN 202311481764 A CN202311481764 A CN 202311481764A CN 117420992 A CN117420992 A CN 117420992A
Authority
CN
China
Prior art keywords
code
target
page
candidate
template
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
CN202311481764.2A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202311481764.2A priority Critical patent/CN117420992A/en
Publication of CN117420992A publication Critical patent/CN117420992A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (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 application relates to a code generation method, a code generation device, computer equipment and a storage medium, which can be used in the field of financial science and technology or other related fields. The method comprises the following steps: responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page; determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier; and generating target codes for constructing the target page according to the code configuration file and the target code template. By adopting the method, the target code for constructing the target page can be more efficiently and accurately generated.

Description

Code generation method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a code generating method, apparatus, computer device, and storage medium, which may be used in the field of financial science and technology or other related fields.
Background
With the vigorous development of the information age, the demand of various industries for various software is increasing, and various software products are also layered endlessly. However, due to the differences in development levels of developers, software products are of poor quality. In the face of huge market demands, how to improve the development efficiency and reduce the development period and development cost becomes the focus of attention of developers and even the whole industry.
In the prior art, the manner in which code is generated to build a desired page is typically written manually by a developer. However, this approach has the problems of higher labor cost, higher accuracy, lower efficiency, etc.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a code generation method, apparatus, computer device, and storage medium that can more efficiently and accurately generate object code for building a target page.
In a first aspect, the present application provides a code generation method, including:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In one embodiment, in response to a page code generation request, obtaining a target function identifier and a code configuration file of a target page includes:
responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party;
and acquiring a target function identification and a code configuration file of the target page according to the input operation of the operation and maintenance party on the code configuration page.
In one embodiment, determining the target code template from the candidate code templates according to the target function identifier based on the correspondence between the candidate code templates and the candidate function identifier comprises:
selecting at least one standby code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
an object code template is generated based on the at least one spare code template.
In one embodiment, generating an object code template from at least one alternate code template includes:
determining calling relations among the standby code templates according to the code configuration files;
and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
In one embodiment, generating object code for building an object page from a code configuration file and an object code template includes:
extracting page content corresponding to the target function identifier from the code configuration file;
and adding the page content into the target code template to obtain target codes for constructing the target page.
In one embodiment, the method further comprises:
running the target code to obtain a target page corresponding to the target code;
displaying a target page to an operation and maintenance party;
and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
In a second aspect, the present application further provides a code generating apparatus, including:
the data acquisition module is used for responding to the page code generation request and acquiring a target function identifier and a code configuration file of a target page;
the template determining module is used for determining target code templates from the candidate code templates according to the target function identifiers based on the corresponding relation between the candidate code templates and the candidate function identifiers;
and the code generation module is used for generating target codes for constructing the target page according to the code configuration file and the target code template.
In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In a fourth aspect, the present application also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
The code generation method, the code generation device, the computer equipment and the storage medium acquire the target function identification and the code configuration file of the target page by responding to the page code generation request; determining a target code template according to the target function identifier based on the corresponding relation between the candidate code template and the candidate function identifier; and generating target codes for constructing the target page according to the code configuration file and the target code template. According to the scheme, the pre-stored candidate code templates are introduced, and the target code templates can be more accurately determined according to the target function identifiers based on the corresponding relation between the candidate code templates and the candidate function identifiers; furthermore, according to the determined target code template and in combination with the code configuration file, the target code for constructing the target page can be generated more efficiently and accurately, and the labor cost is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to the drawings without inventive effort for a person having ordinary skill in the art.
FIG. 1 is an application environment diagram of a code generation method in one embodiment;
FIG. 2 is a flow diagram of a code generation method in one embodiment;
FIG. 3 is a flow diagram of a process for obtaining a target function identification and code configuration file in one embodiment;
FIG. 4 is a flow diagram of determining an object code template in one embodiment;
FIG. 5 is a flow diagram of generating object code in one embodiment;
FIG. 6 is a flow chart of a code generation method according to another embodiment;
FIG. 7 is a block diagram of a code generation apparatus in one embodiment;
FIG. 8 is a block diagram showing the structure of a code generating apparatus in another embodiment;
FIG. 9 is a block diagram showing the construction of a code generating apparatus in yet another embodiment;
FIG. 10 is a block diagram showing the structure of a code generating apparatus in still another embodiment;
FIG. 11 is an internal block diagram of a computer device in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
The code generation method provided by the embodiment of the application can be applied to an application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process, such as target function identification of target pages and data for code configuration files, candidate codes, and the like. The data storage system may be integrated on the server 104 or may be located on a cloud or other network server. Specifically, the operation and maintenance party may initiate a page code generation request to the server 104 through the terminal 102; the server 104 responds to the page code generation request to acquire a target function identification and a code configuration file of a target page; further, determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier; generating target codes for constructing the target page according to the code configuration file and the target code template; further, the target code can be run, a target page is constructed, interaction is carried out between the terminal 102 and the target page through a network, the constructed target page is displayed to the operation and maintenance party by the terminal 102, and feedback information of the operation and maintenance party on the target page of the terminal 102 is obtained; the terminal 102 may feed back information of the operation and maintenance party to the target page to the server 104; after receiving the feedback information, the server 104 may adjust the object code to generate a more accurate object code.
The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices, portable wearable devices, and the internet of things devices may be smart televisions, smart vehicle devices, and the like. The portable wearable device may be a smart watch, smart bracelet, headset, or the like. The server 104 may be implemented as a stand-alone server or as a server cluster of multiple servers.
In an exemplary embodiment, as shown in fig. 2, a code generation method is provided, and an example of application of the method to the server 104 in fig. 1 is described, including the following steps 201 to 203.
Wherein:
s201, responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page.
The page code generation request is a request for generating a target code for constructing a target page, and may be a request initiated by a terminal to a server when the operation and maintenance party has a need of generating the target code, or may be a preset request initiated automatically. The target page is a page to be constructed and can comprise one or more business functions; the target function identifier is an identifier of a function required for constructing a target page, and may be a function name (such as "service function display"), a function number, or one or more. The code configuration file is a configuration file for generating the target code, and can be input by an operation and maintenance party through a terminal or can be prestored.
Optionally, when the occurrence of the page code generation request is detected, in response to the page code generation request, a target function identifier and a code configuration file of a target page stored in advance may be acquired from the data storage system. If the pre-stored target function identification and code configuration file do not exist in the data storage system, the target function identification and code configuration file of the target page can be acquired from the page code generation request input by the operation and maintenance party by interacting with the operation and maintenance party and acquiring the page code generation request initiated by the operation and maintenance party to the server through the terminal.
S202, determining target code templates from the candidate code templates according to the target function identifiers based on the corresponding relation between the candidate code templates and the candidate function identifiers.
The candidate code templates are pre-stored code templates, and the candidate function identifiers are function identifiers possibly required by the pre-stored pages; each candidate code template may correspond to one or more candidate function identities. The target code template is the determined code template for constructing the target page.
Optionally, after the target function identifier and the code configuration file of the target page are obtained, the candidate code template corresponding to the target function identifier can be searched from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier, and then fusion processing is performed on the searched candidate code templates to obtain the target code template.
S203, generating target codes for constructing the target page according to the code configuration file and the target code template.
Optionally, after the target code template is obtained, codes in the code configuration file can be added to code positions corresponding to the target code template according to the code position information in the target code template, so that a target code for constructing the target page is obtained.
The code generation method is used for acquiring the target function identification and the code configuration file of the target page by responding to the page code generation request; determining a target code template according to the target function identifier based on the corresponding relation between the candidate code template and the candidate function identifier; and generating target codes for constructing the target page according to the code configuration file and the target code template. According to the scheme, the pre-stored candidate code templates are introduced, and the target code templates can be more accurately determined according to the target function identifiers based on the corresponding relation between the candidate code templates and the candidate function identifiers; furthermore, according to the determined target code template and in combination with the code configuration file, the target code for constructing the target page can be generated more efficiently and accurately, and the labor cost is reduced.
In an exemplary embodiment, as shown in fig. 3, an implementation manner is provided for the above S201, and steps 301 to 302 may be included. Wherein:
s301, responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party.
The operation and maintenance party is the party with the requirement of generating the target code. The code configuration page is a page for the operation and maintenance party to configure the target code to be generated.
Optionally, when detecting that there is a page code generation request initiated by the operation and maintenance party through the terminal, responding to the page code generation request initiated by the operation and maintenance party, transmitting a code configuration page to the terminal so as to display the code configuration page to the operation and maintenance party through the terminal.
S302, according to the input operation of the operation and maintenance party on the code configuration page, the target function identification and the code configuration file of the target page are obtained.
Optionally, the operation and maintenance party can click on the candidate function identifier provided in the code configuration page through the code configuration page so as to select the target function identifier; when the candidate function identifier provided in the code configuration page does not have the target function identifier, the target function identifier can be input through an identifier input box; further, the operator may input the code configuration file through a file input box provided in the code configuration page. Further, the server can interact with the terminal through the network to obtain the target function identification and the code configuration file of the determined target page by clicking or inputting operation on the code configuration page by the operation and maintenance party.
It can be understood that the target function identification and the code configuration file of the target page can be obtained more flexibly and accurately by interacting with the operation and maintenance party, so that the generated target code can meet the requirement of the operation and maintenance party.
Further, after generating the target code for constructing the target page, the target code can be operated to obtain the target page corresponding to the target code; displaying a target page to an operation and maintenance party; and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
Optionally, after generating the target code for constructing the target page, the generated target code may be run to construct the target page corresponding to the target code; the method comprises the steps of interacting with a terminal through a network, feeding back a constructed target page to the terminal, and displaying the target page to an operation and maintenance party by the terminal; furthermore, the feedback information of the operation and maintenance party on the target page can be obtained, and according to the feedback information, the adjustment position and the specific adjustment operation on the target code are determined, so that the target code is adjusted.
By running the object code, the object page corresponding to the constructed object code is displayed for the operation and maintenance party, and the object code is adjusted according to the feedback information of the operation and maintenance party on the object page, so that flexible interaction with the operation and maintenance party can be realized, and the effect of adjusting the object code can be more accurately achieved.
In order to be able to determine the object code template more accurately, in an exemplary embodiment, as shown in fig. 4, the step S202 may include steps 401 to 402. Wherein:
s401, selecting at least one standby code template from the candidate code templates according to the target function identification based on the corresponding relation between the candidate code templates and the candidate function identification.
The standby code template is a candidate code template corresponding to the target function identifier; one target function identifier may correspond to a plurality of candidate code templates, and one candidate code template may be determined from the plurality of candidate code templates corresponding to the plurality of target function identifiers; in the case that the target function is identified as a plurality of the standby code templates, the standby code templates can be correspondingly also a plurality of the standby code templates.
Optionally, after the target function identifier of the target page is obtained, searching is performed from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifiers, so as to obtain at least one candidate code template corresponding to the target function identifier; further, the candidate code template corresponding to the obtained target function identifier is used as a standby code template.
S402, generating an object code template according to at least one standby code template.
Alternatively, if only one spare code template is obtained, the spare code template may be directly used as the target code template.
If a plurality of standby code templates are obtained, the standby code templates can be spliced to obtain the target code templates. For example, calling relations among the standby code templates can be determined according to the code configuration files; and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
The calling relationship is a relationship called by each standby code template, for example, the standby code template A calls the standby code template B.
Optionally, if a plurality of standby code templates are obtained, a calling relationship between service functions corresponding to each target function identifier may be obtained according to the code configuration file, and the calling relationship is used as a calling relationship between standby code templates corresponding to each target function identifier; furthermore, a calling interface can be set for each standby code template, and fusion processing is carried out on each standby code template through the set calling interface according to the calling relation among the standby code templates, so that the target code template is obtained.
If a plurality of standby code templates are acquired, the standby code templates are fused according to the calling relationship among the standby code templates determined from the code configuration file, so that the effect of the target code template can be obtained effectively and accurately.
It can be appreciated that by introducing the standby code templates selected from the candidate code templates according to the target function identifier based on the correspondence between the candidate code templates and the candidate function identifier, the effect of generating the target code template more efficiently and accurately can be achieved according to at least one standby code template.
In order to be able to generate the object code more accurately, in an exemplary embodiment, as shown in fig. 5, the above step S203 may include steps 501 to 502. Wherein:
s501, extracting page content corresponding to the target function identification from the code configuration file.
The page content is the content, such as specific title content, color content, link content, etc., which needs to be added to the target code template in the code configuration file.
Specifically, after the target code template is obtained, the code configuration file can be analyzed, and page content corresponding to the target identifier is extracted from the code configuration file according to the target function identifier; for example, when the target function identifier is a service function presentation, page content (such as a service function name, a service function jump link, etc.) corresponding to the service function presentation may be extracted from the code configuration file.
S502, adding page content into a target code template to obtain target codes for constructing a target page.
Optionally, after extracting the page content corresponding to the target function identifier, the extracted page content may be added to the code position corresponding to the target function identifier in the target code template according to the code position information in the target code template, so as to obtain the target code for constructing the target page.
It can be understood that by extracting the page content corresponding to the target function identifier from the code configuration file and adding the page content to the target code template, the effect of more efficiently and accurately obtaining the target code for constructing the target page can be achieved.
In one embodiment, as shown in FIG. 6, a preferred example of a network determination method is provided. The specific process is as follows:
s601, responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party.
S602, according to the input operation of the operation and maintenance party on the code configuration page, the target function identification and the code configuration file of the target page are obtained.
S603, selecting at least one standby code template from the candidate code templates according to the target function identification based on the corresponding relation between the candidate code templates and the candidate function identification.
S604, determining the calling relation among the standby code templates according to the code configuration file.
S605, according to the calling relation, fusing the standby code templates to obtain the target code template.
S606, extracting page content corresponding to the target function identification from the code configuration file.
S607, adding the page content to the target code template to obtain target codes for constructing the target page.
S608, running the target code to obtain a target page corresponding to the target code.
S609, displaying the target page to the operation and maintenance party.
And S610, adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
The specific process of S601 to S610 may refer to the description of the above method embodiment, and its implementation principle and technical effects are similar, and are not repeated here.
It should be understood that, although the steps in the flowcharts related to the embodiments described above are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described in the above embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least some of the other steps or stages.
Based on the same inventive concept, the embodiments of the present application also provide a code generation apparatus for implementing the above-mentioned related code generation method. The implementation of the solution provided by the device is similar to the implementation described in the above method, so the specific limitation in one or more code generating device embodiments provided below may refer to the limitation of the code generating method hereinabove, and will not be repeated here.
In an exemplary embodiment, as shown in fig. 7, there is provided a code generating apparatus 1 including: a data acquisition module 10, a template determination module 20, and a code generation module 30, wherein:
the data acquisition module 10 is configured to acquire a target function identifier and a code configuration file of a target page in response to a page code generation request.
The template determining module 20 is configured to determine, from the candidate code templates, an object code template according to the object function identifier based on a correspondence between the candidate code templates and the candidate function identifier.
The code generating module 30 is configured to generate an object code for constructing an object page according to the code configuration file and the object code template.
In an exemplary embodiment, based on fig. 7, as shown in fig. 8, the data acquisition module 10 may include:
and the page display unit 11 is used for responding to the page code generation request initiated by the operation and maintenance party and displaying the code configuration page to the operation and maintenance party.
The file obtaining unit 12 is configured to obtain a target function identifier of a target page and a code configuration file according to an input operation of the operation and maintenance party on the code configuration page.
In an exemplary embodiment, based on the above fig. 7 or fig. 8, as shown in fig. 9, the above template determining module 20 may include:
the template selecting unit 21 is configured to select at least one standby code template from the candidate code templates according to the target function identifier based on the correspondence between the candidate code templates and the candidate function identifier.
The template generating unit 22 is configured to generate an object code template according to at least one standby code template.
In an exemplary embodiment, the template generating unit 22 may specifically be configured to:
determining calling relations among the standby code templates according to the code configuration files; and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
In an exemplary embodiment, on the basis of fig. 7, 8 or 9, as shown in fig. 10, the code generating module 30 may include:
the content extraction unit 31 is configured to extract, from the code configuration file, page content corresponding to the target function identifier.
The code generating unit 32 is configured to add the page content to the target code template, so as to obtain target code for constructing the target page.
In an exemplary embodiment, the code generating apparatus 1 may include:
the code adjustment module is used for running the target code to obtain a target page corresponding to the target code; displaying a target page to an operation and maintenance party; and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
Each of the modules in the code generating apparatus described above may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one exemplary embodiment, a computer device is provided, which may be a server, and the internal structure thereof may be as shown in fig. 11. The computer device includes a processor, a memory, an Input/Output interface (I/O) and a communication interface. The processor, the memory and the input/output interface are connected through a system bus, and the communication interface is connected to the system bus through the input/output interface. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used for storing the target function identification of the target page, the code configuration file, the candidate codes and other data. The input/output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a code generation method.
It will be appreciated by those skilled in the art that the structure shown in fig. 11 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one exemplary embodiment, a computer device is provided comprising a memory and a processor, the memory having stored therein a computer program, the processor when executing the computer program performing the steps of:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In one embodiment, when the processor executes logic for obtaining the target function identification and code configuration file of the target page in response to the page code generation request, the processor further performs the steps of:
responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party; and acquiring a target function identification and a code configuration file of the target page according to the input operation of the operation and maintenance party on the code configuration page.
In one embodiment, when the processor executes the computer program to determine the logic of the target code template from the candidate code templates according to the target function identification based on the correspondence between the candidate code templates and the candidate function identifications, the following steps are further implemented:
selecting at least one standby code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier; an object code template is generated based on the at least one spare code template.
In one embodiment, the logic of the computer program for generating the object code template from the at least one spare code template is further implemented by the processor to:
determining calling relations among the standby code templates according to the code configuration files; and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
In one embodiment, when the processor executes the computer program to generate logic for constructing object code of the object page according to the code configuration file and the object code template, the following steps are further implemented:
extracting page content corresponding to the target function identifier from the code configuration file; and adding the page content into the target code template to obtain target codes for constructing the target page.
In one embodiment, the processor, when executing the computer program, further performs the steps of:
running the target code to obtain a target page corresponding to the target code; displaying a target page to an operation and maintenance party; and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
In one embodiment, a computer readable storage medium is provided having a computer program stored thereon, which when executed by a processor, performs the steps of:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In one embodiment, the logic for obtaining the target function identification and code configuration file of the target page in response to the page code generation request is executed by the processor and further performs the steps of:
responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party; and acquiring a target function identification and a code configuration file of the target page according to the input operation of the operation and maintenance party on the code configuration page.
In one embodiment, the computer program further performs the following steps when the logic for determining the target code template from the candidate code templates is executed by the processor, based on the correspondence between the candidate code templates and the candidate function identifiers, according to the target function identifier:
selecting at least one standby code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier; an object code template is generated based on the at least one spare code template.
In one embodiment, the computer program further performs the following steps when the logic for generating the object code template is executed by the processor, based on the at least one spare code template:
determining calling relations among the standby code templates according to the code configuration files; and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
In one embodiment, the computer program further performs the following steps when the logic for generating object code for building the object page is executed by the processor, based on the code configuration file and the object code template:
extracting page content corresponding to the target function identifier from the code configuration file; and adding the page content into the target code template to obtain target codes for constructing the target page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
running the target code to obtain a target page corresponding to the target code; displaying a target page to an operation and maintenance party; and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
In one embodiment, a computer program product is provided comprising a computer program which, when executed by a processor, performs the steps of:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
In one embodiment, the logic for obtaining the target function identification and code configuration file of the target page in response to the page code generation request is executed by the processor and further performs the steps of:
responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party; and acquiring a target function identification and a code configuration file of the target page according to the input operation of the operation and maintenance party on the code configuration page.
In one embodiment, the computer program further performs the following steps when the logic for determining the target code template from the candidate code templates is executed by the processor, based on the correspondence between the candidate code templates and the candidate function identifiers, according to the target function identifier:
selecting at least one standby code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier; an object code template is generated based on the at least one spare code template.
In one embodiment, the computer program further performs the following steps when the logic for generating the object code template is executed by the processor, based on the at least one spare code template:
determining calling relations among the standby code templates according to the code configuration files; and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
In one embodiment, the computer program further performs the following steps when the logic for generating object code for building the object page is executed by the processor, based on the code configuration file and the object code template:
extracting page content corresponding to the target function identifier from the code configuration file; and adding the page content into the target code template to obtain target codes for constructing the target page.
In one embodiment, the computer program when executed by the processor further performs the steps of:
running the target code to obtain a target page corresponding to the target code; displaying a target page to an operation and maintenance party; and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
It should be noted that, the data related to the present application (including, but not limited to, the target function identifier of the target page, the code configuration file, the candidate code, etc.) are all data that are fully authorized by each party, and the collection, use and processing of the related data need to meet the related regulations.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high density embedded nonvolatile Memory, resistive random access Memory (ReRAM), magnetic random access Memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric Memory (Ferroelectric Random Access Memory, FRAM), phase change Memory (Phase Change Memory, PCM), graphene Memory, and the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, and the like. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like. The databases referred to in the various embodiments provided herein may include at least one of relational databases and non-relational databases. The non-relational database may include, but is not limited to, a blockchain-based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic units, quantum computing-based data processing logic units, etc., without being limited thereto.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples only represent a few embodiments of the present application, which are described in more detail and are not to be construed as limiting the scope of the present application. It should be noted that it would be apparent to those skilled in the art that various modifications and improvements could be made without departing from the spirit of the present application, which would be within the scope of the present application. Accordingly, the scope of protection of the present application shall be subject to the appended claims.

Claims (10)

1. A code generation method, the method comprising:
responding to a page code generation request, and acquiring a target function identification and a code configuration file of a target page;
determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating target codes for constructing the target page according to the code configuration file and the target code template.
2. The method of claim 1, wherein the obtaining the target function identification and the code configuration file of the target page in response to the page code generation request comprises:
responding to a page code generation request initiated by an operation and maintenance party, and displaying a code configuration page to the operation and maintenance party;
and acquiring a target function identification and a code configuration file of a target page according to the input operation of the operation and maintenance party on the code configuration page.
3. The method of claim 1, wherein determining an object code template from the candidate code templates based on the correspondence between the candidate code templates and the candidate function identifiers according to the object function identifier comprises:
selecting at least one standby code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and generating an object code template according to the at least one standby code template.
4. A method according to claim 3, wherein said generating an object code template from said at least one alternate code template comprises:
determining calling relations among the standby code templates according to the code configuration files;
and according to the calling relation, carrying out fusion processing on each standby code template to obtain the target code template.
5. The method of claim 1, wherein generating object code for building the object page from the code profile and the object code template comprises:
extracting page content corresponding to the target function identifier from the code configuration file;
and adding the page content into the target code template to obtain target codes for constructing the target page.
6. The method according to claim 2, wherein the method further comprises:
operating the target code to obtain a target page corresponding to the target code;
displaying the target page to the operation and maintenance party;
and adjusting the target code according to the feedback information of the operation and maintenance party on the target page.
7. A code generating apparatus, the apparatus comprising:
the data acquisition module is used for responding to the page code generation request and acquiring a target function identifier and a code configuration file of a target page;
the template determining module is used for determining a target code template from the candidate code templates according to the target function identifier based on the corresponding relation between the candidate code templates and the candidate function identifier;
and the code generation module is used for generating target codes for constructing the target page according to the code configuration file and the target code template.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
9. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202311481764.2A 2023-11-08 2023-11-08 Code generation method, device, computer equipment and storage medium Pending CN117420992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311481764.2A CN117420992A (en) 2023-11-08 2023-11-08 Code generation method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311481764.2A CN117420992A (en) 2023-11-08 2023-11-08 Code generation method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117420992A true CN117420992A (en) 2024-01-19

Family

ID=89532463

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311481764.2A Pending CN117420992A (en) 2023-11-08 2023-11-08 Code generation method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117420992A (en)

Similar Documents

Publication Publication Date Title
CN108874926B (en) Mass data query method, device, computer equipment and storage medium
US10656979B2 (en) Structural and temporal semantics heterogeneous information network (HIN) for process trace clustering
US20210318851A1 (en) Systems and Methods for Dataset Merging using Flow Structures
CN112860777B (en) Data processing method, device and equipment
CN112765497A (en) Business data analysis result query display method, device, equipment and medium
CN114327374A (en) Business process generation method and device and computer equipment
CN108228611B (en) Document information copying method and device
US11341197B2 (en) Recommendation system based on adjustable virtual indicium
CN116737495A (en) Method, device, computer equipment and storage medium for determining running state
CN117420992A (en) Code generation method, device, computer equipment and storage medium
AU2017227739A1 (en) Automated testing method for application program user interface, electronic device, system, and storage medium
CN112231377A (en) Data mapping method, system, device, server and storage medium
CN111191057A (en) User-defined retrieval method and device, electronic equipment and storage medium thereof
CN117313666A (en) Information acquisition method, apparatus, device, storage medium, and program product
CN117389605A (en) Service interface configuration method, device, equipment, storage medium and program product
CN116051056A (en) Front-end project management method, front-end project management device, computer equipment and storage medium
CN117076274A (en) Performance determination method, device, computer equipment and storage medium
CN117149572A (en) Monitoring view generation method, device, computer equipment and storage medium
CN117492767A (en) Project processing method, device, computer equipment and storage medium
CN116860603A (en) Report test method, report test device, computer equipment and storage medium
CN116069991A (en) Server data acquisition method, device, computer equipment and storage medium
CN117492728A (en) Interface generation method, device, computer equipment and storage medium
CN117612192A (en) Electronic drawing information identification method, system, electronic equipment and storage medium
CN116701178A (en) Interface test method, device, computer equipment and storage medium
CN116301733A (en) Service transaction logic arrangement method, device, computer equipment and storage medium

Legal Events

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