CN117519722A - Code generation method and device, electronic equipment and computer readable storage medium - Google Patents

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

Info

Publication number
CN117519722A
CN117519722A CN202311609620.0A CN202311609620A CN117519722A CN 117519722 A CN117519722 A CN 117519722A CN 202311609620 A CN202311609620 A CN 202311609620A CN 117519722 A CN117519722 A CN 117519722A
Authority
CN
China
Prior art keywords
information
sub
identifier
candidate
target
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
CN202311609620.0A
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 CN202311609620.0A priority Critical patent/CN117519722A/en
Publication of CN117519722A publication Critical patent/CN117519722A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure provides a code generation method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of computer technology, software technology, and financial science and technology. The code generation method comprises the following steps: responding to the received code generation instruction, and acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction also comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship; processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information; determining business flow information in response to detecting a selection operation of a user on N target components on a component panel, wherein N is a positive integer; and calling a generating method corresponding to the application program interface identifier, and processing the difference information and the business flow information to obtain an object code.

Description

Code generation method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the fields of computer technology, software technology, and financial science and technology, and more particularly, to a code generation method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
Background
With the development of computer technology, the application of codes is also becoming more and more widespread. Code development may refer to the process of writing, testing, and maintaining computer programs in a programming language, according to requirements and specifications.
However, with the continuous optimization of service scenarios and the continuous increase of the requirements for scenario development, developers need to frequently develop codes required to be used in new service scenarios.
In the process of implementing the disclosed concept, the inventor finds that at least the following problems exist in the related art: because the code generation method in the related technology lacks the capability of rapid customized generation and subsequent real-time updating, the efficiency and the accuracy of code generation cannot be ensured.
Disclosure of Invention
In view of this, the present disclosure provides a code generation method and apparatus, an electronic device, a computer-readable storage medium, and a computer program product.
According to one aspect of the present disclosure, there is provided a code generation method including: responding to a received code generation instruction, and acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction further comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship; processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information; determining business flow information in response to detecting a selection operation of a user on N target components on a component panel, wherein N is a positive integer; and calling a generating method corresponding to the application program interface identifier, and processing the difference information and the business flow information to obtain an object code.
According to an embodiment of the present disclosure, the above-described difference information includes resource difference information. Processing the plurality of compressed files and stock files corresponding to the plurality of compressed files according to the dependency relationship to obtain difference information, wherein the difference information comprises: in response to a timed task being triggered, determining current resource information corresponding to a current system time and historical resource information corresponding to a historical system time from a resource library, wherein the historical system time is determined according to the current system time; and generating the resource difference information according to the current system time, the current resource information and the historical resource information in response to the current resource information and the historical resource information not being matched.
According to an embodiment of the present disclosure, the above-mentioned difference information further includes version difference information. The code generation method further includes: sequentially determining an ith compressed file in the plurality of compressed files according to the dependency relationship; determining an ith stock file from the plurality of stock files according to the ith compressed file; and generating the version difference information according to a file identification corresponding to the ith compressed file, the current version information and the history version information in response to the fact that the current version information corresponding to the ith compressed file and the history version information corresponding to the ith stored file are not matched.
According to an embodiment of the present disclosure, the method further includes, after processing the plurality of compressed files and the stock files corresponding to the plurality of compressed files according to the dependency relationship to obtain difference information: presenting the difference information to the user in response to detecting that the difference information is generated; and updating the stock file according to the difference information in response to detecting a permission operation of the user for the difference information.
According to an embodiment of the present disclosure, the code generation instruction further includes a service scenario identifier. The code generating method further comprises, before determining the business flow information in response to detecting the selection operation of the user on the N target components on the component panel: determining candidate business process information according to the business scene identifications, wherein the candidate business process information comprises a first number of candidate sub-process identifications and candidate component identifications corresponding to a second number of candidate sub-process identifications, and the first number is greater than or equal to the second number; and displaying a second number of first candidate components on the component panel according to the second number of candidate component identifiers, wherein the second number of first candidate components respectively correspond to the selective frames, and the candidate components comprise at least one of a technical configuration component and an operation and maintenance configuration component.
According to an embodiment of the present disclosure, the component panel further includes a third number of second candidate components thereon. The determining business process information in response to detecting the selection operation of the user on the N target components on the component panel comprises: in response to detecting a selection operation of a user for a target selection frame in the second number of selection frames, determining a first candidate component corresponding to the target selection frame as the target component; determining the second candidate component as the target component in response to detecting a drag operation of the user on any of the third number of second candidate components; determining a fourth number of sub-process identifiers and target component identifiers corresponding to a fifth number of sub-process identifiers according to the candidate business process information and the position relation of the N target components on the component panel, wherein the fourth number is greater than or equal to the fifth number; and determining the business process information according to the candidate business process information, the fourth number of sub-process identifiers and the target component identifiers corresponding to the fifth number of sub-process identifiers.
According to an embodiment of the disclosure, the business process information includes P sub-process identifiers, a script to be processed corresponding to each of the P sub-process identifiers, and a target component identifier corresponding to each of Q sub-process identifiers, where P and Q are positive integers, and Q is less than or equal to P.
According to an embodiment of the present disclosure, when P is greater than 1 and less than or equal to P, the calling a generating method corresponding to the application program interface identifier, processing the difference information and the business process information, and obtaining an object code includes: sequentially determining a P-th sub-process identifier in the P sub-process identifiers; when the target component identifier corresponding to the p-th sub-flow identifier does not exist, calling an application program interface corresponding to the application program interface identifier, and processing a script to be processed corresponding to the p-th sub-flow identifier according to the difference information corresponding to the p-th sub-flow identifier to obtain a processed script corresponding to the p-th sub-flow identifier; when the target component identifier corresponding to the p-th sub-flow identifier exists, processing a script to be processed corresponding to the p-th sub-flow identifier according to the difference information corresponding to the p-th sub-flow identifier by using the target component corresponding to the target component identifier to obtain a processed script corresponding to the p-th sub-flow identifier; and determining the target code according to the processed script corresponding to each of the P sub-flow identifiers in response to the completion of processing the to-be-processed script corresponding to each of the P sub-flow identifiers.
According to an embodiment of the present disclosure, the obtaining, in response to receiving a code generation instruction, a plurality of compressed files according to an item identifier indicated by the code generation instruction includes: in response to receiving the code generation instruction, determining an item object model file corresponding to the item identifier according to the item identifier; searching for a dependency corresponding to the project object model file in a remote repository in response to the dependency corresponding to the project object model file not being present in the local repository; and obtaining the plurality of compressed files from the remote repository based on the dependencies corresponding to the project object model files in response to the dependencies corresponding to the project object model files existing in the remote repository.
According to an embodiment of the present disclosure, the method further includes, after the generating method corresponding to the application program interface identifier is invoked, processing the difference information and the business process information to obtain an object code: in response to receiving a service processing instruction, acquiring the target code corresponding to a target service scene identifier according to the target service scene identifier indicated by the service processing instruction, wherein the service processing instruction further comprises service information to be processed, and the target service scene identifier comprises at least one of a service function identifier and an operation maintenance identifier; and executing the target code so as to process the service information to be processed.
According to another aspect of the present disclosure, there is provided a code generating apparatus including: the first acquisition module is used for responding to a received code generation instruction, acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction also comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship; the first processing module is used for processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information; the first determining module is used for determining business flow information in response to detecting the selection operation of a user on N target components on the component panel, wherein N is a positive integer; and the second processing module is used for calling a generating method corresponding to the application program interface identifier and processing the difference information and the business flow information to obtain an object code.
According to another aspect of the present disclosure, there is provided an electronic device including: one or more processors; and a memory for storing one or more instructions that, when executed by the one or more processors, cause the one or more processors to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to implement a method as described in the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising computer executable instructions which, when executed, are adapted to carry out the method as described in the present disclosure.
According to the embodiment of the disclosure, since the compressed file is automatically acquired according to the item identification indicated by the code generation instruction, the workload of manually writing the code by a developer is reduced. By processing the plurality of compressed files and the stock files corresponding to the plurality of compressed files according to the dependency relationship, difference information for representing the difference between the current code and the original code can be obtained, so that a developer can better know the change and update of the code. Business process information is determined in response to user selection operations on the component panels, thereby taking into account business logic requirements when generating code. On the basis, the generation method corresponding to the application program interface identifier is called to process the difference information and the business flow information, so that the efficiency and the accuracy of generating the target code are improved, and the development task of the code is better completed by developers.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent from the following description of embodiments thereof with reference to the accompanying drawings in which:
FIG. 1 schematically illustrates a system architecture to which a code generation method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a code generation method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates an example schematic diagram of a process of acquiring a plurality of compressed files according to an item identification indicated by a code generation instruction according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates an example schematic diagram of a process of processing a plurality of compressed files and stock files corresponding to each of the plurality of compressed files according to a dependency relationship to obtain difference information according to an embodiment of the present disclosure;
FIG. 5 schematically illustrates an example schematic diagram of a process of determining business process information in response to detecting a user selection operation for N target components on a component panel, according to an embodiment of the disclosure;
FIG. 6 schematically illustrates an example schematic diagram of a code generation process according to an embodiment of the disclosure;
FIG. 7 schematically illustrates a block diagram of a code generation apparatus according to an embodiment of the disclosure; and
Fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement a code generation method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is only exemplary and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and/or the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the terms used herein should be construed to have meanings consistent with the context of the present specification and should not be construed in an idealized or overly formal manner.
Where expressions like at least one of "A, B and C, etc. are used, the expressions should generally be interpreted in accordance with the meaning as commonly understood by those skilled in the art (e.g.," a system having at least one of A, B and C "shall include, but not be limited to, a system having a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the related personal information of the user all conform to the regulations of related laws and regulations, necessary security measures are taken, and the public order harmony is not violated.
In the technical scheme of the disclosure, the authorization or consent of the user is obtained before the personal information of the user is obtained or acquired.
In the related art, there are a scaffold capable of automatically introducing jar packages and a tool for directly outputting the scaffold, but in general, handwriting configuration is needed, so that one-key configuration cannot be realized, a required module cannot be introduced into an engineering by one key, and in addition, a module asset library cannot iteratively notify update in real time. In summary, the code generation method in the related art lacks the capability of rapid customized generation of the module and subsequent real-time notification update, and further cannot guarantee the efficiency and accuracy of code generation.
In order to at least partially solve the technical problems in the related art, the present disclosure provides a code generation method and apparatus, an electronic device, and a computer-readable storage medium, which can be applied to the fields of computer technology, software technology, and financial technology. The code generation method comprises the following steps: responding to the received code generation instruction, and acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction also comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship; processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information; determining business flow information in response to detecting a selection operation of a user on N target components on a component panel, wherein N is a positive integer; and calling a generating method corresponding to the application program interface identifier, and processing the difference information and the business flow information to obtain an object code.
It should be noted that the code generation method and apparatus provided in the embodiments of the present disclosure may be used in the fields of computer technology, software technology, and financial technology, for example, in the field of development. The code generation method and the code generation device provided by the embodiment of the disclosure can be applied to any field except the fields of computer technology, software technology and financial science and technology, for example, the field of information processing technology. The application fields of the code generation method and the code generation device provided by the embodiment of the disclosure are not limited.
Fig. 1 schematically illustrates a system architecture to which a code generation method may be applied according to an embodiment of the present disclosure. It should be noted that fig. 1 is only an example of a system architecture to which embodiments of the present disclosure may be applied to assist those skilled in the art in understanding the technical content of the present disclosure, but does not mean that embodiments of the present disclosure may not be used in other devices, systems, environments, or scenarios.
As shown in fig. 1, a system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is a medium used to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 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 through the network 104 using at least one of the first terminal device 101, the second terminal device 102, the third terminal device 103, to receive or send messages, etc. Various communication client applications, such as a shopping class application, a web browser application, a search class application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only) may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103.
The first terminal device 101, the second terminal device 102, the third terminal device 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablets, laptop and desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (by way of example only) providing support for websites browsed by the user using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as the user request, and feed back the processing result (e.g., the web page, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the code generation method provided by the embodiments of the present disclosure may be generally executed by the server 105. Accordingly, the code generating apparatus provided by the embodiments of the present disclosure may be generally provided in the server 105. The code generation method provided by the embodiments of the present disclosure may also be performed by a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105. Accordingly, the code generating apparatus provided by the embodiments of the present disclosure may also be provided in a server or a server cluster that is different from the server 105 and is capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and/or the server 105.
Alternatively, the code generating method provided by the embodiment of the present disclosure may be performed by the first terminal device 101, the second terminal device 102, or the third terminal device 103, or may be performed by other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103. Accordingly, the code generating apparatus provided by the embodiments of the present disclosure may also be provided in the first terminal device 101, the second terminal device 102, or the third terminal device 103, or in other terminal devices different from the first terminal device 101, the second terminal device 102, or the third terminal device 103.
It should be understood that the number of first, second or third terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of first, second or third terminal devices, networks and servers, as desired for implementation.
It should be noted that the sequence numbers of the respective operations in the following methods are merely representative of the operations for the purpose of description, and should not be construed as representing the order of execution of the respective operations. The method need not be performed in the exact order shown unless explicitly stated.
Fig. 2 schematically shows a flow chart of a code generation method according to an embodiment of the present disclosure.
As shown in fig. 2, the code generation method 200 includes operations S210 to S240.
In response to receiving the code generation instruction, a plurality of compressed files are acquired according to the item identifier indicated by the code generation instruction, where the code generation instruction further includes an application program interface identifier, and a dependency relationship exists between the plurality of compressed files in operation S210.
In operation S220, the plurality of compressed files and the stock files corresponding to the plurality of compressed files are processed according to the dependency relationship to obtain the difference information.
In response to detecting the selection operation of the user for the N target components on the component panel, the business process information is determined in operation S230, where N is a positive integer.
In operation S240, a generating method corresponding to the application program interface identifier is called, and the difference information and the business process information are processed to obtain the object code.
According to the embodiment of the disclosure, the code for generating the code generation instruction may be written in the first script in advance, and in response to detecting the code generation operation initiated by the user, the item identifier, the service scene identifier, and the application program interface identifier corresponding to the target code desired to be generated may be acquired. On the basis, the client can run the script and generate code generation instructions according to the item identification, the service scene identification and the application program interface identification. The client can send the code generation instruction to the server, so that the server can process the compressed file corresponding to the code generation operation according to the code generation instruction, and further obtain the target code.
According to embodiments of the present disclosure, item identification may be used to uniquely identify different items. The at least one candidate item identification and the candidate item object model file corresponding to each of the at least one candidate item identification may be preconfigured before the code generation method provided by the present disclosure is executed. After receiving the code generation instruction, the item identifier indicated by the code generation instruction and the at least one candidate item identifier may be respectively matched so as to determine a target item identifier in the at least one candidate item identifier. The candidate item object model file corresponding to the target item identification may be determined as the item object model file corresponding to the item identification indicated by the code generation instruction according to the correspondence between the pre-configured candidate item identification and the candidate item object model file. On this basis, a plurality of compressed files to be acquired can be further determined according to the project object model files.
According to embodiments of the present disclosure, there may be a dependency relationship between multiple compressed files. The dependency relationships may be used to characterize the relationship and order relationships between multiple compressed files. For example, the plurality of compressed files may include a file a, a file B, and a file C, and the association relationship may be understood that the file a and the file B are files processed in parallel, and the sequential relationship may be understood that the file C needs to rely on the output result of the file a and the output result of the file B for subsequent processing.
According to an embodiment of the present disclosure, the difference information may include at least one of: resource difference information and version difference information. The resource difference information may be used to characterize the difference between the current resource information and the historical resource information. The current resource information and the historical resource information may be configured according to actual service requirements, which is not limited herein. For example, a timing task may be preset, and current resource information corresponding to a current system time may be automatically acquired in real time in response to the timing task being triggered. Alternatively, historical resource information corresponding to the historical system time may be obtained from a database.
According to embodiments of the present disclosure, version difference information may be used to characterize the difference situation between the current version information and the historical version information. The determination manner of the current version information and the historical version information can be configured according to the actual service requirement, which is not limited herein. For example, the i-th compressed file may be sequentially determined among the plurality of compressed files, and version information corresponding to the i-th compressed file may be determined as the current version information. Alternatively, the ith stock file may be determined from among the plurality of stock files according to the ith compressed file, and version information corresponding to the ith stock file may be determined as history version information.
According to the embodiment of the disclosure, after receiving the code generation instruction, candidate business flow information can be determined according to the business scene identifier indicated by the code generation instruction. At least one first candidate component corresponding to the candidate business process information may be presented on the component panel. The first candidate component may be used to characterize a component in the candidate business process information that has a candidate sub-process identification corresponding to the component. In addition, at least one second candidate component may be presented on the component panel. The second candidate component may be used to characterize a component in the candidate business process information that does not have a candidate sub-process identification corresponding to the component. N target components can be determined in at least one first follow-up component and at least one second candidate component according to the selection operation of a user, so that business process information corresponding to the code generation instruction is determined according to the candidate business process information and the N target components.
According to the embodiment of the disclosure, after the difference information and the business flow information are obtained, a generating method corresponding to the application program interface identifier can be called according to the application program interface identifier, and then the difference information and the business flow information are processed by using the generating method to generate the target code.
According to the embodiment of the disclosure, since the compressed file is automatically acquired according to the item identification indicated by the code generation instruction, the workload of manually writing the code by a developer is reduced. By processing the plurality of compressed files and the stock files corresponding to the plurality of compressed files according to the dependency relationship, difference information for representing the difference between the current code and the original code can be obtained, so that a developer can better know the change and update of the code. Business process information is determined in response to user selection operations on the component panels, thereby taking into account business logic requirements when generating code. On the basis, the generation method corresponding to the application program interface identifier is called to process the difference information and the business flow information, so that the efficiency and the accuracy of generating the target code are improved, and the development task of the code is better completed by developers.
A code generation method 200 according to an embodiment of the present invention is further described below with reference to fig. 3-6.
According to an embodiment of the present disclosure, the code generation method 200 may be applied to a code generation system. The code generation system may include a technical module, a scenerization module, an operation and maintenance module, and a scaffolding module.
According to embodiments of the present disclosure, technical modules may be used to perform free assembly of technical building blocks, providing standardized configurations for industry componentization capabilities. The technical building block may comprise at least one of: ocr identify blocks, data desensitizing blocks, monitoring blocks, current limiting blocks, application image monitoring blocks, man-machine password separation monitoring blocks, security component blocks, holographic monitoring blocks, flow playback blocks, cloud-medical fault platform blocks, on-line small lot blocks, and the like.
According to the embodiment of the disclosure, the scenerization module can be used for constructing and controlling a business building block system for solving the problem of a specific scene, supporting configuration and UI style adjustment, and realizing data standardization conversion and communication. The scenerising module may be used for individual modeling for a specific business scenario, i.e. for implementation of business processes and scenario components for different business scenarios. For example, an insurance scenario may be scenario optimized by insurance. The standardized building block can analyze the user business parameters according to the rules to finish standardized set-top output.
According to embodiments of the present disclosure, the operation and maintenance module may be used to provide automatic access to more than 10 operation and maintenance capabilities including human-machine password separation, paaS one-key cloud and amc monitoring. For standardized components which need to be accessed, the access modes of the components do not have unified standards, and the self-adaptive configuration can be carried out on different components.
According to the embodiment of the disclosure, the scaffold module can be used for constructing application products by taking the assembly of the foundation framework as a solution, rapidly assembling, rapidly generating codes and the like, improving the research and development efficiency, integrating the functions of a user system, organization management, public foundation members, lightweight localized deployment and the like. The base frame may include at least one of: standard frameworks such as unicon-ui, CTP6 and DDD. Customization can be performed according to the standardized requirements of different access building blocks, the self-built assembly is initialized, and the external access module is continuously supplemented according to the standardized requirements.
According to an embodiment of the present disclosure, operation S210 may include the following operations.
And in response to receiving the code generation instruction, determining an item object model file corresponding to the item identification according to the item identification. In response to the dependency corresponding to the project object model file not being present in the local repository, the dependency corresponding to the project object model file is looked up in the remote repository. In response to a dependency corresponding to the project object model file existing in the remote repository, a plurality of compressed files are obtained from the remote repository according to the dependency corresponding to the project object model file.
According to an embodiment of the present disclosure, at least one candidate item identification and a candidate item object model file corresponding to each of the at least one candidate item identification may be preconfigured. Project object model files (Project Object Model, POM) may refer to descriptions of a single project by the Maven repository. After receiving the code generation instruction, an item object model file corresponding to the item identification may be determined according to the item identification indicated by the code generation instruction and the at least one candidate item identification.
According to an embodiment of the present disclosure, after obtaining the project object model file, a dependency corresponding to the project object model file may be searched in a Maven repository according to the project object model file. Maven warehouses may include local warehouses and remote warehouses. For example, dependencies corresponding to the project object model files may be first looked up in a local repository from the project object model files. If there is a dependency corresponding to the project object model file in the local repository, a plurality of compressed files may be acquired from the local repository directly from the dependency.
Alternatively, in the case where there is no dependency corresponding to the project object model file in the local repository, the dependency corresponding to the project object model file may be looked up in the remote repository from the project object model file according to embodiments of the present disclosure. In the case where there is a dependency corresponding to the project object model file in the remote repository, a plurality of compressed files may be acquired from the remote repository based on the dependency.
According to the embodiment of the disclosure, by searching and acquiring between the local warehouse and the remote warehouse, the dependence of the project can be effectively managed, and code compiling or running errors caused by dependence missing can be avoided, so that the dependence can be dynamically acquired, and all the dependence required by the project can be ensured to be correctly acquired and used.
Fig. 3 schematically illustrates an example schematic diagram of a process of acquiring a plurality of compressed files according to an item identification indicated by a code generation instruction according to an embodiment of the present disclosure.
As shown in fig. 3, in 300, in response to receiving a code generation instruction 301, an item object model file 303 corresponding to the item identification 302 may be determined from the code generation instruction 301 item identification 302. After obtaining the project object model file 303, operation S310 may be performed.
At initial S310, it is determined whether there is a dependency in the local repository corresponding to the project object model file? If so, the compressed file 304 may be obtained directly from the local repository. If not, operation S320 may be performed.
In operation S320, it is determined whether there is a dependency corresponding to the project object model file in the remote repository? If so, the compressed file 304 may be obtained from a remote repository. If not, the flow may end.
According to an embodiment of the present disclosure, the difference information includes resource difference information.
According to an embodiment of the present disclosure, operation S220 may include the following operations.
In response to the timed task being triggered, current resource information corresponding to a current system time and historical resource information corresponding to a historical system time are determined from a resource library, wherein the historical system time is determined according to the current system time. And generating resource difference information according to the current system time, the current resource information and the historical resource information in response to the fact that the current resource information and the historical resource information are not matched.
According to the embodiment of the disclosure, the timing task calculation can be performed on all the assets in the current module asset library, and if the timing task calculation deviates from the assets on the previous day, the data in the user table can be identified. The timed task may include triggering execution of a predetermined action at a predetermined time. The timing tasks may be associated with resource information. The predetermined action may include obtaining current resource information and historical resource information, in which case the timed task may be used to trigger processing of the current resource information and the historical resource information at a predetermined time. The predetermined time may include a predetermined time point and a predetermined period of time. The predetermined time may be set according to actual service requirements, which is not limited herein.
For example, in the case where the predetermined time is a predetermined time point, the predetermined time may be set to 12:00, in this case, in response to the current system time reaching 12:00, triggering timing tasks. Alternatively, in the case where the predetermined time is a predetermined period of time, the predetermined time may be set to 12 hours, in which case the timing task is triggered in response to the current system time interval reaching 12 hours.
According to embodiments of the present disclosure, resource information may refer to information used to characterize all assets in a modular asset library. The modular asset library may be used to import the inventory of assets and deploy the newly imported assets. After the current resource information and the historical resource information are obtained, the current resource information and the historical resource information can be matched, and a matching result is obtained. For example, the resource information may include a resource value, the current resource value and the historical resource value may be compared, and if the two are the same, a matching result of matching the current resource value and the historical resource value may be determined. Alternatively, in the case that the matching result indicates that the current resource information and the historical resource information are not matched, the resource difference condition can be determined according to the current resource information and the historical resource information, and the resource difference information can be determined according to the current system time and the difference resource information.
According to the embodiment of the disclosure, by responding to the triggering of the timing task, determining the current resource information corresponding to the current system time and the historical resource information corresponding to the historical system time from the resource library, and generating the resource difference information when responding to the fact that the current resource information and the historical resource information are not matched, the comparison and analysis of the system resource information can be realized, so that the resource difference information is generated, a system administrator or a developer can be helped to better know the resource change condition of the system at different time points, the optimization of the system performance, the troubleshooting and the safety audit are facilitated, the efficiency and the reliability of the system management can be improved, and the manager can better monitor the change of the system resource, and timely discover and solve the potential problem.
According to an embodiment of the present disclosure, the difference information further includes version difference information.
According to an embodiment of the present disclosure, operation S220 may further include the following operations.
And sequentially determining an ith compressed file in the plurality of compressed files according to the dependency relationship. And determining the ith stock file from the plurality of stock files according to the ith compressed file. And generating version difference information according to the file identification, the current version information and the historical version information corresponding to the ith stock file in response to the fact that the current version information corresponding to the ith compressed file is not matched with the historical version information corresponding to the ith stock file.
According to embodiments of the present disclosure, each compressed file of the plurality of compressed files may each have a file identification, and an inventory file corresponding to the file identification. The compressed file may refer to a newly introduced jar package and the stock file may refer to a stock jar package. After the plurality of compressed files are obtained, an ith compressed file may be sequentially determined among the plurality of compressed files according to the dependency relationship, and an ith stock file may be determined according to the ith compressed file.
According to the embodiment of the disclosure, the introduced dependency of the corresponding module can be updated periodically by periodically recursively comparing the newly introduced jar packet with the stored jar packet, i.e. the jar packet of the current item is updated to be the latest version. For example, after the i-th compressed file is obtained, current version information corresponding to the i-th compressed file may be determined. After the ith stock file is obtained, the history version information corresponding to the ith stock file may be determined. On this basis, the version difference condition can be determined according to the current version information and the historical version information, and the version difference information can be determined according to the file identification and the version difference condition corresponding to the ith compressed file.
According to the embodiment of the disclosure, the ith compressed file and the ith stock file are sequentially determined according to the dependency relationship, and when the current version information corresponding to the ith compressed file and the historical version information corresponding to the ith stock file are not matched, version difference information is generated, so that comparison and analysis of the version information between the stock file and the compressed file can be realized, version difference information is generated, a developer can be helped to better know the change between different versions, version control and code management are facilitated, the efficiency and accuracy of version management in the software development process can be improved, and the developer can better track and understand the difference between different versions, so that software maintenance and updating can be better performed.
Fig. 4 schematically illustrates an example schematic diagram of a process of processing a plurality of compressed files and stock files corresponding to each of the plurality of compressed files according to a dependency relationship to obtain difference information according to an embodiment of the present disclosure.
As shown in fig. 4, in 400, in response to a timing task 401 being triggered, a current system time 402 may be determined and a historical system time 403 may be determined from the current system time 402. Current resource information 404 corresponding to the current system time 402 and historical resource information 405 corresponding to the historical system time 403 are determined from the resource library. After the current resource information 404 and the history resource information 405 are obtained, operation S410 may be performed.
In operation S410, it is determined whether the current resource information and the history resource information match? If so, resource difference information 406 may be generated based on current system time 402, current resource information 404, and historical resource information 405. If not, the flow may end.
According to an embodiment of the present disclosure, the code generation method 200 may further include the following operations.
In response to monitoring that the difference information is generated, the difference information is presented to the user. And in response to detecting the permission operation of the user on the difference information, updating the stock file according to the difference information.
According to embodiments of the present disclosure, the code generation process may be monitored in a polling manner, and after it is heard that the difference information is generated, i.e., the version in the asset library is updated, the difference information may be presented to the user in order to alert the user to the update.
According to the embodiment of the disclosure, the user can be informed of the difference information in a mail manner, and the user can select whether to update all the current dependencies to the latest. After detecting the permission operation of the user on the difference information, the stock file can be updated according to the difference information, so that the real-time monitoring of the code generation process is realized.
According to the embodiment of the disclosure, when the difference information is generated in response to monitoring, the difference information is displayed to a user, and when the permission operation of the user on the difference information is detected, the stock file is updated according to the difference information, so that the monitoring, displaying and updating of the difference information can be realized, the user can be helped to better know the change of a system or a file, and the stock file is updated in time under the condition of permission of the user, so that the instantaneity and the accuracy of the file are ensured, the user experience and the flexibility of the system are improved, the user can more intuitively know the change condition of the system or the file, and corresponding operation is performed when required.
According to an embodiment of the present disclosure, the code generation instructions further comprise a business scenario identification.
According to an embodiment of the present disclosure, the code generation method 200 may further include the following operations.
And determining candidate business process information according to the business scene identifications, wherein the candidate business process information comprises a first number of candidate sub-process identifications and candidate component identifications corresponding to a second number of candidate sub-process identifications, and the first number is greater than or equal to the second number. And displaying a second number of first candidate components on the component panel according to the second number of candidate component identifications, wherein the second number of first candidate components respectively correspond to the selective boxes, and the candidate components comprise at least one of a technical configuration component and an operation and maintenance configuration component.
According to the embodiment of the disclosure, for different code output devices to be introduced, initialization configuration derived from test results of a developer can be provided, and a user only needs to replace personalized configuration of the user. For example, at least one candidate business scenario identification and candidate business process information corresponding to each of the at least one candidate business scenario identification may be preconfigured. After receiving the code generation instruction, candidate business process information corresponding to the business scene identifier can be determined according to the business scene identifier indicated by the code generation instruction and at least one candidate business scene identifier. After the service parameters are introduced, standardized rule output of the standard module can be performed through customized configuration, and then the rule is input into the module output device, so that the standardized code block is output.
According to embodiments of the present disclosure, the candidate business process information may include a first number of candidate sub-process identifications. There may be a second number of candidate sub-flow identifications in the first number of candidate sub-flow identifications each corresponding to a candidate component identification. After obtaining the candidate business process information, a first candidate component corresponding to each of the second number of candidate component identifications may be presented on the component panel. The first candidate component may be used to characterize a component in the candidate business process information that has a candidate sub-process identification corresponding to the component. The second number of first candidate components may each correspond to a selection box, which may be used to indicate whether a first candidate component corresponding to the selection box is subsequently selected.
According to an embodiment of the present disclosure, a third number of second candidate components are also included on the component panel.
According to an embodiment of the present disclosure, operation S230 may include the following operations.
In response to detecting a selection operation of the user for a target selection box in the second number of selection boxes, a first candidate component corresponding to the target selection box is determined as a target component. In response to detecting a drag operation by the user with respect to any of the third number of second candidate components, the second candidate component is determined to be the target component. And determining a fourth number of sub-process identifiers and target component identifiers corresponding to the fifth number of sub-process identifiers according to the candidate business process information and the position relation of N target components on the component panel, wherein the fourth number is greater than or equal to the fifth number. And determining the business process information according to the candidate business process information, the fourth number of sub-process identifiers and the target component identifiers corresponding to the fifth number of sub-process identifiers.
A third number of second candidate components are also shown on the component panel, according to an embodiment of the present disclosure. The second candidate component may be used to characterize a component in the candidate business process information that does not have a candidate sub-process identification corresponding to the component. Each of the second candidate components may also each correspond to a selection box. The user may determine the N target components by selecting a selection box corresponding to the first candidate component and/or a selection box corresponding to the second candidate component.
According to the embodiment of the disclosure, after obtaining N target components, a fourth number of sub-process identifiers and target component identifiers corresponding to a fifth number of sub-process identifiers respectively may be determined according to a first number of candidate sub-process identifiers in the candidate business process information, a target component selected by a user from a second number of first candidate components, and a target component selected by a user from a third number of second candidate components, so that the business process information may be determined.
According to the embodiment of the disclosure, the sub-processes, the components and the target components in the candidate business process information are determined according to the business scene and the user operation, and the complete business process information is finally determined, so that the user can be helped to display the corresponding candidate components on the component panel according to the specific business scene and the requirement, and the final target components and the business process information are determined according to the selection and the operation of the user, so that the efficiency of the design and the configuration of the business process is improved, the user can select and configure the corresponding components according to the specific business scene and the requirement more conveniently, and the complete business process information is determined.
FIG. 5 schematically illustrates an example schematic diagram of a process of determining business process information in response to detecting a user selection operation for N target components on a component panel, according to an embodiment of the disclosure.
As shown in fig. 5, in 500, the code generation instruction 501 may also include a business scenario identification 501_1. After receiving the code generation instruction 501, candidate business process information 502 may be determined according to the business scenario identification 501_1. The candidate business process information 502 may include a first number of candidate sub-process identifications 502_1 and candidate component identifications 5022 corresponding to each of the second number of candidate sub-process identifications 502_1. According to the second number of candidate component identifications 502_1, a second number of first candidate components 503 are presented on the component panel, the second number of first candidate components 503 each corresponding to the selection box 504. In response to detecting a selection operation by the user for a target selection box of the second number of selection boxes 504, the first candidate component 503 corresponding to the target selection box is determined as the target component 505.
Also included on the component panel is a third number of second candidate components 506. In response to detecting a drag operation by the user for any of the third number of second candidate components 506, the second candidate component 506 is determined to be the target component 505.
After obtaining N target components 505, a fourth number of sub-process identifiers 507_1 and target component identifiers 507_2 corresponding to the fifth number of sub-process identifiers 507_1 may be determined according to the candidate sub-process identifiers 502_1 and the positional relationship of the N target components 505 on the component panel. Based on this, business process information 508 may be determined from candidate business process information 502, fourth number of sub-process identifiers 507_1, and target component identifiers 507_2 corresponding to each of fifth number of sub-process identifiers 507_1.
According to the embodiment of the disclosure, the business process information comprises P sub-process identifiers, a script to be processed corresponding to the P sub-process identifiers and a target component identifier corresponding to the Q sub-process identifiers, wherein P and Q are positive integers, and Q is less than or equal to P.
In accordance with an embodiment of the present disclosure, in the case of 1 < p+.P, operation S240 may include the following operations.
And sequentially determining the P-th sub-flow identification in the P sub-flow identifications. And calling an application program interface corresponding to the application program interface identifier under the condition that the target component identifier corresponding to the p-th sub-flow identifier does not exist, and processing the script to be processed corresponding to the p-th sub-flow identifier according to the difference information corresponding to the p-th sub-flow identifier to obtain the script to be processed corresponding to the p-th sub-flow identifier. And under the condition that the target component identifier corresponding to the p-th sub-flow identifier exists, processing the script to be processed corresponding to the p-th sub-flow identifier according to the difference information corresponding to the p-th sub-flow identifier by utilizing the target component corresponding to the target component identifier, and obtaining the processed script corresponding to the p-th sub-flow identifier. And responding to the completion of processing of the to-be-processed scripts corresponding to the P sub-flow identifiers respectively, and determining the target code according to the processed scripts corresponding to the P sub-flow identifiers respectively.
According to the embodiment of the disclosure, after the difference information and the business process information are obtained, the P-th sub-process identifier can be sequentially determined in the P-th sub-process identifiers, and the processing method of the script to be processed corresponding to the P-th sub-process identifier is determined according to the corresponding condition of the target component identifier of the P-th sub-process identifier.
For example, in the case where there is a target component identifier corresponding to the p-th sub-flow identifier, the difference information and the script to be processed corresponding to the p-th sub-flow identifier may be processed using the target component corresponding to the target component identifier. Alternatively, in the case where the target component identifier corresponding to the p-th sub-flow identifier does not exist, the difference information and the script to be processed corresponding to the p-th sub-flow identifier may be processed using the application program interface corresponding to the application program interface identifier.
According to the embodiment of the disclosure, the script to be processed is processed according to the sub-flow identification and the related difference information, and finally the target code is determined. Through the process, the script to be processed can be respectively processed appropriately according to the existence or nonexistence of the target component identifier corresponding to the sub-flow identifier, so that the processed script is obtained, the target code is finally determined, automatic processing and code generation are facilitated, and the script to be processed is processed in a targeted manner according to the sub-flow identifier and the difference information, so that the processed script and the final target code are obtained.
Fig. 6 schematically illustrates an example schematic diagram of a code generation process procedure according to an embodiment of the present disclosure.
As shown in fig. 6, in 600, an operation and maintenance plug-in item 601 may be created and a plug-in panel 604 drawn. After the operation and maintenance plug-in item 601 is created, operation S610 may be performed. In operation S610, it is determined whether it is an item object model file? If so, the project object model files 602 may be queried and parsed.
After obtaining the project object model file 602, operation S620 may be performed. In operation S620, it is determined that the comparison operation component depends? If so, a first candidate component 603 may be displayed.
After obtaining the project object model files 602, a selection box 605 may also be defined in the plug-in panel 604 in synchronization. In addition, buttons and text boxes can be created on the plug-in panel 604 and listener and event actions added to create the panel interaction class 606. After the panel interaction class 606 is created, operation S630 may be performed. Is a panel view able to be generated in operation S630? If so, a second candidate component 607 may be displayed. In addition, a document path may also be displayed.
In response to detecting a user selection operation with respect to the first candidate component 603 and/or the second candidate component 607, a target component 608 may be determined. After obtaining the target component 608, a generation method generation operation component 609 may be invoked.
According to the embodiment of the disclosure, the engineering can be quickly introduced while the modularization capability is provided, and the one-key configuration capability can be realized by quickly configuring through the visual operation. In addition, by iterative updating of the modules, one-key updated module information can be realized.
According to an embodiment of the present disclosure, the code generation method 200 may further include the following operations.
And responding to the received service processing instruction, and acquiring a target code corresponding to the target service scene identifier according to the target service scene identifier indicated by the service processing instruction, wherein the service processing instruction further comprises service information to be processed, and the target service scene identifier comprises at least one of a service function identifier and an operation maintenance identifier. And executing the target code so as to process the service information to be processed.
According to the embodiment of the disclosure, the code for generating the service processing instruction may be written in the second script in advance, and the target service scene identifier may be obtained in response to detecting the service processing operation initiated by the user. On the basis, the client can run the script and generate a service processing instruction according to the target service scene identifier. The client can send the service processing instruction to the server, so that the server can acquire the target code corresponding to the service scene identifier according to the service processing instruction, and further process the service information to be processed by using the target code.
According to embodiments of the present disclosure, the target business scenario identification may be used to uniquely identify different business scenarios. The at least one candidate traffic scenario identification and the candidate codes corresponding to the at least one candidate traffic scenario identification may be preconfigured. After receiving the service processing instruction, the target service scene identifier and the at least one candidate service scene identifier indicated by the service processing instruction may be respectively matched, so as to determine an actual service scene identifier in the at least one candidate service scene identifier. And determining the candidate code corresponding to the actual service scene identifier as the target code according to the corresponding relation between the pre-configured candidate service scene identifier and the candidate code.
The above is only an exemplary embodiment, but is not limited thereto, and other code generation methods known in the art may be included as long as the efficiency and accuracy of object code generation can be improved.
Fig. 7 schematically shows a block diagram of a code generating apparatus according to an embodiment of the present disclosure.
As shown in fig. 7, the code generating apparatus 700 may include a first acquisition module 710, a first processing module 720, a first determination module 730, and a second processing module 740.
The first obtaining module 710 is configured to obtain, in response to receiving the code generation instruction, a plurality of compressed files according to the item identifier indicated by the code generation instruction, where the code generation instruction further includes an application program interface identifier, and the plurality of compressed files have a dependency relationship therebetween.
The first processing module 720 is configured to process the plurality of compressed files and stock files corresponding to the plurality of compressed files according to the dependency relationship, so as to obtain difference information.
A first determining module 730, configured to determine, in response to detecting a selection operation of a user for N target components on the component panel, the business process information, where N is a positive integer.
And the second processing module 740 is configured to invoke a generating method corresponding to the application program interface identifier, and process the difference information and the business flow information to obtain an object code.
According to an embodiment of the present disclosure, the difference information includes resource difference information.
According to an embodiment of the present disclosure, the first processing module 720 may include a first determining unit and a first generating unit.
And the first determining unit is used for determining current resource information corresponding to the current system time and historical resource information corresponding to the historical system time from the resource library in response to the triggering of the timing task, wherein the historical system time is determined according to the current system time.
The first generation unit is used for generating resource difference information according to the current system moment, the current resource information and the historical resource information in response to the fact that the current resource information and the historical resource information are not matched.
According to an embodiment of the present disclosure, the difference information further includes version difference information.
According to an embodiment of the present disclosure, the first processing module 720 may further include a second determining unit, a third determining unit, and a second generating unit.
And the second determining unit is used for sequentially determining the ith compressed file in the plurality of compressed files according to the dependency relationship.
And a third determining unit configured to determine an ith stock file from the plurality of stock files based on the ith compressed file.
And a second generation unit for generating version difference information according to the file identification, the current version information and the history version information corresponding to the ith storage file in response to the fact that the current version information corresponding to the ith compressed file and the history version information corresponding to the ith storage file are not matched.
According to an embodiment of the present disclosure, the code generating apparatus 700 may further include a first presentation module and an update module.
And the first display module is used for responding to the fact that the difference information is monitored to be generated and displaying the difference information to the user.
And the updating module is used for responding to the detection of the permission operation of the user on the difference information and updating the stock file according to the difference information.
According to an embodiment of the present disclosure, the code generation instructions further comprise a business scenario identification.
According to an embodiment of the present disclosure, the code generating apparatus 700 may further include a second determining module and a second presentation module.
And the second determining module is used for determining candidate business process information according to the business scene identifications, wherein the candidate business process information comprises a first number of candidate sub-process identifications and candidate component identifications corresponding to a second number of candidate sub-process identifications, and the first number is larger than or equal to the second number.
And the second display module is used for displaying a second number of first candidate components on the component panel according to the second number of candidate component identifications, wherein the second number of first candidate components respectively correspond to the selective frames, and the candidate components comprise at least one of a technical configuration component and an operation and maintenance configuration component.
According to an embodiment of the present disclosure, a third number of second candidate components are also included on the component panel.
According to an embodiment of the present disclosure, the first determining module 730 may include a fourth determining unit, a fifth determining unit, a sixth determining unit, and a seventh determining unit.
And a fourth determining unit configured to determine, as the target component, the first candidate component corresponding to the target selection frame in response to detection of a selection operation by the user for the target selection frame in the second number of selection frames.
And a fifth determining unit configured to determine the second candidate component as the target component in response to detecting a drag operation of the user with respect to any of the third number of second candidate components.
And a sixth determining unit, configured to determine, according to the candidate business process information and the positional relationships of the N target components on the component panel, a fourth number of sub-process identifiers and target component identifiers corresponding to the fifth number of sub-process identifiers, where the fourth number is greater than or equal to the fifth number.
And the seventh determining unit is used for determining the business process information according to the candidate business process information, the fourth number of sub-process identifiers and the target component identifiers corresponding to the fifth number of sub-process identifiers.
According to the embodiment of the disclosure, the business process information comprises P sub-process identifiers, a script to be processed corresponding to the P sub-process identifiers and a target component identifier corresponding to the Q sub-process identifiers, wherein P and Q are positive integers, and Q is less than or equal to P.
According to an embodiment of the present disclosure, in case 1 < p+.p, the second processing module 740 may include an eighth determining unit, a first processing unit, a second processing unit, and a ninth determining unit.
And the eighth determining unit is used for sequentially determining the P-th sub-flow identifier in the P sub-flow identifiers.
And the first processing unit is used for calling the application program interface corresponding to the application program interface identifier under the condition that the target component identifier corresponding to the p-th sub-flow identifier does not exist, and processing the script to be processed corresponding to the p-th sub-flow identifier according to the difference information corresponding to the p-th sub-flow identifier to obtain the processed script corresponding to the p-th sub-flow identifier.
And the second processing unit is used for processing the script to be processed corresponding to the p-th sub-flow identification according to the difference information corresponding to the p-th sub-flow identification by utilizing the target component corresponding to the target component identification under the condition that the target component identification corresponding to the p-th sub-flow identification exists, so as to obtain the processed script corresponding to the p-th sub-flow identification.
And the ninth determining unit is used for determining the target code according to the processed script corresponding to each of the P sub-flow identifiers in response to the completion of the processing of the to-be-processed script corresponding to each of the P sub-flow identifiers.
According to an embodiment of the present disclosure, the first acquisition module 710 may include a tenth determination unit, a search unit, and an acquisition unit.
And a tenth determining unit for determining an item object model file corresponding to the item identification according to the item identification in response to receiving the code generation instruction.
And a searching unit for searching the dependency corresponding to the project object model file in the remote warehouse in response to the dependency corresponding to the project object model file not existing in the local warehouse.
And the acquisition unit is used for responding to the existence of the dependence corresponding to the project object model file in the remote warehouse and acquiring a plurality of compressed files from the remote warehouse according to the dependence corresponding to the project object model file.
According to an embodiment of the present disclosure, the code generating apparatus 700 may further include a second acquisition module and an execution module.
The second acquisition module is used for responding to the received service processing instruction, and acquiring a target code corresponding to the target service scene identifier according to the target service scene identifier indicated by the service processing instruction, wherein the service processing instruction further comprises service information to be processed, and the target service scene identifier comprises at least one of a service function identifier and an operation maintenance identifier.
And the execution module is used for executing the target code so as to process the service information to be processed.
Any number of modules, sub-modules, units, sub-units, or at least some of the functionality of any number of the sub-units according to embodiments of the present disclosure may be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented as split into multiple modules. Any one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system-on-chip, a system-on-substrate, a system-on-package, an Application Specific Integrated Circuit (ASIC), or in any other reasonable manner of hardware or firmware that integrates or encapsulates the circuit, or in any one of or a suitable combination of three of software, hardware, and firmware. Alternatively, one or more of the modules, sub-modules, units, sub-units according to embodiments of the present disclosure may be at least partially implemented as computer program modules, which when executed, may perform the corresponding functions.
For example, any of the first acquisition module 710, the first processing module 720, the first determination module 730, and the second processing module 740 may be combined in one module/unit/sub-unit, or any of the modules/units/sub-units may be split into a plurality of modules/units/sub-units. Alternatively, at least some of the functionality of one or more of these modules/units/sub-units may be combined with at least some of the functionality of other modules/units/sub-units and implemented in one module/unit/sub-unit. According to embodiments of the present disclosure, at least one of the first acquisition module 710, the first processing module 720, the first determination module 730, and the second processing module 740 may be implemented at least in part as hardware circuitry, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or as hardware or firmware in any other reasonable manner of integrating or packaging the circuitry, or as any one of or a suitable combination of any of the three. Alternatively, at least one of the first acquisition module 710, the first processing module 720, the first determination module 730, and the second processing module 740 may be at least partially implemented as computer program modules, which when executed, may perform the respective functions.
Note that, in the embodiment of the present disclosure, the code generating device portion corresponds to the code generating method portion in the embodiment of the present disclosure, and the description of the code generating device portion specifically refers to the code generating method portion and is not described herein again.
Fig. 8 schematically illustrates a block diagram of an electronic device adapted to implement a code generation method according to an embodiment of the disclosure. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, a computer electronic device 800 according to an embodiment of the present disclosure includes a processor 801 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 802 or a program loaded from a storage section 809 into a Random Access Memory (RAM) 803. The processor 801 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or an associated chipset and/or special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), or the like. The processor 801 may also include on-board memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing the different actions of the method flows according to embodiments of the disclosure.
In the RAM 803, various programs and data required for the operation of the electronic device 800 are stored. The processor 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. The processor 801 performs various operations of the method flow according to the embodiments of the present disclosure by executing programs in the ROM 802 and/or the RAM 803. Note that the program may be stored in one or more memories other than the ROM 802 and the RAM 803. The processor 801 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
According to an embodiment of the present disclosure, the electronic device 800 may also include an input/output (I/O) interface 805, the input/output (I/O) interface 805 also being connected to the bus 804. The electronic device 800 may also include one or more of the following components connected to an input/output (I/O) interface 805: an input portion 806 including a keyboard, mouse, etc.; an output portion 807 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and a speaker; a storage section 808 including a hard disk or the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. The drive 810 is also connected to an input/output (I/O) interface 805 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as needed so that a computer program read out therefrom is mounted into the storage section 808 as needed.
According to embodiments of the present disclosure, the method flow according to embodiments of the present disclosure may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable storage medium, the computer program comprising program code for performing the method shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section 809, and/or installed from the removable media 811. The above-described functions defined in the system of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, devices, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
The present disclosure also provides a computer-readable storage medium that may be embodied in the apparatus/device/system described in the above embodiments; or may exist alone without being assembled into the apparatus/device/system. The computer-readable storage medium carries one or more programs which, when executed, implement methods in accordance with embodiments of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples may include, but are not limited to: 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), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
For example, according to embodiments of the present disclosure, the computer-readable storage medium may include ROM 802 and/or RAM 803 and/or one or more memories other than ROM 802 and RAM 803 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program comprising program code for performing the methods provided by the embodiments of the present disclosure, the program code for causing an electronic device to implement the code generation methods provided by the embodiments of the present disclosure when the computer program product is run on the electronic device.
The above-described functions defined in the system/apparatus of the embodiments of the present disclosure are performed when the computer program is executed by the processor 801. The systems, apparatus, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the disclosure.
In one embodiment, the computer program may be based on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed, and downloaded and installed in the form of a signal on a network medium, and/or from a removable medium 811 via a communication portion 809. The computer program may include program code that may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
According to embodiments of the present disclosure, program code for performing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, such computer programs may be implemented in high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. Programming languages include, but are not limited to, such as Java, c++, python, "C" or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., connected via the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. Those skilled in the art will appreciate that the features recited in the various embodiments of the disclosure and/or in the claims may be combined in various combinations and/or combinations, even if such combinations or combinations are not explicitly recited in the disclosure. In particular, the features recited in the various embodiments of the present disclosure and/or the claims may be variously combined and/or combined without departing from the spirit and teachings of the present disclosure. All such combinations and/or combinations fall within the scope of the present disclosure.
The embodiments of the present disclosure are described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the embodiments cannot be used advantageously in combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be made by those skilled in the art without departing from the scope of the disclosure, and such alternatives and modifications are intended to fall within the scope of the disclosure.

Claims (13)

1. A code generation method, comprising:
responding to a received code generation instruction, and acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction further comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship;
processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information;
determining business flow information in response to detecting a selection operation of a user on N target components on a component panel, wherein N is a positive integer; and
And calling a generating method corresponding to the application program receiving a identifier, and processing the difference information and the business flow information to obtain an object code.
2. The method of claim 1, wherein the difference information comprises resource difference information;
the processing, according to the dependency relationship, the plurality of compressed files and stock files corresponding to the plurality of compressed files, to obtain difference information includes:
in response to a timing task being triggered, determining current resource information corresponding to a current system time and historical resource information corresponding to a historical system time from a resource library, wherein the historical system time is determined according to the current system time; and
and generating the resource difference information according to the current system time, the current resource information and the historical resource information in response to the fact that the current resource information and the historical resource information are not matched.
3. The method of claim 2, wherein the difference information further comprises version difference information;
the method further comprises the steps of:
sequentially determining an ith compressed file in the plurality of compressed files according to the dependency relationship;
Determining an ith stock file from the plurality of stock files according to the ith compressed file; and
and generating the version difference information according to the file identification corresponding to the ith stock file, the current version information and the historical version information in response to the fact that the current version information corresponding to the ith compressed file and the historical version information corresponding to the ith stock file are not matched.
4. A method according to any one of claims 1 to 3, further comprising, after said processing the plurality of compressed files and stock files corresponding to each of the plurality of compressed files according to the dependency relationship, obtaining difference information:
in response to monitoring that the difference information is generated, presenting the difference information to the user; and
and in response to detecting the permission operation of the user on the difference information, updating the stock file according to the difference information.
5. The method of claim 1, wherein the code generation instructions further comprise a business scenario identification;
the method further includes, prior to the determining business process information in response to detecting a user selection operation for N target components on the component panel:
Determining candidate business process information according to the business scene identifications, wherein the candidate business process information comprises a first number of candidate sub-process identifications and candidate component identifications corresponding to a second number of candidate sub-process identifications, and the first number is greater than or equal to the second number; and
and displaying a second number of first candidate components on the component panel according to the second number of candidate component identifications, wherein the second number of first candidate components respectively correspond to a selection box, and the candidate components comprise at least one of a technical configuration component and an operation and maintenance configuration component.
6. The method of claim 5, wherein the component panel further comprises a third number of second candidate components thereon;
the determining business process information in response to detecting the selection operation of the user on N target components on the component panel comprises:
in response to detecting a selection operation of a user for a target selection box in the second number of selection boxes, determining a first candidate component corresponding to the target selection box as the target component;
in response to detecting a drag operation by a user on any of the third number of second candidate components, determining the second candidate component as the target component;
Determining a fourth number of sub-process identifiers and target component identifiers corresponding to a fifth number of sub-process identifiers according to the candidate business process information and the position relation of the N target components on the component panel, wherein the fourth number is larger than or equal to the fifth number; and
and determining the business process information according to the candidate business process information, the fourth number of sub-process identifiers and the target component identifiers corresponding to the fifth number of sub-process identifiers.
7. The method of claim 6, wherein the business process information comprises P sub-process identifiers, a script to be processed corresponding to each of the P sub-process identifiers, and a target component identifier corresponding to each of Q sub-process identifiers, P and Q being positive integers, and Q being equal to or less than P;
and under the condition that P is more than 1 and less than or equal to P, the calling a generating method corresponding to the application program interface identifier, processing the difference information and the business flow information, and obtaining an object code comprises the following steps:
sequentially determining a P-th sub-flow identifier in the P sub-flow identifiers;
when the target component identifier corresponding to the p-th sub-flow identifier does not exist, calling an application program interface corresponding to the application program interface identifier, and processing a script to be processed corresponding to the p-th sub-flow identifier according to difference information corresponding to the p-th sub-flow identifier to obtain a processed script corresponding to the p-th sub-flow identifier;
When the target component identifier corresponding to the p-th sub-flow identifier exists, processing a script to be processed corresponding to the p-th sub-flow identifier according to difference information corresponding to the p-th sub-flow identifier by utilizing a target component corresponding to the target component identifier, so as to obtain a processed script corresponding to the p-th sub-flow identifier; and
and responding to the completion of processing of the to-be-processed scripts corresponding to the P sub-flow identifiers respectively, and determining the target code according to the processed scripts corresponding to the P sub-flow identifiers respectively.
8. A method according to any one of claims 1 to 3, wherein, in response to receiving a code generation instruction, obtaining a plurality of compressed files from an item identification indicated by the code generation instruction comprises:
in response to receiving the code generation instruction, determining a project object model file corresponding to the project identifier according to the project identifier;
responsive to the absence of a dependency corresponding to the project object model file in the local repository, searching for a dependency corresponding to the project object model file in the remote repository; and
In response to the dependency corresponding to the project object model file existing in the remote repository, the plurality of compressed files are obtained from the remote repository according to the dependency corresponding to the project object model file.
9. A method according to any one of claims 1 to 3, further comprising, after said calling a generating method corresponding to said application program interface identifier, processing said difference information and said business process information to obtain an object code:
in response to receiving a service processing instruction, acquiring the target code corresponding to a target service scene identifier according to the target service scene identifier indicated by the service processing instruction, wherein the service processing instruction further comprises service information to be processed, and the target service scene identifier comprises at least one of a service function identifier and an operation maintenance identifier; and
and executing the target code so as to process the service information to be processed.
10. A code generating apparatus comprising:
the first acquisition module is used for responding to a received code generation instruction, acquiring a plurality of compressed files according to item identifiers indicated by the code generation instruction, wherein the code generation instruction also comprises an application program interface identifier, and the plurality of compressed files have a dependency relationship;
The first processing module is used for processing the plurality of compressed files and stock files corresponding to the plurality of compressed files respectively according to the dependency relationship to obtain difference information;
the first determining module is used for determining business flow information in response to detecting the selection operation of a user on N target components on the component panel, wherein N is a positive integer; and
and the second processing module is used for calling a generating method corresponding to the application program interface identifier, and processing the difference information and the business flow information to obtain an object code.
11. An electronic device, comprising:
one or more processors;
a memory for storing one or more instructions,
wherein the one or more instructions, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1 to 9.
12. A computer readable storage medium having stored thereon executable instructions which when executed by a processor cause the processor to implement the method of any of claims 1 to 9.
13. A computer program product comprising computer executable instructions for implementing the method of any one of claims 1 to 9 when executed.
CN202311609620.0A 2023-11-29 2023-11-29 Code generation method and device, electronic equipment and computer readable storage medium Pending CN117519722A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311609620.0A CN117519722A (en) 2023-11-29 2023-11-29 Code generation method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311609620.0A CN117519722A (en) 2023-11-29 2023-11-29 Code generation method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117519722A true CN117519722A (en) 2024-02-06

Family

ID=89766166

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311609620.0A Pending CN117519722A (en) 2023-11-29 2023-11-29 Code generation method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117519722A (en)

Similar Documents

Publication Publication Date Title
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
US10152400B2 (en) Method and system for dynamically unblocking customers in critical workflows by pushing community contributed solutions just-in-time when an error is encountered
CN113900834B (en) Data processing method, device, equipment and storage medium based on Internet of things technology
CN114490272A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113515271B (en) Service code generation method and device, electronic equipment and readable storage medium
CN113157523B (en) Service monitoring method and device, computer equipment and storage medium
CN113032256B (en) Automated testing method, apparatus, computer system, and readable storage medium
CN115760013A (en) Operation and maintenance model construction method and device, electronic equipment and storage medium
CN117519722A (en) Code generation method and device, electronic equipment and computer readable storage medium
CN114237821A (en) Self-discovery method and device for Kubernetes container cluster, electronic device and storage medium
CN114281586A (en) Fault determination method and device, electronic equipment and computer readable storage medium
CN113986258A (en) Service publishing method, device, equipment and storage medium
CN115190008B (en) Fault processing method, fault processing device, electronic equipment and storage medium
CN116401319B (en) Data synchronization method and device, electronic equipment and computer readable storage medium
CN113535568B (en) Verification method, device, equipment and medium for application deployment version
CN113762871B (en) Production data control method, device, equipment and storage medium
US11150966B1 (en) Managing toast notifications via a toast adapter and plugins
CN116382703B (en) Software package generation method, code development method and device, electronic equipment and medium
CN114640585B (en) Resource updating method and device, electronic equipment and storage medium
CN116975200A (en) Method, device, equipment and medium for controlling working state of server
CN117130812A (en) System fault detection method, apparatus, device, medium and program product
CN116560692A (en) Service resource updating method, device, equipment and storage medium
CN117176576A (en) Network resource changing method, device, equipment and storage medium
CN114266547A (en) Method, device, equipment, medium and program product for identifying business processing strategy
CN116719538A (en) Version deployment consistency verification method and device

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