WO2018039875A1 - Method and apparatus for acquiring application upgrade package - Google Patents

Method and apparatus for acquiring application upgrade package Download PDF

Info

Publication number
WO2018039875A1
WO2018039875A1 PCT/CN2016/097181 CN2016097181W WO2018039875A1 WO 2018039875 A1 WO2018039875 A1 WO 2018039875A1 CN 2016097181 W CN2016097181 W CN 2016097181W WO 2018039875 A1 WO2018039875 A1 WO 2018039875A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
type
application
difference
original
Prior art date
Application number
PCT/CN2016/097181
Other languages
French (fr)
Chinese (zh)
Inventor
钱晋超
伍业雄
丁亮
Original Assignee
北京小米移动软件有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京小米移动软件有限公司 filed Critical 北京小米移动软件有限公司
Priority to PCT/CN2016/097181 priority Critical patent/WO2018039875A1/en
Priority to CN201680001806.XA priority patent/CN106462430B/en
Publication of WO2018039875A1 publication Critical patent/WO2018039875A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present disclosure relates to the field of network technologies, and in particular, to an application upgrade package acquiring method and apparatus.
  • the current application upgrade method For a terminal, multiple applications are installed on one terminal, and when these applications are upgraded to the latest version, large traffic consumption is caused.
  • the current application upgrade method generally adopts an incremental upgrade mode.
  • the following application method is generally used to obtain an application upgrade package: binary difference is directly performed between the new and old application installation packages to obtain a difference.
  • the upgrade package can be upgraded based on the differential upgrade package. Since the data volume of the differential upgrade package is smaller than the data volume of the installation package of the entire application, the purpose of reducing the traffic consumption can be achieved.
  • the present disclosure provides an application upgrade package acquisition method and apparatus.
  • an application upgrade package obtaining method including:
  • Decompressing the first installation package and the second installation package of the application obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package; determining a file type of each file, The file type is used to indicate whether the file can be further decomposed; according to the file type of each file, performing differential processing corresponding to the file type on the at least one original file and the at least one target file to obtain at least a differential file; compressing the at least one differential file to obtain a differential upgrade package for the application.
  • the method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package to obtain the applied application.
  • the differential upgrade package because some files that can be further decomposed account for a considerable proportion of the installation package, the difference result obtained by differentially decompressing the file is directly compared with the differential result of the binary difference without decompression, and the differential upgrade package The smaller amount of data can further reduce the traffic consumption required for application upgrades.
  • the determining a file type of each file includes:
  • the file is included in both the original version and the new version.
  • the specific content of the file may change. For example, whether the file is increased or decreased in the file directory, etc., therefore, can be further based on whether it can be further Decompose to determine the file type for differentiated differential processing.
  • performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file including: a first file and a second file having the same file name, if the first file and the second file are of the first type, comparing file feature values in the directory of the first file and the second file, Generating a file record for recording a decrease or decrease of a file in the directory of the second file relative to the first file; generating a first difference file according to the file record; wherein the first file The file is the original file, and the second file is the target file.
  • the file's directory can contain many files, so the difference can be made at a smaller granularity, making the difference results more accurate and making the amount of data smaller.
  • performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file including: a third file and a fourth file having the same file name, if the first file and the second file are of the second type, performing binary difference on the third file and the fourth file to generate a second difference a file; wherein the third file is an original file, and the fourth file is an object file.
  • the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc
  • the file of the second type includes a folder file.
  • an application upgrade package obtaining apparatus including:
  • a decompression module configured to decompress the first installation package and the second installation package of the application, to obtain at least one original file and at least one target file, where the version of the first installation package is lower than the version of the second installation package;
  • a determining module configured to determine a file type of each file, the file type being used to indicate whether the file can be further decomposed;
  • a difference module configured to perform differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
  • a compression module configured to compress the at least one differential file to obtain a differential upgrade package of the application.
  • the determining module is configured to determine, for the at least one original file and the file with the same file name in the at least one target file, whether the file can be further decomposed, and if yes, determine the The file is of the first type, and if not, it is determined that the file is of the second type.
  • the difference module is used for the first file and the second file with the same file name, and if the first file and the second file are of the first type, comparing the first And a file feature value in the directory of the file and the second file, generating a file record for recording a second file relative to a file in the directory of the first file; File recording, generating a first difference file; wherein the first file is an original file, and the second file is an object file.
  • the difference module is used for the third file and the fourth file with the same file name, and if the first file and the second file are of the second type, the third The file and the fourth file are binary-differentiated to generate a second difference file; wherein the third file is an original file, and the fourth file is an object file.
  • the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc
  • the file of the second type includes a folder file.
  • an application upgrade package obtaining apparatus including:
  • a memory for storing instructions executable by the processor
  • processor is configured to:
  • Decompressing the first installation package and the second installation package of the application obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package;
  • FIG. 1 is a flowchart of an application upgrade package acquisition method according to an exemplary embodiment.
  • FIG. 2A is a flowchart of an application upgrade package acquisition method according to an exemplary embodiment.
  • 2B is a schematic diagram of at least one object file obtained after decompressing a second installation package of an application.
  • Figure 2C is a schematic diagram of a file in a differential file.
  • FIG. 3 is a block diagram of an application upgrade package obtaining apparatus according to an exemplary embodiment.
  • FIG. 4 is a block diagram of an application upgrade package obtaining apparatus 400, according to an exemplary embodiment.
  • FIG. 1 is a flowchart of an application upgrade package obtaining method according to an exemplary embodiment. As shown in FIG. 1 , an application upgrade package obtaining method is used in a server, and includes the following steps.
  • step 101 the first installation package and the second installation package of the application are decompressed to obtain at least one original file and at least one target file, and the version of the first installation package is lower than the version of the second installation package.
  • step 102 a file type of each file is determined, the file type being used to indicate whether the file can be further broken down.
  • step 103 performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to the file type of each file to obtain at least one difference file.
  • step 104 the at least one difference file is compressed to obtain a differential upgrade package of the application.
  • the method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package, so as to obtain a differential upgrade package of the application, which may be further decomposed.
  • the file accounts for a considerable proportion of the installation package. Therefore, the difference result obtained by the difference between the decompressed files is directly compared with the binary difference of the non-decompressed, and the difference upgrade packet has a smaller amount of data, which can be further reduced. The traffic consumption required to apply the upgrade.
  • the determining a file type of each file includes:
  • the at least one original file and the at least one target file are subjected to differential processing corresponding to the file type according to the file type of each file, and obtaining at least one difference file includes:
  • first file and the second file having the same file name
  • first file and the second file are of the first type
  • comparing the file feature values in the directory of the first file and the second file Generating a file record for recording a decrease or decrease of the file in the directory of the second file relative to the first file; generating a first difference file according to the file record; wherein One file is the original file, and the second file is the target file.
  • the at least one original file and the at least one target file are subjected to differential processing corresponding to the file type according to the file type of each file, and obtaining at least one difference file includes:
  • the third file and the fourth file having the same file name, if the first file and the second file are of the second type, performing binary difference on the third file and the fourth file to generate a second a differential file; wherein the third file is an original file, and the fourth file is an object file.
  • the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc
  • the second type of file includes a file. Folder file.
  • FIG. 2A is a flowchart of an application upgrade package obtaining method according to an exemplary embodiment. As shown in FIG. 2A, an application upgrade package obtaining method is used in a server, and includes the following steps.
  • step 201 the first installation package and the second installation package of the application are decompressed to obtain at least one original file and at least one target file, and the version of the first installation package is lower than the version of the second installation package.
  • the first installation package and the second installation package of the application are used to refer to the full installation package of the application, that is, all the installation files required by the corresponding version are included in the first installation package and the second installation package.
  • the second installation package may be an installation package of the latest version of the application.
  • the installation package of the application is actually a compressed package, so all the installation files in the installation package can be obtained by decompression, so the server can be decompressed.
  • the application provider may upload or publish the new version, that is, the second installation package of the application, to the server. Therefore, after obtaining the second installation package of the application, the server may obtain the first installation package of the application according to the application, thereby decompressing the first installation package and the second installation package respectively to obtain at least one original file and at least An object file. At least one original file and at least one target file may be separately stored in separate folders for distinction.
  • the application upgrade package obtaining process may be triggered automatically after receiving the second installation package of the application, or may be triggered by the server management personnel by using an operation instruction, and the server may maintain an application management.
  • the application management list is used to record the version information, the storage address, and the like of the existing application on the current server.
  • the application management list may be queried according to the application to obtain the application.
  • the storage address of the first installation package, and the first installation package of the application is obtained from the storage address to perform the decompression step of step 201, and the process triggered by the operation instruction may also be the same as the above process, of course,
  • the first installation package of the application may be copied from the other location of the server or other access device by the administrator. The embodiment of the disclosure does not specifically limit this.
  • the server may first perform security monitoring on the second installation package to avoid uploading of the malicious application, and the security monitoring may include using an antivirus engine for checking.
  • the process of detecting and detecting sensitive information is not limited in this embodiment of the present disclosure.
  • step 202 a file type of each file is determined, the file type being used to indicate whether the file can be further broken down.
  • the respective files involved in the step 202 refer to the at least one original file and the at least one target file.
  • some files are not available due to different forms of the files.
  • Further decomposing the file for example, the classes.dex file exists as a separate file, the file cannot be further decomposed, and some files, such as folders for placing resource files, can be further decomposed, for example, the res folder is a A folder whose directory has multiple resource files such as pictures, etc., and the file belongs to can be further decomposed.
  • At least one object file may include the following types of files: (1) a file having the same file name as some of the original files in at least one of the original files. Such a file may not be updated in the new version of the application, or it may be updated, but the update is not performed, such as deleting files or adding files, but in the directory file of the file. Updates such as deletions or additions have been made. (2) At least one document that is not in the original document. This kind of file is the file corresponding to the added functions in the new version of the application.
  • the original file and the target file mentioned above refer to the file of the same level obtained by the decompression of step 201.
  • file A, file B and folder C are obtained, and folder C is obtained.
  • files C1, C2, and C3 where file A, file B, and folder C belong to the same level of files, while files C1, C2, and C3 belong to the next level of files, and the hierarchical relationship can be deduced by analogy. Do not repeat them.
  • step 203 for the first file and the second file having the same file name, if the first file and the second file are of the first type, comparing the directories of the first file and the second file a file feature value, generating a file record, the file record is used to record the second file relative to the file in the directory of the first file increase and decrease; according to the file record, generating a first difference file;
  • the first file is an original file
  • the second file is an object file.
  • At least one file may be included in the first file directory, and at least one file may be included in the second file directory.
  • the updated application updates the file in the directory, and can compare the file feature values to obtain which file is deleted in the directory, which file is added, and a file record is generated according to the deletion and addition. Recording a second file is increased or decreased relative to a file in the directory of the first file.
  • the file further includes a file that can be further decomposed, the difference can be made in a manner similar to the above method based on the next layer of the file, which is not specifically limited in the embodiment of the present disclosure.
  • the first type of file may be a folder type file, for example, a res folder and an assets folder, wherein the res folder is a resource folder in an Android application, the resource.
  • Various icons, pictures, and the like can be included. Therefore, by comparing the feature values of all the files in the res directory (for example, md5), it is obtained which are new pictures and which pictures are deleted in the new version, thereby generating a first difference file, of course, the first difference
  • the file may also be in the form of a folder, which is not limited by the embodiment of the present disclosure.
  • the assets folder is similar to the res folder, and it can also generate a differential assets folder.
  • FIG. 2B is a schematic diagram of at least one object file obtained after decompressing a second installation package of an application.
  • the first column is the decompressed object file
  • the second column is the secondary file included in the "mishopWebView_new" folder in the target file
  • the third column is the third-level file included in the res folder of the secondary file.
  • the fourth column is the four-level file included in the "drawable-xxhdpi-v4" folder in the third-level file.
  • the outside of the res folder For the second type, the type of the file in the res folder is further determined. As shown in FIG. 2B, the res folder is the first type of file, and the "drawable-xxhdpi-v4" is further determined. "The type of the internal file, as shown in Figure 2B, the files in "drawable-xxhdpi-v4" are all of the second type, then the file eigenvalues can be compared one by one to determine the second file. The "drawable-xxhdpi-v4" folder is added with the pay_ in the "drawable-xxhdpi-v4" folder of the first file, and the added image can be recorded to the file record to generate the entire file together with other additions and subtractions.
  • the file record can generate a first difference file, in the generated first difference file can include the data in the "mishopWebView_patch" folder as shown in Figure 2COf course, the above examples are merely examples of one implementation, and the embodiments of the present disclosure are The generated file record and the specific file form of the difference file generated based on the file record may not be limited.
  • step 204 for the third file and the fourth file having the same file name, if the first file and the second file are of the second type, the third file and the fourth file are binary. Differentially, generating a second difference file; wherein the third file is an original file, and the fourth file is an object file.
  • the binary difference between the files can be directly used to obtain the difference between the files.
  • the results can be obtained by binary difference. There is no change between the two files, indicating that the new version does not modify the part, and if the difference result obtained by the binary difference is not 0, it means that the new version has some modifications to the part, then it can be based on The difference result generates a second difference file.
  • the second type of file may include a file suffixed with .dex, for example, a classes.dex file
  • the second type of file may also be a file with a suffix of .rasc, for example, a resources.arsc file.
  • classes.dex is a file format that can be run directly on the Dalvik virtual machine in the Android system. It cannot be decomposed again. Therefore, the classes.dex files in the original file and the target file are binary-differentiated and differentiated to obtain classes. Patch differential file.
  • the resources.arsc file is used to describe the resource configuration information with the ID value. The content is equivalent to a resource index table and cannot be decomposed again. Therefore, the same binary difference processing as the classes.dex file can be used to generate the resources.patch. Differential file.
  • Step 203 to step 204 are performed by performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to the file type of each file, to obtain at least one difference file.
  • the file name may be compared by the server name, and the server may have the file names in at least one target file, but not exist in at least one original file.
  • the file in the file is obtained as the third differential file.
  • step 205 the at least one difference file is compressed to obtain a differential upgrade package of the application.
  • the at least one difference file obtained by the above steps is combined and compressed to obtain an applied differential upgrade package.
  • the server can get a smaller differential upgrade package.
  • at least one differential upgrade package can be generated for each version and the latest version, and each differential upgrade package corresponds to one original version and one target version.
  • the specific content of each differential upgrade package will vary depending on the data between versions.
  • the terminal when the terminal needs to be upgraded, the terminal may carry the application version information of the terminal in the upgrade request, and the server obtains the corresponding differential upgrade package according to the received application version information and the latest version. And sending the obtained differential upgrade package to the terminal, so that the terminal can merge the installation file of the existing application and the differential upgrade package on the basis of the existing application version, so as to implement the version upgrade of the application.
  • the merging may refer to adding or reducing some data in the installation file of the application already in the terminal, which is not specifically limited in this embodiment of the present disclosure.
  • the method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package, so as to obtain a differential upgrade package of the application, which may be further decomposed.
  • the file accounts for a considerable proportion of the installation package. Therefore, the difference result obtained by the difference between the decompressed files is directly compared with the binary difference of the non-decompressed, and the difference upgrade packet has a smaller amount of data, which can be further reduced.
  • the traffic consumption required to apply the upgrade Further, by performing the above-described decompression and differential processing based on whether or not the file can be further decomposed, the difference result obtained by the differential processing is more stable, and data errors are less likely to occur. Further, the acquisition method of the differential upgrade package is also more suitable for some applications with a small amount of data.
  • FIG. 3 is a block diagram of an application upgrade package obtaining apparatus according to an exemplary embodiment.
  • the apparatus includes a decompression module 301, a determination module 302, a difference module 303, and a compression module 304.
  • the decompression module 301 is configured to decompress the first installation package and the second installation package of the application, to obtain at least one original file and at least one target file, where the version of the first installation package is lower than the version of the second installation package;
  • a determining module 302 configured to determine a file type of each file obtained by decompressing the decompression module 301, where the file type is used to indicate whether the file can be further decomposed;
  • a difference module 303 configured to perform differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file determined by the determining module 302, to obtain at least one difference file;
  • the compression module 304 is configured to compress the at least one difference file obtained by the difference module 303 to obtain a differential upgrade package of the application.
  • the determining module 302 is configured to use the at least one original file And a file having the same file name as the at least one object file, determining whether the file can be further decomposed, and if so, determining that the file is of a first type, and if not, determining that the file is of a second type.
  • the difference module 303 is configured to use the first file and the second file with the same file name, and if the first file and the second file are the first type, compare the first Generating, by a file and a file feature value in a directory of the second file, a file record for recording a second file relative to a file in the directory of the first file; The file record generates a first difference file; wherein the first file is an original file, and the second file is an object file.
  • the difference module 303 is configured to use a third file and a fourth file with the same file name, and if the first file and the second file are the second type, The third file and the fourth file are binary-differentiated to generate a second difference file; wherein the third file is an original file, and the fourth file is an object file.
  • the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc
  • the file of the second type includes a folder file.
  • FIG. 4 is a block diagram of an application upgrade package obtaining apparatus 400, according to an exemplary embodiment.
  • device 400 can be provided as a server.
  • apparatus 400 includes a processing component 422 that further includes one or more processors, and memory resources represented by memory 432 for storing instructions executable by processing component 422, such as an application.
  • An application stored in memory 432 may include one or more modules each corresponding to a set of instructions.
  • the processing component 422 is configured to execute instructions to perform the application upgrade package acquisition method described above.
  • Device 400 may also include a power supply component 426 configured to perform power management of device 400, a wired or wireless network interface 450 configured to connect device 400 to the network, and an input/output (I/O) interface 458.
  • Device 400 can operate based on an operating system stored in memory 432, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-transitory computer readable storage medium wherein when instructions in the storage medium are executed by a processor of a mobile terminal, enabling the mobile terminal to perform a response
  • Obtaining a method by using an upgrade package the method comprising: decompressing a first installation package and a second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the second installation a version of the package; determining a file type of each file, the file type being used to indicate whether the file can be further decomposed; and performing, according to the file type of the respective file, the at least one original file and the at least one target file Performing differential processing corresponding to the file type to obtain at least one difference file; compressing the at least one difference file to obtain a differential upgrade package of the application.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Disclosed are a method and apparatus for acquiring an application upgrade package, falling within the technical field of networks. The method comprises: decompressing a first installation package and a second installation package of an application to obtain at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package; determining a file type of each of the files; according to the file type of each of the files, performing differential processing, corresponding to the file type, on the at least one original file and the at least one target file to obtain at least one differential file; and compressing the at least one differential file to obtain a differential upgrade package of the application. According to the present disclosure, the differential upgrade package has a smaller amount of data, and the consumption traffic required when upgrading an application can further be reduced.

Description

应用升级包获取方法及装置Application upgrade package acquisition method and device 技术领域Technical field
本公开涉及网络技术领域,尤其涉及一种应用升级包获取方法及装置。The present disclosure relates to the field of network technologies, and in particular, to an application upgrade package acquiring method and apparatus.
背景技术Background technique
随着网络技术的发展,多种多样的应用如雨后春笋般涌现。为了满足用户越来越多样化或针对性的需求,应用提供商也会积极对应用的版本不断进行更迭,以便进一步完善应用的功能。With the development of network technology, a variety of applications have sprung up. In order to meet the increasingly diverse or targeted needs of users, application providers will also actively change the version of the application to further improve the functionality of the application.
对于终端来说,一个终端上会安装多个应用,于是在将这多个应用升级至最新版本时,会导致较大的流量消耗。为了减小流量消耗,目前的应用升级方法一般采用增量升级方式,在该增量升级过程中一般采用下述方法获取应用升级包:对新旧应用安装包之间直接进行二进制差分,以得到差分升级包,后续终端可以基于该差分升级包进行升级,由于差分升级包的数据量小于整个应用的安装包的数据量,因此,可以实现减小流量消耗的目的。For a terminal, multiple applications are installed on one terminal, and when these applications are upgraded to the latest version, large traffic consumption is caused. In order to reduce the traffic consumption, the current application upgrade method generally adopts an incremental upgrade mode. In the incremental upgrade process, the following application method is generally used to obtain an application upgrade package: binary difference is directly performed between the new and old application installation packages to obtain a difference. The upgrade package can be upgraded based on the differential upgrade package. Since the data volume of the differential upgrade package is smaller than the data volume of the installation package of the entire application, the purpose of reducing the traffic consumption can be achieved.
发明内容Summary of the invention
为克服相关技术中存在的问题,本公开提供一种应用升级包获取方法及装置。To overcome the problems in the related art, the present disclosure provides an application upgrade package acquisition method and apparatus.
根据本公开实施例的第一方面,提供一种应用升级包获取方法,包括:According to a first aspect of the embodiments of the present disclosure, an application upgrade package obtaining method is provided, including:
解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。Decompressing the first installation package and the second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package; determining a file type of each file, The file type is used to indicate whether the file can be further decomposed; according to the file type of each file, performing differential processing corresponding to the file type on the at least one original file and the at least one target file to obtain at least a differential file; compressing the at least one differential file to obtain a differential upgrade package for the application.
本公开实施例提供的方法,通过对安装包进行解压,从而可以对解压后的文件根据文件是否能够被进一步分解来进行区别化的差分处理,以得到应用的 差分升级包,由于一些可进一步分解的文件占安装包的相当大比重,因此,对解压后的文件进行差分所得到的差分结果相对于不解压而直接进行二进制差分的差分结果,其差分升级包数据量更小,可以进一步减小应用升级所需的流量消耗。The method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package to obtain the applied application. The differential upgrade package, because some files that can be further decomposed account for a considerable proportion of the installation package, the difference result obtained by differentially decompressing the file is directly compared with the differential result of the binary difference without decompression, and the differential upgrade package The smaller amount of data can further reduce the traffic consumption required for application upgrades.
在一种可能实现方式中,所述确定各个文件的文件类型包括:In a possible implementation manner, the determining a file type of each file includes:
对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。Determining, for the at least one original file and the file having the same file name in the at least one target file, whether the file can be further decomposed, and if yes, determining that the file is of a first type, and if not, determining the file For the second type.
对于文件名称相同的文件,说明原版本和新版本中均包含了该文件,可能发生变化的是文件的具体内容,例如,文件目录下是否增减了文件等,因此,可以根据是否能够被进一步分解,来确定文件类型,以进行区别化的差分处理。For files with the same file name, the file is included in both the original version and the new version. The specific content of the file may change. For example, whether the file is increased or decreased in the file directory, etc., therefore, can be further based on whether it can be further Decompose to determine the file type for differentiated differential processing.
在一种可能实现方式中,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括:对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。In a possible implementation, performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file, including: a first file and a second file having the same file name, if the first file and the second file are of the first type, comparing file feature values in the directory of the first file and the second file, Generating a file record for recording a decrease or decrease of a file in the directory of the second file relative to the first file; generating a first difference file according to the file record; wherein the first file The file is the original file, and the second file is the target file.
对于能够进一步分解的文件,该文件的目录内可以包含很多文件,因此,可以在更小的粒度下进行差分,使得差分结果更加准确,也使得数据量更小。For files that can be further decomposed, the file's directory can contain many files, so the difference can be made at a smaller granularity, making the difference results more accurate and making the amount of data smaller.
在一种可能实现方式中,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括:对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。In a possible implementation, performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file, including: a third file and a fourth file having the same file name, if the first file and the second file are of the second type, performing binary difference on the third file and the fourth file to generate a second difference a file; wherein the third file is an original file, and the fourth file is an object file.
在一种可能实现方式中,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文件夹文件。In a possible implementation manner, the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc, and the file of the second type includes a folder file.
根据本公开实施例的第二方面,提供一种应用升级包获取装置,包括:According to a second aspect of the embodiments of the present disclosure, an application upgrade package obtaining apparatus is provided, including:
解压模块,用于解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本; a decompression module, configured to decompress the first installation package and the second installation package of the application, to obtain at least one original file and at least one target file, where the version of the first installation package is lower than the version of the second installation package;
确定模块,用于确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;a determining module, configured to determine a file type of each file, the file type being used to indicate whether the file can be further decomposed;
差分模块,用于根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;a difference module, configured to perform differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
压缩模块,用于将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。And a compression module, configured to compress the at least one differential file to obtain a differential upgrade package of the application.
在一种可能实现方式中,所述确定模块用于对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。In a possible implementation, the determining module is configured to determine, for the at least one original file and the file with the same file name in the at least one target file, whether the file can be further decomposed, and if yes, determine the The file is of the first type, and if not, it is determined that the file is of the second type.
在一种可能实现方式中,所述差分模块用于对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。In a possible implementation, the difference module is used for the first file and the second file with the same file name, and if the first file and the second file are of the first type, comparing the first And a file feature value in the directory of the file and the second file, generating a file record for recording a second file relative to a file in the directory of the first file; File recording, generating a first difference file; wherein the first file is an original file, and the second file is an object file.
在一种可能实现方式中,所述差分模块用于对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。In a possible implementation, the difference module is used for the third file and the fourth file with the same file name, and if the first file and the second file are of the second type, the third The file and the fourth file are binary-differentiated to generate a second difference file; wherein the third file is an original file, and the fourth file is an object file.
在一种可能实现方式中,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文件夹文件。In a possible implementation manner, the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc, and the file of the second type includes a folder file.
根据本公开实施例的第三方面,提供一种应用升级包获取装置,包括:According to a third aspect of the embodiments of the present disclosure, an application upgrade package obtaining apparatus is provided, including:
处理器;processor;
用于存储处理器可执行的指令的存储器;a memory for storing instructions executable by the processor;
其中,所述处理器被配置为:Wherein the processor is configured to:
解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;Decompressing the first installation package and the second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package;
确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解; Determining a file type of each file, the file type being used to indicate whether the file can be further decomposed;
根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;Performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。Compressing the at least one differential file to obtain a differential upgrade package of the application.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。The above general description and the following detailed description are intended to be illustrative and not restrictive.
附图说明DRAWINGS
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。The accompanying drawings, which are incorporated in the specification
图1是根据一示例性实施例示出的应用升级包获取方法的流程图。FIG. 1 is a flowchart of an application upgrade package acquisition method according to an exemplary embodiment.
图2A是根据一示例性实施例示出的应用升级包获取方法的流程图。FIG. 2A is a flowchart of an application upgrade package acquisition method according to an exemplary embodiment.
图2B是一个应用的第二安装包解压后所得到的至少一个目标文件的示意图。2B is a schematic diagram of at least one object file obtained after decompressing a second installation package of an application.
图2C是一个差分文件中文件的示意图。Figure 2C is a schematic diagram of a file in a differential file.
图3是根据一示例性实施例示出的一种应用升级包获取装置框图。FIG. 3 is a block diagram of an application upgrade package obtaining apparatus according to an exemplary embodiment.
图4是根据一示例性实施例示出的一种应用升级包获取装置400的框图。FIG. 4 is a block diagram of an application upgrade package obtaining apparatus 400, according to an exemplary embodiment.
具体实施方式detailed description
为使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开实施方式作进一步地详细描述。The embodiments of the present disclosure will be further described in detail below with reference to the accompanying drawings.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The following description refers to the same or similar elements in the different figures unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with aspects of the present disclosure as detailed in the appended claims.
图1是根据一示例性实施例示出的应用升级包获取方法的流程图,如图1所示,应用升级包获取方法用于服务器中,包括以下步骤。FIG. 1 is a flowchart of an application upgrade package obtaining method according to an exemplary embodiment. As shown in FIG. 1 , an application upgrade package obtaining method is used in a server, and includes the following steps.
在步骤101中,解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本。In step 101, the first installation package and the second installation package of the application are decompressed to obtain at least one original file and at least one target file, and the version of the first installation package is lower than the version of the second installation package.
在步骤102中,确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解。 In step 102, a file type of each file is determined, the file type being used to indicate whether the file can be further broken down.
在步骤103中,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件。In step 103, performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to the file type of each file to obtain at least one difference file.
在步骤104中,将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。In step 104, the at least one difference file is compressed to obtain a differential upgrade package of the application.
本公开实施例提供的方法,通过对安装包进行解压,从而可以对解压后的文件根据文件是否能够被进一步分解来进行区别化的差分处理,以得到应用的差分升级包,由于一些可进一步分解的文件占安装包的相当大比重,因此,对解压后的文件进行差分所得到的差分结果相对于不解压而直接进行二进制差分的差分结果,其差分升级包数据量更小,可以进一步减小应用升级所需的流量消耗。The method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package, so as to obtain a differential upgrade package of the application, which may be further decomposed. The file accounts for a considerable proportion of the installation package. Therefore, the difference result obtained by the difference between the decompressed files is directly compared with the binary difference of the non-decompressed, and the difference upgrade packet has a smaller amount of data, which can be further reduced. The traffic consumption required to apply the upgrade.
在一种可能实现方式中,所述确定各个文件的文件类型包括:In a possible implementation manner, the determining a file type of each file includes:
对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。Determining, for the at least one original file and the file having the same file name in the at least one target file, whether the file can be further decomposed, and if yes, determining that the file is of a first type, and if not, determining the file For the second type.
在一种可能实现方式中,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括:In a possible implementation, the at least one original file and the at least one target file are subjected to differential processing corresponding to the file type according to the file type of each file, and obtaining at least one difference file includes:
对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。For the first file and the second file having the same file name, if the first file and the second file are of the first type, comparing the file feature values in the directory of the first file and the second file Generating a file record for recording a decrease or decrease of the file in the directory of the second file relative to the first file; generating a first difference file according to the file record; wherein One file is the original file, and the second file is the target file.
在一种可能实现方式中,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括:In a possible implementation, the at least one original file and the at least one target file are subjected to differential processing corresponding to the file type according to the file type of each file, and obtaining at least one difference file includes:
对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。For the third file and the fourth file having the same file name, if the first file and the second file are of the second type, performing binary difference on the third file and the fourth file to generate a second a differential file; wherein the third file is an original file, and the fourth file is an object file.
结合上述任一种可能实现方式,在一种可能实现方式中,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文 件夹文件。In combination with any of the foregoing possible implementation manners, in a possible implementation manner, the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc, and the second type of file includes a file. Folder file.
上述所有可选技术方案,可以采用任意结合形成本公开的可选实施例,在此不再一一赘述。All of the above optional technical solutions may be combined to form an optional embodiment of the present disclosure, and will not be further described herein.
图2A是根据一示例性实施例示出的应用升级包获取方法的流程图,如图2A所示,应用升级包获取方法用于服务器中,包括以下步骤。FIG. 2A is a flowchart of an application upgrade package obtaining method according to an exemplary embodiment. As shown in FIG. 2A, an application upgrade package obtaining method is used in a server, and includes the following steps.
在步骤201中,解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本。In step 201, the first installation package and the second installation package of the application are decompressed to obtain at least one original file and at least one target file, and the version of the first installation package is lower than the version of the second installation package.
其中,应用的第一安装包和第二安装包均用于指代应用的全量安装包,也即是,第一安装包内和第二安装包内均包括有对应版本所需的所有安装文件。其中,第二安装包可以为该应用当前最新版本的安装包。The first installation package and the second installation package of the application are used to refer to the full installation package of the application, that is, all the installation files required by the corresponding version are included in the first installation package and the second installation package. . The second installation package may be an installation package of the latest version of the application.
发明人认识到,对于任一种应用来说,其应用的安装包事实上均为一种压缩包,因此,可以通过解压来得到该安装包内的所有安装文件,因此,服务器可以通过解压后的安装文件,来进行升级包的获取过程。The inventor has realized that for any application, the installation package of the application is actually a compressed package, so all the installation files in the installation package can be obtained by decompression, so the server can be decompressed. The installation file to get the upgrade package acquisition process.
在本公开实施例中,应用提供商在应用新版本开发后,可以将该新版本也即是应用的第二安装包上传或发布至服务器。因此,服务器在获取到应用的第二安装包后,可以根据该应用获取该应用的第一安装包,从而对第一安装包和第二安装包分别进行解压,以得到至少一个原文件和至少一个目标文件。其中,至少一个原文件和至少一个目标文件可以分别存储于独立的文件夹中,以便区别。In the embodiment of the present disclosure, after the application version is developed, the application provider may upload or publish the new version, that is, the second installation package of the application, to the server. Therefore, after obtaining the second installation package of the application, the server may obtain the first installation package of the application according to the application, thereby decompressing the first installation package and the second installation package respectively to obtain at least one original file and at least An object file. At least one original file and at least one target file may be separately stored in separate folders for distinction.
对于服务器来说,本公开实施例所提供的应用升级包获取过程可以是由接收到应用的第二安装包后自动触发,也可以是由服务器管理人员通过操作指令触发,服务器可以维护一个应用管理列表,该应用管理列表用于记录当前服务器上已有的应用的版本信息、存储地址等,当接收到任一个应用的第二安装包,则可以根据应用查询该应用管理列表,以获取应用的第一安装包的存储地址,进而从该存储地址获取到该应用的第一安装包,以执行步骤201的解压步骤,而对于通过操作指令触发的过程也可以与上述过程同理,当然,也可以由管理人员直接从服务器的其他位置或是其他接入设备上将该应用的第一安装包复制过来,本公开实施例对此不做具体限定。For the server, the application upgrade package obtaining process provided by the embodiment of the present disclosure may be triggered automatically after receiving the second installation package of the application, or may be triggered by the server management personnel by using an operation instruction, and the server may maintain an application management. The application management list is used to record the version information, the storage address, and the like of the existing application on the current server. When receiving the second installation package of any application, the application management list may be queried according to the application to obtain the application. The storage address of the first installation package, and the first installation package of the application is obtained from the storage address to perform the decompression step of step 201, and the process triggered by the operation instruction may also be the same as the above process, of course, The first installation package of the application may be copied from the other location of the server or other access device by the administrator. The embodiment of the disclosure does not specifically limit this.
当然,服务器在接收到应用的第二安装包后,可以首先对第二安装包进行安全监测,以避免恶意应用的上传,该安全监测可以包括采用杀毒引擎进行检 测以及对敏感信息进行检测等过程,本公开实施例对此不做限定。Of course, after receiving the second installation package of the application, the server may first perform security monitoring on the second installation package to avoid uploading of the malicious application, and the security monitoring may include using an antivirus engine for checking. The process of detecting and detecting sensitive information is not limited in this embodiment of the present disclosure.
在步骤202中,确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解。In step 202, a file type of each file is determined, the file type being used to indicate whether the file can be further broken down.
在该步骤202中所涉及的各个文件是指上述至少一个原文件和至少一个目标文件,对于应用的至少一个原文件和至少一个目标文件来说,由于文件的存在形式不同,有的文件是不可进一步分解文件,例如,classes.dex文件,是作为一个独立文件存在,则该文件不可被进一步分解,有的文件如用于放置资源文件的文件夹等可以被进一步分解,例如res文件夹是一个文件夹,该文件夹的目录内具有多个资源文件如图片等,则该文件属于可被进一步分解。The respective files involved in the step 202 refer to the at least one original file and the at least one target file. For at least one original file and at least one target file of the application, some files are not available due to different forms of the files. Further decomposing the file, for example, the classes.dex file exists as a separate file, the file cannot be further decomposed, and some files, such as folders for placing resource files, can be further decomposed, for example, the res folder is a A folder whose directory has multiple resource files such as pictures, etc., and the file belongs to can be further decomposed.
综上,则可以对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型,从而确定各个文件的文件类型。In summary, it may be determined whether the file can be further decomposed for the file with the same file name in the at least one original file and the at least one target file, and if yes, determine that the file is of the first type, and if not, Then determining that the file is of a second type, thereby determining the file type of each file.
发明人认识到,对于至少一个原文件和至少一个目标文件来说,由于目标文件是更新了的应用所包括的安装文件,因此,该至少一个目标文件和至少一个原文件如果对比来看,具有一定的关系,例如,至少一个目标文件中可以包括以下几类文件:(1)与至少一个原文件中某些原文件的文件名称相同的文件。这种文件,可能是新版本应用中并未对该文件进行更新,也可能是虽然对该文件进行了更新,但是并未进行如删除文件或增加文件等更新,而是在该文件的目录文件内进行了删除或增加等更新。(2)至少一个原文件中没有的文件。这种文件则是新版本应用中所增加的功能等所对应的文件。当然,上述所涉及的原文件和目标文件,均是指通过步骤201的解压得到的同一层级的文件,例如,在一次解压后,得到了文件A、文件B和文件夹C,文件夹C中还包括文件C1、C2和C3,则文件A、文件B和文件夹C属于同一层级的文件,而文件C1、C2和C3则属于下一层级的文件,该层级关系可以以此类推,在此不做赘述。The inventor recognizes that, for at least one original file and at least one object file, since the target file is an installation file included in the updated application, the at least one object file and the at least one original file have, if compared, A certain relationship, for example, at least one object file may include the following types of files: (1) a file having the same file name as some of the original files in at least one of the original files. Such a file may not be updated in the new version of the application, or it may be updated, but the update is not performed, such as deleting files or adding files, but in the directory file of the file. Updates such as deletions or additions have been made. (2) At least one document that is not in the original document. This kind of file is the file corresponding to the added functions in the new version of the application. Of course, the original file and the target file mentioned above refer to the file of the same level obtained by the decompression of step 201. For example, after one decompression, file A, file B and folder C are obtained, and folder C is obtained. Also includes files C1, C2, and C3, where file A, file B, and folder C belong to the same level of files, while files C1, C2, and C3 belong to the next level of files, and the hierarchical relationship can be deduced by analogy. Do not repeat them.
在步骤203中,对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。 In step 203, for the first file and the second file having the same file name, if the first file and the second file are of the first type, comparing the directories of the first file and the second file a file feature value, generating a file record, the file record is used to record the second file relative to the file in the directory of the first file increase and decrease; according to the file record, generating a first difference file; The first file is an original file, and the second file is an object file.
对于第一文件和第二文件来说,由于均为可进一步分解的文件,因此,第一文件目录内可以包括至少一个文件,而第二文件目录内也可以包括至少一个文件,此时,为了获知更新的应用对目录内哪个文件进行了更新,可以通过对比文件特征值来进行对比,从而获取目录内删除了哪个文件、增加了哪个文件,根据该删除以及增加,生成一个文件记录,用于记录第二文件相对于所述第一文件的目录内的文件增减。当然,如果该文件中还包括可进一步分解的文件,则可以再基于下一层文件采取与上述类似的方式来进行差分,本公开实施例对此不做具体限定。For the first file and the second file, since the files are further decomposed, at least one file may be included in the first file directory, and at least one file may be included in the second file directory. It is known that the updated application updates the file in the directory, and can compare the file feature values to obtain which file is deleted in the directory, which file is added, and a file record is generated according to the deletion and addition. Recording a second file is increased or decreased relative to a file in the directory of the first file. Of course, if the file further includes a file that can be further decomposed, the difference can be made in a manner similar to the above method based on the next layer of the file, which is not specifically limited in the embodiment of the present disclosure.
需要说明的是,该第一类型的文件可以为文件夹类型的文件,例如,res文件夹和assets文件夹,其中,res文件夹是存放安卓(Android)应用程序中的资源文件夹,该资源可以包括各种图标、图片等。因此,可以通过对比res目录下的所有文件的特征值(例如,md5),得到哪些是新的图片,哪些图片在新版本中被删除了,从而生成第一差分文件,当然,该第一差分文件也可以是文件夹形式,本公开实施例对此不做限定。assets文件夹类似于res文件夹,也可以生成差分assets文件夹。It should be noted that the first type of file may be a folder type file, for example, a res folder and an assets folder, wherein the res folder is a resource folder in an Android application, the resource. Various icons, pictures, and the like can be included. Therefore, by comparing the feature values of all the files in the res directory (for example, md5), it is obtained which are new pictures and which pictures are deleted in the new version, thereby generating a first difference file, of course, the first difference The file may also be in the form of a folder, which is not limited by the embodiment of the present disclosure. The assets folder is similar to the res folder, and it can also generate a differential assets folder.
例如,参见图2B和图2C,图2B是一个应用的第二安装包解压后所得到的至少一个目标文件的示意图。其中,第一栏为解压后的目标文件,第二栏为目标文件中“mishopWebView_new”文件夹中包括的二级文件,而第三栏为二级文件中res文件夹所包括的三级文件,第四栏则为三级文件中“drawable-xxhdpi-v4”文件夹所包括的四级文件。在进行差分时,当确定“mishopWebView_new”文件夹是一个第一类型的文件时,则可以进一步确定该文件夹内的文件的类型,从图2B上所示可以看出,res文件夹以外的均为第二类型,则进一步确定该res文件夹内的文件的类型,从图2B上所示可以看出,res文件夹内均为第一类型的文件,则进一步确定该“drawable-xxhdpi-v4”内文件的类型,从图2B上所示可以看出,“drawable-xxhdpi-v4”内的文件均为第二类型,则可以对其进行文件特征值的一一对比,确定该第二文件的“drawable-xxhdpi-v4”文件夹相对于第一文件的“drawable-xxhdpi-v4”文件夹内,增加了pay_,可以将该增加图片记录至文件记录,以便与其他增减一同生成整个文件_A夹.pn的g文件记录,再根据该文件记录可以生成第一差分文件,在所生成的第一差分文件中可以包括如图2C所示的“mishopWebView_patch”文件夹内的数据。当然,上述举例仅是一种实现方式的示例,本公开实施例对 生成的文件记录以及根据文件记录生成的差分文件的具体文件形式可以不做限定。For example, referring to FIG. 2B and FIG. 2C, FIG. 2B is a schematic diagram of at least one object file obtained after decompressing a second installation package of an application. The first column is the decompressed object file, the second column is the secondary file included in the "mishopWebView_new" folder in the target file, and the third column is the third-level file included in the res folder of the secondary file. The fourth column is the four-level file included in the "drawable-xxhdpi-v4" folder in the third-level file. When the difference is made, when it is determined that the "mishopWebView_new" folder is a file of the first type, the type of the file in the folder can be further determined. As can be seen from FIG. 2B, the outside of the res folder For the second type, the type of the file in the res folder is further determined. As shown in FIG. 2B, the res folder is the first type of file, and the "drawable-xxhdpi-v4" is further determined. "The type of the internal file, as shown in Figure 2B, the files in "drawable-xxhdpi-v4" are all of the second type, then the file eigenvalues can be compared one by one to determine the second file. The "drawable-xxhdpi-v4" folder is added with the pay_ in the "drawable-xxhdpi-v4" folder of the first file, and the added image can be recorded to the file record to generate the entire file together with other additions and subtractions. _A folder.pn g file record, according to the file record can generate a first difference file, in the generated first difference file can include the data in the "mishopWebView_patch" folder as shown in Figure 2COf course, the above examples are merely examples of one implementation, and the embodiments of the present disclosure are The generated file record and the specific file form of the difference file generated based on the file record may not be limited.
在步骤204中,对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。In step 204, for the third file and the fourth file having the same file name, if the first file and the second file are of the second type, the third file and the fourth file are binary. Differentially, generating a second difference file; wherein the third file is an original file, and the fourth file is an object file.
对于第三文件和第四文件来说,由于均为无法进一步分解的文件,因此,可以直接采用对文件进行二进制差分的方式,得到文件之间的差别,当然,通过二进制差分,可能得到的结果是该两个文件之间没有改变,说明新版本并未对该部分进行修改,而如果通过二进制差分所得到的差分结果不为0,则说明新版本对该部分进行了一定修改,则可以基于差分结果生成第二差分文件。For the third file and the fourth file, since they are files that cannot be further decomposed, the binary difference between the files can be directly used to obtain the difference between the files. Of course, the results can be obtained by binary difference. There is no change between the two files, indicating that the new version does not modify the part, and if the difference result obtained by the binary difference is not 0, it means that the new version has some modifications to the part, then it can be based on The difference result generates a second difference file.
需要说明的是,该第二类型的文件可以包括后缀有.dex的文件,例如,classes.dex文件,该第二类型的文件还可以是后缀为.rasc的文件,例如,resources.arsc文件。其中,classes.dex是安卓(Android)***中可以在Dalvik虚拟机上直接运行的文件格式,无法再次分解,因此,把原文件和目标文件中的classes.dex文件作二进制对比差分,得到classes.patch的差分文件。而resources.arsc文件是用来描述具有ID值的资源配置信息,其内容相当于是一个资源索引表,也无法再次分解,因此可以采用与classes.dex文件一样的二进制差分处理,生成resources.patch的差分文件。It should be noted that the second type of file may include a file suffixed with .dex, for example, a classes.dex file, and the second type of file may also be a file with a suffix of .rasc, for example, a resources.arsc file. Among them, classes.dex is a file format that can be run directly on the Dalvik virtual machine in the Android system. It cannot be decomposed again. Therefore, the classes.dex files in the original file and the target file are binary-differentiated and differentiated to obtain classes. Patch differential file. The resources.arsc file is used to describe the resource configuration information with the ID value. The content is equivalent to a resource index table and cannot be decomposed again. Therefore, the same binary difference processing as the classes.dex file can be used to generate the resources.patch. Differential file.
上述步骤203至步骤204为根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件。当然,对于上述(2)中所涉及的至少一个原文件中没有的文件,则可以通过文件名称的对比确定,服务器可以将这些文件名称存在于至少一个目标文件中,但不存在于至少一个原文件中的文件,获取为第三差分文件。Step 203 to step 204 are performed by performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to the file type of each file, to obtain at least one difference file. Of course, for the files that are not included in the at least one original file involved in (2) above, the file name may be compared by the server name, and the server may have the file names in at least one target file, but not exist in at least one original file. The file in the file is obtained as the third differential file.
在步骤205中,将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。In step 205, the at least one difference file is compressed to obtain a differential upgrade package of the application.
通过将上述步骤所得到的至少一个差分文件合并后进行压缩,以得到应用的差分升级包。此时,服务器可以得到一个较小的差分升级包。当然,如果服务器上存储有一个应用的多个版本,还可以针对每个版本以及这个最新版本,生成至少一个差分升级包,每个差分升级包对应于一个原版本和一个目标版 本,每个差分升级包的具体内容会根据版本之间的数据变化而不同。The at least one difference file obtained by the above steps is combined and compressed to obtain an applied differential upgrade package. At this point, the server can get a smaller differential upgrade package. Of course, if there are multiple versions of an application stored on the server, at least one differential upgrade package can be generated for each version and the latest version, and each differential upgrade package corresponds to one original version and one target version. The specific content of each differential upgrade package will vary depending on the data between versions.
针对上述至少一个差分升级包,终端在需要进行版本升级时,可以在升级请求中携带终端已有的应用版本信息,由服务器根据接收到的应用版本信息以及最新版本,获取对应的差分升级包,并将改获取到的差分升级包发送至终端,使得终端能够在已有的应用版本的基础上,将已有应用的安装文件和该差分升级包合并,以实现应用的版本升级。当然,根据差分升级包内具体内容的不同,该合并可以是指在终端已有应用的安装文件中增加、减少某些数据,本公开实施例对此不做具体限定。For the at least one differential upgrade package, when the terminal needs to be upgraded, the terminal may carry the application version information of the terminal in the upgrade request, and the server obtains the corresponding differential upgrade package according to the received application version information and the latest version. And sending the obtained differential upgrade package to the terminal, so that the terminal can merge the installation file of the existing application and the differential upgrade package on the basis of the existing application version, so as to implement the version upgrade of the application. Of course, according to the specific content in the differential upgrade package, the merging may refer to adding or reducing some data in the installation file of the application already in the terminal, which is not specifically limited in this embodiment of the present disclosure.
本公开实施例提供的方法,通过对安装包进行解压,从而可以对解压后的文件根据文件是否能够被进一步分解来进行区别化的差分处理,以得到应用的差分升级包,由于一些可进一步分解的文件占安装包的相当大比重,因此,对解压后的文件进行差分所得到的差分结果相对于不解压而直接进行二进制差分的差分结果,其差分升级包数据量更小,可以进一步减小应用升级所需的流量消耗。并且,通过上述解压后根据文件是否能够被进一步分解来进行区别化的差分处理,使得差分处理所得到的差分结果更加稳定,不容易出现数据错误。进一步地,这种差分升级包的获取方式,也更加适用于一些本身数据量较小的应用。The method provided by the embodiment of the present disclosure can perform differential processing on the decompressed file according to whether the file can be further decomposed according to the decompression of the installation package, so as to obtain a differential upgrade package of the application, which may be further decomposed. The file accounts for a considerable proportion of the installation package. Therefore, the difference result obtained by the difference between the decompressed files is directly compared with the binary difference of the non-decompressed, and the difference upgrade packet has a smaller amount of data, which can be further reduced. The traffic consumption required to apply the upgrade. Further, by performing the above-described decompression and differential processing based on whether or not the file can be further decomposed, the difference result obtained by the differential processing is more stable, and data errors are less likely to occur. Further, the acquisition method of the differential upgrade package is also more suitable for some applications with a small amount of data.
图3是根据一示例性实施例示出的一种应用升级包获取装置框图。参照图3,该装置包括解压模块301,确定模块302,差分模块303和压缩模块304。FIG. 3 is a block diagram of an application upgrade package obtaining apparatus according to an exemplary embodiment. Referring to FIG. 3, the apparatus includes a decompression module 301, a determination module 302, a difference module 303, and a compression module 304.
解压模块301,用于解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;The decompression module 301 is configured to decompress the first installation package and the second installation package of the application, to obtain at least one original file and at least one target file, where the version of the first installation package is lower than the version of the second installation package;
确定模块302,用于确定所述解压模块301解压得到的各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;a determining module 302, configured to determine a file type of each file obtained by decompressing the decompression module 301, where the file type is used to indicate whether the file can be further decomposed;
差分模块303,用于根据所述确定模块302所确定的各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;a difference module 303, configured to perform differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file determined by the determining module 302, to obtain at least one difference file;
压缩模块304,用于将所述差分模块303所得到的所述至少一个差分文件进行压缩,得到所述应用的差分升级包。The compression module 304 is configured to compress the at least one difference file obtained by the difference module 303 to obtain a differential upgrade package of the application.
在一种可能实现方式中,所述确定模块302用于对于所述至少一个原文件 和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。In a possible implementation, the determining module 302 is configured to use the at least one original file And a file having the same file name as the at least one object file, determining whether the file can be further decomposed, and if so, determining that the file is of a first type, and if not, determining that the file is of a second type.
在一种可能实现方式中,所述差分模块303用于对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。In a possible implementation manner, the difference module 303 is configured to use the first file and the second file with the same file name, and if the first file and the second file are the first type, compare the first Generating, by a file and a file feature value in a directory of the second file, a file record for recording a second file relative to a file in the directory of the first file; The file record generates a first difference file; wherein the first file is an original file, and the second file is an object file.
在一种可能实现方式中,所述差分模块303用于对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。In a possible implementation manner, the difference module 303 is configured to use a third file and a fourth file with the same file name, and if the first file and the second file are the second type, The third file and the fourth file are binary-differentiated to generate a second difference file; wherein the third file is an original file, and the fourth file is an object file.
在一种可能实现方式中,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文件夹文件。In a possible implementation manner, the file of the first type includes a file with a suffix of .dex and a file with a suffix of .arsc, and the file of the second type includes a folder file.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。With regard to the apparatus in the above embodiments, the specific manner in which the respective modules perform the operations has been described in detail in the embodiment relating to the method, and will not be explained in detail herein.
图4是根据一示例性实施例示出的一种应用升级包获取装置400的框图。例如,装置400可以被提供为一服务器。参照图4,装置400包括处理组件422,其进一步包括一个或多个处理器,以及由存储器432所代表的存储器资源,用于存储可由处理部件422的执行的指令,例如应用程序。存储器432中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件422被配置为执行指令,以执行上述应用升级包获取方法。FIG. 4 is a block diagram of an application upgrade package obtaining apparatus 400, according to an exemplary embodiment. For example, device 400 can be provided as a server. Referring to FIG. 4, apparatus 400 includes a processing component 422 that further includes one or more processors, and memory resources represented by memory 432 for storing instructions executable by processing component 422, such as an application. An application stored in memory 432 may include one or more modules each corresponding to a set of instructions. Further, the processing component 422 is configured to execute instructions to perform the application upgrade package acquisition method described above.
装置400还可以包括一个电源组件426被配置为执行装置400的电源管理,一个有线或无线网络接口450被配置为将装置400连接到网络,和一个输入输出(I/O)接口458。装置400可以操作基于存储在存储器432的操作***,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。 Device 400 may also include a power supply component 426 configured to perform power management of device 400, a wired or wireless network interface 450 configured to connect device 400 to the network, and an input/output (I/O) interface 458. Device 400 can operate based on an operating system stored in memory 432, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
在示例性实施例中,还提供了一种非临时性计算机可读存储介质,当所述存储介质中的指令由移动终端的处理器执行时,使得移动终端能够执行一种应 用升级包获取方法,所述方法包括:解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。In an exemplary embodiment, there is also provided a non-transitory computer readable storage medium, wherein when instructions in the storage medium are executed by a processor of a mobile terminal, enabling the mobile terminal to perform a response Obtaining a method by using an upgrade package, the method comprising: decompressing a first installation package and a second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the second installation a version of the package; determining a file type of each file, the file type being used to indicate whether the file can be further decomposed; and performing, according to the file type of the respective file, the at least one original file and the at least one target file Performing differential processing corresponding to the file type to obtain at least one difference file; compressing the at least one difference file to obtain a differential upgrade package of the application.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will be apparent to those skilled in the <RTIgt; The present application is intended to cover any variations, uses, or adaptations of the present disclosure, which are in accordance with the general principles of the disclosure and include common general knowledge or common technical means in the art that are not disclosed in the present disclosure. . The specification and examples are to be regarded as illustrative only,
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。 It is to be understood that the invention is not limited to the details of the details and The scope of the disclosure is to be limited only by the appended claims.

Claims (11)

  1. 一种应用升级包获取方法,其特征在于,所述方法包括:An application upgrade package obtaining method, the method comprising:
    解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;Decompressing the first installation package and the second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package;
    确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;Determining a file type of each file, the file type being used to indicate whether the file can be further decomposed;
    根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;Performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
    将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。Compressing the at least one differential file to obtain a differential upgrade package of the application.
  2. 根据权利要求1所述的方法,其特征在于,所述确定各个文件的文件类型包括:The method according to claim 1, wherein said determining a file type of each file comprises:
    对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。Determining, for the at least one original file and the file having the same file name in the at least one target file, whether the file can be further decomposed, and if yes, determining that the file is of a first type, and if not, determining the file For the second type.
  3. 根据权利要求2所述的方法,其特征在于,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括:The method according to claim 2, wherein the at least one original file and the at least one object file are subjected to differential processing corresponding to the file type according to a file type of each file, to obtain at least one The difference file includes:
    对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;For the first file and the second file having the same file name, if the first file and the second file are of the first type, comparing the file feature values in the directory of the first file and the second file Generating a file record for recording the increase or decrease of the file in the directory of the second file relative to the first file;
    根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。And generating, according to the file record, a first difference file; wherein the first file is an original file, and the second file is an object file.
  4. 根据权利要求2所述的方法,其特征在于,根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件包括: The method according to claim 2, wherein the at least one original file and the at least one object file are subjected to differential processing corresponding to the file type according to a file type of each file, to obtain at least one The difference file includes:
    对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。For the third file and the fourth file having the same file name, if the first file and the second file are of the second type, performing binary difference on the third file and the fourth file to generate a second a differential file; wherein the third file is an original file, and the fourth file is an object file.
  5. 根据权利要求2至4任一项所述的方法,其特征在于,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文件夹文件。The method according to any one of claims 2 to 4, wherein the file of the first type comprises a file suffixed with .dex, a file suffixed with .arsc, and the file of the second type includes a folder. file.
  6. 一种应用升级包获取装置,其特征在于,所述装置包括:An application upgrade package obtaining device, wherein the device comprises:
    解压模块,用于解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;a decompression module, configured to decompress the first installation package and the second installation package of the application, to obtain at least one original file and at least one target file, where the version of the first installation package is lower than the version of the second installation package;
    确定模块,用于确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;a determining module, configured to determine a file type of each file, the file type being used to indicate whether the file can be further decomposed;
    差分模块,用于根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;a difference module, configured to perform differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
    压缩模块,用于将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。And a compression module, configured to compress the at least one differential file to obtain a differential upgrade package of the application.
  7. 根据权利要求6所述的装置,其特征在于,所述确定模块用于对于所述至少一个原文件和至少一个目标文件中文件名称相同的文件,判断所述文件是否能够被进一步分解,如果是,则确定所述文件为第一类型,如果否,则确定所述文件为第二类型。The apparatus according to claim 6, wherein the determining module is configured to determine whether the file can be further decomposed for the file with the same file name in the at least one original file and the at least one target file, if And determining that the file is of a first type, and if not, determining that the file is of a second type.
  8. 根据权利要求7所述的装置,其特征在于,所述差分模块用于对于文件名称相同的第一文件和第二文件,如果所述第一文件和所述第二文件为第一类型,则对比所述第一文件和所述第二文件的目录内的文件特征值,生成一个文件记录,所述文件记录用于记录所述第二文件相对于所述第一文件的目录内的文件增减;根据所述文件记录,生成第一差分文件;其中,所述第一文件为原文件,所述第二文件为目标文件。 The apparatus according to claim 7, wherein the difference module is used for the first file and the second file having the same file name, if the first file and the second file are of the first type, Comparing the file feature values in the directory of the first file and the second file, generating a file record, wherein the file record is used to record the file in the directory of the second file relative to the first file And generating, according to the file record, a first difference file; wherein the first file is an original file, and the second file is an object file.
  9. 根据权利要求7所述的装置,其特征在于,所述差分模块用于对于文件名称相同的第三文件和第四文件,如果所述第一文件和所述第二文件为第二类型,则对所述第三文件和所述第四文件进行二进制差分,生成第二差分文件;其中,所述第三文件为原文件,所述第四文件为目标文件。The apparatus according to claim 7, wherein the difference module is used for a third file and a fourth file having the same file name, and if the first file and the second file are of a second type, And performing binary difference on the third file and the fourth file to generate a second difference file; wherein the third file is an original file, and the fourth file is an object file.
  10. 根据权利要求7至9任一项所述的装置,其特征在于,所述第一类型的文件包括后缀为.dex的文件、后缀为.arsc的文件,所述第二类型的文件包括文件夹文件。The apparatus according to any one of claims 7 to 9, wherein the file of the first type comprises a file suffixed with .dex, a file suffixed with .arsc, and the file of the second type includes a folder. file.
  11. 一种应用升级包获取装置,其特征在于,包括:An application upgrade package obtaining device, comprising:
    处理器;processor;
    用于存储处理器可执行的指令的存储器;a memory for storing instructions executable by the processor;
    其中,所述处理器被配置为:Wherein the processor is configured to:
    解压应用的第一安装包和第二安装包,得到至少一个原文件和至少一个目标文件,所述第一安装包的版本低于所述第二安装包的版本;Decompressing the first installation package and the second installation package of the application, obtaining at least one original file and at least one target file, wherein the version of the first installation package is lower than the version of the second installation package;
    确定各个文件的文件类型,所述文件类型用于指示文件是否能够被进一步分解;Determining a file type of each file, the file type being used to indicate whether the file can be further decomposed;
    根据所述各个文件的文件类型,对所述至少一个原文件和所述至少一个目标文件进行与所述文件类型相应的差分处理,得到至少一个差分文件;Performing differential processing corresponding to the file type on the at least one original file and the at least one target file according to a file type of each file, to obtain at least one difference file;
    将所述至少一个差分文件进行压缩,得到所述应用的差分升级包。 Compressing the at least one differential file to obtain a differential upgrade package of the application.
PCT/CN2016/097181 2016-08-29 2016-08-29 Method and apparatus for acquiring application upgrade package WO2018039875A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2016/097181 WO2018039875A1 (en) 2016-08-29 2016-08-29 Method and apparatus for acquiring application upgrade package
CN201680001806.XA CN106462430B (en) 2016-08-29 2016-08-29 Application upgrade package obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/097181 WO2018039875A1 (en) 2016-08-29 2016-08-29 Method and apparatus for acquiring application upgrade package

Publications (1)

Publication Number Publication Date
WO2018039875A1 true WO2018039875A1 (en) 2018-03-08

Family

ID=58215731

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/097181 WO2018039875A1 (en) 2016-08-29 2016-08-29 Method and apparatus for acquiring application upgrade package

Country Status (2)

Country Link
CN (1) CN106462430B (en)
WO (1) WO2018039875A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10579374B2 (en) * 2016-11-14 2020-03-03 Samsung Sds Co., Ltd. Method for converting application and computing device
CN112558994A (en) * 2020-12-23 2021-03-26 上海眼控科技股份有限公司 Application software upgrading method, device, equipment and storage medium
CN112988691A (en) * 2021-03-31 2021-06-18 深圳市优必选科技股份有限公司 File updating method and device based on embedded system and terminal equipment
CN116257277A (en) * 2023-05-12 2023-06-13 天津卓朗昆仑云软件技术有限公司 Mirror image file updating method and device and VOI system
CN116501363A (en) * 2023-06-29 2023-07-28 杭州美创科技股份有限公司 Method and device for rapidly upgrading software offline, computer equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106648712A (en) * 2017-02-27 2017-05-10 百度在线网络技术(北京)有限公司 Incremental updating packet generating method and device, and server
CN107168733B (en) * 2017-04-25 2020-07-17 北京五八信息技术有限公司 Method, device and system for generating differential file package and updating application program
CN107391145A (en) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 AKU preparation method and device, the method and device of upgrade file
CN107766062B (en) * 2017-12-08 2021-02-09 北京小米移动软件有限公司 Method and system for installing software and first terminal
CN110162330B (en) * 2019-07-08 2021-04-13 上海赫千电子科技有限公司 System and method applied to automobile ECU (electronic control Unit) file upgrading
WO2021114101A1 (en) * 2019-12-10 2021-06-17 深圳市欢太科技有限公司 Method and apparatus for incremental update of file, and terminal and computer-readable storage medium
CN111556127B (en) * 2020-04-24 2023-04-07 广东乐心医疗电子股份有限公司 Wearable device upgrading method and related device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095838A (en) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 Method for upgrading Android smartphone software through downloading incremental upgrade package
CN103713928A (en) * 2013-12-31 2014-04-09 优视科技有限公司 Incremental file generating method, and application program installing file updating method and device
WO2014180425A1 (en) * 2013-12-16 2014-11-13 中兴通讯股份有限公司 File system upgrade package production method, upgrade method, device and terminal
CN104391728A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Software upgrading delta pack acquiring method, corresponding upgrading method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473099B (en) * 2013-09-13 2017-02-01 惠州Tcl移动通信有限公司 Software upgrading method and system for mobile terminal
CN105573785A (en) * 2015-12-11 2016-05-11 青岛海信电器股份有限公司 Differential package manufacturing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095838A (en) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 Method for upgrading Android smartphone software through downloading incremental upgrade package
WO2014180425A1 (en) * 2013-12-16 2014-11-13 中兴通讯股份有限公司 File system upgrade package production method, upgrade method, device and terminal
CN103713928A (en) * 2013-12-31 2014-04-09 优视科技有限公司 Incremental file generating method, and application program installing file updating method and device
CN104391728A (en) * 2014-12-12 2015-03-04 北京奇虎科技有限公司 Software upgrading delta pack acquiring method, corresponding upgrading method and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10579374B2 (en) * 2016-11-14 2020-03-03 Samsung Sds Co., Ltd. Method for converting application and computing device
CN112558994A (en) * 2020-12-23 2021-03-26 上海眼控科技股份有限公司 Application software upgrading method, device, equipment and storage medium
CN112988691A (en) * 2021-03-31 2021-06-18 深圳市优必选科技股份有限公司 File updating method and device based on embedded system and terminal equipment
CN116257277A (en) * 2023-05-12 2023-06-13 天津卓朗昆仑云软件技术有限公司 Mirror image file updating method and device and VOI system
CN116501363A (en) * 2023-06-29 2023-07-28 杭州美创科技股份有限公司 Method and device for rapidly upgrading software offline, computer equipment and storage medium

Also Published As

Publication number Publication date
CN106462430A (en) 2017-02-22
CN106462430B (en) 2020-06-02

Similar Documents

Publication Publication Date Title
WO2018039875A1 (en) Method and apparatus for acquiring application upgrade package
CN108958927B (en) Deployment method and device of container application, computer equipment and storage medium
CA2954294C (en) Website access method, apparatus, and website system
CN107729041B (en) Application program hot updating method, device, terminal and storage medium
JP6629697B2 (en) Method and apparatus for extracting a virtual machine image file
AU2016404863B2 (en) Patch-upgrade-based file processing method and apparatus, terminal, and storage medium
US8527978B1 (en) System, method, and computer program product for populating a list of known wanted data
US8630978B2 (en) Method of bi-directional synchronization of user data
US20170206353A1 (en) Method and system for preventing malicious alteration of data in computer system
US9864736B2 (en) Information processing apparatus, control method, and recording medium
US9317681B2 (en) Information processing apparatus, information processing method, and computer program product
US20130232187A1 (en) Systems and methods for managing data in a networked communication system
CN109391673B (en) Method, system and terminal equipment for managing update file
CN105049486A (en) Version management and file pulling control methods for static files, version management and file pulling control devices, and version control system
WO2015078166A1 (en) Load processing method and device for system application installation package, and terminal
CN111008034B (en) Patch generation method and device
CN105302920A (en) Optimal management method and system for cloud storage data
EP3289513A1 (en) Protecting user identifiable information in the transfer of telemetry data
CN110990335A (en) Log archiving method, device, equipment and computer readable storage medium
US9665732B2 (en) Secure Download from internet marketplace
CN111818175A (en) Enterprise service bus configuration file generation method, device, equipment and storage medium
CN114328029B (en) Backup method and device of application resources, electronic equipment and storage medium
US11537735B2 (en) Trusted enterprise data assets via data confidence fabrics
WO2020224108A1 (en) Url interception and conversion method, device, and computer apparatus
TWI571754B (en) Method for performing file synchronization control, and associated apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16914445

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16914445

Country of ref document: EP

Kind code of ref document: A1