CN109739548B - Program packaging method, program packaging device, and computer-readable storage medium - Google Patents
Program packaging method, program packaging device, and computer-readable storage medium Download PDFInfo
- Publication number
- CN109739548B CN109739548B CN201811624494.5A CN201811624494A CN109739548B CN 109739548 B CN109739548 B CN 109739548B CN 201811624494 A CN201811624494 A CN 201811624494A CN 109739548 B CN109739548 B CN 109739548B
- Authority
- CN
- China
- Prior art keywords
- package
- module
- subpackage
- configuration information
- modules
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
- Stored Programmes (AREA)
Abstract
一种程序打包方法、程序打包装置及计算机可读存储介质,其中,上述程序打包方法包括:获取分包的配置信息,其中,所述配置信息包含对本包所包含模块的指定;据所述分包的配置信息生成本包的模块调用方法,其中,所述模块调用方法用以指定本包所调用的各模块的加载方式;基于所述分包的配置信息和所述模块调用方法进行打包操作,得到分包文件,其中,所述分包文件包含本包的模块调用方法。本申请提供的方案使得分包文件可以在各种平台运行。
A program packaging method, a program packaging device, and a computer-readable storage medium, wherein the program packaging method includes: acquiring subpackage configuration information, wherein the configuration information includes a designation of a module included in this package; according to the subpackage The configuration information of the package generates the module calling method of the package, wherein the module calling method is used to specify the loading mode of each module called by the package; the packaging operation is performed based on the configuration information of the subpackage and the module calling method , to obtain a subcontracting file, wherein the subcontracting file contains the module calling method of this package. The solution provided by this application enables the subcontracted documents to be run on various platforms.
Description
技术领域technical field
本申请涉及通信技术领域,尤其涉及一种程序打包方法、程序打包装置及计算机可读存储介质。The present application relates to the field of communication technologies, and in particular, to a program packaging method, a program packaging device, and a computer-readable storage medium.
背景技术Background technique
随着科学技术的发展,各种智能终端已经成为人们生活和工作中不可或缺的部分。智能终端通过搭载各种应用程序,能够实现各种各样的功能,满足用户的不同需求。With the development of science and technology, various intelligent terminals have become an indispensable part of people's life and work. Smart terminals can realize various functions by carrying various application programs to meet the different needs of users.
“快应用”是几家手机厂商基于硬件平台共同推出的新型应用生态,用户不必下载安装,即点即用,能够享受到原生应用的性能体验。“快应用”使用前端技术栈开发与原生渲染,兼具H5页面和原生应用的双重优点。"Quick App" is a new type of application ecosystem jointly launched by several mobile phone manufacturers based on the hardware platform. Users do not need to download and install, just click and use, and can enjoy the performance experience of native applications. "Quick application" uses front-end technology stack development and native rendering, which combines the dual advantages of H5 pages and native applications.
目前,“快应用”的典型案例有微信的小程序,某些情况下,开发者需要将小程序划分成不同的子包,在构建时打包成不同的分包,用户在使用时按需进行加载。现有技术中,通过打包工具打包出的分包需要依赖于微信的引擎才能启动,而无法在其它平台下(例如浏览器)中运行。At present, the typical case of "quick application" is the WeChat applet. In some cases, the developer needs to divide the applet into different sub-packages, and package them into different sub-packages during construction. load. In the prior art, the subpackage packaged by the packaging tool needs to rely on the engine of WeChat to be started, and cannot be run under other platforms (such as browsers).
发明内容SUMMARY OF THE INVENTION
本申请提供一种程序打包方法、程序打包装置及计算机可读存储介质,使得分包文件可以在各种平台运行。The present application provides a program packaging method, a program packaging device, and a computer-readable storage medium, so that the subpackaged files can be run on various platforms.
本申请第一方面提供一种程序打包方法,包括:A first aspect of the present application provides a program packaging method, including:
获取分包的配置信息,其中,所述配置信息包含对本包所包含模块的指定和本包所调用模块的指定;Obtain the configuration information of subcontracting, wherein, the configuration information includes the designation of the module included in this package and the designation of the module called by this package;
根据所述分包的配置信息生成本包的模块调用方法,其中,所述模块调用方法用以指定本包所调用的各模块的加载方式;The module calling method of this package is generated according to the configuration information of the subpackage, wherein the module calling method is used to specify the loading mode of each module called by this package;
基于所述分包的配置信息和所述模块调用方法进行打包操作,得到分包文件,其中,所述分包文件包含本包的模块调用方法。The packaging operation is performed based on the configuration information of the subpackage and the module invocation method to obtain a subpackage file, wherein the subpackage file includes the module invocation method of the package.
本申请第二方面提供一种程序打包装置,包括:A second aspect of the present application provides a program packaging device, comprising:
获取单元,用于获取分包的配置信息,其中,所述配置信息包含对本包所包含模块的指定和本包所调用模块的指定;an acquisition unit for acquiring the configuration information of the subcontracting, wherein the configuration information includes a specification of a module included in this package and a specification of a module called by this package;
生成单元,用于根据所述分包的配置信息生成本包的模块调用方法,其中,所述模块调用方法用以指定本包所调用的各模块的加载方式;a generating unit, configured to generate a module calling method of the package according to the configuration information of the subpackage, wherein the module calling method is used to specify the loading mode of each module called by the package;
打包单元,用于基于所述分包的配置信息和所述模块调用方法进行打包操作,得到分包文件,其中,所述分包文件包含本包的模块调用方法。A packaging unit, configured to perform a packaging operation based on the configuration information of the subpackage and the module invocation method to obtain a subpackage file, wherein the subpackage file includes the module invocation method of the package.
本申请第三方面提供另一种程序打包装置,该程序打包装置包括:A third aspect of the present application provides another program packaging device, the program packaging device comprising:
存储器、处理器及存储在上述存储器上并可在上述处理器上运行的计算机程序,上述处理器执行上述计算机程序时,实现上述本申请实施例第一方面提供的程序打包方法中的各步骤。A memory, a processor, and a computer program stored in the memory and running on the processor, when the processor executes the computer program, implements the steps in the program packaging method provided in the first aspect of the embodiment of the present application.
本申请第四方面提供一种计算机可读存储介质,其上存储有计算机程序,上述计算机程序被处理器执行时,实现上述本申请实施例第一方面提供的程序打包方法中的各步骤。A fourth aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, each step of the program packaging method provided in the first aspect of the embodiment of the present application is implemented.
由上可见,本申请方案根据分包的配置信息生成本包的模块调用方法,并基于分包的配置信息和该模块调用方法进行打包操作,使得分包文件包含本包的模块调用方法。由于模块调用方法指定了本包所调用的各模块的加载方式,因此,通过本申请分案打包生成的分包文件,可以在各种平台下按照该分包文件中的模块调用方法运行,而无需依赖于特定平台中的引擎所指定的加载方式来运行。As can be seen from the above, the solution of the present application generates the module calling method of the package according to the configuration information of the package, and performs the packaging operation based on the configuration information of the package and the module calling method, so that the package file contains the module calling method of the package. Since the module calling method specifies the loading method of each module called by this package, the subpackage file generated by the case division packaging of the present application can be run according to the module calling method in the subpackage file under various platforms, while There is no need to rely on the loading method specified by the engine in a specific platform to run.
附图说明Description of drawings
图1为本申请提供的程序打包方法一个实施例流程示意图;1 is a schematic flowchart of an embodiment of a program packaging method provided by the present application;
图2为本申请提供的总包打包流程示意图;2 is a schematic diagram of the overall package packaging process provided by the application;
图3为本申请提供的程序打包装置一个实施例结构示意图;3 is a schematic structural diagram of an embodiment of a program packaging device provided by the present application;
图4为本申请提供的程序打包装置另一个实施例结构示意图。FIG. 4 is a schematic structural diagram of another embodiment of the program packaging apparatus provided by the present application.
具体实施方式Detailed ways
为使得本申请的发明目的、特征、优点能够更加的明显和易懂,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而非全部实施例。基于本申请中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, features and advantages of the invention of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. The embodiments described above are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of this application.
本申请实施例提供一种程序打包方法,该程序打包方法应用于程序打包装置,该程序打包装置可以集成在智能手机、平板电脑、个人计算机等终端,或者,也可以是独立电子装置,此处不做限定。An embodiment of the present application provides a program packaging method. The program packaging method is applied to a program packaging device. The program packaging device may be integrated in a terminal such as a smart phone, a tablet computer, or a personal computer, or may also be an independent electronic device. Here Not limited.
请参阅图1,本实施例中的程序打包方法主要包括以下步骤:Referring to FIG. 1, the program packaging method in this embodiment mainly includes the following steps:
步骤101、获取分包的配置信息;
本申请实施例中,上述述配置信息包含对本包所包含模块(例如.js文件,一个.js文件可称之为模块)的指定,所谓本包,是指当前需要进行调用模块和对调用方法进行打包操作的资源和代码等文件,而分包是指根据配置信息打包在一起的资源和代码块。从上述定义可获知,本包与分包的关系在于当前是对谁进行操作,若当前是对某个分包操作,则该分包就是一个本包。In the embodiment of the present application, the above configuration information includes the specification of the modules contained in this package (for example, a .js file, a .js file may be called a module). Files such as resources and codes for packaging operations, and sub-packages refer to resources and code blocks that are packaged together according to configuration information. From the above definition, it can be known that the relationship between this package and subcontracting is who is currently operating.
可选的,对本包所包含模块的指定可以是通过指定目录的方式对本包所包含模块进行指定,则被指定的目录下的所有模块为本包所包含的模块。举例说明,对于以目录“stage1”作为分包名称的分包stage1,可以通过如下代码指定目录stage1下的所有模块为分包stage1所包含的模块:Optionally, the modules included in this package can be specified by specifying a directory, and then all modules in the specified directory are modules included in this package. For example, for the subpackage stage1 with the directory "stage1" as the subpackage name, you can specify all modules under the directory stage1 as the modules included in the subpackage stage1 by the following code:
当然,也可以通过指定模块的方式直接进行指定,以上面例子为例,则可以通过如下代码对js1这个模块进行指定:Of course, it can also be specified directly by specifying a module. Taking the above example as an example, the js1 module can be specified by the following code:
进一步,上述配置信息还可以包括如下几项:分包根目录、分包别名、分包相对于分包根目录的页面路径以及指示分包是否为独立分包的标志位。Further, the above configuration information may also include the following items: a subpackage root directory, a subpackage alias, a page path of the subpackage relative to the subpackage root directory, and a flag indicating whether the subpackage is an independent subpackage.
在实际应用中,各个分包的配置信息可以由开发人员预先通过特定的接口输入,除分包以外的其它数据可认为是主包的数据,这些数据被打包到主包中而生成主包文件。通常,主包文件包括:默认启动页面和分包所调用的公共资源。In practical applications, the configuration information of each sub-package can be input by the developer through a specific interface in advance, and other data except the sub-package can be regarded as the data of the main package, and these data are packaged into the main package to generate the main package file. . Usually, the main package file includes: the default startup page and the common resources called by the subpackage.
步骤102、根据上述分包的配置信息生成本包的模块调用方法;
其中,上述模块调用方法用以指定本包所调用的各模块的加载方式。The above module calling method is used to specify the loading method of each module called by this package.
上述模块调用方法可解决如下两个问题:The above module calling method can solve the following two problems:
1、实现模块的加载(例如异步加载),避免加载模块时无响应;1. Implement the loading of modules (such as asynchronous loading) to avoid no response when loading modules;
2、管理模块之间的依赖性,便于代码的编写和维护。2. Manage dependencies between modules to facilitate code writing and maintenance.
由于上述配置信息包含对本包所包含模块的指定。作为本申请一个实施例,根据上述分包的配置信息生成本包的模块调用方法可以是:根据分包的配置信息获取本包所包含模块以及各模块之间的依赖关系,通过各模块之间的依赖关系获知各模块的加载顺序,生成本包的模块调用方法。Because the above configuration information contains the specification of the modules included in this package. As an embodiment of the present application, the module calling method for generating the package according to the configuration information of the subpackage may be: acquiring the modules included in the package and the dependencies between the modules according to the configuration information of the subpackage, and passing the modules between the modules. The dependencies of the module know the loading order of each module, and generate the module call method of this package.
可选的,上述模块调用方法为require方法(也可称为require()函数),则步骤102具体表现为:根据上述分包的配置信息生成本包的require方法。具体的,require方法的写法格式可如下:require([module],callback),由该格式可见,require方法包含两个参数,第一个参数[module]是一个数组,里面的成员就是要加载的模块,第二个参数callback,则是加载成功之后的回调函数。Optionally, the above-mentioned module calling method is a require method (also referred to as a require() function), and
当然,require方法仅是上述模块调用方法的一种实现方式,在其它实施例中,上述模块调用方法也可以为define方法或其它方法,此处不做限定。Of course, the require method is only an implementation manner of the above-mentioned module invocation method. In other embodiments, the above-mentioned module invocation method may also be a define method or other methods, which is not limited here.
步骤103、基于上述分包的配置信息和上述模块调用方法进行打包操作,得到分包文件;
其中,上述分包文件包含本包的模块调用方法。Among them, the above-mentioned subpackage file contains the module calling method of this package.
在步骤103中,基于上述分包的配置信息将本包所调用的模块进行打包,并在打包过程中写入步骤102生成的模块调用方法,以得到分包文件。In
可选的,为了减小分包文件的大小,对于分包文件所调用的模块且该分包文件未包含的模块,本申请实施例中将这些模块称之为外包模块,可以不将这些模块打包在分包文件中(即将这些模块排除),由于通常开发者对模块的路径定义为相对路径即相对于所在分包根目录的路径,为了使得分包文件在调用外包模块时能够找到相关文件,本申请实施例中可以对本包所调用的外包模块的相对路径和该外包模块的绝对路径进行映射,并将映射得到的模块映射信息写入该本包中。具体的,本申请实施例中的程序打包方法还包括:Optionally, in order to reduce the size of the subcontracting file, for the modules called by the subcontracting file and the modules not included in the subcontracting file, these modules are referred to as outsourcing modules in the embodiments of the present application, and these modules may not be referred to as outsourcing modules. Packaged in the subpackage file (that is, excluding these modules), because usually the developer defines the path of the module as a relative path, that is, the path relative to the root directory of the subpackage, in order to enable the subpackage file to find the related files when calling the outsourced module. , in the embodiment of the present application, the relative path of the outsourced module called by this package and the absolute path of the outsourced module may be mapped, and the module mapping information obtained by the mapping may be written into this package. Specifically, the program packaging method in the embodiment of the present application further includes:
当上述分包调用的模块包含外包模块时,生成上述分包的模块映射信息,其中,上述模块映射信息用以对本包所调用的外包模块的相对路径和上述外包模块的绝对路径进行映射,其中,上述外包模块是指本包内调用且本包未包含的模块,上述相对路径是指相对于本包根目录的路径,而外包模块的绝对路径是相当于外包模块的字典。步骤103可表现为:基于上述分包的配置信息和所述模块调用方法,对上述分包所包含的模块和上述分包的模块映射信息进行打包操作。When the module called by the above-mentioned subcontracting includes an outsourced module, the above-mentioned subcontracted module mapping information is generated, wherein the above-mentioned module mapping information is used to map the relative path of the outsourced module called by this package and the absolute path of the above-mentioned outsourced module, wherein , the above-mentioned outsourced module refers to the module called in this package and not included in this package, the above-mentioned relative path refers to the path relative to the root directory of this package, and the absolute path of the outsourced module is a dictionary equivalent to the outsourced module. Step 103 may be represented as: based on the configuration information of the subpackage and the module calling method, a packaging operation is performed on the modules included in the subpackage and the module mapping information in the subpackage.
对于模块为Js模块的场景,步骤103的打包操作可以使用Gulp控制打包流程,包括JS的转化、sourceMap的生成、错误处理、代码压缩和混淆等,并可使用Browserify对JS模块进行打包。For the scenario where the module is a Js module, the packaging operation in
进一步,在得到各分包文件和主包文件后,可以将得到的各分包文件和主包文件打包为总包文件。如图2所示,在打包得到分包文件1-N(在图2中以分包1.rpk、分包2.rpk……分包文件N.rpk进行示意)和主包文件(在图2中以main.rpk进行示意)后,可以将各分包文件和主包文件打包为总包文件(在图2中以[project name].rpk进行示意),其中,“rpk”为包文件的后缀名。Further, after each subcontracting file and the main package file are obtained, each obtained subcontracting file and the main package file can be packaged into a general package file. As shown in Figure 2, the sub-package files 1-N (in Figure 2 are shown as sub-package 1.rpk, sub-package 2.rpk...sub-package file N.rpk) and the main package file (in Figure 2) are obtained after packaging. 2), each sub-package file and the main package file can be packaged into a total package file (indicated by [project name].rpk in Figure 2), where "rpk" is the package file suffix.
需要说明的是,本申请实施例中的程序打包方法是针对模块的打包逻辑进行改进的方案,对于分包文件包含的其它非模块资源(css、图片、音视频等文件),可以参照已有技术(例如复制操作)加入分包文件即可。It should be noted that the program packaging method in the embodiment of the present application is a solution for improving the packaging logic of modules. For other non-module resources (css, pictures, audio and video files, etc.) contained in the subpackaged file, you can refer to the existing Technology (such as copy operation) can be added to the subcontract file.
还需要说明的是,本申请实施例中的程序打包文件适用于对各个分包进行打包,对于主包的打包流程,可以参照已有技术实现,此处不再赘述。It should also be noted that the program packaging file in the embodiment of the present application is suitable for packaging each sub-package, and the packaging process of the main package may be implemented with reference to the prior art, which will not be repeated here.
由上可见,本申请方案根据分包的配置信息生成本包的模块调用方法,并基于分包的配置信息和该模块调用方法进行打包操作,使得分包文件包含本包的模块调用方法。由于模块调用方法指定了本包所调用的各模块的加载方式,因此,通过本申请分案打包生成的分包文件,可以在各种平台下(例如V8环境搭建的平台)按照该分包文件中的模块调用方法运行,而无需依赖于特定平台中的引擎所指定的加载方式来运行。As can be seen from the above, the solution of the present application generates the module calling method of the package according to the configuration information of the package, and performs the packaging operation based on the configuration information of the package and the module calling method, so that the package file contains the module calling method of the package. Since the module calling method specifies the loading method of each module called by this package, the sub-package file generated by the case-divided packaging of this application can be used on various platforms (such as the platform built in the V8 environment) according to the sub-package file. The modules in the call method run without relying on the loading method specified by the engine in the specific platform to run.
图3为本申请实施例提供一种程序打包装置。该程序打包装置可用于实现图1所示实施例中的程序打包方法。如图3所示,该程序打包装置主要包括:FIG. 3 provides a program packaging apparatus according to an embodiment of the present application. The program packaging device can be used to implement the program packaging method in the embodiment shown in FIG. 1 . As shown in Figure 3, the program packaging device mainly includes:
获取单元301,用于获取分包的配置信息,其中,所述配置信息包含对本包所包含模块的指定;The obtaining
生成单元302,用于根据上述分包的配置信息生成本包的模块调用方法,其中,上述模块调用方法用以指定本包所调用的各模块的加载方式;A generating
打包单元303,用于基于上述分包的配置信息和上述模块调用方法进行打包操作,得到分包文件,其中,上述分包文件包含本包的模块调用方法。The
可选的,上述程序打包装置还包括:Optionally, the above-mentioned program packaging device further includes:
映射单元,用于当上述分包调用的模块包含外包模块时,生成上述分包的模块映射信息,其中,上述模块映射信息用以对本包所调用的外包模块的相对路径和所述外包模块的绝对路径进行映射,其中,上述外包模块是指本包内调用且本包未包含的模块,上述相对路径是指相对于本包根目录的路径;The mapping unit is used to generate the module mapping information of the above-mentioned subcontracting when the module called by the above-mentioned subcontracting includes the outsourcing module, wherein, the above-mentioned module mapping information is used to the relative path of the outsourcing module called by this bag and the relative path of the outsourcing module. The absolute path is mapped, wherein the above-mentioned outsourced module refers to the module called in this package and not included in this package, and the above-mentioned relative path refers to the path relative to the root directory of this package;
打包单元303具体用于:基于上述分包的配置信息和上述模块调用方法,对上述分包所包含的模块和上述分包的模块映射信息进行打包操作。The
需要说明的是,以上图3示例的程序打包装置的实施方式中,各功能模块的划分仅是举例说明,实际应用中可以根据需要,例如相应硬件的配置要求或者软件的实现的便利考虑,而将上述功能分配由不同的功能模块完成,即将程序打包装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。而且,在实际应用中,本实施例中的相应的功能模块可以是由相应的硬件实现,也可以由相应的硬件执行相应的软件完成。本说明书提供的各个实施例都可应用上述描述原则,以下不再赘述。It should be noted that, in the above embodiment of the program packaging device illustrated in FIG. 3 , the division of each functional module is only an example, and in practical applications, it can be based on needs, such as the configuration requirements of corresponding hardware or the convenience of software implementation, and The above function allocation is completed by different function modules, that is, the internal structure of the program packaging device is divided into different function modules, so as to complete all or part of the functions described above. Moreover, in practical applications, the corresponding functional modules in this embodiment may be implemented by corresponding hardware, or may be implemented by corresponding hardware executing corresponding software. The above description principles can be applied to each of the embodiments provided in this specification, which will not be repeated below.
本实施例提供的程序打包装置中各功能模块实现各自功能的具体过程,请参见上述方法实施例中描述的具体内容,此处不再赘述。For the specific process of each functional module in the program packaging device provided in this embodiment implementing their respective functions, please refer to the specific content described in the foregoing method embodiment, which will not be repeated here.
由上可见,本申请实施例中的程序打包装置根据分包的配置信息生成本包的模块调用方法,并基于分包的配置信息和该模块调用方法进行打包操作,使得分包文件包含本包的模块调用方法。由于模块调用方法指定了本包所调用的各模块的加载方式,因此,通过本申请分案打包生成的分包文件,可以在各种平台下按照该分包文件中的模块调用方法运行,而无需依赖于特定平台中的引擎所指定的加载方式来运行。As can be seen from the above, the program packaging device in the embodiment of the present application generates a module calling method of the package according to the configuration information of the package, and performs a packaging operation based on the configuration information of the package and the module calling method, so that the package file contains the package. The module calls the method. Since the module calling method specifies the loading method of each module called by this package, the subpackage file generated by the case division packaging of the present application can be run according to the module calling method in the subpackage file under various platforms, while There is no need to rely on the loading method specified by the engine in a specific platform to run.
图4为本申请实施例提供一种程序打包装置。该程序打包装置可用于实现图1所示实施例中的程序打包方法。如图4所示,该程序打包装置主要包括:FIG. 4 provides a program packaging apparatus according to an embodiment of the present application. The program packaging device can be used to implement the program packaging method in the embodiment shown in FIG. 1 . As shown in Figure 4, the program packaging device mainly includes:
存储器401、处理器402及存储在存储器401上并可在处理器402上运行的计算机程序,处理器402执行该计算机程序时,实现图1所示实施例中的程序打包方法。A
进一步的,该程序打包装置还包括:Further, the program packaging device also includes:
至少一个输入设备403以及至少一个输出设备404。At least one
上述存储器401、处理器402、输入设备403以及输出设备404,通过总线405连接。The above-mentioned
其中,输入设备403具体可为摄像头、触控面板、物理按键或者鼠标等等。输出设备404具体可为显示屏。The
存储器401可以是高速随机存取记忆体(RAM,Random Access Memory)存储器,也可为非不稳定的存储器(non-volatile memory),例如磁盘存储器。存储器401用于存储一组可执行程序代码,处理器402与存储器401耦合。The
由上可见,本申请实施例中的程序打包装置根据分包的配置信息生成本包的模块调用方法,并基于分包的配置信息和该模块调用方法进行打包操作,使得分包文件包含本包的模块调用方法。由于模块调用方法指定了本包所调用的各模块的加载方式,因此,通过本申请分案打包生成的分包文件,可以在各种平台下按照该分包文件中的模块调用方法运行,而无需依赖于特定平台中的引擎所指定的加载方式来运行。As can be seen from the above, the program packaging device in the embodiment of the present application generates a module calling method of the package according to the configuration information of the package, and performs a packaging operation based on the configuration information of the package and the module calling method, so that the package file contains the package. The module calls the method. Since the module calling method specifies the loading method of each module called by this package, the subpackage file generated by the case division packaging of the present application can be run according to the module calling method in the subpackage file under various platforms, while There is no need to rely on the loading method specified by the engine in a specific platform to run.
进一步的,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质可以是设置于上述各实施例中的程序打包装置中,该计算机可读存储介质可以是前述图3所示实施例中的存储器。该计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现图1所示实施例中的程序打包方法。进一步的,该计算机可存储介质还可以是U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Further, an embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium may be set in the program packaging apparatus in the above-mentioned embodiments, and the computer-readable storage medium may be the aforementioned FIG. 3 memory in the embodiment shown. A computer program is stored on the computer-readable storage medium, and when the program is executed by the processor, the program packaging method in the embodiment shown in FIG. 1 is implemented. Further, the computer-storable medium may also be a USB flash drive, a removable hard disk, a read-only memory (ROM, Read-Only Memory), a RAM, a magnetic disk, or an optical disk and other media that can store program codes.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the above modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules or components may be combined or Integration into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or modules, and may be in electrical, mechanical or other forms.
上述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described above as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, may be located in one place, or may be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.
上述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个可读存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例上述方法的全部或部分步骤。而前述的可读存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the above-mentioned integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a readable storage The medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the above-mentioned methods of the various embodiments of the present application. The aforementioned readable storage medium includes: U disk, removable hard disk, ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
需要说明的是,对于前述的各方法实施例,为了简便描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其它顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定都是本申请所必须的。It should be noted that, for the convenience of description, the foregoing method embodiments are described as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily all necessary for the present application.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其它实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
以上为对本申请所提供的程序打包方法、程序打包装置及计算机可读存储介质的描述,对于本领域的技术人员,依据本申请实施例的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。The above is a description of the program packaging method, the program packaging device and the computer-readable storage medium provided by the present application. For those skilled in the art, according to the ideas of the embodiments of the present application, there will be changes in the specific implementation and application scope. In conclusion, the content of this specification should not be construed as a limitation on this application.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811624494.5A CN109739548B (en) | 2018-12-28 | 2018-12-28 | Program packaging method, program packaging device, and computer-readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201811624494.5A CN109739548B (en) | 2018-12-28 | 2018-12-28 | Program packaging method, program packaging device, and computer-readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN109739548A CN109739548A (en) | 2019-05-10 |
| CN109739548B true CN109739548B (en) | 2022-05-17 |
Family
ID=66361916
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201811624494.5A Active CN109739548B (en) | 2018-12-28 | 2018-12-28 | Program packaging method, program packaging device, and computer-readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN109739548B (en) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111710051B (en) * | 2020-06-17 | 2024-06-14 | 京东方科技集团股份有限公司 | Human body model data processing method, device, electronic equipment and storage medium |
| CN113342400B (en) * | 2021-06-29 | 2022-05-17 | 上海哔哩哔哩科技有限公司 | Off-line package packing method and device and computer equipment |
| CN115328506A (en) * | 2022-09-01 | 2022-11-11 | 抖音视界有限公司 | Application package generation method, loading method, device, medium and equipment |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5715454A (en) * | 1996-03-11 | 1998-02-03 | Hewlett-Packard Company | Version control of documents by independent line change packaging |
| CN106980504A (en) * | 2017-03-28 | 2017-07-25 | 腾讯科技(深圳)有限公司 | A kind of application development method and its instrument, equipment |
-
2018
- 2018-12-28 CN CN201811624494.5A patent/CN109739548B/en active Active
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5715454A (en) * | 1996-03-11 | 1998-02-03 | Hewlett-Packard Company | Version control of documents by independent line change packaging |
| CN106980504A (en) * | 2017-03-28 | 2017-07-25 | 腾讯科技(深圳)有限公司 | A kind of application development method and its instrument, equipment |
Non-Patent Citations (3)
| Title |
|---|
| weixin_33859844.小程序分包加载.《https://blog.csdn.net/weixin_33859844/article/details/88711162》.2018, * |
| 小程序分包加载;weixin_33859844;《https://blog.csdn.net/weixin_33859844/article/details/88711162》;20181111;第1-5页 * |
| 微信小程序引入外部js方法;进击的小牛牛;《https://www.cnblogs.com/zzd0916/p/7723994.html》;20171024;第1-5页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109739548A (en) | 2019-05-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109542399B (en) | Software development method and device, terminal equipment and computer readable storage medium | |
| CN106547580B (en) | Method and device for hooking function, mobile terminal and storage medium | |
| CN109739548B (en) | Program packaging method, program packaging device, and computer-readable storage medium | |
| CN108228147A (en) | A kind of performance data journal obtaining method and device | |
| CN108647032B (en) | Application loading method and apparatus, computer apparatus and computer-readable storage medium | |
| CN106155749A (en) | A kind of monitoring plug-in extension method and device | |
| CN111880786A (en) | Multi-application sharing method, system, device, electronic device and storage medium | |
| WO2021252848A1 (en) | Techniques to facilitate a migration process to cloud storage | |
| CN112214250A (en) | Application program assembly loading method and device | |
| CN118132203A (en) | Container management method, device, equipment and medium | |
| CN109815455A (en) | Item file treating method and apparatus | |
| RU2616164C9 (en) | Methods and device for browser engine work | |
| CN115658185A (en) | Method, device, storage medium and electronic device for quick start of cloud application | |
| US10599444B2 (en) | Extensible input stack for processing input device data | |
| CN105247618B (en) | Method and device for executing application code on hard disk | |
| CN115658184B (en) | Method and device for quickly starting cloud application, storage medium and electronic equipment | |
| US20190213015A1 (en) | Extensible input stack for processing input device data | |
| WO2023143545A1 (en) | Resource processing method and apparatus, electronic device, and computer-readable storage medium | |
| CN112131495B (en) | Webpage display method, device, equipment and storage medium based on decision flow result | |
| CN115292169A (en) | UI automation test method and system | |
| CN115270198A (en) | PDF document signature method, device and storage medium | |
| CN104462498B (en) | Search for the method, apparatus and search client of input frame refocusing | |
| CN106294143A (en) | The adjustment method of the depositor of chip and device | |
| CN114416215A (en) | Function calling method and device | |
| CN112860139A (en) | Application program interface switching method and device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |