Automatic installation package generation method, electronic equipment, storage medium and program
By generating parameter configuration files, automatically modifying the target configuration parameters of the application template code, and automatically generating application installation packages, solving the problem of high repetition of development work and improving application development efficiency.
Patent Information
- Application Number
- CN202510601140.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-12
- Publication Date
- 2025-06-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In project development, high repetitive development efforts lead to inefficiency in development, especially in the process of frequent creation and replacement of application projects.
By generating parameter configuration files, we automatically modify the target configuration parameters of the application template code, thereby automatically generating application installation packages to reduce duplicate work for developers.
It improves the generation efficiency of application installation packages, reduces development time, and improves the overall application development efficiency.
Smart Images

Figure CN120122981A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the technical field of computer software applications, and in particular, to a method, device, electronic device, storage medium, and program for automatically generating an installation package. Background Art
[0002] In project development, repetitive development work is a common problem that affects efficiency. It not only wastes time and resources but also may lead to a decline in code quality.
[0003] For some separately deployed application projects, whenever a new application project needs to be developed and deployed, developers need to recreate an application and replace a series of related parameters in the template project provided by the application system. Occasionally, there may also be problems with replacing related parameters in existing application packages.
[0004] In the process of implementing the present invention, the inventor found that the parameter replacement process in the application project development process is a development process with a high degree of repetition, which takes up a lot of development time for developers. Repetitive development work is a major pain point in project development, but through means such as standardization, resource sharing, and automation, this problem can be effectively reduced, thereby improving the development efficiency of application projects. Summary of the Invention
[0005] Embodiments of the present invention provide a method, device, electronic device, storage medium, and program for automatically generating an installation package, which can improve the generation efficiency of application installation packages and thus improve the development efficiency of applications.
[0006] According to one aspect of the present invention, there is provided a method for automatically generating an installation package, including:
[0007] Generating a parameter configuration file according to the target configuration parameters of the application template code of the target system application;
[0008] Modifying the target configuration parameters of the application template code according to the parameter configuration file to obtain a configuration template code;
[0009] Generating an application installation package of the target system application according to the configuration template code.
[0010] According to another aspect of the present invention, there is provided an apparatus for automatically generating an installation package, including:
[0011] A parameter configuration file generation module, configured to generate a parameter configuration file according to the target configuration parameters of the application template code of the target system application;
[0012] A configuration template code generation module, configured to modify the target configuration parameters of the application template code according to the parameter configuration file to obtain a configuration template code;
[0013] An application installation package generation module, configured to generate an application installation package for the target system application according to the configuration template code.
[0014] According to another aspect of the present invention, there is provided an electronic device, including:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the installation package automatic generation method according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the installation package automatic generation method according to any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, there is also provided a computer program product including a computer program that implements the installation package automatic generation method according to any embodiment of the present invention when executed by a processor.
[0020] In the embodiments of the present invention, by generating a parameter configuration file according to the target configuration parameters of the application template code of the target system application, and then modifying the target configuration parameters of the application template code according to the parameter configuration file to obtain a configuration template code, and finally generating an application installation package for the target system application according to the configuration template code, the problem of low efficiency existing in the existing application installation package generation method is solved, the generation efficiency of the application installation package can be improved, and thus the development efficiency of the application can be improved.
[0021] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0023] Figure 1It is a flowchart of a method for automatically generating an installation package provided by an embodiment of the present invention;
[0024] Figure 2 It is a flowchart of another method for automatically generating an installation package provided by an embodiment of the present invention;
[0025] Figure 3 It is a schematic flowchart of a method for automatically generating an installation package applied to the iOS system provided by an embodiment of the present invention;
[0026] Figure 4 It is a schematic diagram of an installation package automatic generation device provided by an embodiment of the present invention;
[0027] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners
[0028] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order different from those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0030] Figure 1It is a flowchart of a method for automatically generating an installation package provided by an embodiment of the present invention. This embodiment is applicable to the situation where a parameter configuration file generated according to application template code is automatically modified to configure the application template code, and then an installation package corresponding to the system application is further generated. This method can be executed by an installation package automatic generation device, which can be implemented in software and / or hardware, and is generally integrated in an electronic device. The electronic device can be a terminal device or a server device, as long as it can execute the installation package automatic generation method. The embodiment of the present invention does not limit the specific device type of the electronic device. Correspondingly, as Figure 1 shown, the method includes the following operations:
[0031] S110. Generate a parameter configuration file according to the target configuration parameters of the application template code of the target system application.
[0032] Among them, the target system application can be an application running in the target operating system. The target operating system can be a certain type of operating system. Exemplarily, the target system application can be an application of the Android system, an application of the iOS (a mobile operating system) system, an application of the HarmonyOS system, etc. The embodiment of the present invention does not limit the system type and application type corresponding to the target system application. The application template code can be provided by the target system and is template code for developing a project application that can run on the target system. Developers can develop a new target system application based on the application template code. The target configuration parameters can be parameters that need to be modified and replaced when developing the target system application based on the application template code. That is, the target configuration parameters are part of the parameters in the application template code. The parameter configuration file can be a configuration file generated based on the target configuration parameters of the application template code and can be used to configure the relevant parameters of the target system application.
[0033] In the embodiment of the present invention, the generation process of the installation package can be automatically executed through a pre-edited script to realize the automatic development process of the application project. Correspondingly, before automatically executing the generation process of the installation package through the pre-edited script, the target system application to be developed can be first determined, and the application template code of the target system application can be obtained. Further, the target configuration parameters that need to be developed and modified for the target system application can be determined based on the application template code of the target system application through the script, and then a parameter configuration file for generating the installation package of the target system application can be automatically generated according to the determined target configuration parameters.
[0034] S120. Modify the target configuration parameters of the application template code according to the parameter configuration file to obtain a configured template code.
[0035] Among them, the configured template code can be the code obtained after modifying some parameters in the application template code.
[0036] Correspondingly, after automatically generating a parameter configuration file corresponding to the application template code of the target system application through a script, the target configuration parameters corresponding to the application template code of the target system application can be automatically modified according to the parameter configuration file. After the modification of the target configuration parameters corresponding to the application template code of the target system application is completed, a configuration template code for the target system application can be generated accordingly.
[0037] Optionally, when the number of target system applications is multiple, the script can simultaneously and in parallel generate corresponding parameter configuration files for multiple target system applications, and modify the target configuration parameters of the application template code of multiple target system applications simultaneously and in parallel according to the corresponding parameter configuration files generated for each target system application, so as to generate configuration template codes for multiple target system applications in parallel.
[0038] S130. Generate an application installation package for the target system application according to the configuration template code.
[0039] Correspondingly, after obtaining the configuration template code of the target system application, an application installation package for the target system application can be further generated based on the configuration template code.
[0040] It can be seen that the above technical solution automatically processes the parameter configuration file of the target system application in the form of a script, automatically modifies the target configuration parameters of the application template code according to the parameter configuration file, and automatically generates an application installation package for the target system application based on the target configuration parameters of the application template code, which can avoid the process of developers repeatedly developing configuration parameters for each newly developed target system application, thereby greatly reducing the development duration of the target system application, improving the generation efficiency of the application installation package, and further improving the development efficiency of the application.
[0041] In the embodiment of the present invention, a parameter configuration file is generated according to the target configuration parameters of the application template code of the target system application, and then the target configuration parameters of the application template code are modified according to the parameter configuration file to obtain a configuration template code. Finally, an application installation package for the target system application is generated according to the configuration template code, which solves the problem of low efficiency existing in the existing method for generating an application installation package, can improve the generation efficiency of the application installation package, and further improve the development efficiency of the application.
[0042] Figure 2 It is a flowchart of another method for automatically generating an installation package provided by an embodiment of the present invention. This embodiment is specific based on the above embodiment. In this embodiment, various specific and optional implementation manners for generating a parameter configuration file according to the target configuration parameters of the application template code and modifying the target configuration parameters of the application template code according to the parameter configuration file are given. Correspondingly, as Figure 2As shown, the method of this embodiment may include:
[0043] S210. Generate a parameter configuration file according to the target configuration parameters of the application template code of the target system application.
[0044] In an alternative embodiment of the present invention, the target configuration parameters may include string parameters and non-string parameters.
[0045] Among them, the string parameter may be a parameter in string form, for example, it may include parameters such as interface addresses. The non-string parameter may be a parameter in non-string form, for example, it may be a parameter composed of icons, etc. The embodiments of the present invention do not limit the parameter content of the string parameter and the non-string parameter.
[0046] Correspondingly, step S210 may include the following operations:
[0047] S211. Create a first configuration folder corresponding to the string parameter according to the application template code of the target system application.
[0048] Among them, the first configuration folder may be a folder for configuring string parameters.
[0049] In the embodiments of the present invention, for the string parameters that need secondary development included in the application template code of the target system application, a corresponding first configuration folder may be created to configure the parameter configuration file corresponding to the string parameter through the first configuration folder.
[0050] Exemplarily, the name of the created first configuration folder may be defined according to the folder name where the string parameter that needs secondary development in the application template code of the target system application is located. For example, when the folder name where the string parameter that needs secondary development in the application template code of the target system application is located is "config", the name of the first configuration folder may also be configured as "config". Optionally, the file type of the folder where the string parameter that needs secondary development in the application template code of the target system application is located may be different from the file type corresponding to the first configuration folder. For example, the file type of the folder where the string parameter that needs secondary development in the application template code of the target system application is located may be a header file, and the file type corresponding to the first configuration folder may be a JSON (JavaScript Object Notation) file.
[0051] S212. Generate a first parameter configuration file of the string parameter in the first configuration folder according to the configuration value of the string parameter.
[0052] Among them, the first parameter configuration file can be a parameter configuration file generated according to string parameter configurations. Exemplarily, the first parameter configuration file can be a file in JSON format. The embodiments of the present invention do not limit the file type of the first parameter configuration file.
[0053] Correspondingly, after creating the first configuration folder corresponding to the string parameter, the configuration values of each string parameter can be determined, and then the first parameter configuration file of the string parameter can be generated in the first configuration folder according to the configuration values of each string parameter.
[0054] In an optional embodiment of the present invention, generating the first parameter configuration file of the string parameter in the first configuration folder according to the configuration value of the string parameter may include: determining the parameter names of each string parameter in the application template code and the parameter values corresponding to each string parameter; establishing a mapping relationship between the parameter names of each string parameter and the parameter values corresponding to each string parameter in the first configuration folder to generate the first parameter configuration file of the string parameter.
[0055] Optionally, the configuration value of the string parameter may include the parameter name corresponding to the string parameter in the application template code and the specific value corresponding to it in the target system application. Specifically, the parameter names corresponding to each string parameter in the application template code can be determined, and the parameter names corresponding to each string parameter can be defined in the first configuration folder based on the parameter names corresponding to each string parameter in the application template code. At the same time, the specific values corresponding to each string parameter can be determined according to the development requirements of the target system application as parameter values. Further, a mapping relationship is established in the first configuration folder between the parameter names of each defined string parameter and the corresponding parameter values, thereby generating the first parameter configuration file of the string parameter.
[0056] In a specific example, assume that the original configuration information of the string parameter that needs to be secondarily developed in the application template code of the target system application is as follows:
[0057]
[0058]
[0059]
[0060]
[0061] Correspondingly, the parameter names of the above string parameters in the application template code can be determined based on the original configuration information corresponding to the above string parameters as "project_identity", "appname", "version", and "build". Further, the specific parameter values corresponding to the above string parameters in the target system application are determined, and a first parameter configuration file for the string parameters is generated according to the mapping relationship established between the parameter names of the string parameters and the parameter values corresponding to the string parameters in the first configuration folder. For example, the configuration information of the string parameters included in the first parameter configuration file is as follows:
[0062]
[0063]
[0064]
[0065]
[0066] Among them, "111" represents the parameter value of the "project_identity" parameter in the target system application, "222" represents the parameter value of the "appname" parameter in the target system application, "1.5" represents the parameter value of the "version" parameter in the target system application, and "1" represents the parameter value of the "build" parameter in the target system application.
[0067] S213. Create a second configuration folder corresponding to the non-string parameters according to the application template code of the target system application.
[0068] Among them, the second configuration folder can be a folder for configuring non-string parameters.
[0069] In the embodiment of the present invention, for the non-string parameters that need secondary development included in the application template code of the target system application, a corresponding second configuration folder can be created to configure the parameter configuration file corresponding to the non-string parameters through the second configuration folder.
[0070] Exemplarily, the name of the created second configuration folder can be defined according to the folder type where the non-string parameter that needs secondary development in the application template code of the target system application is located. For example, if the folder where the string parameter that needs secondary development in the application template code of the target system application stores various icon parameters required by the system application (including but not limited to application icons and startup icons), the name of the second configuration folder can be configured as "Images". Optionally, the file type of the folder where the non-string parameter that needs secondary development in the application template code of the target system application is located can be different from the file type corresponding to the second configuration folder, and the embodiments of the present invention do not limit this.
[0071] S214. Generate a second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code.
[0072] Among them, the configuration template of the non-string parameter in the application template code is a template for configuring the non-string parameter. The second parameter configuration file can be a parameter configuration file generated according to the non-string parameter configuration.
[0073] Correspondingly, after creating the second configuration folder corresponding to the non-string parameter, the configuration template of each non-string parameter in the application template code can be determined, and the same configuration template of each non-string parameter in the application template code can be generated in the second configuration folder. Further, by configuring the corresponding non-string parameter in the configuration template of each non-string parameter in the second configuration folder, the second parameter configuration file corresponding to the non-string parameter can be generated.
[0074] Exemplarily, if the non-string parameter is an icon or an image, the same template can be created in the second configuration folder according to the configuration template of such non-string parameter in the application template code, and the icon or image required during the development of the target system application can be dragged into the template created in the second configuration folder, so as to generate the second parameter configuration file of non-string parameters such as the icon or image of the target system application. Optionally, the configuration template corresponding to the non-string parameter of the icon or image type can configure information such as the size, resolution, and quantity of the icon or image.
[0075] Exemplarily, if the non-string parameter is a video or an animation, a same template can be created in the second configuration folder according to the configuration template of such non-string parameter in the application template code, and the video or animation required during the development of the target system application can be dragged into the template created in the second configuration folder, so as to generate a second parameter configuration file for non-string parameters such as the video or animation of the target system application. Optionally, the configuration template corresponding to the non-string parameter of the video or animation type can be configured with information such as the duration, resolution, and quantity of the video or animation.
[0076] In an alternative embodiment of the present invention, the non-string parameter may include an icon; the generating of the second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code may include: generating a corresponding sub-configuration folder in the second configuration folder according to the sub-folder name of the non-string parameter in the application template code; determining a parameter embedding template corresponding to each target non-string parameter for each sub-configuration folder; and generating a sub-parameter configuration file of the target non-string parameter in each sub-configuration folder in response to a drag operation of the target non-string parameter in the parameter embedding template, so as to obtain the second parameter configuration file.
[0077] Among them, the sub-configuration folder may be a folder included in the second configuration folder. The target non-string parameter may be a specific type of non-string parameter. The parameter embedding template may be a template for embedding non-string parameters. The sub-parameter configuration file may be a file automatically generated in response to the drag operation of the target non-string parameter in the second parameter configuration file, and is used to replace and modify the non-string parameters included in the corresponding parameter embedding template in the application template code according to the non-string parameters included in the parameter embedding template in the sub-configuration folder and the name of the sub-parameter configuration file.
[0078] Optionally, non-string parameters of the icon type usually can include the application icon and the launch icon. Among them, the application icon is an important part of the user interface design, mainly used to identify and launch the application program. The launch icon is the visual entry of the application program, used to represent the application in the device's home screen or application list. By clicking on the launch icon, the user can directly launch the corresponding application program, which is the first step in the interaction between the user and the application program. Since the icon types are different and different icons have different configuration methods. Therefore, for each type of icon, according to the subfolder name of this type of icon in the application template code, the corresponding sub-configuration folders of each type of icon in the second configuration folder can be created respectively, and the corresponding sub-configuration folders of each type of icon in the second configuration folder can be named. Exemplarily, if there are 3 subfolders in the icon type in the application template code, and the names of the subfolders are "applcon", "img1", and "img2" respectively, then 3 sub-configuration folders named "applcon", "img1", and "img2" can be generated respectively in the second configuration folder of the target system application.
[0079] Furthermore, the parameter embedding templates corresponding to the target non-string parameters can be determined for each sub-configuration folder. Optionally, the icon embedding templates in the subfolders of the application template code (the subfolders in the application template code are used for the templates of embedding icons) can be referred to, to adapt to the configuration of the parameter embedding templates corresponding to the target non-string parameters of each sub-configuration folder. Optionally, the parameter embedding templates corresponding to the target non-string parameters of the sub-configuration folders can be the same as the icon embedding templates with the same subfolder names in the application template code.
[0080] In a specific example, it is assumed that the sub - folder of "applcon" in the application template code includes two icon - embedding templates corresponding to application icons, and each icon - embedding template corresponding to an application icon specifies the size of the application icon. For example, it is assumed that the size of the application icon corresponding to the first icon - embedding template in the sub - folder of "applcon" in the application template code is A, and the size of the application icon corresponding to the second icon - embedding template is B. It can be understood that the size can include parameters such as length, width, and resolution for configuration. In the above example, the sizes A and B are only used to distinguish two different sizes, and do not specifically limit the specific size parameters. Correspondingly, a sub - configuration folder of "applcon" can be synchronously created in the second configuration folder, and a parameter - embedding template with a size of A and a parameter - embedding template with a size of B can be configured in the sub - configuration folder of "applcon". That is to say, the sub - configuration folder of "applcon" in the second configuration folder also includes two parameter - embedding templates, and each parameter - embedding template can be adaptively configured with reference to each icon - embedding template in the sub - folder of "applcon" in the application template code.
[0081] It can be understood that if the types of sub - configuration folders are different, the types and numbers of parameter - embedding templates included may also be different, and the embodiments of the present invention do not limit this.
[0082] Correspondingly, after determining the parameter - embedding templates for each non - string parameter, the corresponding target non - string parameters can be dragged into each parameter - embedding template. For example, an application icon of the corresponding size can be dragged into the first parameter - embedding template in the sub - configuration folder of "applcon", an application icon of another corresponding size can be dragged into the second parameter - embedding template in the sub - configuration folder of "applcon", and startup icons of corresponding sizes can be dragged into each parameter - embedding template in the sub - configuration folder of "img1", etc.
[0083] After the drag - and - drop operation of the corresponding target non - string parameters is completed for the parameter - embedding templates in each sub - configuration folder, a sub - parameter configuration file for the target non - string parameters in the sub - configuration folder can be correspondingly updated and generated. After all sub - configuration folders are configured and the corresponding sub - parameter configuration files are generated, the second parameter configuration file is configured.
[0084] Optionally, the sub-parameter configuration file for the target non-string parameter can be a file in JSON format. The sub-parameter configuration file for the target non-string parameter can be used to automatically replace and update the non-string parameters (such as icons) in the corresponding icon embedding template within the same folder name as the application template code according to the name of the sub-configuration folder where it is located and each target non-string parameter embedded in the parameter embedding template within the sub-configuration folder.
[0085] It should be noted that Figure 2 It is only a schematic diagram of one implementation method, and there is no limitation on the order of execution between steps S211 - S212 and steps S213 - S214. That is, steps S211 - S212 can be executed first, and then steps S213 - S214; or, steps S213 - S214 can be executed first, and then steps S211 - S212; or, steps S211 - S212 and steps S213 - S214 can also be executed simultaneously.
[0086] S220. Modify the corresponding string parameter in the application template code according to the first parameter configuration file of the string parameter.
[0087] In the embodiment of the present invention, the corresponding string parameter in the application template code can be automatically modified and replaced based on the first parameter configuration file generated by the script for the string parameter.
[0088] In a specific example, the configuration information of some string parameters included in the first parameter configuration file for the target system application is as follows:
[0089]
[0090]
[0091]
[0092]
[0093] Correspondingly, the partial original configuration information of the string parameters that need secondary development in the application template code of the target system application is as follows:
[0094]
[0095]
[0096]
[0097]
[0098] Correspondingly, the script can automatically modify the corresponding part of the original configuration information in the application template code to the following content according to the first parameter configuration file of the target system application:
[0099]
[0100]
[0101]
[0102]
[0103] It can be seen that after modifying the corresponding string parameters in the application template code according to the first parameter configuration file of the string parameters, the modified string parameters of the application template code can meet the development requirements of the target system application.
[0104] S230. Modify the corresponding non-string parameters in the application template code according to the second parameter configuration file of the non-string parameters to obtain the configuration template code.
[0105] Similarly, the script can automatically modify and replace the corresponding non-string parameters in the application template code based on the second parameter configuration file generated by the non-string parameters. When the script has automatically modified and replaced all the string parameters and non-string parameters that need to be modified and replaced in the application template code through the first parameter configuration file and the second parameter configuration file, the configuration template code of the target system application can be generated based on the application template code.
[0106] In a specific example, assume that the size of the first parameter embedding template in the sub-configuration folder of "applcon" in the second parameter configuration file is A, and it embeds an application icon with a size of A. Correspondingly, the script can locate the "applcon" folder in the application template code according to the sub-parameter configuration file such as the JSON file in the sub-configuration folder of "applcon" in the second parameter configuration file, and use the application icon embedded by the parameter embedding template with a size of A in the sub-configuration folder of "applcon" in the second parameter configuration file to replace the default icon embedded by the icon embedding template with a size of A in the "applcon" folder in the application template code.
[0107] S240. Generate the application installation package of the target system application according to the configuration template code.
[0108] In an alternative embodiment of the present invention, generating the application installation package of the target system application according to the configuration template code may include: obtaining the packaging file of the target system application; generating the application installation package of the target system application according to the packaging file of the target system application and the configuration template code.
[0109] When generating the application installation package of the target system application according to the configuration template code, the packaging file of the target system application may be obtained first. It can be understood that if the type of the target system is different, the type of the corresponding packaging file and the way of obtaining the packaging file may also be different. After obtaining the packaging file of the target system application, the configuration template code can be packaged according to the packaging file of the target system application to generate the application installation package of the target system application.
[0110] In the above technical solution, by creating a first configuration folder corresponding to the string parameter according to the application template code of the target system application, and generating a first parameter configuration file of the string parameter in the first configuration folder according to the configuration value of the string parameter; at the same time, creating a second configuration folder corresponding to the non-string parameter according to the application template code of the target system application, and generating a second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code. Furthermore, modifying the corresponding string parameter in the application template code according to the first parameter configuration file of the string parameter, and modifying the corresponding non-string parameter in the application template code according to the second parameter configuration file of the non-string parameter. After obtaining the configuration template code, the application installation package of the target system application can be generated according to the packaging file of the target system application and the configuration template code, improving the generation efficiency of the application installation package, and thus improving the development efficiency of the application.
[0111] Specific application scenario
[0112] To more clearly describe the technical solution provided by the embodiments of the present invention, the embodiments of the present invention take the iOS system as an example to specifically illustrate the process of the method for automatically generating the installation package applied to the iOS system. Figure 3 It is a schematic flow chart of a method for automatically generating an installation package applied to the iOS system provided by the embodiments of the present invention. In a specific example, as Figure 3 shown, the method for automatically generating an installation package applied to the iOS system may include the following operations:
[0113] 1. Pull the iOS template code from the remote open source code repository.
[0114] 2. Generate corresponding parameter configuration files according to the parameters to be replaced in the iOS template code. Among them, the parameters to be replaced may include, but are not limited to, a series of related parameters such as application icons, startup icons, and interface addresses.
[0115] 2.1. For icon parameters, create a new folder by referring to the icon configuration folder in the iOS template code. Drag all the icons to be referenced into the folder corresponding to the parameter and embed them in the template.
[0116] 2.2. For other string parameters, create a JSON file. The file name of the JSON file should be the same as the folder name where the corresponding string parameter is located in the iOS template code, and configure the name and value of the corresponding string parameter in the iOS template code in the JSON file.
[0117] 3. Log in to the developer account of the iOS system.
[0118] 4. Generate an appid and a ".mobileprofile file" for packaging in the developer account. The ".mobileprofile file" can be used to generate some certificates required for new project development and export an IPA file based on these certificates.
[0119] 5. Download and install the ".mobileprofile file" and install the developer certificate.
[0120] 6. Modify the configuration items in the iOS template code using the generated parameter configuration file.
[0121] 7. Modify the relevant configurations in the project by using the folders corresponding to different parameter types in the parameter configuration file in sequence.
[0122] 7.1. Use an automated script to automatically replace the icons in the corresponding template code with the icons in the icon folder in the parameter configuration file.
[0123] 7.2. Use an automated script to automatically replace the corresponding string parameters in the template code with the JSON file configured with string parameters in the parameter configuration file.
[0124] 8. Generate the finished code corresponding to the iOS template code.
[0125] 9. Determine whether the finished code needs to be further modified. If not, jump to step 10; if modification is required, jump to step 7 to modify again.
[0126] 10. Use the command-line tool for compiling the project to export the IPA file of the new project based on the ".mobileprofile file" and the finished code.
[0127] 11. Upload the modified finished code to the open-source repository for future maintenance and update.
[0128] The above technical solution provides a method for automatically generating an application installation package. During the generation process of the application installation package, no developers are required to intervene. Implementers can independently export the IPA application package of the iOS project through a script tool, which improves the work efficiency of application project development and reduces the work pressure of developers.
[0129] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by users or fully authorized by all parties, and the collection, use, and processing of the relevant data comply with the relevant laws, regulations, and standards in the relevant regions.
[0130] It should be noted that any permutation and combination of the technical features in the above embodiments also fall within the protection scope of the present invention.
[0131] Figure 4 It is a schematic diagram of an automatic installation package generation device provided by an embodiment of the present invention. As Figure 4 shown, the device includes: a parameter configuration file generation module 310, a configuration template code generation module 320, and an application installation package generation module 330, where:
[0132] The parameter configuration file generation module 310 is used to generate a parameter configuration file according to the target configuration parameters of the application template code of the target system application;
[0133] The configuration template code generation module 320 is used to modify the target configuration parameters of the application template code according to the parameter configuration file to obtain a configuration template code;
[0134] The application installation package generation module 330 is used to generate an application installation package of the target system application according to the configuration template code.
[0135] In the embodiment of the present invention, a parameter configuration file is generated according to the target configuration parameters of the application template code of the target system application, and then the target configuration parameters of the application template code are modified according to the parameter configuration file to obtain a configuration template code. Finally, an application installation package of the target system application is generated according to the configuration template code, which solves the problem of low efficiency in the existing application installation package generation method, can improve the generation efficiency of the application installation package, and further improve the development efficiency of the application.
[0136] Optionally, the target configuration parameters include string parameters; the parameter configuration file generation module 310 is further used to: create a first configuration folder corresponding to the string parameter according to the application template code of the target system application; generate a first parameter configuration file of the string parameter in the first configuration folder according to the configuration value of the string parameter.
[0137] Optionally, the parameter configuration file generation module 310 is further configured to: determine the parameter names of the string parameters in the application template code and the parameter values corresponding to the string parameters; establish a mapping relationship between the parameter names of the string parameters and the parameter values corresponding to the string parameters in the first configuration folder, and generate a first parameter configuration file for the string parameters.
[0138] Optionally, the target configuration parameter includes a non-string parameter; the parameter configuration file generation module 310 is further configured to: create a second configuration folder corresponding to the non-string parameter according to the application template code of the target system application; generate a second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code.
[0139] Optionally, the parameter configuration file generation module 310 is further configured to: generate a corresponding sub-configuration folder in the second configuration folder according to the sub-folder name of the non-string parameter in the application template code; determine a parameter embedding template for the corresponding target non-string parameter for each sub-configuration folder; drag the corresponding target non-string parameter into each parameter embedding template; in response to the dragging operation of the target non-string parameter, generate a sub-parameter configuration file for the target non-string parameter in each sub-configuration folder to obtain the second parameter configuration file.
[0140] Optionally, the configuration template code generation module 320 is further configured to: modify the corresponding string parameter in the application template code according to the first parameter configuration file of the string parameter; modify the corresponding non-string parameter in the application template code according to the second parameter configuration file of the non-string parameter to obtain the configuration template code.
[0141] Optionally, the application installation package generation module 330 is further configured to: obtain the packaging file of the target system application; generate an application installation package of the target system application according to the packaging file of the target system application and the configuration template code.
[0142] The above installation package automatic generation device can execute the installation package automatic generation method provided by any embodiment of the present invention, and has corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the installation package automatic generation method provided by any embodiment of the present invention.
[0143] Since the installation package automatic generation device introduced above is a device that can execute the installation package automatic generation method in the embodiments of the present invention, based on the installation package automatic generation method introduced in the embodiments of the present invention, those skilled in the art can understand the specific implementation manners and various variations of the installation package automatic generation device in this embodiment. Therefore, the implementation of how the installation package automatic generation device realizes the installation package automatic generation method in the embodiments of the present invention will not be described in detail here. As long as the devices adopted by those skilled in the art to implement the installation package automatic generation method in the embodiments of the present invention fall within the scope of protection of this application.
[0144] Figure 5 FIG. shows a schematic structural diagram of an electronic device 10 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0145] As Figure 5 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. The memory stores a computer program executable by the at least one processor. The processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0146] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0147] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the installation package automatic generation method.
[0148] Optionally, the installation package automatic generation method may include: generating a parameter configuration file according to the target configuration parameters of the application template code of the target system application; modifying the target configuration parameters of the application template code according to the parameter configuration file to obtain a configuration template code; and generating an application installation package of the target system application according to the configuration template code.
[0149] In some embodiments, the installation package automatic generation method can be implemented as a computer program, which is tangibly included in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the installation package automatic generation method described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the installation package automatic generation method by any other suitable means (e.g., by means of firmware).
[0150] The various embodiments of the systems and technologies described above in this article can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor, and can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0151] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0152] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0153] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input received from the user can be in any form (including acoustic input, voice input, or tactile input).
[0154] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0155] A computing system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0156] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.
[0157] The above specific embodiments do not constitute a limitation on the protection scope of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the protection scope of this disclosure.
Claims
1. A method for automatically generating an installation package, characterized in that: include: Generate a parameter configuration file according to target configuration parameters of the application template code of the target system application; Modify the target configuration parameters of the application template code according to the parameter configuration file to obtain the configuration template code; Generate an application installation package for the target system application according to the configuration template code.
2. The method for automatically generating an installation package according to claim 1, characterized in that: The target configuration parameters include string parameters; the parameter configuration file is generated according to the target configuration parameters of the application template code of the target system application, including: Creating a first configuration folder corresponding to the string parameter according to the application template code of the target system application; A first parameter configuration file for the string parameter is generated in the first configuration folder according to the configuration value of the string parameter.
3. The method for automatically generating an installation package according to claim 2, characterized in that: The step of generating a first parameter configuration file for the string parameter in the first configuration folder according to the configuration value of the string parameter comprises: Determine a parameter name of each string parameter in the application template code and a parameter value corresponding to each string parameter; A mapping relationship between the parameter name of each of the string parameters and the parameter value corresponding to each of the string parameters is established in the first configuration folder to generate a first parameter configuration file for the string parameters.
4. The method for automatically generating an installation package according to claim 1, characterized in that: The target configuration parameters include non-string parameters; the generating of the parameter configuration file according to the target configuration parameters of the application template code of the target system application includes: Creating a second configuration folder corresponding to the non-string parameter according to the application template code of the target system application; Generate a second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code.
5. The method for automatically generating an installation package according to claim 4, characterized in that: The non-string parameter includes an icon; and generating a second parameter configuration file in the second configuration folder according to the configuration template of the non-string parameter in the application template code includes: Generate a corresponding sub-configuration folder in the second configuration folder according to the sub-folder name of the non-string parameter in the application template code; Determining a parameter embedding template corresponding to the target non-string parameter for each of the sub-configuration folders; In response to the dragging operation of the target non-string parameter in the parameter embedding template, a sub-parameter configuration file of the target non-string parameter is generated in each of the sub-configuration folders to obtain the second parameter configuration file.
6. The method for automatically generating an installation package according to claim 1, characterized in that: The step of modifying the target configuration parameters of the application template code according to the parameter configuration file to obtain the configuration template code includes: Modify the corresponding string parameter in the application template code according to the first parameter configuration file of the string parameter; The corresponding non-string parameters in the application template code are modified according to the second parameter configuration file of the non-string parameters to obtain the configuration template code.
7. The method for automatically generating an installation package according to claim 1, characterized in that: The step of generating the application installation package of the target system application according to the configuration template code includes: Obtaining a package file of the target system application; An application installation package of the target system application is generated according to the packaging file of the target system application and the configuration template code.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for automatically generating an installation package as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for automatically generating an installation package as described in any one of claims 1-7 when executed.
10. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method for automatically generating an installation package according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Intelligent packaging method and system for customized software and storage medium
CN115599350A
SDK (Software Development Kit) automatic generation method and device, electronic equipment and storage medium
CN117149162A
Application program generation method, system and device, electronic equipment and storage medium
CN117270942A