Application package generation method, electronic equipment and storage medium
By obtaining the existing code file package and configuration information of the configuration components in the target application, establishing the dependency between the entry file and the target application, and directly generating the application package, solving the problem of long-term packaging in the existing technology and achieving more efficient application package generation.
Patent Information
- Application Number
- CN202411613479.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-04-22
AI Technical Summary
Existing application packaging methods take a long time because all component source code needs to be loaded for full packaging.
By obtaining the existing code file package and configuration information of the configuration component in the target application, establish the dependency between the entry file of the configuration component and the target application, and directly generate the application package to avoid downloading and parsing dependencies.
Improve the speed of application package generation, reduce time consumption during packaging process, and reduce the use of packaged server resources.
Smart Images

Figure CN119861957A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an application package generation method, an electronic device, and a storage medium. Background Art
[0002] The existing application packaging method generates an application package in one process, downloads the dependencies of each component, parses the dependencies within the component, and ensures that all dependencies of each component are correctly introduced. Then, it is necessary to load all component source codes and then fully package them to obtain the code file packages of each component, and then generate the application package based on the code file packages of each component. In the process of packaging the application each time, all component source codes are loaded and then fully packaged to obtain the code file packages of each component, which makes the application packaging process time-consuming.
[0003] In view of the existing technical defects, how to provide a solution to increase the speed of application package generation is a technical problem that needs to be solved urgently by technical personnel in this field. Summary of the invention
[0004] The present application at least provides an application package generation method, an electronic device and a storage medium.
[0005] The present application provides an application package generation method, comprising: obtaining existing code file packages of several configuration components in a target application and configuration information of each configuration component, each configuration information including identification information of an entry file of each configuration component; using each entry identification information, respectively establishing a dependency relationship between the entry file of each configuration component and an application package to be generated for the target application; based on each dependency relationship and the existing code file packages of each configuration component, generating an application package for the target application.
[0006] The present application provides an application package generation device, including: an acquisition module, used to acquire existing code file packages of several configuration components in a target application and configuration information of each configuration component, each configuration information including identification information of an entry file of each configuration component; an establishment module, used to use each entry identification information to establish a dependency relationship between the entry file of each configuration component and an application package to be generated by the target application; and a generation module, used to generate an application package of the target application based on each dependency relationship and the existing code file packages of each configuration component.
[0007] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned application package generation method.
[0008] The present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned application package generation method is implemented.
[0009] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0010] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0012] Figure 1 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 1 ;
[0013] Figure 2 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 2 ;
[0014] Figure 3 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 3 ;
[0015] Figure 4 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 4 ;
[0016] Figure 5 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 5 ;
[0017] Figure 6 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 6 ;
[0018] Figure 7 It is a structural diagram of an embodiment of an application package generating device of the present application;
[0019] Figure 8 It is a structural schematic diagram of an embodiment of the electronic device of the present application;
[0020] Fig. 9 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0021] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0022] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0023] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0024] The present application provides some application package generation methods and application package generation devices. The application scenarios of the application package generation method include but are not limited to the packaging of application packages of application programs. The execution subject of the application package generation method can be an application package generation device. For example, the application package generation device can be set in a terminal device or a server or other processing device, wherein the terminal device can be a device for application package generation, a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, etc. In some possible implementations, the application package generation method can be implemented by a processor calling a computer-readable instruction stored in a memory.
[0025] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 1 Specifically, the application package generation method may include the following steps:
[0026] Step S11: Obtain existing code file packages of several configuration components in the target application and configuration information of each configuration component.
[0027] Each configuration information includes entry identification information corresponding to each configuration component, and each entry identification information is used to represent the identification information of the entry file of each configuration component.
[0028] The target application may be an application program that needs to be packaged in an application package. The target application includes several configuration components. Several is one or more. The several configuration components may be all configuration components in the target application. The several configuration components may also be configuration components that need to be added to the target application. Among them, the configuration components that need to be added are newly added configuration components. The existing code file packages of each configuration component may be the packaged component file code.
[0029] The method of obtaining the existing code file packages of several configuration components in the target application may be to pull them from the database or download them from the cloud platform. Exemplarily, the configuration information of each configuration component also includes the component package address of each configuration component, and before the above step S11, it also includes: downloading the existing code file packages of each configuration component according to the configuration component package address of each configuration component.
[0030] Exemplarily, the code packages of various configuration components of the application may be compiled in advance on a code compilation platform and then the code packages of the compiled packages may be stored in a database or a cloud platform.
[0031] In some application scenarios, the method of pre-compiling the code packages of each configuration component in the application on the code compilation platform can be: based on the componentized development mode, each time a configuration component is developed, a component version is generated for the configuration component, and the configuration components under the component version are compiled and packaged to obtain the existing code file packages of each configuration component. Among them, in the process of generating the application package of the target application, the existing code file packages of each configuration component do not need to be fully compiled. It can be understood that a corresponding configuration component version information is generated for the configuration component each time a configuration component is developed. For example, the configuration component version information can be the version number of the RN component. And the configuration component is compiled and packaged to obtain the existing code file package of the configuration component. After packaging is completed, the existing code file package of the configuration component is uploaded to the server storage, and the configuration file information corresponding to the configuration component is submitted to the server storage. Among them, the configuration file information corresponding to the configuration component may include: configuration component unique identification, configuration component package address, configuration component version information, identification information of the entry file, etc. Among them, the configuration component unique identification can be the component name of the configuration component. When configuring an application, maintain a list of configuration components. Each time a configuration component is added, the configuration component file can be obtained from the server and written into the configuration of the application package. The server can target the application server corresponding to the application.
[0032] Several configuration components in the target application correspond to component list configuration files. The component list configuration file is parsed to obtain the configuration information of each configuration component. The configuration information of each configuration component includes the identification information of the entry file of each configuration component. Each configuration component includes an entry file and several function files. The function file can be a module Bundle package of the function module in each configuration component. Among them, the function module can be used to implement the specific function of the configuration component.
[0033] The entry file can be the module Bundle package of the entry module in each configuration component. Among them, the entry module can be the entry point of the entire component of each configuration component, and the file that the user first references when using this configuration component. The identification information of the entry file of each configuration component is used to represent the unique identification information of the entry module of each configuration component. Among them, the module Bundle package of each functional module and / or the module Bundle package of the entry module can be obtained in RN (React Native). Among them, RN (React Native) is a cross-platform application development framework. When developing applications based on RN, RN can package the application's script language (JavaScript, JS) files (i.e., script code) into a Bundle package, which is a folder containing executable code and the resources required for the code, combined in a specific standard hierarchical structure.
[0034] Step S12: using each entry identification information, respectively establish a dependency relationship between the entry file of each configuration component and the application package to be generated of the target application.
[0035] The application package to be generated by the target application may be an empty package that only contains the application framework code but does not contain any old configuration components. The application package to be generated by the target application may also be an old application package of the target application, wherein the old application package includes the temporarily stored old configuration components.
[0036] For each configuration component, the entry identification information of the configuration component is written into the application package to be generated by the target application, and a dependency relationship is established between the entry file of the configuration component and the application package to be generated by the target application. Each dependency relationship is used to represent the association between the application package to be generated by the target application and the entry module of each configuration component.
[0037] Step S13: Generate an application package of the target application based on the dependencies and the existing code file packages of the configuration components.
[0038] The application package of the target application is the final application package after the target application is packaged. After establishing the dependencies, the existing code file packages of the configuration components are written into the application package to be generated by the target application to generate the application package of the target application.
[0039] In some application scenarios, when the application package to be generated by the target application is an empty package, the application package of the target application is an application package including all configuration components. Based on the association between the application package to be generated by the target application and the entry modules of all configuration components, and the existing code file packages of all configuration components are written into the application package to be generated by the target application, the application package of the target application is generated. In other application scenarios, when the application package to be generated by the target application is an old application package, the application package of the target application also includes some newly added configuration components compared to the old application package. Among them, newly added configuration components may exist in several configuration components. Based on the association between the application package to be generated by the target application and the entry modules of the newly added configuration components, and the existing code file packages of the newly added configuration components are written into the application package to be generated by the target application, the application package of the target application is generated.
[0040] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0041] In some embodiments, the above step S12 may include the following steps: first, based on each entry identification information, generate registration information corresponding to each configuration component. Then, write each registration information into the registration file corresponding to the application package to be generated by the target application to obtain the dependency relationship.
[0042] The registration information corresponding to the configuration component can be used to represent the registration code corresponding to the configuration component. Based on each entry identification information, the step of generating the registration information corresponding to each configuration component can be to map the entry identification information and the registration logic of the entry module of each configuration component to the registration code to obtain the registration information corresponding to each configuration component. The registration file corresponding to the application package to be generated by the target application can register the association between the application package to be generated by the target application and the entry module of each configuration component. Write each registration information into the registration file corresponding to the application package to be generated by the target application, and register the association between the application package to be generated by the target application and the entry module of each configuration component corresponding to each registration information.
[0043] In some embodiments, the configuration information of each configuration component also includes the compilation result of the entry file of each configuration component, and each compilation result includes the binding relationship between the entry file of each configuration component and the function file of each configuration component. The above step S13 may include the following steps: First, based on each dependency relationship and each binding relationship, determine the association relationship between the function file of each configuration component and the application package to be generated of the target application. Then, based on the association relationship and the existing code file package of each configuration component, generate the application package of the target application.
[0044] The binding relationship can be directly obtained based on the configuration information of each configuration component. Among them, the binding relationship can be the dependency relationship between the entry file of each configuration component and the function file of each configuration component. Through the compilation result of the entry file of each configuration component, the dependency relationship between the entry file and several function files inside each configuration component can be directly obtained. It can be understood that the dependency relationship between the entry file of each configuration component and the function file of each configuration component in the existing code file package of each configuration component can be directly configured. Each association relationship can characterize the association between the function file of each configuration component and the application package to be generated by the target application. Through the binding relationship between the entry file of each configuration component and the function file of each configuration component and the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, the obtained association relationship can ensure that all dependencies of each configuration component are correctly introduced into the application package to be generated by the target application. Using the association relationship corresponding to all dependencies of each configuration component and the existing code file package of each configuration component, the application package of the target application is directly generated.
[0045] Exemplarily, the process of generating an application package of the target application can refer to the following content: the application package of the target application can be an RN package. The RN package consists of a series of obfuscated JavaScript code modules, and each JavaScript code module is a __d function. Assume that there is currently a configuration component C, and the source code files of configuration component C can be defined as: source code files related to the entry module and source code files related to the functional module. Among them, the source code file related to the entry module can be expressed as index.js, that is, the entry file can be expressed as index.js. The source code file related to the functional module can be expressed as detail.js, that is, the functional file can be expressed as detail.js. Among them, the source code file related to the entry module imports the source code file related to the functional module, which can be expressed as (import Detail from". / detail.js"). Specifically, the existing code file package structure obtained after packaging the configuration component C can refer to the following content:
[0046] __d(function(g,r,i,a,m,e,d){...},"template_0",["template_1"]);
[0047] __d(function(g,r,i,a,m,e,d){...},"template_1",[]);
[0048] __r("template_0");
[0049] Among them, the first __d(x) function can correspond to the entry module, and can represent the compilation result of the entry file of the configuration component C. "template_0" can represent the unique identifier of the entry module, that is, the entry identification information of the entry file of the configuration component C. Among them, the second __d(x) function can correspond to the functional module, and can represent the compilation result of any functional file of the configuration component C. "template_1" can represent the identification information of any functional file of the configuration component C. It can be seen from the existing code file package structure of the configuration component C that the entry module corresponding to "template_0" depends on the functional module corresponding to "template_1". The __r(x) function can be represented as the compilation result of the export module in the existing code file package of the configuration component C.
[0050] The package to be generated of the above-mentioned target program can be an RN empty package. The structure of the RN empty package can refer to the existing code file package structure obtained after packaging the above-mentioned configuration component C, but the empty package and several configuration components need to be dependently bound to obtain the above-mentioned association relationship. Among them, the process of dependency binding the empty package and several configuration components can be to generate registration codes for several configuration components. Then, each registration information is written into the registration file corresponding to the application package to be generated by the target application, and through the entry identification information of the entry file of each configuration component, the application package to be generated by the target application is dependently bound with the entry module of each configuration component so as to establish a dependency relationship between the application package to be generated by the target application and the entry module of each configuration component.
[0051] Generating registration codes for several configuration components is to generate registration information for several configuration components. Exemplarily, the process of generating registration information for configuration component C may be: mapping the entry identification information of the entry module of configuration component C and the registration logic to the registration code to obtain the registration information corresponding to configuration component C.
[0052] Exemplarily, the following content may be referred to for generating the registration information corresponding to the configuration component C: Object.defineProperty(e,"component_C",{enumerable:!0,get:function(){retur nk0.default;}});
[0053] var k0=n(r(d[1]));
[0054] Among them, "component_C" is the component name of the configuration component C. According to the entry identification information of the entry modules of several configuration components, the component name of each configuration component is determined. The component name of each configuration component is mapped to the registration code to obtain the registration information corresponding to each configuration component.
[0055] The above-mentioned process of writing each registration information into the registration file corresponding to the application package to be generated of the target application, and performing dependency binding between the application package to be generated of the target application and the entry module of each configuration component through the entry identification information of the entry file of each configuration component can be: injecting the registration information of each configuration component into the anchor point M of the package to be generated of the target application, and performing dependency binding through the entry identification information of the entry file of each configuration component. Among them, the anchor point M of the package to be generated of the target application can represent the registration file in the package to be generated of the target application. Exemplarily, for configuration component C, the application package of the target application generated by using the established dependency relationship between the entry file of configuration component C and the application package to be generated of the target application and the existing code file package of configuration component C can refer to the following content:
[0056] __d(
[0057] function(g,r,i,a,m,e,d){
[0058] var n = r(d[0]);
[0059] Object.defineProperty(e,"component_C",{enumerable:!0,get:function(){return k0.default;}});
[0060] var k0=n(r(d[1]));
[0061] },
[0062] "template_101",
[0063] ["template_0"] );
[0065] __d(function(g,r,i,a,m,e,d){...},"template_0",["template_1"]);
[0066] __d(function(g,r,i,a,m,e,d){...},"template_1",[]);
[0067] Among them, the above module "template_101" is a module in the RN empty package used to bind configuration components. It can be seen that the registration information of configuration component C is written into the registration file in the RN empty package, and it depends on the entry module "template_0" of configuration component C. The compilation results corresponding to all modules in configuration component C are written into the RN empty package to form the complete functions of configuration component C. So far, the RN empty package has completed the binding of configuration component C. By binding other configuration components in this way, an application package containing all component functions can be generated.
[0068] Exemplarily, if there are several configuration components including two configuration components, the sample code for generating an application package of a target application may refer to the following:
[0069] __d(
[0070] function(g,r,i,a,m,e,d){
[0071] var n = r(d[0]); / / Anchor point M / / Register configuration component C
[0072] Object.defineProperty(e,"component_C",{enumerable:!0,get:function(){return k0.default;}});
[0073] var k0 = n(r(d[1])); / / Register configuration component D
[0074] Object.defineProperty(e,"component_D",{enumerable:!0,get:function(){return k1.default;}});
[0075] var k1=n(r(d[2]));
[0076] },
[0077] "template_101",
[0078] ["template_0","template_2"] / / Entry module that depends on configuration components C and D );
[0080] __d(function(g,r,i,a,m,e,d){...},"template_0",["template_1"]);
[0081] __d(function(g,r,i,a,m,e,d){...},"template_1",[]); / / Configure all modules of component C
[0082] __d(function(g,r,i,a,m,e,d){...},"template_2",[]); / / Configure all modules of component D.
[0083] Among them, "component_D" is the component name of configuration component D. The above module "template_101" is a module in the RN empty package for binding configuration components. It can be seen that the registration file in the RN empty package has written the registration information of configuration component C and configuration component D, and depends on the entry module "template_0" of configuration component C and the entry module "template_2" of configuration component C. The compilation results corresponding to all modules in configuration component C and configuration component D are written into the RN empty package to form the complete function of configuration component C.
[0084] It can be considered that the present application can directly skip the compilation step and directly write the existing code file packages of each configuration component into the application package to be generated by the target application. It only needs to establish the dependency relationship between the entry files of each configuration component and the application package to be generated by the target application to complete the application package generation, which can improve the speed of application package generation. In addition, the present application divides the full compilation task of the target application by component packaging, and uses the existing code file packages of the configuration components that have been packaged in advance to achieve time dispersion at different stages of the development process, thereby reducing the excessive occupation of packaging server resources.
[0085] See also Figure 2 , Figure 2 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 2 .
[0086] In some embodiments, after the above step S13, the application package generation method may further include the following steps: Step S21: Obtain configuration information of several newly configured components in the target application. Step S22: Determine the target change type based on the difference between the configuration information of each configuration component and the configuration information of each newly configured component. The target change type includes a component increase or decrease type and / or a component update type. Step S23: According to the application package adjustment method corresponding to the target change type, adjust the application package of the target application to obtain a new application package of the target application.
[0087] The configuration information of several configuration components in the target application may be the component configuration information corresponding to the historical version of the target application. The configuration information of several new configuration components in the target application may be the component configuration information corresponding to the current version of the target application. Temporarily store the configuration information of several configuration components in the target application. Use the configuration information of several configuration components in the target application as the old configuration information. Use the configuration information of several new configuration components in the target application as the new configuration information.
[0088] Step S22 may be to compare the configuration information difference between the old configuration information and the new configuration information. The configuration information difference may be the configuration component version information difference of the same configuration component, or the difference in the number of components between several configuration components and several new configuration components. Specifically, when the difference in the number of components is that the number of several new configuration components is greater than the number of several configuration components, there are components to be added in the several new configuration components. When the difference in the number of components is that the number of several new configuration components is less than the number of several configuration components, there are components to be deleted in the several configuration components.
[0089] In some application scenarios, in response to the configuration information difference being that there is a difference in the configuration component version information of the same component in several configuration components and several new configuration components, the target change type is a component update type. The component update type is used to indicate that when the configuration component version information of any one of the same components in several configuration components and several new configuration components is different, it is expected that the version of any one of the same components is updated. In other application scenarios, in response to the configuration information difference being the difference in the number of components, the target change type is a component increase and decrease type. Specifically, the component increase and decrease type is used to indicate the change in the number of components between several configuration components and several new configuration components. In response to the configuration information difference being that the number of several new configuration components in the difference in the number of components is greater than the number of several configuration components, the target change type is a component increase type. Among them, the component increase type is used to indicate that it is expected to increase the components to be added in several configuration components. In response to the configuration information difference being that the number of components is less than the number of several configuration components, the target change type is a component reduction type. Among them, the component reduction type is used to indicate that it is expected to reduce the components to be deleted in several configuration components.
[0090] Different target change types have different application package adjustment methods corresponding to the target change types. Specifically, when the target change type is a component update type, the application package adjustment method corresponding to the target change type is the first type of adjustment method. When the target change type is a component increase or decrease type, the application package adjustment method corresponding to the target change type is the second type of adjustment method. Specifically, when the target change type is a component increase type, the application package adjustment method corresponding to the target change type is an addition adjustment method in the second type of adjustment method. When the target change type is a component reduction type, the application package adjustment method corresponding to the target change type is a deletion adjustment method in the second type of adjustment method. Among them, the first adjustment method may involve a version update of any component in the application package of the target application to obtain a new application package of the target application. Add or delete any one of the several newly configured components in the application package of the target application, and any one of the several newly configured components is a component to be added or a component to be deleted. The second type of adjustment method may involve the addition of components to be added and / or the deletion of components to be deleted, as well as the adjustment of the dependency relationship between components to be added and / or components to be deleted and the application package of the target application to obtain a new application package of the target application. Specifically, the addition adjustment method in the second type of adjustment method may involve adding a component to be added, and establishing a dependency relationship between the component to be added and the application package of the target application, to obtain a new application package of the target application. Specifically, the deletion adjustment method in the second type of adjustment method may involve deleting a component to be deleted, and releasing the dependency relationship between the component to be deleted and the application package of the target application, to obtain a new application package of the target application.
[0091] It can be considered that after determining different adjustment methods, decomposing the specific adjustment methods by component dimension and packaging the changed components as needed can significantly reduce the amount of packaged code and improve the packaging efficiency of the new application package for the target application.
[0092] See also Figure 3 , Figure 3 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 3 .
[0093] In some embodiments, the above step S23 may include the following steps: Step S31: In response to the target change type being a component update type, obtaining at least one update entry identification information. Each update entry identification information is used to represent the identification information of the entry file of at least one component to be updated among several newly configured components. Step S32: Delete the existing code file package of at least one target component in the application package of the target application to obtain a processed application package. The identification information of the entry file of each target component is the same as each update entry identification information. Step S33: Write the existing code file package of each component to be updated into the processed application package to obtain a new application package of the target application.
[0094] In response to the target change type including the component update type, the application package adjustment method is determined to be the first type of adjustment method. Specifically, the first type of adjustment method may include the following contents: when the target change type is the component update type, obtain the identification information of the entry file of at least one component to be updated among several newly configured components. The component names in the configuration information between each target component and each component to be updated in the application package of the target application are the same. The identification information of the entry file of each target component is the same as the identification information of each update entry. Delete the existing code file package of each target component in the application package of the target application to obtain the processed application package. At this time, the existing code file package of each target component does not exist in the processed application package, but the dependency relationship between the entry file of each target component and the processed application package still exists. Write the existing code file package of each component to be updated into the processed application package to obtain a new application package of the target application. It can be understood that the configuration component version information in the configuration information between each target component and each component to be updated is different.
[0095] It can be understood that when the target change type is a component update type, by finding and deleting the existing code file packages of all target components in the application package of the target application based on the unique identifier of the entry file of the component to be updated, that is, updating the entry identification information, and then merging the existing code file packages of each component to be updated that has different configuration component version information compared with the existing code file packages of the target component into the processed application package to obtain a new application package of the target application. This can improve the packaging efficiency of the new application package of the target application without changing the dependency relationship.
[0096] See also Figure 4 , Figure 4 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 4 .
[0097] In some embodiments, the above step S23 may include the following steps: Step S41: In response to the target change type being a component increase or decrease type, obtaining at least one increase or decrease entry identification information. Each increase or decrease entry identification information is used to represent the identification information of the entry file of at least one component to be changed among several newly configured components. Step S42: According to the component increase or decrease type, determine the dependency result between the entry file of each component to be changed and the new application package of the target application. Each dependency result is used to indicate whether there is a dependency relationship between the entry file of each component to be changed and the new application package of the target application. Step S43: Based on the dependency result, adjust the application package of the target application to obtain the new application package of the target application.
[0098] Each component to be changed includes at least one component to be added and / or at least one component to be deleted. When the target change type is a component increase or decrease type, determine the number of newly configured components that expect to add at least one component to be added and / or at least one component to be deleted. Use the identification information of the entry file of each component to be changed as each increase or decrease entry identification information. Each increase or decrease entry identification information includes at least one entry identification information to be added corresponding to the component to be added and / or at least one entry identification information to be deleted corresponding to the component to be deleted. Determine each dependency result corresponding to the component increase or decrease type, wherein each dependency result is used to indicate whether there is a dependency relationship between the entry file of each component to be changed and the new application package of the target application. Each dependency result includes at least one first dependency result and / or at least one second dependency result. Each first dependency result is used to indicate that there is a dependency relationship between the entry file of each component to be changed and the new application package of the target application. Each second dependency result is used to indicate that there is no dependency relationship between the entry file of each component to be changed and the new application package of the target application. The dependency result corresponding to the determined component increase or decrease type includes any one of at least one first dependency result and at least one second dependency result, or both, which are not limited here.
[0099] In some embodiments, the above step S43 may include the following steps: First, in response to the dependency result including at least one first dependency result, the components to be changed corresponding to each first dependency result are determined as components to be added. Each first dependency result is used to indicate that there is a dependency relationship between the entry file of each component to be changed and the new application package of the target application. Subsequently, a first dependency relationship is established between each component to be added and the application package of the target application. Then, the existing code file package of each component to be added is added to the application package of the target application to obtain the added application package. Next, based on each first dependency relationship and the added application package, a new application package of the target application is obtained.
[0100] In response to the target change type including the component addition type, the application package adjustment method is determined as the addition adjustment method in the second type of adjustment method. Specifically, the deletion adjustment method may include the following content: the determined dependency result includes at least one first dependency result. The components to be changed in the several newly configured components in each first dependency result are taken as the components to be added. Each first dependency result can also be expressed as an expectation that there is a dependency relationship between the entry file of each component to be added and the new application package of the target application. Establishing the first dependency relationship between each component to be added and the application package of the target application may be: based on the entry identification information to be added corresponding to each component to be added, generating the first registration information corresponding to each component to be added. Subsequently, each first registration information is written into the registration file corresponding to the application package of the target application to obtain the first dependency relationship. The configuration information of several newly configured components also includes the compilation result of the entry file of each component to be added. Based on each first dependency relationship and the added application package, obtaining the new application package of the target application may be: based on each first dependency relationship and the compilation result of the entry file of each component to be added, determining the association relationship between the function file of each component to be added and the application package of the target application. Subsequently, a new application package of the target application is obtained according to the association relationship between the function files of each component to be added and the application package of the target application and the added application package.
[0101] It is understandable that, in the case where the target change type is a component addition type, it is determined that the dependency result includes at least one first dependency result, thereby determining that the adjustment method for the application package of the target application is to add an adjustment method in the second type of adjustment method. And by establishing a dependency relationship between the entry file of the component to be added and the application package of the target application based on the unique identifier of the entry file of the component to be added, that is, the entry identification information to be added, and then adding the existing code file package of the component to be added to the application package of the target application to obtain a new application package of the target application, before generating the new application package of the target application, the existing code file packages of each component to be added are ready, and the present application can directly skip the compilation step, and only needs to establish a dependency relationship between the entry file of each component to be added and the application package of the target application to complete the generation of the new application package, which can improve the speed of application package generation.
[0102] In some embodiments, the above step S43 may include the following steps: First, in response to the dependency result including at least one second dependency result, the components to be changed belonging to each second dependency result are determined as components to be deleted. Each second dependency result is used to indicate that there is no dependency relationship between the entry file of each component to be changed and the new application package of the target application. Subsequently, the second dependency relationship between each component to be deleted and the application package of the target application is released. Next, the existing code file package of each component to be deleted in the application package of the target application is deleted to obtain a new application package of the target application.
[0103] In response to the target change type including the component reduction type, the application package adjustment method is determined as a deletion adjustment method in the second type of adjustment method. Specifically, the deletion adjustment method may include the following content: the determined dependency result includes at least one second dependency result. The components to be changed in several configuration components in each second dependency result are used as each component to be deleted. Each second dependency result can also be expressed as an expectation that there is no dependency relationship between the entry file of each component to be deleted and the new application package of the target application. Removing the second dependency relationship between each component to be deleted and the application package of the target application can be: according to the entry identification information to be deleted corresponding to each component to be deleted, find the second dependency relationship of the component to be deleted in the dependency relationship between the entry file of each configuration component and the application package of the target application. Delete the second dependency relationship of the component to be deleted in the dependency relationship between the entry file of each configuration component and the application package of the target application in the application package of the target application. Deleting the existing code files of each component to be deleted in the application package of the target application, and obtaining the new application package of the target application can be: determining the component name of each component to be deleted from the configuration information of each configuration component. According to the component names of the components to be deleted, the existing code file packages belonging to the components to be deleted in the application package of the target application are found and deleted to obtain a new application package of the target application.
[0104] It can be understood that, in the case where the target change type is a component reduction type, it is determined that the dependency result includes at least one second dependency result, thereby determining that the adjustment method for the application package of the target application is the deletion adjustment method in the second type of adjustment method. And by releasing the dependency relationship between the entry file of the component to be deleted and the application package of the target application based on the unique identifier of the entry file of the component to be deleted, that is, the entry identification information to be deleted, and then deleting the existing code file package belonging to the component to be deleted in the application package of the target application, the present application can directly release the dependency relationship between the entry file belonging to the component to be deleted in the old application package and the old application package based on the entry identification information to be deleted corresponding to the component to be deleted, and delete the existing code file package of the component to be deleted in the old application package to directly obtain the new application package of the target application, which can improve the speed of generating the new application package.
[0105] It is understandable that the determined target change type may include any one, any two, or three of the component update type, component increase type, and component reduction type, and is not limited here. The above is only an exemplary description of the case where the target change type includes any one of the component update type, component increase type, and component reduction type, and the case where the target change type may include any two or three of the component update type, component increase type, and component reduction type will not be repeated here.
[0106] See also Figure 5 , Figure 5This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 5 .
[0107] Step S51, step S52, step S53, step S54, and step S55 are performed in sequence. Step S51: In response to the target application needing to create a new application package, the existing code file packages of several configuration components in the target application and the configuration information of each configuration component are obtained. Before step S51, it is determined whether the target application needs to create a new application package. If the result of the determination is that the target application needs to create a new application package, step S51 is performed. If the result of the determination is that the target application does not need to create a new application package, the old application package of the target application is temporarily stored. The old application package of the target application is adjusted according to the application package adjustment method corresponding to the target change type to obtain a new application package of the target application. Step S52: Based on each entry identification information, the registration information corresponding to each configuration component is generated. Step S53: Each registration information is written into the registration file corresponding to the application package to be generated of the target application to obtain a dependency relationship. Step S54: Based on each dependency relationship and each binding relationship, the association relationship between the function file of each configuration component and the application package to be generated of the target application is determined. Step S55: Based on the association relationship and the existing code file packages of each configuration component, the application package of the target application is generated.
[0108] See also Figure 6 , Figure 6 This is a flow chart of an embodiment of the method for generating an application package of the present application. Figure 6 .
[0109] Step S61, step S62 and step S63 are performed in sequence. Step S61: temporarily store the application package of the target application. Step S62: obtain the configuration information of several newly configured components in the target application. Step S63: determine the target change type according to the difference between the configuration information of each configuration component and the configuration information of each newly configured component. After step S63, in the case where the target change type can include three of the component update type, the component increase type and the component reduction type, the step of adjusting the application package of the target application to obtain the new application package of the target application according to the application package adjustment method corresponding to the target change type may include: step S64, step S65, step S66 and step S67. Among them, step S64, step S65 and step S66 can be executed serially or in parallel, and step S67 is executed after step S64, step S65 and step S66. In the case of serial execution of steps S64, step S65 and step S66, the execution order is not in particular order. This application takes the parallel execution of steps S64, step S65 and step S66 as an example. Step S64: In response to the target change type including the component update type, the target application package is adjusted according to the first type of adjustment method corresponding to the component update type to obtain the first application package of the target application. Step S65: In response to the target change type including the component increase type, the target application package is adjusted according to the increase adjustment method in the second type of adjustment method corresponding to the component update type to obtain the second application package of the target application. Step S66: In response to the target change type including the component reduction type, the target application package is adjusted according to the deletion adjustment method in the second type of adjustment method corresponding to the component update type to obtain the third application package of the target application. Step S67: Based on the first application package of the target application, the second application package of the target application, and the third application package of the target application, a new application package of the target application is determined.
[0110] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0111] See also Figure 7 , Figure 7 It is a structural diagram of an embodiment of the application package generation device of the present application. The application package generation device 70 includes an acquisition module 71, which is used to acquire the existing code file packages of several configuration components in the target application and the configuration information of each configuration component, each configuration information includes the identification information of the entry file of each configuration component; an establishment module 72, which is used to use each entry identification information to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application; and a generation module 73, which is used to generate the application package of the target application based on each dependency relationship and the existing code file package of each configuration component.
[0112] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0113] For the functions performed by each module, please refer to the application package generation method, which will not be repeated here.
[0114] See also Figure 8 , Figure 8 80 is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 80 includes a memory 81 and a processor 82, and the processor 82 is used to execute the program instructions stored in the memory 81 to implement the steps in the above-mentioned application package generation method embodiment. In a specific implementation scenario, the electronic device 80 may include but is not limited to: a multi-camera device, a microcomputer, and a server. In addition, the electronic device 80 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.
[0115] Specifically, the processor 82 is used to control itself and the memory 81 to implement the steps in the above-mentioned application package generation method embodiment. The processor 82 can also be called a CPU (Central Processing Unit). The processor 82 may be an integrated circuit chip with signal processing capabilities. The processor 82 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 82 can be implemented by an integrated circuit chip.
[0116] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0117] See also Fig. 9 , Fig. 9 The computer-readable storage medium 90 stores program instructions 901, which implement the steps in any of the above-mentioned application package generation method embodiments when executed by a processor.
[0118] In the above scheme, before generating the application package of the target application, the existing code file packages of each configuration component are ready. In the process of packaging the target application, the present application does not need to download and parse the dependencies of each component and load the source code of each component for full packaging. Instead, the present application uses the identification information of each configuration information including the entry file of each configuration component to respectively establish the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application. The present application packages each configuration component in the target application separately to obtain the existing code file package, analyzes the structure of the application package of the target application and establishes the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application, and uses the dependency relationships and the existing code file packages of each configuration component to form the application package of the target application, so that in the packaging process of the target application, only the dependency relationship between the entry file of each configuration component and the application package to be generated by the target application needs to be established to complete the application package generation, which can improve the application package generation speed.
[0119] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0120] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.
[0121] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0123] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
Claims
1. A method for generating an application package, characterized in that: The method comprises: Obtain existing code file packages of several configuration components in the target application and configuration information of each of the configuration components, wherein each of the configuration information includes entry identification information corresponding to each of the configuration components, and each of the entry identification information is used to indicate identification information of an entry file of each of the configuration components; Using each of the entry identification information, respectively establish a dependency relationship between the entry file of each of the configuration components and the application package to be generated by the target application; Based on the dependency relationships and the existing code file packages of the configuration components, an application package of the target application is generated.
2. The method according to claim 1, characterized in that The using of each entry identification information to respectively establish a dependency relationship between the entry file of each configuration component and the application package to be generated by the target application includes: Based on each of the entry identification information, generate registration information corresponding to each of the configuration components; Each of the registration information is written into a registration file corresponding to the application package to be generated by the target application to obtain the dependency relationship.
3. The method according to any one of claims 1 to 2, characterized in that The configuration information of each configuration component also includes the compilation result of the entry file of each configuration component, and each compilation result includes the binding relationship between the entry file of each configuration component and the function file of each configuration component. The application package of the target application is generated based on each dependency relationship and the existing code file package of each configuration component, including: Based on the dependency relationships and the binding relationships, determining the association relationship between the function files of the configuration components and the application packages to be generated by the target application; An application package of the target application is generated according to the association relationship and the existing code file packages of each of the configuration components.
4. The method according to any one of claims 1 to 2, characterized in that: After generating the application package of the target application based on the dependency relationships and the existing code file packages of the configuration components, the method further includes: Obtaining configuration information of several new configuration components in the target application; Determining a target change type according to a difference between the configuration information of each of the configured components and the configuration information of each of the newly configured components, wherein the target change type includes a component addition / reduction type and / or a component update type; According to the application package adjustment method corresponding to the target change type, the application package of the target application is adjusted to obtain a new application package of the target application.
5. The method according to claim 4, characterized in that The adjusting the application package of the target application according to the application package adjustment method corresponding to the target change type to obtain a new application package of the target application includes: In response to the target change type being a component update type, obtaining at least one update entry identification information, each of the update entry identification information being used to represent identification information of an entry file of at least one component to be updated among the plurality of newly configured components; Deleting an existing code file package of at least one target component in an application package of the target application to obtain a processed application package, wherein identification information of an entry file of each target component is the same as each update entry identification information; The existing code file packages of the components to be updated are written into the processed application package to obtain a new application package of the target application.
6. The method according to claim 4, characterized in that The adjusting the application package of the target application according to the application package adjustment method corresponding to the target change type to obtain a new application package of the target application includes: In response to the target change type being a component addition or reduction type, obtaining at least one addition or reduction entry identification information, each of the addition or reduction entry identification information being used to represent identification information of an entry file of at least one component to be changed among the plurality of newly configured components; Determine, according to the component addition and reduction type, a dependency result between the entry file of each component to be changed and the new application package of the target application, wherein each dependency result is used to indicate whether there is a dependency relationship between the entry file of each component to be changed and the new application package of the target application; Based on the dependency result, the application package of the target application is adjusted to obtain a new application package of the target application.
7. The method according to claim 6, characterized in that The adjusting the application package of the target application based on the dependency result to obtain a new application package of the target application includes: In response to the dependency results including at least one first dependency result, determining the components to be changed corresponding to each of the first dependency results as components to be added, each of the first dependency results being used to indicate that there is a dependency relationship between an entry file of each of the components to be changed and a new application package of the target application; Establishing a first dependency relationship between each of the components to be added and the application package of the target application; Adding the existing code file packages of the components to be added to the application package of the target application to obtain an added application package; Based on each of the first dependencies and the added application package, a new application package of the target application is obtained.
8. The method according to claim 6, characterized in that The adjusting the application package of the target application based on the dependency result to obtain a new application package of the target application includes: In response to the dependency result including at least one second dependency result, determining the components to be changed belonging to each of the second dependency results as components to be deleted, each of the second dependency results being used to indicate that there is no dependency relationship between the entry file of each of the components to be changed and the new application package of the target application; Removing the second dependency relationship between each of the components to be deleted and the application package of the target application; The existing code file packages of each of the components to be deleted in the application package of the target application are deleted to obtain a new application package of the target application.
9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the method according to any one of claims 1 to 8.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: include: A program file is stored, and when the program file is executed by a processor, it is used to implement the method according to any one of claims 1 to 8.