CN115407971A - Software product generation method and device - Google Patents

Software product generation method and device Download PDF

Info

Publication number
CN115407971A
CN115407971A CN202210994082.0A CN202210994082A CN115407971A CN 115407971 A CN115407971 A CN 115407971A CN 202210994082 A CN202210994082 A CN 202210994082A CN 115407971 A CN115407971 A CN 115407971A
Authority
CN
China
Prior art keywords
software product
target
template
manufactured
product
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
CN202210994082.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.)
Langxin Data Technology Co ltd
Original Assignee
Langxin Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Langxin Data Technology Co ltd filed Critical Langxin Data Technology Co ltd
Priority to CN202210994082.0A priority Critical patent/CN115407971A/en
Publication of CN115407971A publication Critical patent/CN115407971A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design

Landscapes

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

Abstract

The invention provides a software product generation method and a device, which are used for acquiring a target source code and a target software product template corresponding to a software product to be manufactured; generating a software product to be manufactured based on the target source code and the target software product template; wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition. The software product generation method and the device provided by the invention can standardize the flow and the mode of software product generation based on the software product format standard, and can avoid the influence of the execution level of developers and personal experience on the delivery standard of the software product, thereby improving the quality stability of the software product, reducing the labor cost and time cost required to be invested when the software product is generated, and improving the generation efficiency of the software product.

Description

Software product generation method and device
Technical Field
The invention relates to the technical field of computers, in particular to a software product generation method and device.
Background
In general, after a developer generates a software product through offline editing, an installation package of the software product may be distributed through a mail, an FTP, or the like, and an application person may manually deploy the software product to a target electronic device based on the installation package of the software product.
However, in the above process of generating a software product, the quality of the software product is greatly influenced by the execution level and personal experience of the developer, and the execution level and personal experience of the developer may directly influence the delivery standard of the software product. Moreover, a large amount of labor cost and time cost are required to be invested for generating the software product manually, and the generation efficiency of the software product is not high. Therefore, how to improve the quality stability and the generation efficiency of the software product is a technical problem that needs to be solved urgently by those skilled in the art.
Disclosure of Invention
The invention provides a software product generation method and device, which are used for overcoming the defects that the quality of a software product is greatly influenced by the execution level of developers and personal experience and the generation efficiency of the software product is low in the prior art, and improving the quality stability and the generation efficiency of the software product.
The invention provides a software product generation method, which comprises the following steps:
acquiring a target source code and a target software product template corresponding to a software product to be manufactured;
generating the software product to be manufactured based on the target source code and the target software product template;
wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of a software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
According to the software product generation method provided by the invention, the generation of the software product to be manufactured based on the target source code and the target software product template comprises the following steps:
compiling the target source code to obtain a target source code file executable program;
combining the executable program of the target source code file and the target software product template to obtain a product file of the software to be manufactured;
and compressing the product file to obtain the software product to be manufactured.
According to the software product generation method provided by the invention, the product name naming definition comprises the following steps: the name of the software product template needs to comprise a template identifier, a deployment mode identifier and a version identifier which are sequentially arranged;
the template identification, the deployment mode and the version of the software product template are determined based on a product description file carried by the software product template.
According to the software product generation method provided by the invention, after the software product to be manufactured is generated, the method further comprises the following steps:
and writing a digital signature for the software product to be manufactured based on a digital signature format specified in the software product format standard.
According to the software product generation method provided by the present invention, after writing the digital signature to the software product to be manufactured, the method further comprises:
and storing the software product to be manufactured with the digital signature in a product file library.
The software product generation method provided by the invention further comprises the following steps:
acquiring a target software product from a product file library;
and executing an automation script corresponding to the deployment mode which can be supported by the target software product, and deploying the target software product to the target resource.
According to the software product generation method provided by the present invention, when the deployment mode that can be supported by the target software product is the host deployment mode, the executing of the automation script corresponding to the deployment mode that can be supported by the target software product deploys the target software product to the target resource includes:
executing an automation script corresponding to a host deployment mode, and replacing an initial input variable in the automation script corresponding to the host deployment mode for deploying the target software product to a target resource;
wherein initial input variables of the automation script corresponding to the host deployment mode are predefined.
According to the software product generation method provided by the present invention, in a case that the deployment mode that can be supported by the target software product is the container deployment mode, the executing an automation script corresponding to the deployment mode that can be supported by the target software product deploys the target software product to a target resource includes:
acquiring a mirror image file corresponding to the target software product;
executing an automation script corresponding to a container deployment mode, and replacing an initial input variable in the automation script corresponding to the container deployment mode so as to deploy the image file to a target resource;
wherein the initial input parameters of the automation script corresponding to the container deployment mode are predefined.
According to the software product generation method provided by the present invention, in a case where the number of the target software products is plural, after the target software product is obtained from the product file library, the method further includes:
merging each target software product into a software product group;
and executing an automation script corresponding to the deployment mode which can be supported by the software product group, and deploying the software product group to a target resource.
The present invention also provides a software product generating apparatus, comprising:
the data acquisition module is used for acquiring a target source code and a target software product template corresponding to a software product to be manufactured;
the product generation module is used for generating the software product to be manufactured based on the target source code and the target software product template;
wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of a software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the software product generation method according to any one of the above.
The invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a software product generation method as described in any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a software product generation method as in any one of the above.
According to the software product generation method and device, after the target source code and the target software product template corresponding to the software product to be generated are obtained, the software product to be generated is generated based on the target source code and the target software product template, the target software product template is generated based on the software product format standard, the software product format standard is used for defining the file description and the directory structure of the software product template, the file description comprises product name naming definition, version definition, application parameter definition and container extension parameter definition, the software product generation process and mode can be standardized based on the software product format standard, the influence of the execution level of developers and personal experience on the delivery standard of the software product can be avoided, the quality stability of the software product can be improved, the labor cost and time cost required to be invested when the software product is generated can be reduced, and the generation efficiency of the software product can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a software product generation method provided by the present invention;
FIG. 2 is a second flowchart of the software product generation method provided by the present invention;
FIG. 3 is a schematic flow chart of deploying a software product in the software product generation method provided by the present invention;
FIG. 4 is a schematic flow chart of the software product group generated in the software product generation method provided by the present invention;
FIG. 5 is a schematic structural diagram of a software product generating device provided by the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood according to specific situations by those of ordinary skill in the art.
It should be noted that, the release of the traditional software product, the off-line editing of the software product by the developer, includes: program media, deployment scripts, and deployment specifications, among others. After the off-line editing of the traditional software product is completed, developers can collect and edit the publishing media, and the distribution of the installation package of the traditional software product is realized through mails or FTPs and other modes. The application personnel may manually deploy the legacy software product to the target electronic device based on the installation package of the legacy software product.
However, the above-mentioned conventional software product is manufactured, distributed and deployed, and has a problem that the standard of the installation medium is not uniform. In the distribution process of the installation package of the traditional software product, no flow, namely the guarantee of a platform, easily causes the file to be lost or tampered, and the integrity and the safety of the file are difficult to guarantee. In the actual deployment of the conventional software product, uniform flow unified configuration is difficult to realize. Moreover, each conventional software product is independently released, and the execution level and personal experience of the developer directly influence the delivery standard of the conventional software product.
Therefore, the invention provides a software product generation method, which can formulate a software product format standard on the basis of the technical development trend of a code warehouse and a continuous integration tool to construct a program package, standardize the flow and mode of software product generation, distribution and deployment based on the software product format standard, meet the software product specification requirements of a host and containerization deployment, provide a set of standards for opening the box and using the box and a technical solution for the generation, release and deployment of software products in a development, test, operation and maintenance environment, help a product team to perfect the product release and deployment flow, and realize the standardization of each link.
Fig. 1 is a flow chart of a software product generation method provided by the present invention. The software product generation method of the present invention is described below in conjunction with fig. 1. As shown in fig. 1, the method includes: step 101, acquiring a target source code and a target software product template corresponding to a software product to be manufactured.
Wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
The execution subject of the embodiment of the present invention is a software product generation apparatus.
Specifically, in the embodiment of the present invention, the target source code and the target software product template corresponding to the software product to be manufactured may be obtained in various ways. For example: the method comprises the following steps that a developer can write and input a target source code corresponding to a software product to be manufactured based on the generation requirement of the software product to be manufactured, and the developer can manufacture and input a target software product template corresponding to the software product to be manufactured based on the generation requirement of the software product to be manufactured and the format standard of the software product, so that the target source code corresponding to the software product to be manufactured and the target software product template can be obtained based on the input of a user; or, based on the generation requirement of the software product to be manufactured, the target source code corresponding to the software to be manufactured is searched and acquired from the stored source code, and the target software index template corresponding to the software to be manufactured is searched and acquired from the stored software product templates manufactured based on the software product format standard.
It should be noted that each application in the software product to be manufactured may correspond to one target software product template, and each middleware in the software product to be manufactured may also correspond to one target software product template. Therefore, the number of target software product templates corresponding to the software product to be manufactured is related to the number of applications and the number of middleware in the software product to be manufactured.
Fig. 2 is a second schematic flowchart of the software product generating method provided by the present invention. As shown in fig. 2, in the embodiment of the present invention, based on the generation requirement of the software product to be manufactured, a target software product template corresponding to the software product to be manufactured may be searched and obtained in the software product templates stored in the software product template library.
The software product template stored in the software product template library may be created by a developer based on a software product format standard. After the developer makes each software product template based on the software product format, the software index template can be uploaded to the software product template library for storage.
It can be understood that, under the condition that each software product template stored in the software product template library is manufactured based on the software product format standard, the target software product template corresponding to the software product to be manufactured, which is searched and acquired from the software product templates stored in the software product template library, is also manufactured based on the software product format standard.
As shown in fig. 2, in the embodiment of the present invention, based on the generation requirement of the software product to be manufactured, the target source code corresponding to the software product to be manufactured may be searched and obtained in the source code stored in the source code library.
The source code in the source code library may be written in advance by a developer. After the developer writes the source code, the source code can be uploaded to a source code library for storage.
It should be noted that the software product format standard in the embodiment of the present invention may be established based on a priori knowledge and/or actual conditions. The software product format standard can be used for defining the file description and the directory structure of the software product template, so that the application program, the middleware and the like can be packaged into the software product template according to the standard format.
Based on the content of the above embodiments, the product name definition includes: the name of the software product template needs to comprise a template identifier, a deployment mode identifier and a version identifier which are sequentially arranged; the template identification, deployment mode and version of the software product template are determined based on a product description file carried by the software product template.
Alternatively, the software artifact format standards may include, but are not limited to, artifact file naming and file format specifications, artifact file directory structure specifications, and artifact description file specifications.
The product file naming specification, including the name of the software product template, needs to include the template identifier, the deployment mode identifier and the version information which are arranged in sequence. For example, the name of any software artifact template is [ artifact english name ] _(dc | dm) [ artifact version ]. Wherein the [ product english name ] may be determined based on the enName in a product description file (product. Json) carried by the software product template, and the [ product version ] may be determined based on the version in the product description file carried by the software product template; dc represents a container deployment mode, dm represents a host deployment mode, and the deployment mode of the software product template can be determined based on a product description file carried by the software product template. Therefore, based on the name of any software product template, whether the software product template is used for container deployment or host deployment can be quickly and accurately determined.
It should be noted that the overall description of the product description file is shown in table 1.
TABLE 1 Overall description of the article description document
Figure BDA0003804914990000091
The product description file carried by any software product template can be used as the outline of the software product template and is used for describing the basic information (including a deployment mode, a standard template version, a product file Chinese name, a product file English name, a product version release instruction and the like) and application parameters, container extension parameters and extension parameters of the software product template. The product description file carried by the software product template can clearly define the use, the deployment mode and the definition specification of the related deployment mode of the software product template.
The product description file carried by any software product template is a Json file, and in order to facilitate conversion and meet the requirement of front and rear ends on parameter verification, the param object specification is defined in the embodiment of the invention, so that the definition and constraint of parameter values are clearly defined when the product files are made, and the flexibility and the expandability are enhanced. The param object specification is shown in table 2.
TABLE 2 param object Specification
Figure BDA0003804914990000101
It should be noted that the file format of the software product template is a zip format.
In the case that the deployment mode of any software product template is the container deployment mode, the directory structure of the software product template is as follows: [ app ] files required for product file deployment are stored in a directory;
documents or pvc configuration description information to be mounted on a container is stored in a directory;
a (confspec) directory stores configuration information files required when versions are deployed;
the [ script ] directory stores deployment scripts required when versions are deployed;
setup is an installation medium deployed in a directory storage container, which can compile and package a program by Jenkins, and place the compiled installation medium in the directory.
In the case that the deployment mode of any software product template is the host deployment mode, the directory structure of the software product template is as follows: [ app ] files required for product file deployment are stored in a directory;
the directory stores an pending operation, installation and configuration operation file;
a (confspec) directory stores configuration information files required when versions are deployed;
the [ script ] directory stores deployment scripts required when versions are deployed;
optionally, any software product template may also carry an image description file (Dockerfile). The image description file carried by any software product template can be used when generating an image file based on the software product template, and can be a predefined file.
And 102, generating a software product to be manufactured based on the target source code and the target software product template.
Specifically, after the target source code and the target software product template corresponding to the software product to be manufactured are obtained, the software product to be manufactured may be generated based on the target source code and the target software product template.
According to the embodiment of the invention, after the target source code and the target software product template corresponding to the software product to be manufactured are obtained, the software product to be manufactured is generated based on the target source code and the target software product template, the target software product template is generated based on the software product format standard, the software product format standard is used for defining the file description and the directory structure of the software product template, the file description comprises product name naming definition, version definition, application parameter definition and container extension parameter definition, and the software product generation process and mode can be standardized based on the software product format standard, so that the influence of the execution level of developers and personal experience on the delivery standard of the software product can be avoided, the quality stability of the software product can be improved, the labor cost and time cost required to be invested when the software product is generated can be reduced, and the generation efficiency of the software product can be improved.
Based on the content of the foregoing embodiments, generating a software product to be manufactured based on the target source code and the target software product template includes: and compiling the target source code to obtain the executable program of the target source code file.
Specifically, as shown in fig. 2, after the target source code corresponding to the software product to be manufactured is obtained, the target source code may be compiled, so that the executable program of the target source code file may be obtained.
And combining the executable program of the target source code file and the target software product template to obtain a product file of the software product to be manufactured.
Specifically, as shown in fig. 2, after the target source code file executable program is obtained, the binary file may be stored in a corresponding directory of the target software product template, so as to implement the combination of the target source code file executable program and the target software product template, and obtain the product file of the software product to be manufactured.
And compressing the product file to obtain the software product to be manufactured.
Specifically, as shown in fig. 2, after the product file of the software product to be manufactured is obtained, the product file of the software product to be manufactured may be compressed to obtain the software product to be manufactured.
According to the embodiment of the invention, the target source code corresponding to the software product to be manufactured is compiled, the target source code file executable program is obtained, then the target source code file executable program and the target software product template corresponding to the software product to be manufactured are combined, the product file of the software product to be manufactured is obtained, the product file is compressed, the software product to be manufactured is obtained, and the software product to be manufactured can be generated more simply and efficiently based on the target source code corresponding to the software product to be manufactured and the target software product template.
Based on the content of the foregoing embodiments, after generating a software product to be manufactured, the method further includes: and writing a digital signature for the software product to be manufactured based on a digital signature format specified in the software product format standard.
Optionally, the software product format standard may also include a software product digital signature format.
Specifically, as shown in fig. 2, in order to ensure the security of the software product and avoid the software product from being tampered in the distribution process, after the software product to be manufactured is generated, a corresponding digital signature may be generated for the software product to be manufactured by using a private key based on a digital signature format specified in a software product format standard by using an asymmetric encryption technology, and a bytecode of the digital signature is written into the software product to be manufactured.
According to the embodiment of the invention, after the software product to be manufactured is generated, the digital signature is written into the software to be manufactured based on the digital signature format specified in the software product format standard, so that the software to be manufactured can be prevented from being tampered in the distribution process, and the safety of the software product to be manufactured can be improved.
Based on the content of the foregoing embodiments, after writing the digital signature for the software product to be manufactured, the method further includes: and storing the software product to be manufactured with the digital signature in a product file library.
Specifically, as shown in fig. 2, after writing a digital signature for a software product to be manufactured, the software product to be manufactured with the digital signature written therein may be pushed to a product file library for classified storage according to the type and version of the software product to be manufactured.
The embodiment of the invention can standardize the distribution flow and mode of the software products by storing the software products to be manufactured written with the digital signatures, and can provide a set of standard and technical solution for opening the box and using the software products in the development, test, operation and maintenance environment.
Based on the content of the above embodiments, the method further includes: and acquiring the target software product from the product file library.
Fig. 3 is a schematic flow chart of deploying a software product in the software product generation method provided by the present invention. As shown in fig. 3, when the deployment mode of the software product includes a container deployment mode, when the software product enters a product file library, an image file (Docker) corresponding to the software product is generated based on an image description file carried by the software product, and the image file corresponding to the software product may be pushed to a container image library for storage.
In the embodiment of the invention, the target software product can be acquired from the software products stored in the container mirror image library based on the actual deployment requirement.
And executing an automation script corresponding to the deployment mode which can be supported by the target software product, and deploying the target software product to the target resource.
Specifically, after the target software artifact is retrieved from the container mirror library, the target software artifact may be deployed.
During the deployment process of the target software product, the target resource for deployment can be determined based on the deployment mode (host deployment mode or mirror deployment mode) which can be supported by the target software product.
The target software product deployment process is executed by the automation script corresponding to the deployment mode supportable by the target software product, and the target software product can be deployed to the target resource by executing the automation script corresponding to the deployment mode supportable by the target software product.
According to the embodiment of the invention, after the target software product is acquired from the software products stored in the container mirror library, the automatic script corresponding to the deployment mode which can be supported by the target software product is executed, the target software product is deployed to the target resource, the software product deployment flow and mode can be specified, the software product specification requirements of the host and container deployment mode can be met, and the software product deployment efficiency and stability can be improved.
Based on the content of the foregoing embodiments, in a case that the deployment mode supportable by the target software product includes the host deployment mode, executing an automation script corresponding to the deployment mode supportable by the target software product, and deploying the target software product to the target resource, includes: and executing the automation script corresponding to the host deployment mode, and replacing the initial input variable in the automation script corresponding to the host deployment mode so as to deploy the target software product to the target resource.
Wherein the initial input variables of the automation script corresponding to the host deployment mode are predefined.
Specifically, as shown in fig. 3, in the case that the deployment modes supportable by the target software product include a host deployment mode, the automation script corresponding to the host deployment mode may be executed and replace the initial input variables in the automation script.
The automatic script can read a preset deployment pipeline template and deploy the target software product to the target resource according to the execution steps preset in the deployment pipeline template. The target resource may be a host server.
It should be noted that the initial input variables of the automation script corresponding to the host deployment mode may be predefined based on a priori knowledge and/or actual conditions.
According to the embodiment of the invention, under the condition that the deployment modes which can be supported by the target software product comprise the host deployment mode, the automatic script corresponding to the host deployment mode is executed, and the initial input variable in the automatic script corresponding to the host deployment mode is replaced so as to deploy the target software product to the target resource, so that the software product deployment flow and mode of the host deployment mode can be standardized, and the software product deployment of the host deployment mode can be realized more accurately and efficiently.
Based on the content of the foregoing embodiments, in a case that the deployment mode supportable by the target software product includes the container deployment mode, executing the automation script corresponding to the deployment mode supportable by the target software product, and deploying the target software product to the target resource, includes: and acquiring the image file corresponding to the target software product.
Specifically, as shown in fig. 3, in a case that the deployment mode supportable by the target software product includes a container deployment mode, the image file corresponding to the target software product may be searched and acquired in the container image library.
And executing the automation script corresponding to the container deployment mode, and replacing the initial input variable in the automation script corresponding to the container deployment mode so as to deploy the image file to the target resource.
Wherein initial input parameters of the automation script corresponding to the container deployment mode are predefined.
Specifically, as shown in fig. 3, after the image file corresponding to the target software product is obtained, the automation script corresponding to the container deployment mode may be executed, and the initial input variable in the automation script may be replaced.
The automatic script can read a preset deployment pipeline template and deploy the target software product to the target resource according to the execution steps preset in the deployment pipeline template. Wherein, the target resource may be kubernets.
It should be noted that Kubernetes, abbreviated as K8s, is an abbreviation formed by replacing 8 characters "ubernet" in the middle of the name with 8. Is an open source for managing containerized applications on multiple hosts in a cloud platform.
It should be noted that the output and input variables of the automation script corresponding to the host deployment mode may be predefined based on a priori knowledge and/or actual conditions.
Optionally, the initial input variables in the automation script corresponding to the container deployment mode include a container parameter definition, a container extension parameter definition, and an application parameter definition.
And the container parameter definition comprises the definitions of the number of container copies, the upper limit and the lower limit of a container CPU (Central processing Unit), the upper limit and the lower limit of a container memory, a container environment variable, a starting parameter and the like.
And the container extension parameter definition comprises a container access mode and a definition of container mount file configuration.
And (3) applying parameter definition, including definition of dynamic variables in the mount file. The application parameters described above may be dynamically replaced when the target software article is deployed.
According to the embodiment of the invention, under the condition that the supportable deployment mode of the target software product comprises the container deployment mode, the image file corresponding to the target software product is obtained, the automatic script corresponding to the container deployment mode is executed, and the initial input variable in the automatic script corresponding to the container deployment mode is replaced, so that the image file corresponding to the target software product is deployed to the target resource, the software product deployment flow and mode of the container deployment mode can be specified, and the software product deployment of the container deployment mode can be realized more accurately and more efficiently.
Based on the content of the foregoing embodiments, in the case that the number of the target software products is multiple, after obtaining the target software products from the product file library, the method further includes: merging the target software products into a software product group;
fig. 3 is a schematic flow chart of generating a software product group in the software product generating method provided by the present invention. As shown in fig. 3, in the case of obtaining a plurality of target software products from the product file library, the target software products may be combined into a software product group, so that a plurality of software products may be deployed at one time based on the software product group.
And executing an automation script corresponding to the deployment mode which can be supported by the software product group, and deploying the software product group to the target resource.
Specifically, during the deployment process of the software product group, the target resource for deployment may be determined based on a deployment mode (host deployment mode or mirror deployment mode) supportable by the software product group.
The software product group deployment process is executed by an automation script corresponding to a deployment mode supportable by the software product group, and the software product group can be deployed to the target resource by executing the automation script corresponding to the deployment mode supportable by the software product group.
Alternatively, the target software product and/or group of software products after deployment may be stored to a central product library. The central artifact repository may push the target software artifact and/or software artifact group to the local artifact repository for storage.
According to the embodiment of the invention, after a plurality of target software products are combined into one software product group, the automatic script corresponding to the deployment mode which can be supported by the software product group is executed, and the software product group is deployed to the target resource, so that a plurality of software products can be deployed at one time, and the deployment efficiency of the software products can be improved.
Fig. 5 is a schematic structural diagram of a software product generating device provided by the present invention. The software product generating device provided by the present invention is described below with reference to fig. 5, and the software product generating device described below and the software product generating method provided by the present invention described above may be referred to correspondingly. As shown in fig. 5, the apparatus includes: a data acquisition module 501 and an article generation module 502.
The data obtaining module 501 is configured to obtain a target source code and a target software product template corresponding to a software product to be manufactured.
The product generation module 502 is configured to generate a software product to be manufactured based on the target source code and the target software product template.
The target software product template is generated based on the software product format standard; the software product format standard defines the file description and directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
Specifically, the data acquisition module 501 and the artifact generation module 502 are electrically connected.
The data obtaining module 501 may be used to obtain the target source code and the target software product template corresponding to the software product to be manufactured in various ways. For example: the method comprises the following steps that a developer can write and input a target source code corresponding to a software product to be manufactured based on the generation requirement of the software product to be manufactured, and the developer can manufacture and input a target software product template corresponding to the software product to be manufactured based on the generation requirement of the software product to be manufactured and the format standard of the software product, so that the target source code and the target software product template corresponding to the software product to be manufactured can be obtained based on the input of a user; or, based on the generation requirement of the software product to be manufactured, the target source code corresponding to the software to be manufactured is searched and acquired from the stored source code, and the target software index template corresponding to the software to be manufactured is searched and acquired from the stored software product templates manufactured based on the software product format standard.
The article generation module 502 may be used to generate a software article to be produced based on the target source code and the target software article template.
Optionally, the product generation module 502 may be specifically configured to compile an object source code, and obtain an object source code file executable program; combining the executable program of the target source code file and the target software product template to obtain a product file of the software to be manufactured; and compressing the product file to obtain the software product to be manufactured.
Optionally, the software product generating device may further include a signature writing module and a storage module.
The signature writing module may be configured to write a digital signature for the software product to be produced based on a digital signature format specified in a software product format standard.
The storage module can be used for storing the software product to be manufactured with the digital signature to a product file library.
Optionally, the software product generating means may further comprise a software deployment module.
The software deployment module can be used for acquiring a target software product from the product file library; and executing the automation script corresponding to the deployment mode which can be supported by the target software product, and deploying the target software product to the target resource.
Optionally, the software deployment module may further include a host deployment unit and a container deployment unit.
When the deployment mode supportable by the target software product is the host deployment mode, the host deployment unit may be configured to execute the automation script corresponding to the host deployment mode and replace an initial input variable in the automation script corresponding to the host deployment mode, so as to deploy the target software product to the target resource; wherein initial input variables of the automation script corresponding to the host deployment mode are predefined.
The container deployment unit may be configured to obtain an image file corresponding to the target software product when the deployment mode that is supportable by the target software product is a container deployment mode; executing the automation script corresponding to the container deployment mode, and replacing the initial input variable in the automation script corresponding to the container deployment mode so as to deploy the mirror image file to the target resource; wherein the initial input parameters of the automation script corresponding to the container deployment mode are predefined.
Optionally, the software deployment module may further include a merging unit.
The merging unit may be configured to merge the target software products into a software product group; and executing an automation script corresponding to the deployment mode which can be supported by the software product group, and deploying the software product group to the target resource.
Typically, a software product is comprised of a combination of various components, such as application programs, middleware, and software products.
The software product generation device in the embodiment of the invention can acquire the target software product template corresponding to the software product to be manufactured, which is generated based on the software product format standard, so that the application program, the middleware, the software product and the like in the software product to be manufactured can be packaged according to the software product format standard based on the target software product template and the target source code corresponding to the software product to be manufactured, and the software product to be manufactured is generated.
After the software product to be manufactured is generated, a digital signature can be written into the software product to be manufactured, so that the software product to be manufactured is prevented from being tampered in the transmission process.
After the digital signature is written into the software product to be manufactured, the software product to be manufactured can be stored in a product file library to be deployed.
It should be noted that each software product in the product file library can support any number of versions that exist simultaneously.
The software product generation device in the embodiment of the present invention may also select a software product or a software product group from the product file library to deploy.
The digital signature may be verified prior to deployment to secure the software product or group of software products.
And executing formal deployment operation after the verification is passed, wherein the deployment mode can select modes such as host direct deployment or kubernets container deployment and the like according to the deployment mode of the software products or the software product groups, and finally the software products or the software product groups are deployed into a host server or a kubernets container by executing an automation script.
According to the software product generating device in the embodiment of the invention, after the target source code and the target software product template corresponding to the software product to be manufactured are obtained, the software product to be manufactured is generated based on the target source code and the target software product template, the target software product template is generated based on the software product format standard, the software product format standard is used for defining the file description and the directory structure of the software product template, the file description comprises product name naming definition, version definition, application parameter definition and container extension parameter definition, the software product generating process and mode can be standardized based on the software product format standard, the influence of the execution level of a developer and personal experience on the delivery standard of the software product can be avoided, the quality stability of the software product can be improved, the labor cost and time cost required to be invested when the software product is generated can be reduced, and the software product generating efficiency can be improved.
Fig. 6 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 6: a processor (processor) 610, a communication Interface (Communications Interface) 620, a memory (memory) 630 and a communication bus 640, wherein the processor 610, the communication Interface 620 and the memory 630 communicate with each other via the communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a software product generation method comprising: acquiring a target source code and a target software product template corresponding to a software product to be manufactured; generating a software product to be manufactured based on the target source code and the target software product template; wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
In addition, the logic instructions in the memory 630 may be implemented in software functional units and stored in a computer readable storage medium when the logic instructions are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, the computer program product comprising a computer program, the computer program being storable on a non-transitory computer-readable storage medium, the computer program, when executed by a processor, being capable of executing the software product generation method provided by the above methods, the method comprising: acquiring a target source code and a target software product template corresponding to a software product to be manufactured; generating a software product to be manufactured based on the target source code and the target software product template; wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and the directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a software product generation method provided by the above methods, the method comprising: acquiring a target source code and a target software product template corresponding to a software product to be manufactured; generating a software product to be manufactured based on the target source code and the target software product template; the target software product template is generated based on the software product format standard; the software product format standard is used for defining the file description and directory structure of the software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment may be implemented by software plus a necessary general hardware platform, and may also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, and not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A software product generation method, comprising:
acquiring a target source code and a target software product template corresponding to a software product to be manufactured;
generating the software product to be manufactured based on the target source code and the target software product template;
wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of a software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
2. The method for generating a software product according to claim 1, wherein the generating the software product to be manufactured based on the target source code and the target software product template comprises:
compiling the target source code to obtain a target source code file executable program;
combining the executable program of the target source code file and the target software product template to obtain a product file of the software to be manufactured;
and compressing the product file to obtain the software product to be manufactured.
3. The software product generation method of claim 1, wherein the product name naming definition comprises: the name of the software product template needs to comprise a template identifier, a deployment mode identifier and a version identifier which are sequentially arranged;
the template identification, the deployment mode and the version of the software product template are determined based on a product description file carried by the software product template.
4. The method for generating a software product according to any one of claims 1 to 3, further comprising, after generating the software product to be manufactured:
and writing a digital signature for the software product to be manufactured based on a digital signature format specified in the software product format standard.
5. The method according to claim 4, further comprising, after writing a digital signature for the software product to be manufactured:
and storing the software product to be manufactured with the digital signature in a product file library.
6. The software product generation method of claim 5, further comprising:
acquiring a target software product from the product file library;
and executing an automation script corresponding to the deployment mode which can be supported by the target software product, and deploying the target software product to the target resource.
7. The method according to claim 6, wherein, when the deployment mode supportable by the target software product is the host deployment mode, the executing an automation script corresponding to the deployment mode supportable by the target software product to deploy the target software product to the target resource comprises:
executing an automation script corresponding to a host deployment mode, and replacing an initial input variable in the automation script corresponding to the host deployment mode for deploying the target software product to a target resource;
wherein initial input variables of the automation script corresponding to the host deployment mode are predefined.
8. The method according to claim 6, wherein, when the deployment mode supportable by the target software product is a container deployment mode, the executing an automation script corresponding to the deployment mode supportable by the target software product to deploy the target software product to the target resource comprises:
acquiring a mirror image file corresponding to the target software product;
executing an automation script corresponding to a container deployment mode, and replacing an initial input variable in the automation script corresponding to the container deployment mode so as to deploy the image file to a target resource;
wherein the initial input parameters of the automation script corresponding to the container deployment mode are predefined.
9. The method according to any one of claims 6 to 8, wherein, when the number of the target software products is plural, after acquiring the target software products from the product file library, the method further comprises:
merging each target software product into a software product group;
and executing an automation script corresponding to the deployment mode which can be supported by the software product group, and deploying the software product group to a target resource.
10. A software product generation apparatus, comprising:
the data acquisition module is used for acquiring a target source code and a target software product template corresponding to a software product to be manufactured;
the product generation module is used for generating the software product to be manufactured based on the target source code and the target software product template;
wherein the target software product template is generated based on a software product format standard; the software product format standard is used for defining the file description and directory structure of a software product template; the file description includes an artifact name naming definition, a version definition, an application parameter definition, and a container extension parameter definition.
CN202210994082.0A 2022-08-18 2022-08-18 Software product generation method and device Pending CN115407971A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210994082.0A CN115407971A (en) 2022-08-18 2022-08-18 Software product generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210994082.0A CN115407971A (en) 2022-08-18 2022-08-18 Software product generation method and device

Publications (1)

Publication Number Publication Date
CN115407971A true CN115407971A (en) 2022-11-29

Family

ID=84159578

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210994082.0A Pending CN115407971A (en) 2022-08-18 2022-08-18 Software product generation method and device

Country Status (1)

Country Link
CN (1) CN115407971A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116302075A (en) * 2023-05-17 2023-06-23 工业富联(佛山)创新中心有限公司 Software product management method and related equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116302075A (en) * 2023-05-17 2023-06-23 工业富联(佛山)创新中心有限公司 Software product management method and related equipment

Similar Documents

Publication Publication Date Title
US9971590B2 (en) Package design and generation
KR101314949B1 (en) Integration environment generator
CN108964968B (en) Service access management method and system in container cloud environment
EP3047372B1 (en) Computer-aided development of native mobile application code
CN106547681B (en) Method and device for testing data automatic loading and multiplexing simulation service
CN106775744B (en) Method and device for generating static library
US9575735B2 (en) Application template creation and management
CN107341102B (en) Test case file generation method and device
CN113687858B (en) Configuration file checking method and device, electronic equipment and storage medium
CN115407971A (en) Software product generation method and device
US10956659B1 (en) System for generating templates from webpages
CN107357588B (en) Object code generation method and device
CN115202663A (en) Data processing method, device and storage medium
CN112667242A (en) Method and device for packaging C code into FMU
CN116301951A (en) Micro-service application installation upgrading method and device based on kubernetes
CN115525396A (en) Application management method and device based on cloud protogenesis
CN113741954A (en) System software generation method and device, electronic equipment and storage medium
CN112328241B (en) Method and device for creating Android library module dependency relationship in application program development
CN113094085A (en) Component integration method and device, computer-readable storage medium and electronic equipment
CN113268232A (en) Page skin generation method and device and computer readable storage medium
US20200293309A1 (en) Diagram model for a program
CN114003257A (en) Upgrading method and device
CN108255499B (en) Component processing method and device
CN112667491A (en) Function test method and device of virtual machine
CN113590134B (en) Project generation 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