One-key automated packaging method, device, equipment and medium

Through the one-click automated packaging method, componentized configuration items and dynamic dependency library technology are used to realize flexible replacement and deletion of functional modules in APP projects, solving the problem of redundant resources in APP projects, and improving development efficiency and maintainability.

CN113485740BActive Publication Date: 2024-10-29INSPUR ZHUOSHU BIG DATA IND DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110679441.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-18
Publication Date
2024-10-29
Estimated Expiration
2041-06-18

AI Technical Summary

Technical Problem

Existing technology makes it difficult to flexibly replace and delete functional modules in APP projects, resulting in a large number of redundant resources included in the installation package, affecting development efficiency and maintenance costs.

Method used

Adopt a one-click automated packaging method, create a minimum dependency library through component configuration items, dynamically replace images and string resources, determine module reference rules, achieve decoupling and dynamic dependencies between modules, and generate personalized installation packages.

Benefits of technology

It reduces the size of the installation package and redundant resources, saves development time and memory space, and improves the flexibility and maintainability of the project.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485740B_ABST
    Figure CN113485740B_ABST
Patent Text Reader

Abstract

The embodiment of this specification discloses a one-click automated packaging method, which is used to solve the problem that a single main module of Android cannot be flexibly packaged in the prior art. The method includes: creating a first minimum dependency library based on componentized configuration items; the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; the resource information includes at least one or more of the following: image file resources, string resources; various types of image file resources are integrated and classified in the first minimum dependency library, and the characters that need to be replaced are mapped to projects; each module dynamically depends on the module according to the configured resources, realizes dynamic addition and deletion of modules, and replaces basic library resources, etc., so as to realize the generation of applications with different focuses based on componentized one-click configuration automation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet communication technology, and in particular to a one-key automated packaging method. Background Art

[0002] Currently, technicians often develop applications. In order to allow more users to use the applications, it is necessary to generate an installation package for the applications so that users can download the installation package of the applications and install the applications according to the installation package so that users can use the applications.

[0003] However, with the continuous iteration of application versions and the continuous addition of new functions, the business will become more and more complex. The number of APP business modules may continue to increase, and the code of each business module will also become more and more, which makes the APP architecture under a single project affect the development efficiency and increase the maintenance cost of the project. In addition, in the conventional MVC / MVP architecture of the development project, various business functions and third-party libraries are placed in the same project module. When packaging, because the functional modules in the project are strongly coupled together, there is no way to dynamically increase or decrease the modules, and the strong coupling of the functional modules causes the generated installation package to contain a large amount of redundant resources.

[0004] Therefore, a flexible packaging method is needed to facilitate the replacement and deletion of functional modules in the project. Summary of the invention

[0005] One or more embodiments of this specification provide a one-click automated packaging method for solving the following technical problem: how to provide a flexible packaging method so that functional modules in a project can be easily replaced or deleted.

[0006] One or more embodiments of this specification adopt the following technical solutions:

[0007] One or more embodiments of the present specification provide a one-click automated packaging method, which creates a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0008] According to the preset picture file resources and the initial mapping relationship, the picture resources are replaced to obtain an updated first minimum dependency library;

[0009] Read the code instructions of the preset script in the updated first minimum dependency library, and perform dynamic library dependency on the modules to obtain the reference rules between the modules;

[0010] According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0011] Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0012] The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

[0013] Optionally, in one or more embodiments of the present specification, before replacing the picture resource according to the preset picture file resource and the initial mapping relationship, the method further includes:

[0014] A second minimum dependency library is created based on the componentized configuration items so that the image file resource configuration and the string resource configuration can proceed normally, wherein the second minimum dependency library is preset with a basic configuration for generating an application.

[0015] Optionally, in one or more embodiments of the present specification, the code instructions of the preset script are read in the updated first minimum dependency library, and the dynamic library dependency of the modules is performed to obtain the reference rules between the modules, which specifically includes:

[0016] Obtain the key-value pairs generated by the dependency library in the first configuration file through the preset script;

[0017] According to the key-value pairs of the dependent library, the modules of the application are re-dependent through the preset script to obtain the key-value pairs of the dependent library after re-dependence, so as to realize the dynamic dependency between the module and the dependent library;

[0018] According to the re-dependent key-value pairs, the current dependent library of the module is determined, and the reference rules between modules are determined according to the key-value pairs of the current dependent library.

[0019] Optionally, in one or more embodiments of the present specification, according to the preset string resources and the initial mapping relationship, the string resources are replaced to obtain the current mapping relationship of the string resources, specifically including:

[0020] Get the placeholder name of the string resource through the initial mapping relationship;

[0021] In the first configuration file, the string resources are processed and mapped to the BuildConfig class through the first instruction of the preset script and the placeholder name; or the string resources are processed and mapped to the corresponding resource space through the second instruction of the preset script to obtain the current mapping relationship of the string resources.

[0022] Optionally, in one or more embodiments of the present specification, the reference relationship of the replaced image file resource is configured according to the packaging rule so as to introduce the image file resource into the application packaging, specifically including:

[0023] Creating a self-built directory for replacing picture resource information in the first minimum dependency library, and storing the picture resource information to be replaced in the self-built directory of the first minimum dependency library;

[0024] Configure the reference of the self-built directory based on the preset script in the first minimum dependency library;

[0025] The reference relationship of the image file resource is obtained according to the reference of the self-built directory, so that the image file resource can be introduced into the application according to the reference relationship.

[0026] Optionally, in one or more embodiments of the present specification, before packaging the application based on the packaging rule of the application to obtain the installation package of the application, the method further includes:

[0027] The native interaction mechanism between modules is replaced by the first route to achieve decoupling between different modules; and the decoupled modules are interacted with based on the second route to achieve decoupled interaction between different modules.

[0028] Optionally, in one or more embodiments of the present specification, referencing and filtering the dynamic library according to the reference rule specifically includes:

[0029] The reference rule is read through a preset script. If a corresponding module can be matched through the reference rule, the module is introduced for packaging; if a corresponding module cannot be matched through the reference rule, the module is filtered.

[0030] One or more embodiments of this specification provide a one-key automated packaging device, characterized in that the device includes:

[0031] A first creation unit is used to create a first minimum dependency library based on the componentized configuration item; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0032] A dynamic reference unit, used to read code instructions of a preset script in the first minimum dependency library, and perform dynamic library dependency on the modules to obtain reference rules between the modules;

[0033] a packaging configuration unit, configured to replace the string resource according to the preset string resource and the initial mapping relationship to obtain the current mapping relationship of the string resource, and configure the reference relationship of the replaced image file resource according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0034] A determination unit, configured to determine a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0035] The packaging unit is used to reference and filter the module according to the reference rule, and to package the application based on the packaging rule of the application to obtain the installation package of the application.

[0036] Optionally, in one or more embodiments of this specification, the apparatus further includes: a second creation unit;

[0037] The second creation unit is used to create a second minimum dependency library based on the componentized configuration items so that the image file resource configuration and the string resource configuration can proceed normally, wherein the second minimum dependency library is preset with a basic configuration for generating an application.

[0038] Optionally, in one or more embodiments of this specification, the apparatus further comprises: a reference rule unit;

[0039] The reference rule unit is used to obtain the key-value pairs generated by the dependency library in the first configuration file through a preset script; according to the key-value pairs of the dependency library, the module of the application is re-dependent through the preset script to obtain the key-value pairs of the dependency library after re-dependence, so as to realize the dynamic dependency between the module and the dependency library; according to the key-value pairs after re-dependence, the current dependency library of the module is determined, and the reference rules between modules are determined according to the key-value pairs of the current dependency library.

[0040] Optionally, in one or more embodiments of this specification, the apparatus further includes: a mapping unit;

[0041] The mapping unit is used to obtain the placeholder name of the string resource through the initial mapping relationship; in the first configuration file, the first instruction of the preset script and the placeholder name are used to process and map the string resource to the BuildConfig class; or the second instruction of the preset script is used to process and map the string resource to the corresponding resource space to obtain the current mapping relationship of the string resource.

[0042] Optionally, in one or more embodiments of this specification, the apparatus further comprises: a picture configuration reference unit;

[0043] The image configuration reference unit is used to create a self-built directory for replacing image resource information in the first minimum dependency library, and store the image resource information that needs to be replaced in the self-built directory of the first minimum dependency library; configure the reference of the self-built directory based on the preset script in the first minimum dependency library; obtain the reference relationship of the image file resource according to the reference of the self-built directory, so as to introduce the image file resource into the application according to the reference relationship.

[0044] Optionally, in one or more embodiments of this specification, the apparatus further includes: a routing unit;

[0045] The routing unit is used to replace the native interaction mechanism between the modules through the first routing to achieve decoupling between different modules; and to interact between the decoupled modules based on the second routing to achieve decoupled interaction between different modules.

[0046] Optionally, in one or more embodiments of this specification, the device further comprises: a filtering unit;

[0047] The filtering unit is used to read the reference rule through a preset script, and if it is determined through the reference rule that there is a dynamic dependency between the module and other modules, the module is introduced for packaging; if it is determined through the reference rule that the module does not require dynamic dependency, the module is filtered.

[0048] One or more embodiments of this specification provide a one-key automated packaging device, including:

[0049] at least one processor; and,

[0050] a memory communicatively connected to the at least one processor; wherein,

[0051] The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:

[0052] Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0053] Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules;

[0054] According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0055] Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0056] The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

[0057] One or more embodiments of this specification provide a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured to:

[0058] Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0059] Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules;

[0060] According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0061] Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0062] The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

[0063] At least one of the above technical solutions adopted in the embodiments of this specification can achieve the following beneficial effects: by configuring the packaged application in a componentized manner, users can configure the packaged application automatically with one click to generate different installation packages containing different functional modules, saving time and effort in project development. At the same time, the componentized configuration items realize the unified replacement of resource information such as image file resources and string resources under the same application project, and can generate installation packages focusing on different applications according to application requirements. Through the configuration resources of the modules, dynamic dependencies between modules are achieved, and dynamic deletion of modules is realized, which reduces redundant resources in the application installation package, reduces the size of the installation package, and saves the memory space occupied by the installation package. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0065] Figure 1 A schematic diagram of a method flow of a one-key automated packaging method provided in an embodiment of this specification;

[0066] Figure 2 A schematic diagram of the internal structure of a one-key automated packaging device provided in an embodiment of this specification;

[0067] Figure 3 A schematic diagram of the internal structure of a one-key automated packaging device provided in an embodiment of this specification;

[0068] Figure 4 A schematic diagram of the internal structure of a non-volatile storage medium provided in an embodiment of this specification. DETAILED DESCRIPTION

[0069] The embodiments of this specification provide a one-click automated packaging method, device, equipment, and medium.

[0070] In recent years, the mobile Internet has developed rapidly, and the number and quality of client applications have shown a trend of rapid growth and improvement. On the one hand, these applications provide users with the richest possible functions, and the business logic of the applications has become more and more complex, and the scale of the project has become larger and larger. In addition, the rapid rise of e-commerce companies has increased the demand for application products, and existing R&D personnel are unable to repeatedly redevelop according to the needs of each user and package them into corresponding application APPs. At the same time, taking the applications of various e-commerce clients as an example, in the early stage of the project, due to considerations of cost and rapid application iteration, most projects will adopt the traditional single-project development model for project development.

[0071] In the traditional single-mode development method, the business functions and third-party libraries of MVC / MVP and other architecture projects are placed under the same project module. Since the module functions have not been sorted out for componentization, the boundaries between modules are not clear, and the functional coupling between modules is serious, resulting in the packaged application containing multiple redundant modules. At the same time, due to the strong coupling between modules, there is no way to dynamically increase or decrease modules according to user needs during the development process, making the packaged application installation package have a single functional model and contain a large number of redundant resources. Secondly, the underlying basic service module will be dependent on the upper-level business module, so small modifications to the module may cause multiple modifications to the application project, resulting in poor maintainability and scalability of the application project.

[0072] Therefore, in order to solve the problem that the functions in the prior art are concentrated in a single main module, the functions cannot be dynamically deleted and cannot be flexibly packaged. The present application combines the technical features of componentization to propose a one-click automated packaging method. By saving the image file resources that need to be replaced in the self-built directory of the first minimum dependency library, and referencing the image file resources to the application project through the mapping relationship of the self-built directory, the replacement of image resources according to demand is realized. The string resources that need to be replaced obtain the current mapping relationship through the preset script of the first minimum dependency library. The application and filtering of business modules according to the needs of the application project are realized. With the help of componentization, the strong coupling problem between businesses is avoided by dynamically deleting some libraries that do not need to be dependent. The redundant resources in the installation package can be filtered on demand through dynamic reference modules, reducing the size of the installation package.

[0073] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0074] In one or more embodiments of the present specification, the operation is performed by a server terminal that completes the application project packaging process or each execution unit of the server terminal.

[0075] like Figure 1 As shown, one or more embodiments of the present specification provide a method flow chart of a one-click automated packaging method.

[0076] Figure 1 The process in may include the following steps:

[0077] S101: Create a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources.

[0078] In one or more embodiments of the present specification, before reading the code instructions of the preset script in the first minimum dependency library and performing dynamic library dependency on the modules to obtain reference rules between the modules, the method further includes:

[0079] A second minimum dependency library is created based on the componentized configuration items so that the image file resource configuration and the string resource configuration can proceed normally, wherein the second minimum dependency library is preset with a basic configuration for generating an application.

[0080] Due to the rapid development of the Internet and applications, application functions are becoming more and more abundant, and the scale and development difficulty of projects are gradually increasing. Object-oriented development methods can no longer meet the current project development needs. Therefore, developers have proposed componentization technology based on object-oriented development. Componentization development can be seen as the process of abstracting and dividing multiple functional modules of application development projects into multiple independent components, and then reconstructing them into a complete project. Through componentization, component reuse can be greatly realized, business needs can be responded to quickly and flexibly, and the coupling between modules can be reduced.

[0081] By creating the first minimum dependency library and the second minimum dependency library based on the componentized configuration items, basic dependencies are provided for subsequent replacement configurations and packaging operations. The first minimum dependency library can be a custom library unique to a separately created project, which contains the initial mapping configuration of application projects such as image file resources, string resources, package name versions, etc. for generating different application installation packages. The second minimum dependency library is the basic Bsae library commonly used in development projects. It is the basis for componentized extraction and contains common resources for application projects, such as color, memory size, various tools, etc.

[0082] Among them, it should be noted that: the dependent library means that when dynamic library A is called, A needs to call dynamic library B, then dynamic library B is the dependent library of dynamic library A, and the module is Module, which contains various modules for executing application functions and services.

[0083] S102: Reading code instructions of a preset script in the updated first minimum dependency library, and performing dynamic library dependency on the modules to obtain reference rules between the modules.

[0084] In one or more embodiments of the present specification, the step of reading the code instructions of the preset script in the first minimum dependency library and performing dynamic library dependency on the modules to obtain the reference rules between the modules specifically includes:

[0085] Obtain the key-value pairs generated by the dependency library in the first configuration file through the preset script;

[0086] According to the key-value pairs of the dependency library, the module of the application is re-dependent through a preset script to obtain the key-value pairs of the dependency library after re-dependence, so as to realize the dynamic dependency between the module and the dependency library;

[0087] According to the re-dependent key-value pairs, the current dependent library of the module is determined, and according to the key-value pairs of the current dependent library, the reference rules between modules are determined.

[0088] Before packaging and configuring the application project, the dependency library key-value pairs generated during the initial configuration process can be obtained in the first configuration file of the first minimum dependency library through preset script instructions. According to the dependency library key-value pairs, the module of the application can be re-dependent through the preset script according to the needs of the current application project, while the module key corresponding to the dependency library remains unchanged, so as to obtain the dependency library on which the current module depends, and obtain the dependency library key-value pairs after re-dependence. Through the dynamic reference between the module and the dependency library, the coupling relationship between the functional module of the original module and the dependency library is released, and the current dependency library of the module is determined. Because each module will automatically depend on each other, after obtaining the current dependency value, the reference rules between the current modules can be further obtained according to the needs of the application project, so as to realize the cross-module function reference during the application packaging and execution process. Among them, the first configuration file can be gradle.properties.

[0089] S103: According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging.

[0090] In one or more embodiments of the present specification, replacing the string resource according to the preset string resource and the initial mapping relationship to obtain the current mapping relationship of the string resource specifically includes:

[0091] Obtaining the placeholder name of the string resource through the initial mapping relationship;

[0092] In the first configuration file, the string resource is processed and mapped to the BuildConfig class through the first instruction of the preset script and the placeholder name; or the string resource is processed and mapped to the corresponding resource space through the second instruction of the preset script to obtain the current mapping relationship of the string resource.

[0093] In one or more embodiments of the present specification, configuring the reference relationship of the image file resource according to the packaging rule so as to introduce the image file resource into the application packaging specifically includes:

[0094] Creating a self-built directory for replacing picture resource information in the first minimum dependency library, and storing the picture resource information to be replaced in the self-built directory of the first minimum dependency library;

[0095] Configuring a reference to the self-built directory based on a preset script in the first minimum dependency library;

[0096] The reference relationship of the picture file resource is obtained according to the reference of the self-built directory, so as to introduce the picture file resource into the application according to the reference relationship.

[0097] In the process of component configuration, the initial mapping relationship of different resource information pre-set in the first minimum dependency library is obtained. Before packaging and execution, the configuration of the application installation package with different functions is obtained by replacing the mapping of the image file resources and string resources in the initial mapping relationship. It should be noted that: because the application project has its own personalized needs, it is necessary to replace the image file resources and string resources in the first minimum dependency library to obtain the application project with personalized needs.

[0098] Among them, string resources are uniformly configured in the first configuration file gradle.properties of the first minimum dependency library. First, the initial mapping relationship of the string resource in the first minimum dependency library is obtained through the preset script, and the placeholder name of the key value of the string resource is obtained through the initial mapping relationship of the string resource. Through the first instruction of the preset script and the placeholder name, the string resource corresponding to the placeholder name is obtained, and the string resource is mapped to the BuildConfig class. Through the second instruction of the preset script, the string resource can be processed according to the placeholder name and mapped to its corresponding resource space, such as the R resource class in Android studio. By remapping the string resources, the effect of replacing the string resources based on the needs of the application project is achieved.

[0099] The configuration of the image file resources is located at the res level in the first minimum dependency library. A self-built directory for image and file replacement can be pre-created in the res level. The reference relationship of the self-built directory is configured in the script according to the needs, so that the image file resources can be referenced to the packaged application project as needed according to the reference relationship.

[0100] By replacing and mapping string resources and image file resources in the packaging configuration, the application installation package can display different images and files according to its own needs, thereby realizing the personalized needs of application installation package packaging.

[0101] S104: Determine a packaging rule for the application according to the current mapping relationship between the string resource and the reference relationship between the image resource.

[0102] S105: referencing and filtering modules according to the reference rule, and packaging the application based on the packaging rule of the application to obtain an installation package of the application.

[0103] In one or more embodiments of the present specification, before packaging the application based on the packaging rule of the application to obtain the installation package of the application, the method further includes:

[0104] The native interaction mechanism between the modules is replaced by the first route to achieve decoupling between different modules; and the decoupled modules are interacted with based on the second route to achieve decoupled interaction between different modules.

[0105] In one or more embodiments of the present specification, the citing and filtering of the dynamic library according to the citing rule specifically includes:

[0106] The reference rule is read through a preset script. If it is determined through the reference rule that there is a dynamic dependency between the module and other modules, the module is introduced for packaging; if it is determined through the reference rule that the module does not require a dynamic dependency, the module is filtered.

[0107] During the development of an application project, when there is a project requirement, it is necessary to jump from the function of module A to the function in module C. In the traditional development process, the native interaction mechanism Intent is used to jump between modules. However, this method requires that the corresponding jump module can only be found when the modules are in a coupled relationship, and if the C module is not referenced in the application project at this time, the jump cannot be completed, which will cause the entire packaging execution process to crash. By replacing the native interaction mechanism Intent with the first route, the use of multi-module componentization can be supported, and when the module that needs to jump is missing, only the jump operation will be stopped without affecting the overall packaging process, effectively avoiding the problem of empty jumps when the module is not referenced. After componentization, due to the isolation between the code and the module, it is sometimes impossible to access each other. Through the customized second route, the decoupled modules can interact with each other, realizing the decoupled interaction between different modules and improving the stability and scalability of the application project.

[0108] The modules are referenced and filtered according to the reference rules between modules in the component configuration process obtained in step S102, that is, the dependency relationship between modules is obtained after reading the reference rules through the preset script. If the module has a dependency relationship with other modules, the module is retained for packaging. If there is no dependency relationship between the module and other modules, it can be determined that the module does not play a role in this application project, so it needs to be filtered through the module to achieve the purpose of deleting redundant resources. After filtering out redundant resources, the application is packaged based on the packaging rules obtained in step S104 to obtain application installation packages with different functions.

[0109] like Figure 2 As shown, one or more embodiments of this specification provide a schematic diagram of the internal structure of a one-key automated packaging device.

[0110] like Figure 2 The one-key automated packaging device comprises:

[0111] The first creation unit 201 is used to create a first minimum dependency library based on the componentized configuration item; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0112] The dynamic reference unit 202 is used to read the code instructions of the preset script in the first minimum dependency library, and perform dynamic library dependency on the modules to obtain reference rules between the modules;

[0113] The packaging configuration unit 203 is used to replace the string resource according to the preset string resource and the initial mapping relationship to obtain the current mapping relationship of the string resource, and configure the reference relationship of the replaced image file resource according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0114] A determination unit 204, configured to determine a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0115] The packaging unit 205 is used to reference and filter modules according to the reference rule, and to package the application based on the packaging rule of the application to obtain an installation package of the application.

[0116] In one or more embodiments of this specification, the apparatus further includes: a second creation unit;

[0117] The second creation unit is used to create a second minimum dependency library based on the componentized configuration items so that the image file resource configuration and the string resource configuration can proceed normally, wherein the second minimum dependency library is preset with a basic configuration for generating an application.

[0118] In one or more embodiments of this specification, the apparatus further includes: a reference rule unit;

[0119] The reference rule unit is used to obtain the key-value pairs generated by the dependency library in the first configuration file through a preset script; according to the key-value pairs of the dependency library, the module of the application is re-dependent through the preset script to obtain the key-value pairs of the dependency library after re-dependence, so as to realize the dynamic dependency between the module and the dependency library; according to the key-value pairs after re-dependence, the current dependency library of the module is determined, and the reference rules between modules are determined according to the key-value pairs of the current dependency library.

[0120] In one or more embodiments of this specification, the apparatus further includes: a mapping unit;

[0121] The mapping unit is used to obtain the placeholder name of the string resource through the initial mapping relationship; in the first configuration file, the first instruction of the preset script and the placeholder name are used to process and map the string resource to the BuildConfig class; or the second instruction of the preset script is used to process and map the string resource to the corresponding resource space to obtain the current mapping relationship of the string resource.

[0122] In one or more embodiments of the present specification, the apparatus further includes: a picture configuration reference unit;

[0123] The image configuration reference unit is used to create a self-built directory for replacing image resource information in the first minimum dependency library, and store the image resource information that needs to be replaced in the self-built directory of the first minimum dependency library; configure the reference of the self-built directory based on the preset script in the first minimum dependency library; obtain the reference relationship of the image file resource according to the reference of the self-built directory, so as to introduce the image file resource into the application according to the reference relationship.

[0124] In one or more embodiments of this specification, the apparatus further includes: a routing unit;

[0125] The routing unit is used to replace the native interaction mechanism between the modules through the first routing to achieve decoupling between different modules; and to interact between the decoupled modules based on the second routing to achieve decoupled interaction between different modules.

[0126] In one or more embodiments of this specification, the device further comprises: a filtering unit;

[0127] The filtering unit is used to read the reference rule through a preset script, and if it is determined through the reference rule that there is a dynamic dependency between the module and other modules, the module is introduced for packaging; if it is determined through the reference rule that the module does not require dynamic dependency, the module is filtered.

[0128] like Figure 3 As shown, one or more embodiments of the present specification provide a schematic diagram of the internal structure of a one-key automated packaging device.

[0129] Depend on Figure 3 It can be seen that the one-key automated packaging equipment includes:

[0130] at least one processor 301; and,

[0131] A memory 302 is communicatively connected to the at least one processor 301; wherein,

[0132] The memory 302 stores instructions that can be executed by the at least one processor 301. The instructions are executed by the at least one processor 301 to enable the at least one processor 301 to:

[0133] Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0134] Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules;

[0135] According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0136] Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0137] The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

[0138] like Figure 4 As shown, one or more embodiments of the present specification provide a schematic diagram of the internal structure of a non-volatile storage medium.

[0139] Depend on Figure 4 It can be seen that one or more embodiments of this specification provide a non-volatile computer storage medium, which stores computer executable instructions 401, and the computer executable instructions 401 are configured as follows:

[0140] Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources;

[0141] Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules;

[0142] According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging;

[0143] Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource;

[0144] The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

[0145] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0146] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0147] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.

Claims

1. A one-key automated packaging method, characterized in that: The method comprises: Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources; Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules; According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging; Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource; The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

2. A one-key automated packaging method according to claim 1, characterized in that: Before reading the code instructions of the preset script in the first minimum dependency library and performing dynamic library dependency on the modules to obtain reference rules between the modules, the method further includes: A second minimum dependency library is created based on the componentized configuration items so that the image file resource configuration and the string resource configuration can proceed normally, wherein the second minimum dependency library is preset with a basic configuration for generating an application.

3. A one-key automated packaging method according to claim 1, characterized in that: The step of reading the code instructions of the preset script in the first minimum dependency library and performing dynamic library dependency on the modules to obtain reference rules between the modules specifically includes: Obtain the key-value pairs generated by the dependency library in the first configuration file through the preset script; According to the key-value pairs of the dependency library, the module of the application is re-dependent through a preset script to obtain the key-value pairs of the dependency library after re-dependence, so as to realize the dynamic dependency between the module and the dependency library; According to the re-dependent key-value pairs, the current dependent library of the module is determined, and according to the key-value pairs of the current dependent library, the reference rules between modules are determined.

4. The one-key automated packaging method according to claim 1, characterized in that: The replacing the string resource according to the preset string resource and the initial mapping relationship to obtain the current mapping relationship of the string resource specifically includes: Obtaining the placeholder name of the string resource through the initial mapping relationship; In the first configuration file, the string resource is processed and mapped to the BuildConfig class through the first instruction of the preset script and the placeholder name; or the string resource is processed and mapped to the corresponding resource space through the second instruction of the preset script to obtain the current mapping relationship of the string resource.

5. The one-key automated packaging method according to claim 1, characterized in that: The configuring the reference relationship of the image file resource according to the packaging rule so as to introduce the image file resource into the application packaging specifically includes: Creating a self-built directory for replacing picture resource information in the first minimum dependency library, and storing the picture resource information to be replaced in the self-built directory of the first minimum dependency library; Configuring a reference to the self-built directory based on a preset script in the first minimum dependency library; The reference relationship of the picture file resource is obtained according to the reference of the self-built directory, so as to introduce the picture file resource into the application according to the reference relationship.

6. The one-key automated packaging method according to claim 1, characterized in that: Before packaging the application based on the packaging rule of the application to obtain the installation package of the application, the method further includes: The native interaction mechanism between the modules is replaced by the first route to achieve decoupling between different modules; and the decoupled modules are interacted with based on the second route to achieve decoupled interaction between different modules.

7. The one-key automated packaging method according to claim 1, characterized in that: The quoting and filtering of modules according to the quoting rules specifically includes: The reference rule is read through a preset script. If it is determined through the reference rule that there is a dynamic dependency between the module and other modules, the module is introduced for packaging; if it is determined through the reference rule that the module does not require a dynamic dependency, the module is filtered.

8. A one-key automated packaging device, characterized in that: The device comprises: A first creation unit is used to create a first minimum dependency library based on the componentized configuration item; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources; A dynamic reference unit, used to read code instructions of a preset script in the first minimum dependency library, and perform dynamic library dependency on the modules to obtain reference rules between the modules; a packaging configuration unit, configured to replace the string resource according to the preset string resource and the initial mapping relationship to obtain the current mapping relationship of the string resource, and configure the reference relationship of the replaced image file resource according to the packaging rule, so as to introduce the image file resource into the application packaging; A determination unit, configured to determine a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource; The packaging unit is used to reference and filter the module according to the reference rule, and to package the application based on the packaging rule of the application to obtain the installation package of the application.

9. A one-button automatic packaging device, characterized in that: The device comprises: at least one processor, and a memory communicatively coupled to the at least one processor, wherein: The memory stores executable instructions for the at least one processor, so that the at least one processor can: Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources; Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules; According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging; Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource; The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

10. A non-volatile storage medium storing computer executable instructions, wherein the executable instructions include: Creating a first minimum dependency library based on componentized configuration items; wherein the first minimum dependency library is preset with an initial mapping relationship for generating resource information of different applications; wherein the resource information includes at least one or more of the following: image file resources, string resources; Reading code instructions of a preset script in the first minimum dependency library, performing dynamic library dependency on the modules, and obtaining reference rules between the modules; According to the preset string resource and the initial mapping relationship, the string resource is replaced to obtain the current mapping relationship of the string resource, and the reference relationship of the replaced image file resource is configured according to the packaging rule, so as to introduce the image file resource into the application packaging; Determining a packaging rule for the application according to a current mapping relationship between the string resource and a reference relationship between the image resource; The modules are referenced and filtered according to the reference rule, and the application is packaged based on the packaging rule of the application to obtain an installation package of the application.

Citation Information

Patent Citations

  • Method and device for constructing application program

    CN106873989A

  • Method and device to preprocess application installation files and server

    CN108089880A