CN114816361A - Method, device, equipment, medium and program product for generating splicing project - Google Patents

Method, device, equipment, medium and program product for generating splicing project Download PDF

Info

Publication number
CN114816361A
CN114816361A CN202210448866.3A CN202210448866A CN114816361A CN 114816361 A CN114816361 A CN 114816361A CN 202210448866 A CN202210448866 A CN 202210448866A CN 114816361 A CN114816361 A CN 114816361A
Authority
CN
China
Prior art keywords
configuration
component
project
template
file
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
CN202210448866.3A
Other languages
Chinese (zh)
Inventor
马斌
邓晓辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 CN202210448866.3A priority Critical patent/CN114816361A/en
Publication of CN114816361A publication Critical patent/CN114816361A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Abstract

The disclosure provides a construction project generation method, which can be applied to the technical field of software development. The method for generating the splicing project comprises the following steps: responding to the request variable, and extracting a request component list, engineering dependent coordinates and request variable configuration information in the request variable; acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information; assembling according to the engineering dependent coordinates and the plurality of assembly dependent coordinates to obtain an engineering model file; carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain engineering related files, wherein the engineering related files comprise engineering configuration files and engineering code files; and generating a splicing project according to the project model file, the project configuration file and the project code file. The present disclosure also provides a construction project generating apparatus, a device, a storage medium and a program product.

Description

Method, device, equipment, medium and program product for generating splicing project
Technical Field
The present disclosure relates to the field of computer technologies, particularly to the field of software development technologies, and more particularly, to a method, an apparatus, a device, a medium, and a program product for building a construction.
Background
In the multi-party cooperative development, the development mode is usually based on a universal code template. However, the existing universal code template has many disadvantages such as too large granularity and insufficient flexibility, and these disadvantages further affect the development efficiency of multi-party cooperative development, so that the existing technology cannot meet the increasing requirements of multi-party cooperative development.
Therefore, how to further improve the efficiency of multi-party cooperative development becomes an urgent technical problem to be solved.
Disclosure of Invention
In view of the foregoing, the present disclosure provides a spelling project generation method, apparatus, device, medium, and program product that improve software development efficiency.
According to a first aspect of the present disclosure, a method for generating a spelling project is provided, including: responding to a request variable, and extracting a request component list, engineering dependent coordinates and request variable configuration information in the request variable; acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information; assembling according to the engineering dependent coordinates and the plurality of assembly dependent coordinates to obtain an engineering model file; carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain project related files, wherein the project related files comprise project configuration files and project code files; and generating a splicing project according to the project model file, the project configuration file and the project code file.
According to an embodiment of the present disclosure, the component template configuration information includes: a general configuration template, a custom code template, and an annotation information template.
According to an embodiment of the present disclosure, the performing configuration processing according to the request variable configuration information and the component template configuration information to obtain an engineering related file includes: acquiring a general configuration template and a user-defined configuration template; and replacing the variables of the corresponding configuration items in the general configuration template and the custom configuration template based on the variables of all the configuration items in the request variable configuration information to obtain a general configuration file and a custom configuration file.
According to the embodiment of the disclosure, the configuration items in the general configuration file at least comprise policy sequence numbers, the policy sequence numbers are used for realizing configuration policies of different components, the configuration policies at least comprise a replacement configuration policy and a separation configuration policy,
after configuring the corresponding variables in the general configuration template and the custom configuration template based on the request variable configuration information to obtain a general configuration file and a custom configuration file, the method further comprises the following steps: traversing all configuration items in the component metadata to be pieced together; judging whether variables of the same configuration items exist among the configuration items of different components; and configuring the strategy sequence number based on a principle of avoiding configuration conflict under the condition that the variables of the same configuration item exist among the configuration items of different components.
According to an embodiment of the present disclosure, the performing configuration processing according to the request variable configuration information and the component template configuration information to obtain an engineering related file includes: extracting self-defined code templates of different components for the project code file; splicing the custom code template and the annotation information template in different components to obtain a first project code file; and modifying the annotation information templates of different components in the first engineering code file to obtain the engineering code file.
According to an embodiment of the present disclosure, the categories of the component metadata include: the system comprises a middleware access component, an interface calling adaptation component, a processing chain current limiting component, a processing chain gray level routing component, a processing chain service anti-recombination component, an asynchronous task component and an encryption and decryption component.
According to a second aspect of the present disclosure, there is provided a construction project generation apparatus, including: the system comprises a request variable extraction module, a component metadata matching module, a coordinate assembly module, an engineering configuration module and a splicing engineering generation module, wherein the request variable extraction module is used for responding to a request variable and extracting a request component list, engineering dependent coordinates and request variable configuration information in the request variable; the component metadata matching module is used for acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information; the coordinate assembling module is used for assembling according to the engineering dependent coordinates and the assembly dependent coordinates to obtain an engineering model file; the project configuration module is used for carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain project related files, wherein the project related files comprise project configuration files and project code files; and the construction project generating module is used for generating a construction project according to the project model file, the project configuration file and the project code file.
According to an embodiment of the present disclosure, the component template configuration information includes: a general configuration template, a custom code template, and an annotation information template.
According to the embodiment of the disclosure, the engineering configuration module is further configured to obtain a general configuration template and a custom configuration template; and replacing the variables of the corresponding configuration items in the general configuration template and the custom configuration template based on the variables of all the configuration items in the request variable configuration information to obtain a general configuration file and a custom configuration file.
According to the embodiment of the present disclosure, the configuration items in the general configuration file at least include policy sequence numbers, where the policy sequence numbers are used to implement configuration policies of different components, the configuration policies at least include a replacement configuration policy and a separate configuration policy, and the engineering configuration module is further configured to traverse all configuration items in the component metadata to be pieced together; judging whether variables of the same configuration items exist among the configuration items of different components; and configuring the strategy sequence number based on a principle of avoiding configuration conflict under the condition that the variables of the same configuration item exist among the configuration items of different components.
According to the embodiment of the disclosure, the engineering configuration module is further configured to extract custom code templates of different components; splicing the custom code template and the annotation information template in different components to obtain a first project code file; and modifying the annotation information templates of different components in the first engineering code file to obtain the engineering code file.
According to an embodiment of the present disclosure, the categories of the component metadata include: the system comprises a middleware access component, an interface calling adaptation component, a processing chain current limiting component, a processing chain gray level routing component, a processing chain service anti-recombination component, an asynchronous task component and an encryption and decryption component.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the construction method.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which when executed by a processor, cause the processor to perform the above-mentioned construction method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described spelling project generating method.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a spelling project generation method, apparatus, device, medium and program product according to an embodiment of the disclosure;
FIG. 2 schematically illustrates a flow diagram of a construction generation method according to an embodiment of the disclosure;
FIG. 3 schematically illustrates a flow chart of a project profile generation method according to an embodiment of the disclosure;
FIG. 4 schematically illustrates a flow chart of an engineering code file generation method according to an embodiment of the present disclosure;
FIG. 5 schematically shows a flow diagram of policy configuration according to an embodiment of the disclosure;
FIG. 6 schematically shows a block diagram of a construction generation apparatus according to an embodiment of the present disclosure; and
FIG. 7 schematically illustrates a block diagram of an electronic device suitable for implementing a construction method according to an embodiment of the present 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 illustrative only 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 disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not 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 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 is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have 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.).
Before setting forth the disclosure in detail, the key terms used in the disclosure are presented as follows:
metadata: the various elements that make up a component are collectively referred to as metadata, such as source code, third party dependent coordinates, configuration files, and the like.
Splicing: in particular to the combination of metadata constituting different framework and component example codes.
Splicing engineering: a software project based on a spelling typically includes a plurality of project files.
Variables are as follows: in particular to configuration items depending on specific requirements in the splicing.
Scaffold: and the code layout engine is used for assembling different frameworks and components.
Low code principle: refers to the principle that developers can quickly generate engineering/applications without coding or with a small amount of code.
And (6) Maven: and the project object model completes construction of the project through the description information.
Spring: a software development framework.
A Java virtual machine: (JVM), a fictional computer, so that the Java language does not need to be recompiled when run on different platforms.
In the prior art, a set of unified Java end development framework (Spring boot or other self-developed framework) is usually used for coding development of interactive applications between a bank and a partner, a set of universal development components (encryption and decryption components, transaction current limiting components, message conversion components, database connection components, RPC framework, and the like) are used, a set of unified code templates suitable for different applications can be usually formed under a standardized code structure formed for a long time, and a coding process usually refers to an instruction manual and is combined with a universal example engineering template for secondary development.
In mainstream technologies in the industry (such as Spring community, ali cloud community, etc.), a code is mostly used to automatically generate a scaffold, and different components are pieced together, that is, component-level support is provided. Component level lifecycle: component introduction, component configuration, function development and online operation and maintenance. Spring communities currently only implement the function of "component introduction", i.e. the assembly of different components depending on coordinates. On the basis of solving the problem of 'component introduction', the Aliskiu community adds an electronic box using method and sample codes of the components into a project and provides independent sample codes and built-in configuration samples for each component.
In the prior art, in a multi-party cooperative development scenario, particularly in a development scenario of interactive application between a bank and a partner, a development mode based on a general code template generally has the following disadvantages:
1. the template is heavier and more complicated, and the degree of coupling between the template insides is high, is difficult to select different subassemblies to arrange according to actual demand is nimble, and tailor, the decoupling cost height of template inside subassembly promptly.
2. The universal code template is difficult to expand components, new components are often required to be learned on the basis of being familiar with the original template code, the compatibility problem of new construction and templates is also solved, the template can be expanded, and the cost is too high.
3. The development mode based on the universal code template is difficult to meet the current development requirement, and the development mode of the template codes commonly used in the banking industry is difficult to meet the development requirements of small, flexible and block in the micro-service, agile development and lean development modes.
In order to solve the technical problems of overlarge granularity and insufficient expansibility of a universal template in the prior art, the embodiment of the disclosure provides a construction project generating method, which is used for responding to a request variable and extracting a request component list, project dependent coordinates and request variable configuration information in the request variable; acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information; assembling according to the engineering dependent coordinates and the plurality of assembly dependent coordinates to obtain an engineering model file; and carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain a project related file, wherein the project related file comprises a project configuration file and a project code file.
In the embodiment of the disclosure, the preset component metadata is freely selected based on project requirements, and by assembling the dependency coordinates and configuring the project related files, the free assembly between the components is realized, the original development mode of the fixed template is replaced, the development flexibility is improved while the low-code principle is satisfied, and the assembly project generation method has more efficient development efficiency and wider application scenarios.
Fig. 1 schematically shows an application scenario diagram of a spelling project generation method according to an embodiment of the present disclosure.
As shown in fig. 1, an application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be noted that the spelling project generation method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the construction project generating device provided by the embodiment of the present disclosure may be generally disposed in the server 105. The construction method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and/or the server 105. Correspondingly, the mashup project generating device provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
The detailed description of the spelling project generation method of the disclosed embodiment will be made with fig. 2 to 5 based on the scenario described in fig. 1.
FIG. 2 schematically shows a flow chart of a construction method according to an embodiment of the present disclosure.
As shown in fig. 2, the construction method of the embodiment includes operations S210 to S250, and the construction method may be performed by the server 105.
In operation S210, in response to a request variable, a request component list, engineering dependent coordinates, and request variable configuration information in the request variable are extracted.
According to an embodiment of the present disclosure, the categories of the component metadata include: the system comprises a middleware access component, an interface calling adaptation component, a processing chain current limiting component, a processing chain gray level routing component, a processing chain service anti-recombination component, an asynchronous task component and an encryption and decryption component. In the embodiment of the disclosure, various types of components increase the application scenarios of the disclosure, and the generalization capability of the disclosure is improved.
In particular, the creation of the construction may employ tools commonly used for component collages, such as Maven or Gradle.
It should be noted that, before operation S210, the request variable needs to be configured. For example, the configuration process for the request variable may be: the developer selects the components to be spliced required by the project at the front end, wherein the front end comprises a splicing page, and the splicing page provides various components which can be spliced. After the selection is completed, the request variables corresponding to the project are generated for all the components to be spliced, the request variables are the unedited request variables, and the unedited request variables are edited according to the requirements of the project, so that the request variables can be generated.
Generally, the editing of the request variable includes: basic information of engineering, a request component list and request variable configuration information of a component to be configured. The basic information of the project comprises a project name, a description of the project and project dependent coordinates, and the request component list comprises: the request variable configuration information of the component to be configured includes: variable group ID, variable group name, variable Key, and input variable value.
For example, in the Java implementation environment, the basic information of the project includes: the project name is as follows: "test", engineering description: "intelligent spelling project 1.0", project dependent coordinates "com. demo: 1.0-SNAPSHOT ', wherein the engineering dependent coordinate consists of package information, unique identification and version number, the package information corresponds to com.xxx.xxx, the unique identification corresponds to demo, and the version number corresponds to 1.0-SNAPSHOT'. The list of requesting components includes: component ID "10086", component name "configuration center". The configuration information of the component to be configured comprises: variable group ID: "10086", variable group name: "Apollo configuration center", variable Key: "APP _ ID" and input variable value: "284", wherein the variable Key is a variable of a configuration item. It should be further noted that, the configuration items in different types of components are different, so that the formats and values of the variables for different configuration items are different, and the policy for configuring the variables is also different. Taking an encryption and decryption component as an example, when the component is configured, the configuration items to be configured include an "internal encryption and decryption mode", an "internal algorithm mode", a "3 DES Key file path", and an "encoding format", the variables configuring the configuration items are referred to as configuration information of the component to be configured in the request variables, four configuration items correspond to "variable keys", and the configuration of the variables in each configuration item corresponds to "input variable values".
Specifically, before the assembly is assembled, an engineering template needs to be called and created from a database, and the engineering template includes an engineering model file template, an engineering configuration file template and an engineering code file template, and defines a basic path for storing the engineering model file template, the engineering configuration file template and the engineering code file template. When the contents of the project model file template, the project configuration file template and the project code file template are modified, the basic path is followed.
In operation S220, corresponding component metadata is obtained according to the requested component list, where the component metadata includes component dependent coordinates and component template configuration information.
Specifically, the component-dependent coordinates and the engineering-dependent coordinates also include package information, a unique identifier, and a version number. And will not be described in detail herein.
According to an embodiment of the present disclosure, the component template configuration information includes: a general configuration template, a custom code template, and an annotation information template. Specifically, a general configuration template, a custom code template, and an annotation information template need to be acquired to implement subsequent configuration.
Specifically, the universal file template includes port information, a policy sequence number, a related component ID, a related component configuration block ID, and the like; the configuration file template comprises: a user-defined configuration file splicing path, a user-defined configuration file storage path and the like; the example code template includes: a spelling component example code spelling path, a spelling component example code storage path and the like; the annotation configuration template comprises a start statement, a start statement class and the like.
It should be noted that each component metadata has its own component ID in the database, and the component metadata in the database is matched by requesting the component ID to be selected from the component list. And finding corresponding component metadata from the database by requesting the component list, wherein the component metadata can be regarded as a data template, replacing data needing to be replaced in the data template according to different data in the request variables, and completing the splicing operation of the different component metadata.
In operation S230, an engineering model file is obtained by assembling according to the engineering dependent coordinates and the plurality of component dependent coordinates.
For example, the engineering model file template obtained when the Maven engineering is created is edited, that is, the engineering dependent coordinates and the plurality of component dependent coordinates are assembled in the engineering model file template to obtain the engineering model file pom. Xml is a basic file constituting a Maven project, and is mainly used for managing dependency relationships.
In operation S240, a configuration process is performed according to the request variable configuration information and the component template configuration information to obtain a project-related file, where the project-related file includes a project configuration file and a project code file.
Specifically, the created engineering model file template is edited, that is, the engineering dependent coordinates and the plurality of component dependent coordinates are assembled in the engineering model file template to obtain the engineering model file.
In operation S250, a construction project is generated according to the project model file, the project configuration file, and the project code file.
Specifically, after the files necessary for the construction Project (Project), i.e. the Project model file, the Project configuration file and the Project code file, are created and configured, it means that the creation of a executable construction Project is completed.
In the embodiment of the disclosure, the preset component metadata is freely selected based on project requirements, and by assembling the dependency coordinates and configuring the project related files, the free assembly between the components is realized, the original development mode of the fixed template is replaced, the development flexibility is improved while the low-code principle is satisfied, and the assembly project generation method has more efficient development efficiency and wider application scenarios.
As shown in fig. 3, the project profile generation method of this embodiment includes operations S310 to S320, and the construction method may be performed by the server 105.
In operation S310, a generic configuration template and a custom configuration template are acquired.
Specifically, the relevant configuration items in the general configuration template and the custom configuration template are derived from the component metadata required by the splicing project, and can be regarded as the general configuration file and the custom configuration file which are not configured in the project configuration file template. The method comprises the steps of acquiring a general configuration template and a user-defined configuration template, and configuring variables of configuration items in the general configuration template and the user-defined configuration template to obtain a general configuration file and a user-defined configuration file.
According to an embodiment of the present disclosure, the generic configuration template includes: a policy sequence number, a related component ID, and a related component configuration block ID. The policy sequence number corresponds to configuration policies of different components, and the configuration policies at least include a replacement configuration policy and a separate configuration policy.
Specifically, for example, there are component a and component B to be pieced together in one piece of piecing together engineering, and for component a part in the general configuration template, the policy sequence number is used to describe the configuration policy between the two components, i.e. the configuration policies of component a and component B; the related component ID is used for describing the ID of another component, namely describing the ID of the component B; the related component configuration block ID is used to describe the configuration block ID of another component, i.e., the configuration block ID of component B. And the variable for configuring the universal configuration file splicing path is automatically generated when the splicing project is established.
For another example, the replacement configuration policy includes replacing a certain configuration item of the component B by a certain configuration item of the component a, that is, the component a and the component B commonly use a certain configuration item. The separate configuration policy comprises a configuration item for separately configuring the component A and a configuration item for the component B, namely the component A and the component B separately use a certain configuration item.
According to an embodiment of the present disclosure, the custom configuration template includes a custom configuration file spelling path and a custom configuration file storage path.
Specifically, for example, for a custom configuration template of component a, the custom configuration file spelling path is used to specify a storage path of the spelled file in the database, and the custom configuration file storage path is used to find a storage path of component a (i.e., component metadata) in the database. And the variable for configuring the splicing path of the user-defined configuration file is automatically generated when the splicing project is established.
In operation S320, based on the variables of all configuration items in the request variable configuration information, the variables of the corresponding configuration items in the general configuration template and the custom configuration template are replaced, so as to obtain a general configuration file and a custom configuration file.
Specifically, the variables corresponding to the configuration items in the general configuration template and the custom configuration template are configured according to the request variable matching information, that is, the variables corresponding to the policy serial number, the related component ID, the related component configuration block ID, the custom configuration file splicing path, and the custom configuration file storage path are configured. And at this point, the creation of the general configuration file and the custom configuration file is completed, namely the creation and configuration of the project configuration file are completed.
In embodiments of the present disclosure, the generic configuration file specifies information about the associated configuration, and the custom configuration file specifies the associated path information. And the high-efficiency configuration of the general configuration file and the user-defined configuration file is realized through a replacement mode.
FIG. 4 schematically illustrates an engineering code file generation method according to an embodiment of the disclosure.
As shown in fig. 4, the construction plan generating method of this embodiment includes operations S410 to S430.
In operation S410, custom code templates of different components are extracted.
In operation S420, the custom code template and the annotation information template in different components are pieced together to obtain a first engineering code file.
According to an embodiment of the present disclosure, the custom code template includes an example code, an example code spelling path, and an example code storage path.
Specifically, for example, for the custom code template of component a, the example code spelling path is used to specify a storage path of the example code after spelling in the database, and the example code storage path is used to find a storage path of the example code of component a in the database. Wherein the variables used to configure the example code spelling path are automatically generated at the time of spelling project creation.
According to an embodiment of the present disclosure, the annotation information template includes an annotation statement and an annotation statement class.
In operation S430, the annotation information templates of different components in the first project code file are modified to obtain the project code file.
In particular, the annotation information template is modified, particularly for annotations of some initiating entry classes, in combination with dependencies between different components. And will not be described in detail herein.
At this point, the project code file creation and configuration is complete.
According to an embodiment of the present disclosure, further comprising: and adding starting parameters in the project configuration file.
For example, in the Java implementation environment, an operation of adding a JVM startup parameter is required.
It should be noted that the configured assembly project can be used as a new component to perform warehousing processing, a new component ID is generated and configured for the assembly project, and the project dependent coordinates in the project are used as component dependent coordinates to complete warehousing processing. The construction is called in another subsequent spelling project, and the spelling project is generated and used as component metadata. The method for generating the engineering has the capacity of splicing new components in stock engineering, provides the capacity of splicing new components in original application, and further improves the generalization capacity of the embodiment of the disclosure.
In the embodiment of the disclosure, the project code file is pieced together and annotation configuration is completed, and the configuration of the code level is realized. The generalization property is improved.
FIG. 5 schematically shows a flow diagram of policy configuration according to an embodiment of the disclosure.
As shown in fig. 5, the construction plan generating method of this embodiment includes operations S510 to S530.
It should be noted that, in operation S320, the configuration of the policy sequence number variable is only preliminary, and the final policy sequence number variable configuration needs to further verify whether a configuration conflict event occurs.
In operation S510, all configuration items in the component metadata to be pieced are traversed.
In operation S520, it is determined whether there are variables of the same configuration item among configuration items of different components.
In operation S530, in the case that there are variables of the same configuration item among configuration items of different components, the policy sequence number is configured based on a principle of avoiding configuration conflict.
In particular, when different components are combined, the same configuration item may be used, and such a situation may have a hidden danger of configuration conflict. For example, both components configure configuration items that operate on the database, although there may be differences in the variables in the configuration items. In such a case, a configuration policy needs to be provided to solve such problems. The policy sequence number field is provided to solve the problem of configuration conflict, different sequence numbers correspond to configuration policies aiming at different scenes, the configuration problem between two configuration items which are possibly conflicted is solved, the configuration policies are replaced or the configuration policies are separated, namely, two components can commonly use a certain configuration item or separately use respective configuration items, and corresponding adjustment can be carried out based on actual conditions. Generally, the configuration policy corresponding to the policy sequence number includes a replacement configuration policy and a separate configuration policy, the replacement configuration policy includes a configuration item of the component replacing another component and a configuration item of the component replacing another component, and the policy sequence number is default to the separate configuration.
For example, when the configuration items of the account password of the component a and the component B are consistent, repeated configuration is caused in the scene, and if the account password is verified, the information of the account password is repeatedly sent, so that a potential safety hazard is left. Therefore, the configuration strategy which can be selected in the implementation scene is the replacement configuration, so that the component A and the component B share the same configuration item, and further, no conflict is caused when account password verification is carried out.
It should be noted that, in the prior art, compared with a scaffold development mode used in the industry, a scaffold provided by a Spring community is too simple, although the scaffold provided by an ali cloud community basically meets the requirements in terms of functions, the internet scaffold cannot provide support for special components required by interactive application of a bank and a partner, meanwhile, the ali cloud scaffold provides a built-in configuration sample for the components, cannot preset configuration item values during makeup, is deficient in flexibility in configuring the scaffold, and does not provide a solution for the configuration conflict problem which may occur in the multi-component integration process, so that the requirement for interactive application makeup of the bank and the partner cannot be met.
In the embodiment of the disclosure, the problem of configuration conflict among components is restricted by setting the policy sequence number, so that adverse effects caused by configuration conflict are avoided.
Based on the construction project generating method, the disclosure also provides a construction project generating device. The apparatus will be described in detail below with reference to fig. 6.
Fig. 6 schematically shows a block diagram of a construction of a spelling project generating apparatus according to an embodiment of the present disclosure.
As shown in fig. 6, the construction plan generating apparatus 600 of this embodiment includes a request variable extracting module 610, a component metadata matching module 620, a coordinate assembling module 630, a construction configuration module 640, and a construction plan generating module 650.
The request variable extracting module 610 is configured to, in response to a request variable, extract a request component list, an engineering dependent coordinate, and request variable configuration information in the request variable. In an embodiment, the request variable extracting module 610 may be configured to perform the operation S210, which is not described herein again.
The component metadata matching module 620 is configured to obtain corresponding component metadata according to the request component list, where the component metadata includes component dependent coordinates and component template configuration information. In an embodiment, the component metadata matching module 620 may be configured to perform the operation S220, which is not described herein again.
The coordinate assembling module 630 is configured to assemble the engineering dependent coordinates and the plurality of component dependent coordinates to obtain an engineering model file. In an embodiment, the coordinate assembling module 630 may be configured to perform the operation S230, which is not described herein.
The project configuration module 640 performs configuration processing according to the request variable configuration information and the component template configuration information to obtain project-related files, where the project-related files include project configuration files and project code files. In an embodiment, the engineering configuration module 640 may be configured to perform the operation S240, which is not described herein again.
The construction project generating module 650 is configured to generate a construction project according to the project model file, the project configuration file, and the project code file. In an embodiment, the spelling project generating module 650 may be configured to perform the operation S250, which is not described herein.
In the embodiment of the disclosure, the preset component metadata is freely selected based on project requirements, and by assembling the dependency coordinates and configuring the project related files, the free assembly between the components is realized, the original development mode of the fixed template is replaced, the development flexibility is improved while the low-code principle is satisfied, and the assembly project generation method has more efficient development efficiency and wider application scenarios.
According to an embodiment of the present disclosure, the component template configuration information includes: a general configuration template, a custom code template, and an annotation information template.
According to an embodiment of the present disclosure, the engineering configuration module 630 is further configured to obtain a general configuration template and a custom configuration template; and replacing the variables of the corresponding configuration items in the general configuration template and the custom configuration template based on the variables of all the configuration items in the request variable configuration information to obtain a general configuration file and a custom configuration file.
According to an embodiment of the present disclosure, the configuration items in the general configuration file at least include policy sequence numbers, where the policy sequence numbers are used to implement configuration policies of different components, the configuration policies at least include a replacement configuration policy and a separate configuration policy, and the engineering configuration module 630 is further configured to traverse all configuration items in the component metadata to be pieced together; judging whether variables of the same configuration items exist among the configuration items of different components; and under the condition that the variables of the same configuration item exist among the configuration items of different components, configuring the strategy sequence number based on a principle of avoiding configuration conflict.
According to an embodiment of the present disclosure, the engineering configuration module 630 is further configured to extract custom code templates of different components; splicing the custom code template and the annotation information template in different components to obtain a first project code file; and modifying the annotation information templates of different components in the first engineering code file to obtain the engineering code file.
According to an embodiment of the present disclosure, the categories of the component metadata include: the system comprises a middleware access component, an interface calling adaptation component, a processing chain current limiting component, a processing chain gray level routing component, a processing chain service anti-recombination component, an asynchronous task component and an encryption and decryption component.
According to an embodiment of the present disclosure, any plurality of the request variable extraction module 610, the component metadata matching module 620, the coordinate assembling module 630, the project configuring module 640, and the spelling project generating module 650 may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the request variable extraction module 610, the component metadata matching module 620, the coordinate assembly module 630, the engineering configuration module 640, and the spelling project generation module 650 may be at least partially implemented as a hardware circuit, 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 may be implemented by hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or implemented by any one of three implementations of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the request variable extraction module 610, the component metadata matching module 620, the coordinate assembly module 630, the project configuration module 640, and the spelling project generation module 650 can be at least partially implemented as a computer program module that can perform corresponding functions when executed.
FIG. 7 schematically illustrates a block diagram of an electronic device suitable for implementing a construction method according to an embodiment of the present disclosure.
As shown in fig. 7, an electronic device 700 according to an embodiment of the present disclosure includes a processor 701, which can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)702 or a program loaded from a storage section 708 into a Random Access Memory (RAM) 703. The processor 701 may include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 701 may also include on-board memory for caching purposes. The processor 701 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. The processor 701 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 702 and/or the RAM 703. It is noted that the programs may also be stored in one or more memories other than the ROM 702 and RAM 703. The processor 701 may also perform various operations of method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 700 may also include input/output (I/O) interface 705, which input/output (I/O) interface 705 is also connected to bus 704, according to an embodiment of the present disclosure. The electronic device 700 may also include one or more of the following components connected to the I/O interface 705: an input portion 706 including a keyboard, a mouse, and the like; an output section 707 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 708 including a hard disk and the like; and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 710 as necessary, so that a computer program read out therefrom is mounted into the storage section 708 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement the method according to an embodiment of the disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is 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 present 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, a computer-readable storage medium may include the ROM 702 and/or the RAM 703 and/or one or more memories other than the ROM 702 and the RAM 703 described above.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the item recommendation method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 701. The systems, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted 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 in the form of a signal on a network medium, distributed, downloaded and installed via the communication section 709, and/or installed from the removable medium 711. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 709, and/or installed from the removable medium 711. The computer program, when executed by the processor 701, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, 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., through the internet using an internet service provider).
The flowchart 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 various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been 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 separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (10)

1. A method for generating a splicing project is characterized by comprising the following steps:
responding to a request variable, and extracting a request component list, engineering dependent coordinates and request variable configuration information in the request variable;
acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information;
assembling according to the engineering dependent coordinates and the plurality of assembly dependent coordinates to obtain an engineering model file;
carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain project related files, wherein the project related files comprise project configuration files and project code files; and
and generating a splicing project according to the project model file, the project configuration file and the project code file.
2. The method of claim 1, wherein the component template configuration information comprises: a general configuration template, a custom code template, and an annotation information template.
3. The method of claim 2, wherein the performing configuration processing according to the request variable configuration information and the component template configuration information to obtain a project-related file comprises:
acquiring a general configuration template and a user-defined configuration template;
and replacing the variables of the corresponding configuration items in the general configuration template and the custom configuration template based on the variables of all the configuration items in the request variable configuration information to obtain a general configuration file and a custom configuration file.
4. The method of claim 3, wherein the configuration items in the common configuration file at least comprise policy sequence numbers, the policy sequence numbers being used to implement configuration policies of different components, the configuration policies at least comprising an alternative configuration policy and a separate configuration policy,
after configuring the corresponding variables in the general configuration template and the custom configuration template based on the request variable configuration information to obtain a general configuration file and a custom configuration file, the method further comprises the following steps:
traversing all configuration items in the component metadata to be pieced together;
judging whether variables of the same configuration items exist among the configuration items of different components; and
and under the condition that the variables of the same configuration item exist among the configuration items of different components, configuring the strategy sequence number based on a principle of avoiding configuration conflict.
5. The method according to claim 2, wherein the performing configuration processing according to the request variable configuration information and the component template configuration information to obtain a project-related file comprises:
extracting custom code templates of different components;
splicing the custom code template and the annotation information template in different components to obtain a first project code file; and
and modifying the annotation information templates of different components in the first engineering code file to obtain the engineering code file.
6. The method of any of claims 1-5, wherein the categories of component metadata include: the system comprises a middleware access component, an interface calling adaptation component, a processing chain current limiting component, a processing chain gray level routing component, a processing chain service anti-recombination component, an asynchronous task component and an encryption and decryption component.
7. A construction project generation apparatus, comprising: a request variable extraction module, a component metadata matching module, a coordinate assembly module, an engineering configuration module and a splicing engineering generation module,
wherein, the first and the second end of the pipe are connected with each other,
the request variable extraction module is used for responding to a request variable and extracting a request component list, an engineering dependent coordinate and request variable configuration information in the request variable;
the component metadata matching module is used for acquiring corresponding component metadata according to the request component list, wherein the component metadata comprises component dependent coordinates and component template configuration information;
the coordinate assembling module is used for assembling according to the engineering dependent coordinates and the assembly dependent coordinates to obtain an engineering model file;
the project configuration module is used for carrying out configuration processing according to the request variable configuration information and the component template configuration information to obtain project related files, wherein the project related files comprise project configuration files and project code files; and
and the construction project generating module is used for generating a construction project according to the project model file, the project configuration file and the project code file.
8. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-6.
9. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 6.
CN202210448866.3A 2022-04-26 2022-04-26 Method, device, equipment, medium and program product for generating splicing project Pending CN114816361A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210448866.3A CN114816361A (en) 2022-04-26 2022-04-26 Method, device, equipment, medium and program product for generating splicing project

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210448866.3A CN114816361A (en) 2022-04-26 2022-04-26 Method, device, equipment, medium and program product for generating splicing project

Publications (1)

Publication Number Publication Date
CN114816361A true CN114816361A (en) 2022-07-29

Family

ID=82507459

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210448866.3A Pending CN114816361A (en) 2022-04-26 2022-04-26 Method, device, equipment, medium and program product for generating splicing project

Country Status (1)

Country Link
CN (1) CN114816361A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858012A (en) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115858012A (en) * 2022-12-30 2023-03-28 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium
CN115858012B (en) * 2022-12-30 2023-10-20 广州市易鸿智能装备有限公司 Program variable configuration method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US20210073051A1 (en) Late connection binding for bots
US11669503B2 (en) Building and managing data-processing attributes for modeled data sources
US20190325074A1 (en) Application programing interface document generator
US9690822B2 (en) System and method for metadata level validation of custom setup objects
JP7097958B2 (en) Systems and methods for integrating cloud applications into cloud service broker platforms using the Automatic Universal Connector Package
US11132114B2 (en) Method and apparatus for generating customized visualization component
US11797273B2 (en) System and method for enhancing component based development models with auto-wiring
CN111427561A (en) Service code generation method and device, computer equipment and storage medium
US20180196647A1 (en) Application Programming Interface Discovery Using Pattern Recognition
EP2667301A1 (en) Decision service manager
KR101086620B1 (en) Smart office system and server for managing the sames and method for managing the sames
CN114816361A (en) Method, device, equipment, medium and program product for generating splicing project
CN113448570A (en) Data processing method and device, electronic equipment and storage medium
US20230393832A1 (en) Automated translation of computer languages to extract and deploy computer systems and software
US11803786B2 (en) Enterprise integration platform
CN114756833A (en) Code obfuscation method, apparatus, device, medium, and program product
CN114449063A (en) Message processing method, device and equipment
CN113448960A (en) Method and device for importing form file
CN113032004A (en) Method, apparatus and program product for managing development jobs in a development environment
CN114679366B (en) Tenant-oriented operation and maintenance tool opening method, system and medium in multi-cloud environment
RU2814437C1 (en) Method and device for generating remote calls
CN114266547A (en) Method, device, equipment, medium and program product for identifying business processing strategy
CN116795339A (en) Service interface generation method, device, equipment and storage medium
CN114721713A (en) Annotation-based data processing method, computer device and readable storage medium
CN116820565A (en) Source code processing method, device, electronic equipment and medium

Legal Events

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