[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2015180304A1 - 增量升级方法及装置 - Google Patents

增量升级方法及装置 Download PDF

Info

Publication number
WO2015180304A1
WO2015180304A1 PCT/CN2014/086816 CN2014086816W WO2015180304A1 WO 2015180304 A1 WO2015180304 A1 WO 2015180304A1 CN 2014086816 W CN2014086816 W CN 2014086816W WO 2015180304 A1 WO2015180304 A1 WO 2015180304A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
subfile
compressed
type
difference data
Prior art date
Application number
PCT/CN2014/086816
Other languages
English (en)
French (fr)
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 US15/315,272 priority Critical patent/US10048959B2/en
Publication of WO2015180304A1 publication Critical patent/WO2015180304A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to an incremental upgrade method and apparatus.
  • Version upgrade refers to the improvement of the vulnerability of the operating system or the old version of the software, or the addition of new application functions to the software, so that the software is more perfect and easy to use.
  • Incremental upgrade is a common version upgrade method. The basic principle is: the server compares the old version file with the new version file, and generates an incremental file for recording the difference information between the old version file and the new version file; The client downloads the delta file, and merges the delta file with its own old version file to obtain a corresponding new version file. After the new version file is installed, the version upgrade is completed. Compared with the way to perform the upgrade by downloading the entire new version file, the above incremental upgrade method is widely used because it consumes less data traffic, takes less time, and has higher upgrade efficiency.
  • each version file is a compressed file that contains multiple subfiles.
  • incremental files are obtained mainly by direct comparison method or decompression comparison method.
  • the direct comparison method directly compares the old version file and the new version file as a whole file; the method is more efficient, but the obtained incremental file is large, even close to the size of the new version file, It is convenient for the client to download the delta file. For example, compared to the old version file, each subfile corresponding to the new version file is not modified, but the compression order of the subfile is changed, but from the perspective of the overall file, the two files are still completely different, so The incremental file obtained by the direct comparison method will be large.
  • the decompression comparison method is specifically: extracting the sub-files in the old version file and the new version file respectively, and comparing the old version file obtained after decompression with the sub-file corresponding to the new version file (such as the same file name), Get the delta file.
  • the decompression comparison method can solve the problem that the overall file difference caused by the sub-file order change is large, and the size of the incremental file is effectively reduced.
  • it is generally necessary to perform several thousand decompressions. The compression operation results in a lower upgrade efficiency.
  • an incremental upgrade method and apparatus are provided to solve the problem that the incremental incremental upgrade method cannot balance the incremental file size and the upgrade efficiency.
  • an incremental upgrade method including:
  • the server obtains at least one of a first type of subfile, a second type of subfile, and a third type of subfile; wherein the first type of subfile exists in a new version of the compressed file but does not exist in the old version of the compressed file.
  • the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and that meets the preset decompression conditions, including the second type of subfile in the new version of the compressed file and the old version of the compressed file.
  • a second type of subfile; the third type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and partially or completely does not satisfy the preset decompression condition, including the first in the new version of the compressed file.
  • the third type of subfile and the third type of subfile in the old version of the compressed file is
  • the server decompresses the second type of subfile in the new version of the compressed file and the second subfile in the corresponding old version of the compressed file, and compares the differences to obtain the first difference. data files;
  • the server compares the third type of subfile in the new version of the compressed file and the third subtype of the corresponding old version of the compressed file without directly decompressing, and obtains the second Difference data file;
  • the server generates an incremental file for the client to perform incremental upgrade of the file according to at least one of the obtained first type of subfile, the first difference data file, and the second difference data file.
  • an incremental upgrade method including:
  • the client obtains the delta file from the server, where the delta file includes at least one of the first type of subfile, the first difference data file, and the second difference data file; wherein the first type of subfile is a file that exists in the new version of the compressed file but does not exist in the old version of the compressed file; the first difference data file is the second type of subfile in the new version of the compressed file and the second type in the corresponding old version of the compressed file.
  • the file is decompressed and compared, and the second type of subfile is a file that exists in both the new version compressed file and the old version compressed file and both meet the preset decompression condition; the second difference data file is a new pair
  • the third type of subfile in the version compression file and the third type of subfile in the corresponding old version of the compressed file are not decompressed and directly obtained by differential comparison, and the third type of subfile is a new version of the compressed file and the old version is compressed. a file that exists in the file and partially or completely does not satisfy the preset decom
  • the client uses the delta file to obtain a new version of the compressed file, including: when the delta file includes the first type of subfile, the first difference data file, and the second difference data file, the old version of the compressed file
  • the first difference data file is merged to obtain a first merged sub-file
  • the first merged sub-file is compressed to obtain a first compressed sub-file
  • Combining the three types of subfiles with the second difference data file to obtain a second merged subfile, compressing the second merged subfile to obtain a second compressed subfile
  • the client uses the new version of the compressed file for incremental upgrade of the file.
  • a server including:
  • a first obtaining module configured to obtain at least one of a first type of subfile, a second type of subfile, and a third type of subfile; wherein the first type of subfile exists in a new version of the compressed file but the old version The file that does not exist in the compressed file; the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and that meets the preset decompression conditions, including the second type of subfile in the new version of the compressed file.
  • the third type of subfile is a file that exists in the new version of the compressed file and the old version of the compressed file and partially or completely does not meet the preset decompression conditions, including the new version of the compressed file.
  • the third type of subfile in the file and the third type of subfile in the old version of the compressed file is a file that exists in the new version of the compressed file and the old version of the compressed file and partially or completely does not meet the preset decompression conditions, including the new version of the compressed file.
  • the first comparison module is configured to decompress and differentiate the second type of subfiles in the new version of the compressed file and the second type of subfiles in the corresponding old version of the compressed file when the obtained second file includes the second type of subfile Comparing, obtaining the first difference data file;
  • the second comparison module is configured to directly perform the third type subfile in the new version compressed file and the third type subfile in the corresponding old version compressed file without directly decompressing the third type subfile in the obtained file. Comparing the differences, obtaining a second difference data file;
  • a generating module configured to generate an incremental file for the client to perform an incremental upgrade of the file according to the obtained at least one of the first type of subfile, the first difference data file, and the second difference data file .
  • a client including:
  • a second obtaining module configured to obtain an incremental file from the server, where the incremental file includes at least one of a first type of subfile, a first difference data file, and a second difference data file;
  • a type of subfile is a file that exists in the new version of the compressed file but does not exist in the old version of the compressed file;
  • the first difference data file is in the second type of subfile in the new version of the compressed file and the corresponding old version of the compressed file
  • the second type of subfile is decompressed and compared to obtain a file, and the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and that meets the preset decompression condition;
  • the second difference The data file is a file obtained by directly comparing the third type of subfiles in the new version of the compressed file and the third type of subfiles in the corresponding old version of the compressed file, and the third type of subfile is compressed for the new version.
  • a second merge module configured to use the delta file to obtain a new version of the compressed file, including: compressing the old version when the delta file includes the first type of subfile, the first difference data file, and the second difference data file After decompressing the second type of subfile of the file, combining with the first difference data file to obtain a first merged subfile, compressing the first merged subfile to obtain a first compressed subfile; compressing the old version The third type of subfile of the file is merged with the second difference data file to obtain a second merged subfile, and the second merged subfile is compressed. Obtaining a second compressed subfile; combining the first compressed subfile, the second compressed subfile, and the first subfile to obtain a new version compressed file;
  • the incremental upgrade module is configured to incrementally upgrade files using the new version of the compressed file.
  • a computer program comprising program instructions, when the computer program is run on a server, causing the server to perform the incremental upgrade method of the server side.
  • the invention provides a computer readable medium storing the computer program according to the fifth aspect.
  • a computer program comprising program instructions, when the computer program is run on a client, causing the client to perform an incremental upgrade method of the client.
  • a computer readable medium storing the computer program according to the seventh aspect.
  • the server when generating the delta file, the server first obtains different types of subfiles in the old version compressed file and the new version compressed file, and then performs different difference comparisons on different types of subfiles. Steps to obtain a difference data file of the corresponding type. Then, for the sub-files satisfying the preset decompression conditions, the difference comparison is performed by using the decompression comparison method, and the size of the difference data can be reduced. For the sub-files that do not satisfy the preset decompression conditions, the direct comparison method is used to perform the difference comparison, which can improve the difference comparison. effectiveness.
  • the server generates an incremental file for the client to perform incremental upgrade of the file according to at least one of the obtained first type of subfile, the first difference data file, and the second difference data file.
  • the client obtains the delta file from the server, it can perform different operations according to the type of the subfile in the delta file to obtain a new version of the compressed file.
  • the merge operation of the difference data file and the old version compressed file can be performed according to the type of the difference data file, and a new version of the compressed file is obtained, thereby improving the efficiency of the merge operation. Therefore, compared with the traditional single incremental comparison method or the incremental upgrade based on the decompression comparison method, the present application can achieve the purpose of both the incremental file size and the upgrade efficiency.
  • FIG. 1 is a schematic flowchart diagram of an incremental upgrade method according to an embodiment of the present application
  • FIG. 2 is a schematic flowchart of generating an incremental file in an incremental upgrade method according to an embodiment of the present disclosure
  • FIG. 3 is another schematic flowchart of generating an incremental file in an incremental upgrade method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a storage structure of an old version compressed file and a new version compressed file in the embodiment of the present application;
  • FIG. 5 is a schematic diagram of a storage structure of a first buffer area and a second buffer area in an embodiment of the present application
  • FIG. 6 is a schematic flowchart of a client performing a merge operation in an incremental upgrade method according to an embodiment of the present disclosure
  • FIG. 7 is a schematic flowchart of another incremental upgrade method according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic flowchart of still another incremental upgrade method according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of a relationship between a server and a client that implement incremental upgrade according to an embodiment of the present application.
  • FIG. 10 is a structural block diagram of a server according to an embodiment of the present application.
  • FIG. 11 is a structural block diagram of an optimized server according to an embodiment of the present application.
  • FIG. 12 is a structural block diagram of a client according to an embodiment of the present disclosure
  • FIG. 13 is a structural block diagram of another server according to an embodiment of the present application
  • FIG. 14 is a structural block diagram of another client according to an embodiment of the present application.
  • the embodiment of the present application provides an incremental upgrade method and device to solve the problem that the incremental incremental upgrade method cannot balance the incremental file size and the upgrade efficiency.
  • FIG. 1 is a flowchart of an incremental upgrade method according to an embodiment of the present application.
  • This embodiment first describes the incremental upgrade method of the present application from the perspective of an overall system including a server and a client.
  • the incremental upgrade method provided in this embodiment includes the following steps:
  • the server obtains a new version of the compressed file and a corresponding old version of the compressed file.
  • the embodiment of the present application may determine two corresponding compressed files according to the file name and/or the version identifier, and further determine, according to the version numbers of the two compressed files, which compressed file is an old version compressed file, and which compressed file is The new version of the compressed file.
  • the two compressed files are the corresponding two compressed files; further, of the two compressed files, the compressed version has a version number of 9.6. .0, the version number of another compressed file is 9.6.1, you can determine that the latter version number is higher, the new version is Therefore, it can be determined that the compressed file with the version number of 9.6.0 is the compressed file of the old version, and the compressed file with the version number of 9.6.1 is the compressed file of the new version.
  • the server obtains at least one of a first type of subfile, a second type of subfile, and a third type of subfile.
  • the first type of subfile is a file that exists in the new version compressed file but does not exist in the old version compressed file; the second type of subfile exists in both the new version compressed file and the old version compressed file, and
  • the files satisfying the preset decompression conditions include the second type of subfiles in the new version of the compressed file and the second type of subfiles in the old version of the compressed file; the third type of subfile is the new version of the compressed file.
  • the third type of subfile includes the third type of subfile in the new version of the compressed file and the third type in the old version of the compressed file. sub file.
  • the compressed file (including the old version compressed file and the new version compressed file) in the embodiment of the present application refers to a file obtained by storing a plurality of compressed sub-files in a certain order. More specifically, the compressed file format may be in a zip format, and the corresponding common files include files in the apk format, most game resource files, and data files of some large applications. However, it is not limited thereto, and those skilled in the art should understand that the compressed files of other formats are also applicable to the incremental upgrade scheme of the present application.
  • the data in the new version of the compressed file can be grouped according to functions and the like, and the data and/or subfiles in each group are separately compressed to obtain a plurality of compressed subfiles, and the compressed subfiles are The predetermined order is arranged to obtain a compressed file of the new version file, that is, a new version of the compressed file.
  • the new version of the subfile represents the subfile in the new version of the compressed file
  • the old version of the subfile represents the subfile in the old version of the compressed file.
  • the new version of the subfile A is the first type of subfile.
  • the new version File B is the second type of subfile in the new version of the compressed file
  • the corresponding old version of the subfile B' is the second type of subfile in the old version of the compressed file.
  • the new version of the sub-file C is the third type of sub-file in the new version of the compressed file
  • the corresponding old version of the sub-file C' is the third-type sub-file in the old version of the compressed file.
  • the new version of the sub-file described in this embodiment corresponds to the old version of the sub-file, which means that the new version of the sub-file and the old version of the sub-file achieve the same (or similar) functions.
  • the file names of the corresponding subfiles are the same. Therefore, by looking up the subfiles whose file names are the same as the file names of the new version subfiles in the old version of the compressed file, the subfiles found are The old version of the subfile corresponds to the old version of the subfile.
  • the same difference comparison method is used for all data or subfiles in the compressed file to obtain the corresponding incremental file.
  • the optimal difference comparison method for different sub-files may be different.
  • some files have little or no difference in size before and after compression.
  • the size of the two kinds of difference data obtained by the decompression comparison method and the direct comparison method are not much different.
  • the decompression comparison method requires multiple decompression operations, the execution efficiency is lower than that of the direct comparison method. Therefore, for such documents, the preferred method of comparison of differences is direct comparison.
  • the decompression comparison method needs to sacrifice a certain execution efficiency, since the data granularity obtained after decompression is smaller, it can be recognized that the content of the old version subfile and the new version subfile are the same.
  • the data with different order relations avoids the problem that the overall difference of the file is large due to the change of the data arrangement order, so the size of the difference data obtained is much smaller than the size of the difference data obtained by the direct comparison method. Therefore, for such documents, the preferred method of comparison of differences is the decompression comparison method.
  • the embodiment of the present application distinguishes the above two types of files according to preset decompression conditions, so as to adopt an optimal difference comparison manner for each type of file.
  • the server decompresses the second type of the subfile in the new version of the compressed file and the second subfile in the corresponding old version of the compressed file, and compares the difference to obtain the first A difference data file.
  • the first difference data file is the difference data obtained after the server decompresses and compares the second type of subfiles in the new version of the compressed file and the second type of subfiles in the corresponding old version of the compressed file. That is, the first difference data file is a file generated by the obtained difference data.
  • the server compares the third subtype file in the new version of the compressed file and the third subfile in the corresponding old version of the compressed file without directly decompressing, and obtains a difference comparison.
  • the second difference data file is the third difference data file.
  • the second difference data file is a third type of subfile included in the compressed file of the new version of the server. And the corresponding third version of the sub-file in the old version of the compressed file is not decompressed directly after the difference is compared, the difference data obtained. That is, the second difference data file is a file generated by the obtained difference data.
  • the set of the first type of subfile, the first difference data file, and the second difference data file is an incremental file for recording difference information between the old version compressed file and the new version compressed file; each first type of subfile
  • Each first difference data file and each second difference data file are respectively an incremental subfile. It should be noted that, in actual use, it is possible that the obtained file is part of the first type of subfile, the first difference data file, and the second difference data file, and not all of them, and similarly, the obtained part of the file A collection is an incremental file that records the difference information between an old version of a compressed file and a new version of a compressed file.
  • only a set of the first type of subfiles, only a set of the first difference data files, only a set of the second difference data files, or only a set of the first type of subfiles and the first difference data file are included.
  • the first type of subfile does not exist in the old version of the compressed file, that is, the first type of subfile in the new version of the compressed file is a new file compared to the old version of the compressed file. . Therefore, for the first type of subfile, it is not necessary to perform a difference comparison operation, and the first type of subfile is directly used as a subfile of the delta file.
  • the difference comparison method after the first decompression is used to reduce the size of the corresponding incremental sub-file, thereby reducing the size of the incremental file;
  • the direct comparison method can shorten the time used for the difference comparison, improve the efficiency of the incremental file generation, and improve the incremental upgrade efficiency.
  • the server generates an incremental file for the client to perform incremental upgrade of the file according to at least one of the obtained first type of subfile, the first difference data file, and the second difference data file.
  • the server can compress all the resulting incremental subfiles into one file. For example, compressing the first type of subfile, the first difference data file, and the second difference data file into one file, and obtaining an incremental file in the form of a compressed file, in order to send/download the incremental file completely and accurately. Similarly, when only a part of the first type of subfile, the first difference data file, and the second difference data file are obtained, the obtained partial file is compressed into one file.
  • the client obtains an incremental file from the server, where the incremental file includes at least one of the foregoing first type of subfile, the first difference data file, and the second difference data file.
  • the client obtains the incremental text according to the file type of the subfile in the obtained incremental file.
  • the device performs a merge operation with the old version of the compressed file stored by itself, and obtains a new version of the compressed file.
  • the incremental file includes the first type of subfile, the first difference data file, and the second difference data file
  • the client may perform the merge operation in the following manner to obtain a new version of the compressed file: After decompressing the second type of subfile of the old version compressed file, merge with the first difference data file to obtain the first merged subfile, and compress the first merged subfile to obtain the first compressed subfile; The third type of subfile of the compressed file is merged with the second difference data file to obtain a second merged subfile, and the second merged subfile is compressed to obtain a second compressed subfile; the first compressed subfile is merged, and the first compressed subfile is merged The second compressed subfile and the first subfile get the new version of the compressed file.
  • the client can set a new version of the compressed file storage area and perform the merge operation as follows: the first type of subfiles are directly stored in the new version of the compressed file storage area; the second version of the old version is compressed. After the subfile is decompressed, it is merged with the first difference data file, and then the merged data is compressed to obtain a first compressed subfile, and the first compressed subfile is stored in a new version of the compressed file storage area; The third type of subfile of the version compression file is merged with the second difference data file, and the merged data is compressed to obtain a second compressed subfile, and the second compressed subfile is stored in a new version compressed file storage area. After the merge operation is completed, the file set stored in the new version of the compressed file store is the new version of the compressed file.
  • the first subfile is used to obtain the new version of the compressed file.
  • the first type of subfile can be directly used as a new version of the compressed file.
  • the second type of the sub-file of the old version of the compressed file is decompressed, and merged with the first difference data file to obtain a first merged sub-file, A merged subfile is compressed to obtain a first compressed subfile; the first compressed subfile is used to obtain a new version of the compressed file.
  • the first compressed subfile can be directly used as a new version of the compressed file.
  • the third sub-file of the old version compressed file is merged with the second difference data file to obtain a second merge subfile, and the second merge subfile is Compress to get the second compressed subfile; use the second compressed subfile to get the new version of the compressed file.
  • the second compressed subfile can be directly used as a new version of the compressed file.
  • the second type of the sub-file of the old version of the compressed file is decompressed, and then merged with the first difference data file to obtain the first merged sub-file.
  • the first merged subfile is compressed to obtain a first compressed subfile; the first compressed subfile and the first type of subfile are merged to obtain a new version of the compressed file.
  • the third type of subfile of the old version of the compressed file is merged with the second difference data file to obtain a second merged subfile, and the second merged Subfile Compress, get the second compressed subfile; merge the second compressed subfile and the first subfile to get the new version of the compressed file.
  • the second type of the sub-file of the old version of the compressed file is decompressed, and then merged with the first difference data file to obtain the first merged sub-file.
  • the client uses the new version of the compressed file to perform incremental upgrade of the file.
  • the incremental upgrade method provided by the embodiment of the present application first obtains different types of subfiles in the old version compressed file and the new version compressed file when generating the incremental file, and then pairs different types of subfiles. Perform different difference comparison steps to get the corresponding difference data file. Then, the first type of subfiles that exist in the new version of the compressed file but do not exist in the old version of the compressed file are used as new data, and the third type of subfiles that do not satisfy the preset decompression condition are directly compared. The method obtains the corresponding second difference data file, and adopts a decompression comparison method that can make the difference data smaller to obtain the corresponding first difference data file for the second type of subfile satisfying the preset decompression condition.
  • the server generates an incremental file for the client to perform incremental upgrade of the file according to at least one of the obtained first type of subfile, the first difference data file, and the second difference data file.
  • the client obtains the first type of subfile, the first difference data file, and the second difference data file from the server, and decompresses the second type of subfile of the old version of the compressed file, and the first difference data file.
  • the embodiment of the present application selects the corresponding difference comparison mode and the merge operation mode according to the type of the sub-file in the compressed file, and the purpose of both the incremental file size and the upgrade efficiency can be achieved for the entire incremental upgrade process.
  • the preset decompression condition may be: the size before the file compression is greater than the preset byte value and the compression ratio is less than the preset ratio.
  • the present invention is not limited thereto. In practical applications, those skilled in the art may set other suitable decompression conditions according to the preset decompression conditions to implement the incremental upgrade scheme of the present application.
  • the preset byte can be set to 100 KB, but is not limited thereto;
  • the compression ratio is a ratio of the size of the file after compression to the size before compression, and can be set to 70%, but is not limited thereto.
  • the server after performing the steps S11 to S15, obtains the incremental file between the old version compressed file and the new version compressed file, and may send the upgrade prompt information to the client associated with the client. After receiving the upgrade prompt information, download the corresponding incremental file to implement compression of the old version of the storage itself. Incremental upgrade of files.
  • the upgrade prompt information includes version information of a new version of the compressed file corresponding to the incremental file; the version information includes at least a file name, a version number, and the like.
  • the client may unconditionally download the incremental file corresponding to each upgrade prompt information received, or determine whether the local file is based on the version information in the received upgrade prompt information and the version information of the file stored or installed by itself. If the upgrade is required, the incremental file corresponding to the upgrade prompt information is downloaded. If the upgrade does not need to be performed or the corresponding old version file does not exist, the incremental file corresponding to the upgrade prompt information is not downloaded.
  • the version information carried in the upgrade prompt information received by the client is as follows: the file name is uc_browser.apk, and the version number is 9.6.1. If the file stored or installed by the client itself does not exist, the file named uc_browser.apk exists. Or, there is a file named uc_browser.apk and the version number is 9.6.1, indicating that the client does not need to download the incremental file corresponding to the upgrade prompt information; if the name stored in the client itself is stored or installed, the name is uc_browser.
  • the version number is 9.6.0, that is, the version number is lower than the version number of the new version of the compressed file corresponding to the upgrade prompt information, indicating that it is necessary to upgrade the uc_browser.apk file in the client.
  • the client downloads The incremental file corresponding to the upgrade prompt information.
  • the client may actively send a file upgrade request to the server, and after receiving the file upgrade request, the server sends a corresponding delta file to the client, so that the client stores the old file for itself.
  • the version compression file is incrementally upgraded.
  • the above file upgrade request includes version information of files stored or installed in the client.
  • the server After receiving the file upgrade request from the client, the server searches for a corresponding incremental file, and if so, sends the incremental file to the client.
  • the server may return corresponding prompt information to the client, such as “no new version”, “the current version is the latest version”, and the like.
  • the version information carried in the file upgrade request received by the server is as follows: the file name is uc_browser.apk, and the version number is 9.6.0. If the server finds that it has stored an incremental file that meets the following upgrade conditions: the file name of the old version compressed file and the new version compressed file corresponding to the incremental file is uc_browser.apk, and the version number of the old version compressed file is 9.6. .0. If the version number of the new version of the compressed file is higher than 9.6.0 (such as 9.6.1 or 9.6.2, etc.), the server sends the incremental file to the client.
  • 9.6.0 such as 9.6.1 or 9.6.2, etc.
  • the server can return the corresponding prompt information to the client.
  • FIG. 2 and FIG. 3 are respectively a flowchart of an embodiment, which is applied to a server to implement a comparison between the old version compressed file and the new version compressed file to obtain a corresponding incremental file (ie, steps S12 to S15 described above).
  • the server generates the corresponding incremental file according to the obtained old version compressed file and the new version compressed file as follows:
  • step S201 Determine whether the new version of the sub-file in the new version of the compressed file has been read. If yes, the process ends. Otherwise, step S202 is performed.
  • step S203 Determine whether an old version subfile corresponding to the read new version subfile exists in the old version compressed file, if yes, execute step S205, otherwise perform step S204.
  • step S204 Store the new version subfile in the first storage area for storing the delta file, and return to step S201.
  • the new version of the subfile is the first type of subfile. That is, the new version of the subfile is a new file compared to the old version of the compressed file, which can be directly written to the delta file as an incremental subfile.
  • step S205 Determine whether the old version subfile and the new version subfile satisfy the preset decompression condition. If both meet the preset decompression condition, step S206 is performed, otherwise step S207 is performed.
  • step S206 Decompress the old version subfile and the new version subfile respectively, compare the decompressed old version subfile and the new version subfile, and store the compared first difference data file in the first storage area, and return to step S201.
  • the first difference data file described above may be a subfile of the delta file.
  • the old version subfile and the new version subfile satisfy the preset decompression condition
  • the old version subfile and the new version subfile are the second type subfile, and the decompression comparison method is used to realize the difference comparison between the two, which can ensure The resulting incremental subfile is smaller than the incremental subfile obtained by direct comparison, which in turn makes the entire incremental file smaller.
  • the file header of the new version of the subfile is first written into the first storage area, and after the first difference data file is obtained through the decompression and comparison steps, The first difference data file is further written into the first storage area, and the file data headers of the first difference data file and the new version subfile are consecutive in the storage address of the first storage area.
  • the server writes the file header of the second type of subfile of the new version of the compressed file to the storage area; decompresses the second type of subfile of the new version of the compressed file and the second type of subfile of the corresponding old version of the compressed file And performing a difference comparison to obtain a first difference data; writing the obtained first difference data After entering the storage address of the file data header of the second type of subfile in the storage area, the second type of subfile is continuously stored in the storage area; according to the file data header and the first difference data of the second type of subfile continuously stored, Get the first difference data file.
  • step S207 Directly compare the old version subfile and the new version subfile, and store the compared second difference data file in the first storage area, and return to step S201.
  • the above second difference data file can be used as a subfile of the delta file.
  • the old version of the subfile does not meet the preset decompression conditions, or the new version of the subfile does not meet the preset decompression conditions, or the old version of the subfile and the new version of the subfile do not meet the preset decompression conditions, the old version of the subfile and the new version of the child
  • the file is the third type of subfile.
  • the above two methods (decompression comparison method and direct comparison method) are used to compare the difference between the old version of the subfile and the new version of the subfile.
  • the size of the resulting incremental subfile is close to or the same. . Therefore, the embodiment of the present application uses the direct comparison method to compare the differences between the third type of sub-files, which can reduce the time consumed by the difference comparison, improve the efficiency of the difference comparison, and further improve the efficiency of the entire incremental upgrade process.
  • step S201 if the result of the step S201 is no, that is, the new version of the sub-file in the new version of the compressed file is completely read, indicating that the difference between the old version of the compressed file and the new version of the compressed file has been executed.
  • a collection of all the data stored in the first storage area that is, an incremental file for recording difference information between the old version compressed file and the new version compressed file.
  • the second difference data may also be obtained by the following method:
  • a plurality of new version sub-files of continuous storage ie, storage address consecutive
  • the old version sub-files corresponding to the successively stored plurality of new version sub-files are in one-to-one
  • the storage location that is, the storage address
  • the preset condition is satisfied, the overall file composed of the plurality of newly-updated sub-files continuously stored is compared with another overall file composed of the plurality of consecutively stored plurality of old version sub-files.
  • the server determines that there are multiple third-type sub-files with consecutive storage addresses in the new version of the compressed file, and determines that the storage addresses of the corresponding third-type sub-files in the old version of the compressed file are also consecutive;
  • the compressed file stores a plurality of third-type sub-files with consecutive addresses as a whole file, and the third-type sub-files with consecutive addresses stored in the old version of the compressed file are used as another overall file; the two entire files are not decompressed directly.
  • a difference comparison is made to obtain a second difference data file.
  • the steps for the server to generate a corresponding delta file according to the obtained old version compressed file and the new version compressed file are as follows:
  • step S201' determining whether the new version of the sub-file in the new version of the compressed file has been read, and if so, ending the flow, otherwise executing step S202'.
  • step S203' determining whether there is an old version subfile corresponding to the read new version subfile in the old version compressed file, if yes, executing step S205', otherwise executing step S204'.
  • step S204' storing the new version subfile in the first storage area for storing the delta file, and returning to step S201'.
  • step S205' determining whether the old version subfile and the new version subfile satisfy the preset decompression condition. If both meet the preset decompression condition, step S206' is performed, otherwise step S207' is performed.
  • step S206' decompressing the old version subfile and the new version subfile respectively, comparing the decompressed old version subfile and the new version subfile, and storing the compared first difference data file in the first storage area, and returning to step S201 '.
  • step S205' when the result of the determination in step S205' is negative, that is, both the old version subfile and the new version subfile do not satisfy the preset decompression condition, the following steps are performed:
  • FIG. 4 is a schematic diagram of a storage structure of an old version compressed file and a new version compressed file in the embodiment
  • FIG. 5 is a schematic diagram of a storage structure of a first buffer area and a second buffer area in the embodiment.
  • FIG. 4 it is assumed that a new version of the subfile file_21 with the address B01 is stored in the new version compressed file, and the old version subfile file_11 with the address A01 is stored in the old version compressed file, and neither the file_21 nor the file_11 satisfy the preset decompression condition.
  • the file_11 is stored in the area of the first buffer area with the address C01
  • the file_21 is stored in the area of the second buffer area with the address D01, as shown in FIG.
  • step S208' determining whether the next old version subfile and the next new version subfile exist at the same time. If the next old version subfile and the next new version subfile exist at the same time, step S209' is performed, otherwise step S212' is performed.
  • the next old version of the subfile refers to the old version of the subfile in the old version of the compressed file that satisfies the following conditions: the storage address is the same as the storage address of the old version of the subfile that was last stored in the first cache in the old version of the compressed file; the next new version A file refers to a new version of a subfile in a new version of a compressed file that satisfies the following conditions: the storage address is consecutive with the storage address of the new version of the subfile that was last stored in the second cache in the new version of the compressed file.
  • step S209' can be continued.
  • step S209' determining whether the next new version subfile corresponds to the next old version subfile, if so, executing step S210', otherwise performing step S212'.
  • step S210' determining whether the next new version subfile and the next old version subfile satisfy the preset decompression condition. If yes, step S212' is performed, otherwise step S211' is performed.
  • step S211' storing the next old version subfile in the first buffer area, and storing the next new version subfile in the second buffer area, and returning to step S208'.
  • the second difference data file is also stored in the first storage area as a subfile of the delta file.
  • the set of all the incremental subfiles stored in the first storage area is an incremental file for recording the difference information between the old version compressed file and the new version compressed file.
  • step S209' it is judged in step S209' whether file_12 and file_22 correspond.
  • step S210' is performed to determine whether both file_12 and file_22 satisfy the preset decompression condition. If both file_12 and file_22 satisfy the preset decompression condition, it indicates that file_22 is also a third type of subfile. Therefore, step S211' is executed to store file_12 in the area of the first buffer area with the address C03 and file_22 into the second cache.
  • the area with the area address D03 is shown in Figure 5.
  • the storage addresses of file_11 and file_12 in the first buffer area are also continuous, and the storage addresses of file_21 and file_22 in the first buffer area are also continuous.
  • step S208' determines that the next new version subfile and/or the next old version subfile does not exist, or step S209' determines that the next new version subfile does not correspond to the next old version subfile, or step S210' determines
  • the next new version of the subfile and the next old version of the subfile meet the preset decompression conditions, it means that there is no next new subfile that satisfies the following conditions: the next new subfile is the third subfile, and the next one The old version of the subfile corresponds to the old version of the subfile corresponding to the old version of the subfile, and the storage address in the old version of the compressed file is continuous.
  • step S212' is performed, all the old version sub-files in the first buffer area are regarded as one whole file, and all new version sub-files in the second buffer area are regarded as one overall file, and the above two whole are directly compared by the direct comparison method. After the file performs a difference comparison, the difference information between the multiple new version subfiles and the corresponding old version subfiles can be obtained.
  • file_11 and file_12 are treated as an overall file file_1, and file_21 and file_22 are treated as a whole file file_2.
  • the sub-files satisfying the following preset conditions can be identified: the plurality of new version sub-files continuously stored are all the third-type sub-files, and the existing version of the compressed file exists and continues.
  • the stored version of the new version of the sub-file corresponds to the old version of the sub-file, and the storage location of the plurality of old version of the sub-file in the old version of the compressed file is also continuous; and thus the plurality of new version of the sub-file continuously stored as a whole file
  • the corresponding plurality of old version sub-files are used as another overall file, and a difference comparison method is performed on the two whole files by a direct comparison method, so that the second difference data file corresponding to the plurality of third-type sub-files continuously stored can be obtained. . Therefore, the embodiment shown in FIG. 3 can reduce the number of executions of the difference comparison, thereby further reducing the time required to generate the delta file and improving the upgrade efficiency.
  • the server performs classification processing on the old version compressed file and the new version compressed file in the stage of performing the difference comparison and generating the incremental file, and adopts different difference comparison methods for different types of subfiles.
  • the corresponding difference data file achieves the purpose of taking into account the incremental file size and the upgrade efficiency.
  • the process of the client performing the merge operation according to the data type in the delta file is as follows:
  • the incremental subfile is a subfile of the delta file, and the delta subfile includes at least one of the first subtype file, the first difference data file, and the second difference data file.
  • step S302. Determine whether the incremental subfile is read. If yes, execute step S303; otherwise, end the flow.
  • step S304 If the incremental subfile is the first type of subfile, store the first type of subfile in the second storage area, and return to step S301.
  • the second storage area is a storage area in the client for storing a new version of the compressed file.
  • the file set stored in the second storage area of the client is the target file of the incremental upgrade, that is, the new version compressed file corresponding to the old version compressed file stored by the client.
  • the embodiment of the present application not only classifies the sub-files in the old version compressed file and the new version compressed file by the server in the incremental file generation stage, but also uses different difference comparison methods for different types of sub-files.
  • the corresponding difference data file achieves the purpose of taking into account the incremental file size and the upgrade efficiency.
  • different merge methods are also adopted according to the type of the subfile of the delta file, which can further improve the incremental upgrade efficiency.
  • a browser uc_browser applied to the Android system is upgraded from the 9.6.0 version to the 9.6.1 version.
  • the traditional direct comparison method is used, the compressed files of the two versions of the apk format are compared as a whole. , the resulting incremental file size is 9410KB. If the compression files of the two versions of the apk format are all decompressed and compared based on the traditional decompression comparison method, the incremental file size is 937 KB, and more than 6000 decompression operations need to be performed during the entire incremental file generation process. (Each version of the compressed file includes more than 3,000 subfiles) and more than 3,000 compression operations (a separate compression operation is performed for each incremental subfile obtained).
  • the incremental upgrade method of the embodiment of the present application is adopted, after classification, there are 8 subfiles in the compressed file of the 9.6.1 version as the second type of subfiles, which need to be decompressed and then compared, so only 16 decompression operations are performed (two Versions of compressed files 8 times each) and 1 compression operation (compress all incremental subfiles into one delta file), and the incremental file size is 881KB.
  • the client-side merge operation only 9 decompression operations (1 decompression for the delta file, 8 decompression for the 9.6.0 version of the compressed file) and 8 compression operations are performed.
  • the eight subfiles obtained by first decompressing and then merging are executed once).
  • the method of the present application can reduce the size of the incremental file compared with the traditional method for implementing the incremental upgrade based on the direct comparison method. Compared with the traditional method for implementing the incremental upgrade based on the decompression comparison method, the present application implements For example, the operation complexity can be reduced and the upgrade efficiency can be improved.
  • an embodiment of the present application provides another incremental upgrade method, including the following steps:
  • the server acquires an old version compressed file and a corresponding new version compressed file.
  • the embodiment of the present application may determine two corresponding compressed files according to the file name and/or the version identifier, and further determine, according to the version numbers of the two compressed files, which compressed file is an old version compressed file, and which compressed file is The new version of the compressed file.
  • the server obtains at least one of a first type of subfile, a second type of subfile, and a third type of subfile.
  • the first type of subfiles are files that exist in the new version of the compressed file but do not exist in the old version of the compressed file;
  • the second type of subfiles are both in the new version of the compressed file and the old version of the compressed file and both A file that satisfies the preset decompression condition, including a second type of subfile in the new version of the compressed file and a second type of subfile in the old version of the compressed file;
  • the third type of subfile is the new version of the compressed file and the old version of the compressed file Files that exist and partially or completely fail to meet the preset decompression conditions, including the third type of subfile in the new version of the compressed file and the third type of subfile in the old version of the compressed file.
  • the server decompresses and compares the second type of subfiles in the new version of the compressed file and the second type of subfiles in the corresponding old version of the compressed file to obtain the first difference data file; the first in the new version of the compressed file
  • the third type of subfile and the corresponding third version of the old version of the compressed file are not decompressed and directly compared to obtain a second difference data file.
  • the first type of subfile in the new version compressed file is a new file compared to the old version compressed file. Therefore, for the first type of subfile, it is not necessary to perform a difference comparison operation, and the first type of subfile is directly used as a subfile of the delta file.
  • the set of the first type of subfile, the first difference data file, and the second difference data file is an incremental file for recording difference information between the old version compressed file and the new version compressed file.
  • the server sends the first type of subfile, the first difference data file, and the second difference data file to the client, so that the client incrementally upgrades the old version of the compressed file stored by the client.
  • the client receives the first type of subfile, the first difference data file, and the second difference data file, and obtains a new version of the compressed file in the following manner: the second version of the compressed version of the old version After the file is decompressed, it is merged with the first difference data file to obtain a first merged subfile, and the first merged subfile is compressed to obtain a first compressed subfile; and the third type of subfile of the old version of the compressed file is The second above
  • the difference data file is merged to obtain a second merged subfile, and the second merged subfile is compressed to obtain a second compressed subfile; the first compressed subfile, the second compressed subfile, and the first subfile are merged to obtain The new version of the compressed file.
  • the preset decompression condition may be: the size before the file compression is greater than the preset byte value, and the compression ratio is less than the preset ratio, but is not limited thereto.
  • the compression ratio is the ratio of the size of the file after compression to the size before compression.
  • the server performs steps S41 to S43 to obtain an incremental file between the old version compressed file and the new version compressed file (including the first type of subfile, the first difference data file, and the first
  • the upgrade prompt information may be sent to the client associated with the client.
  • the client downloads the corresponding incremental file to implement incremental upgrade of the compressed file of the old version stored by itself.
  • the server after receiving the file upgrade request sent by the client, the server sends a corresponding delta file to the client, so that the client incrementally upgrades the old version of the compressed file stored by the client. .
  • the server performs classification processing on the subversion file in the old version compressed file and the new version compressed file in the stage of performing the difference comparison and generating the incremental file, Different types of sub-files use different difference comparison methods to obtain different types of difference data files, and then obtain incremental files with multiple types of sub-files, achieving the purpose of both incremental file size and upgrade efficiency.
  • the server sends the obtained incremental file to the client, so that the client can adopt different merge methods according to the type of the subfile of the incremental file, which can further improve the incremental upgrade efficiency.
  • the embodiment of the present application further provides an incremental upgrade method, including the following steps:
  • the client obtains an incremental file from the server, where the incremental file includes at least one of a first type of subfile, a first difference data file, and a second difference data file.
  • the first type of subfile is a file that exists in the new version of the compressed file but does not exist in the old version of the compressed file; the first difference data file exists in both the new version of the compressed file and the old version of the compressed file.
  • the file that meets the preset decompression condition is decompressed and compared by the difference;
  • the second difference data file is that the server has both the new version of the compressed file and the old version of the compressed file, and some or all of the preset decompression conditions are not satisfied.
  • the file is not decompressed and the data obtained by comparing the differences directly.
  • the first type of subfile is a file that exists in the new version of the compressed file but does not exist in the old version of the compressed file
  • the first difference data file is the second type of subfile in the new version of the compressed file and the corresponding old version is compressed
  • the second type of subfile in the file is decompressed and compared, and the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and that meets the preset decompression conditions
  • the second difference The data file is a file obtained by directly comparing the difference between the third type of subfile in the new version of the compressed file and the third type of the subfile in the corresponding old version of the compressed file, wherein the third file is obtained.
  • the class subfile is a file that exists in both the new version compressed file and the old version compressed file and partially or completely does not satisfy the preset decompression condition.
  • S52 The client performs a merge operation on the obtained delta file and the old version compressed file stored by itself according to the file type in the obtained delta file, to obtain a new version compressed file.
  • the delta file includes a first type of subfile, a first difference data file, and a second difference data file
  • the client performs a merge operation in the following manner to obtain a new version of the compressed file: the second version of the old version is compressed.
  • the class file is decompressed, it is merged with the first difference data file to obtain a first merged subfile, and the first merged subfile is compressed to obtain a first compressed subfile; and the third version of the old version is compressed.
  • the preset decompression condition may be: the size before the file compression is greater than the preset byte value, and the compression ratio is less than the preset ratio, but is not limited thereto.
  • the compression ratio is the ratio of the size of the file after compression to the size before compression.
  • the first difference data file is merged to obtain a first merged subfile, and the first merged subfile is compressed.
  • get the first compressed subfile including the following steps:
  • the client reads and stores the file data header in the first difference data file
  • the embodiment of the present application further provides a server 500 and a client 600, respectively.
  • the server 500 is configured to generate a delta file of a new version of the compressed file relative to the old version of the compressed file, and the client 600 acquires the delta file and performs an incremental upgrade of the local old version of the compressed file.
  • the client 600 obtains the delta file, and may send the file upgrade request to the server 500 to enable the server 500 to feed back the corresponding delta file; or the server 500 may actively generate the delta file after the incremental file is generated.
  • the client 600 sends an upgrade prompt message to remind the client 600 to download the delta file to upgrade the local file.
  • a server 500 provided by a feasible embodiment of the present application mainly includes: a first obtaining module 510, a first comparing module 520, a second comparing module 530, and a generating module 540.
  • the first obtaining module 510 is configured to obtain at least one of a first type of subfile, a second type of subfile, and a third type of subfile; wherein the first type of subfile exists in a new version of the compressed file.
  • the file that does not exist in the old version of the compressed file; the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and that meets the preset decompression conditions, including the second in the new version of the compressed file.
  • the third type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and partially or completely does not satisfy the preset decompression condition, including The third type of subfile in the new version of the compressed file and the third type of subfile in the old version of the compressed file.
  • the preset decompression condition may be: the size before the file compression is greater than the preset byte value and the compression ratio is less than the preset ratio, but is not limited thereto.
  • the compression ratio is the ratio of the size of the file after compression to the size before compression.
  • the first comparison module 520 is configured to decompress and perform the second type of subfiles in the new version of the compressed file and the second type of subfiles in the corresponding old version of the compressed file when the obtained file includes the second type of subfile. The difference is compared to obtain the first difference data file.
  • the second comparison module 530 is configured to: when the obtained file includes the third type of subfile, the third type of subfile in the new version of the compressed file and the third subfile in the corresponding old version of the compressed file are not decompressed directly A difference comparison is made to obtain a second difference data file.
  • the generating module 540 is configured to generate, according to the obtained at least one of the first type of subfile, the first difference data file, and the second difference data file, an incremental file for the client to perform file increment upgrade.
  • the client after receiving the first type of subfile, the first difference data file, and the second difference data file, the client obtains a new version of the compressed file in the following manner: the second version of the compressed file is the second version.
  • the class file After the class file is decompressed, it is merged with the first difference data file to obtain a first merged subfile, and the first merged subfile is compressed to obtain a first compressed subfile; and the third version of the old version is compressed.
  • Combining the file with the second difference data file to obtain a second merged subfile compressing the second merged subfile to obtain a second compressed subfile; combining the first compressed subfile, the second compressed subfile, and the first Class subfile, get the new version of the compressed file.
  • a server optimized for the server 500 shown in FIG. 10 is as shown in FIG.
  • the first comparison module 520 includes: a first writing module 5201, a file data header configured to be a second type of subfile of the new version compressed file is written into the storage area; and the decompression comparison module 5202 is configured to compress the new version file.
  • the second type of subfile and the corresponding second version of the old version of the compressed file are decompressed and compared to obtain a first difference data;
  • the second writing module 5203 is configured to write the obtained first difference data.
  • the first merge module 5204 is configured to be based on the file data of the second type of subfile continuously stored. Head and first difference data, get The first difference data file.
  • the second comparison module 530 includes: a determining module 5301 configured to determine that a plurality of third type subfiles having consecutive storage addresses exist in the new version compressed file, and determining a plurality of corresponding thirds in the old version compressed file
  • the storage address of the class subfile is also continuous
  • the integration module 5302 is configured to store a plurality of third type subfiles with consecutive storage addresses in the new version of the compressed file as a whole file, and store the plurality of consecutive addresses in the compressed file of the old version.
  • the three types of sub-files are used as another overall file
  • the direct comparison module 5303 is configured to directly perform difference comparison on the two entire files without decompressing to obtain a second difference data file.
  • the server 500 of the embodiment further includes: a triggering module 550, configured to obtain, in the first type of subfile, the second type of subfile, and the third type of subfile in the new version of the compressed file by the first obtaining module 510.
  • a triggering module 550 configured to obtain, in the first type of subfile, the second type of subfile, and the third type of subfile in the new version of the compressed file by the first obtaining module 510.
  • Receiving, at least one, and at least one of the first type of subfile, the second type of subfile, and the third type of subfile in the old version of the compressed file receiving a file upgrade request sent by the client; When the file upgrade request is requested, the first acquiring module is triggered to execute.
  • the server provided by the embodiment of the present application performs classification processing on the subversion files in the old version compressed file and the new version compressed file in the stage of performing the difference comparison and generating the incremental file, and different types of sub-files.
  • the file uses different difference comparison methods to obtain the difference data file of the corresponding type, and then obtains the incremental file with multiple types of subfiles, thereby achieving the purpose of both the incremental file size and the upgrade efficiency.
  • the server sends the obtained incremental file to the client, so that the client can adopt different merge methods according to the type of the subfile of the incremental file, which can further improve the incremental upgrade efficiency.
  • a client 600 of the present application includes a second obtaining module 610, a second merge module 620, and an incremental upgrade module 630.
  • the second obtaining module 610 is configured to obtain an incremental file from the server, where the incremental file includes at least one of a first type of subfile, a first difference data file, and a second difference data file.
  • the first type of subfile is a file that exists in the new version of the compressed file but does not exist in the old version of the compressed file;
  • the first difference data file is the second type of subfile in the new version of the compressed file and the corresponding old version of the compressed file.
  • the second type of subfiles are decompressed and compared, and the second type of subfiles are files that exist in both the new version of the compressed file and the old version of the compressed file and that meet the preset decompression conditions;
  • the second difference data file is The third type of subfile in the new version of the compressed file and the third type of subfile in the corresponding old version of the compressed file are not decompressed and directly compared, and the third type of subfile is a new version of the compressed file and the old version is compressed. Files that exist in the file and that partially or completely do not meet the preset decompression conditions.
  • the second merge module 620 is configured to use the delta file to obtain a new version of the compressed file.
  • the second merge module 620 may perform a merge operation on the obtained delta file and the old version compressed file stored by itself according to the file type in the obtained delta file to obtain a new version compressed file.
  • the second merge module 620 performs the merge operation in the following manner to obtain a new version of the compressed file: After decompressing the second type of subfile of the old version compressed file, merge with the first difference data file to obtain the first merged subfile, and compress the first merged subfile to obtain the first compressed subfile; The third type of subfile of the compressed file is merged with the second difference data file to obtain a second merged subfile, and the second merged subfile is compressed to obtain a second compressed subfile; the first compressed subfile is merged, and the first compressed subfile is merged The second compressed subfile and the first subfile get the new version of the compressed file.
  • the incremental upgrade module 630 is configured to incrementally upgrade files using the new version of the compressed file.
  • the preset decompression condition may be: the size before the file compression is greater than the preset byte value, and the compression ratio is less than the preset ratio, but is not limited thereto.
  • the compression ratio is the ratio of the size of the file after compression to the size before compression.
  • the second merge module 620 uses the delta file to obtain the new version of the compressed file and also includes:
  • the first subfile is used to obtain a new version of the compressed file
  • the second type of the sub-file of the old version of the compressed file is decompressed, and then merged with the first difference data file to obtain the first merged subfile, and the first merged subfile is obtained. Compressing to obtain the first compressed subfile; using the first compressed subfile to obtain a new version of the compressed file;
  • the third sub-file of the old version compressed file is merged with the second difference data file to obtain a second merge sub-file, and the second merge sub-file is compressed to obtain a second compressed subfile; using the second compressed subfile to obtain a new version of the compressed file;
  • the second type of the sub-file of the old version of the compressed file is decompressed, and then merged with the first difference data file to obtain the first merged sub-file. Compressing the first merged subfile to obtain a first compressed subfile; combining the first compressed subfile and the first type of subfile to obtain a new version of the compressed file;
  • the third type of subfile of the old version of the compressed file is merged with the second difference data file to obtain a second merged subfile, and the second merged
  • the subfile is compressed to obtain a second compressed subfile; the second compressed subfile and the first subfile are merged to obtain a new version of the compressed file;
  • the second type of the sub-file of the old version of the compressed file is decompressed, and then merged with the first difference data file to obtain the first merged sub-file. Compressing the first merged subfile to obtain the first compressed subfile; the third type of subfile of the old version of the compressed file and the second The difference data file is merged to obtain a second merged subfile, and the second merged subfile is compressed to obtain a second compressed subfile; the first compressed subfile and the second compressed subfile are merged to obtain a new version of the compressed file.
  • the second merge module 620 decompresses the second type of subfile of the old version compressed file, merges with the first difference data file, obtains the first merged subfile, and compresses the first merged subfile to obtain the first Compressing the subfile includes: reading and storing the file data header in the first difference data file; reading the second type of subfile corresponding to the first difference data in the old version compressed file; and reading the second type of subfile The file is decompressed; the decompressed second type subfile is merged with the first difference data file to obtain a first merged subfile; and the file header and the first merged subfile are compressed to obtain a first compressed subfile.
  • the method according to the present application can also be implemented as a computer program executed by a CPU.
  • the computer program is executed by the CPU, the above-described functions defined in the method of the present application are performed.
  • the embodiment of the present application further provides a computer readable medium having program code executable by a processor, wherein the program code causes the processor to perform the following steps:
  • the second type of subfiles; the third type of subfiles are files that exist in the new version of the compressed file and the old version of the compressed file and that partially or completely fail to meet the preset decompression conditions, including the third class in the new version of the compressed file.
  • the second sub-file in the new version of the compressed file and the second sub-file in the corresponding old compressed file are decompressed and compared to obtain the first difference data.
  • the first type of subfile, the first difference data, and the second difference data are sent to the client, so that the client incrementally upgrades the old version of the compressed file stored by the client.
  • the preset decompression condition includes: the size before the file compression is greater than the preset byte value, and the compression ratio is less than the preset ratio; the compression ratio is a ratio of the size of the file after compression to the size before compression.
  • a server 500 provided by a possible embodiment of the present application includes a processor 501 and the above computer readable medium 502.
  • the processor 501 can execute the program code in the computer readable medium 502 to implement the new version of the compressed file and the old version of the compressed file. Comparing the differences between the two, the corresponding incremental file is obtained. Compared with the traditional device based on the direct comparison method and the decompression comparison method, the device can ensure that the incremental file is smaller and the efficiency of the difference comparison is better. high.
  • the embodiment of the present application further provides a computer readable medium having program code executable by a processor, wherein the program code causes the processor to perform the following steps:
  • the delta file includes at least one of a first type of subfile, a first difference data file, and a second difference data file; wherein the first type of subfile is compressed in a new version a subfile that exists in the file but does not exist in the old version of the compressed file; the first difference data file is decompressed for the second type of subfile in the new version of the compressed file and the second subtype of the corresponding old version of the compressed file And the file obtained by the difference comparison, the second type of subfile is a file that exists in both the new version of the compressed file and the old version of the compressed file and both meet the preset decompression condition; the second difference data file is the first in the new version of the compressed file.
  • the third type of subfiles and the third type of subfiles in the corresponding old version of the compressed file are not decompressed and directly obtained by differential comparison.
  • the third type of subfile exists in the new version of the compressed file and the old version of the compressed file and partially or completely Files that do not meet the preset decompression conditions:
  • the first difference data file and the second difference data file are executed in the following manner to obtain a new version of the compressed file: after decompressing the second type of subfile of the old version of the compressed file, and merging with the first difference data file Obtaining a first merged subfile, compressing the first merged subfile, and obtaining a first compressed subfile; combining the third type of subfile of the old version of the compressed file with the second differential data file to obtain a second merged sub File, compressing the second merged subfile to obtain a second compressed subfile; combining the first compressed subfile, the second compressed subfile, and the first type of subfile to obtain a new version of the compressed file;
  • the preset decompression condition includes: the size before the file compression is greater than the preset byte value, and the compression ratio is less than the preset ratio; the compression ratio is a ratio of the size of the file after compression to the size before compression.
  • the client reading and storing the file data header in the first difference data file; reading the second type subfile corresponding to the first difference data file in the old version compressed file; The second type of subfile is decompressed; the decompressed second type subfile is merged with the first difference data file to obtain the first merged subfile; The data header and the first merged subfile are compressed to obtain a first compressed subfile.
  • a client 600 provided by a possible embodiment of the present application includes a processor 601 and the above computer readable medium 602.
  • the processor 601 executes program code in the computer readable medium 602 and executes it in the client 600.
  • the merge operation of the old version of the compressed file and the corresponding incremental file, the corresponding new version of the compressed file is obtained, and the incremental upgrade of the old version of the compressed file is implemented.
  • a computer readable medium eg, a memory
  • a volatile memory can be a volatile memory or a nonvolatile memory, or can include both volatile and nonvolatile memory.
  • non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash.
  • ROM read only memory
  • PROM programmable ROM
  • EPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • flash volatile memory
  • Volatile memory can include random access memory (RAM), which can act as external cache memory.
  • RAM can be obtained in a variety of forms, such as synchronous RAM (DRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM) and direct Rambus RAM (DRRAM).
  • DRAM synchronous RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Synchronous Link DRAM
  • DRRAM direct Rambus RAM
  • Storage devices of the disclosed aspects are intended to comprise, without being limited to, these and other suitable types of memory.

Landscapes

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

Abstract

公开了一种增量升级方法及装置,服务器(500)在生成增量文件时,首先获得旧版本压缩文件和新版本压缩文件中的不同类型的子文件,然后对不同类型的子文件执行不同的差异比较步骤,得到对应类型的差异数据文件,对于满足预设解压条件的子文件采用解压比较法执行差异比较,可以减小差异数据的大小,对于不满足预设解压条件的子文件采用直接比较法执行差异比较,可以提交差异比较的效率,进而客户端(600)从服务器(500)获取差异数据文件,并根据差异数据文件的类型,执行对差异数据文件和旧版本压缩文件的合并操作,得到新版本压缩文件,也可以提高合并操作的效率。

Description

增量升级方法及装置 技术领域
本申请涉及数据处理技术领域,特别是涉及一种增量升级方法及装置。
背景技术
版本升级是指对操作系统或软件旧版本的漏洞进行完善,或者对软件添加新的应用功能的更新,使软件更加完善好用。增量升级为一种常用的版本升级方法,其基本原理为:服务器比较旧版本文件和新版本文件,生成用于记录所述旧版本文件和新版本文件之间的差异信息的增量文件;客户端下载所述增量文件,并将所述增量文件与自身的旧版本文件进行合并,得到对应的新版本文件,安装该新版本文件后即完成版本升级。相对于通过下载整个新版本文件来执行升级的方式,上述增量升级方法消耗的数据流量更少、占用的时间更短、升级效率更高,因而得到广泛应用。
通常地,各个版本文件均为包含多个子文件的压缩文件。有鉴于此,传统的增量升级过程中主要通过直接比较法或解压比较法得到增量文件。
其中,所述直接比较法即将旧版本文件和新版本文件分别作为一个整体文件直接进行比较;该方法比较效率较高,但得到的增量文件会很大,甚至接近新版本文件的大小,不利于客户端下载该增量文件。例如,相对于旧版本文件,新版本文件中相对应的每个子文件都未修改,只是更改了子文件的压缩顺序,但从整体文件的角度来看,两个文件仍然是完全不同的,故采用直接比较法得到的增量文件会很大。
所述解压比较法具体为:将旧版本文件和新版本文件中的子文件分别解压,对解压后得到的旧版本文件和新版本文件中相对应(如文件名相同)的子文件进行比较,得到增量文件。相对于直接比较法,解压比较法虽然可以解决子文件顺序改变导致的整体文件差异较大的问题,有效减小增量文件的大小,但是执行过程中一般需要执行几千次的解压缩、再压缩操作,导致升级效率较低。
发明内容
本申请实施例中提供了一种增量升级方法及装置,以解决常用增量升级方法无法兼顾增量文件大小和升级效率的问题。
为了解决上述技术问题,本申请实施例公开了如下技术方案:
本申请第一方面,提供了一种增量升级方法,包括:
服务器获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足所述预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件;
当获得的文件中包括第二类子文件时,服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;
当获得的文件中包括第三类子文件时,服务器对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件;
服务器根据得到的第一类子文件、第一差异数据文件和第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
本申请第二方面,提供了一种增量升级方法,包括:
客户端从服务器获取增量文件,其中,所述增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;所述第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足所述预设解压条件的文件;
所述客户端使用增量文件得到新版本压缩文件,包括:当所述增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第一压缩子文件、所述第二压缩子文件以及所述第一类子文件,得到新版本压缩文件;
所述客户端使用新版本压缩文件进行文件的增量升级。
本申请第三方面,提供了一种服务器,包括:
第一获取模块,配置为获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件;
第一比较模块,配置为当获得的文件中包括第二类子文件时,对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;
第二比较模块,配置为当获得的文件中包括第三类子文件时,对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件;
生成模块,配置为根据得到的所述第一类子文件、所述第一差异数据文件以及所述第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
本申请第四方面,提供了一种客户端,包括:
第二获取模块,配置为从服务器获取增量文件,其中,所述增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;所述第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件;
第二合并模块,配置为使用增量文件得到新版本压缩文件,包括:当所述增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩, 得到第二压缩子文件;合并所述第一压缩子文件、所述第二压缩子文件以及所述第一类子文件,得到新版本压缩文件;
增量升级模块,配置为使用新版本压缩文件进行文件的增量升级。
本申请第五方面,提供了一种包含程序指令的计算机程序,当所述计算机程序在服务器上运行时,引发所述服务器执行上述服务器端的增量升级方法。
本申请第六方面,提供了一种计算机可读介质,其中存储了根据第五方面所述的计算机程序。
本申请第七方面,提供了另一种包含程序指令的计算机程序,当所述计算机程序在客户端上运行时,引发所述客户端执行上述客户端的增量升级方法。
请第八方面,提供了另一种计算机可读介质,其中存储了根据第七方面所述的计算机程序。
由以上技术方案可见,本申请实施例中,服务器在生成增量文件时,首先获得旧版本压缩文件和新版本压缩文件中不同类型的子文件,然后对不同类型的子文件执行不同的差异比较步骤,得到对应类型的差异数据文件。然后,对于满足预设解压条件的子文件采用解压比较法执行差异比较,可以减小差异数据的大小,对于不满足预设解压条件的子文件采用直接比较法执行差异比较,可以提高差异比较的效率。进而,服务器根据得到的第一类子文件、第一差异数据文件和第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。相应地,客户端从服务器获取增量文件后,可以根据增量文件中的子文件的类型执行不同的操作,得到新版本压缩文件。尤其是对于差异数据文件,可以根据差异数据文件的类型,执行对差异数据文件和旧版本压缩文件的合并操作,得到新版本压缩文件,从而提高了合并操作的效率。因此,相对于传统单一的基于直接比较法或基于解压比较法实现的增量升级,本申请可以达到兼顾增量文件大小和升级效率两个方面的目的。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种增量升级方法的流程示意图;
图2为本申请实施例提供的增量升级方法中生成增量文件的一种流程示意图;
图3为本申请实施例提供的增量升级方法中生成增量文件的另一种流程示意图;
图4为本申请实施例中旧版本压缩文件和新版本压缩文件的存储结构示意图;
图5为本申请实施例中第一缓存区和第二缓存区的存储结构示意图;
图6为本申请实施例提供的增量升级方法中客户端执行合并操作的流程示意图;
图7为本申请实施例提供的另一种增量升级方法的流程示意图;
图8为本申请实施例提供的又一种增量升级方法的流程示意图;
图9为本申请实施例提供的实现增量升级的服务器和客户端的关系示意图;
图10为本申请实施例提供的一种服务器的结构框图;
图11为本申请实施例提供的一种优化后的服务器的结构框图;
图12为本申请实施例提供的一种客户端的结构框图;图13为本申请实施例提供的另一种服务器的结构框图;
图14为本申请实施例提供的另一种客户端的结构框图。
具体实施方式
本申请实施例提供一种增量升级方法及装置,以解决常用增量升级方法无法兼顾增量文件大小和升级效率的问题。
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1为本申请实施例提供的一种增量升级方法的流程图。
本实施例首先从包括服务器和客户端的整体系统角度对本申请的增量升级方法进行说明。参见图1,本实施例提供的增量升级方法包括以下步骤:
S11、服务器获取新版本压缩文件和对应的旧版本压缩文件。
可选地,本申请实施例可以根据文件名称和/或版本标识符确定相对应的两个压缩文件,进而根据两个压缩文件的版本号确定哪个压缩文件是旧版本压缩文件,哪个压缩文件是新版本压缩文件。
例如,服务器中有名称均为uc_browser.apk的两个压缩文件,则这两个压缩文件为相对应的两个压缩文件;进一步地,这两个压缩文件中,一个压缩文件的版本号为9.6.0,另一个压缩文件的版本号为9.6.1,则可以确定后者的版本号更高,为新版本文 件,故可以确定:版本号为9.6.0的压缩文件为旧版本压缩文件,版本本号为9.6.1的压缩文件为新版本压缩文件。
S12、服务器获得第一类子文件、第二类子文件、第三类子文件中的至少一种。
本实施例中,第一类子文件为在新版本压缩文件中存在而在旧版本压缩文件中不存在的文件;第二类子文件为新版本压缩文件和旧版本压缩文件中都存在的且都满足预设解压条件的文件,该第二类子文件包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;第三类子文件为新版本压缩文件和旧版本压缩文件中都存在的且部分或全部不满足预设解压条件的文件,该第三类子文件包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件。
本申请实施例的压缩文件(包括旧版本压缩文件和新版本压缩文件),是指由多个压缩子文件按一定顺序存储,得到的一个文件。更具体地,压缩文件格式可以为zip格式,对应的常见文件包括apk格式的文件、大部分游戏资源文件、以及一些大型应用的数据文件。但不限于此,本领域技术人员应当明了,其它格式的压缩文件也同样适用本申请的增量升级方案。以新版本压缩文件为例,可以根据功能等因素将新版本压缩文件中的数据分组,将每组中的数据和/或子文件分别压缩,得到多个压缩子文件,将这些压缩子文件按照预定的顺序排列,即得到新版本文件的压缩文件,即,新版本压缩文件。
本申请中,以新版本子文件表示新版本压缩文件中的子文件,以旧版本子文件表示旧版本压缩文件中的子文件。例如,对于某一新版本子文件A,如果不存在与其对应的旧版本子文件A’,则该新版本子文件A即为第一类子文件。
再如,对于另一新版本子文件B,如果存在与其对应的旧版本子文件B’,且该新版本子文件B和对应的旧版本子文件B’都满足预设解压条件,则该新版本子文件B即为新版本压缩文件中的第二类子文件,该对应的旧版本子文件B’即为旧版本压缩文件中的第二类子文件。
又如,对于又一新版本子文件C,如果存在与其对应的旧版本子文件C’,且该新版本子文件C和对应的旧版本子文件C’部分或全部不满足上述预设解压条件(即:或者该新版本子文件C不满足预设解压条件,或者对应的旧版本子文件C’不满足预设解压条件,或者该新版本子文件C和对应的旧版本子文件C’都不满足预设解压条件),则该新版本子文件C即为新版本压缩文件中的第三类子文件,该对应的旧版本子文件C’即为旧版本压缩文件中的第三类子文件。
需要说明的是,上述处理完成后,如果只得到第一类子文件,说明新版本子文件全部为新增文件,而不是在旧版本子文件的基础上修改得到的。如果上述处理完成后,只得到第二类子文件或只得到第三类子文件,说明新版本子文件都是在对应的旧版本子 文件的基础上修改得到的。同样,如果上述处理完成后,既得到了第二类子文件又得到了第三类子文件,也说明新版本子文件都是在对应的旧版本子文件的基础上修改得到的。而如果同时得到了第一类子文件、第二类子文件和第三类子文件,则说明新版本子文件既有新增文件,又有在对应的旧版本子文件的基础上修改得到的文件。
本实施例所述的新版本子文件与旧版本子文件对应,是指该新版本子文件和旧版本子文件实现的功能相同(或相似)。实际应用中,相对应的子文件的文件名是相同的,因此,可以通过在旧版本压缩文件中查找文件名与新版本子文件的文件名相同的子文件,查找到的子文件即为与新版本子文件对应的旧版本子文件。
常用的增量升级方式中,对压缩文件中所有的数据或子文件采用同一种差异比较方式,以得到相应的增量文件。然而,经过研究发现,不同的子文件对应的最优差异比较方式可能不同。
例如,有些文件压缩前后的大小差异很小甚至无差异,相应地,采用解压比较法和直接比较法得到的两种差异数据的大小也差异不大。然而,由于解压比较法需要多次执行解压缩操作,故执行效率相对于直接比较法较低。因此,对于此类文件,优选的差异比较方式为直接比较法。
又如,对于压缩前后大小差异较大的文件,虽然采用解压比较法需要牺牲一定的执行效率,但由于解压后得到的数据颗粒度更小,可以识别旧版本子文件和新版本子文件中内容相同但顺序关系不同的数据,避免因数据排列顺序的改变导致文件整体差异较大的问题,故得到的差异数据的大小远小于采用直接比较法得到的差异数据的大小。因此,对于此类文件,优选的差异比较方式为解压比较法。
有鉴于此,本申请实施例根据预设解压条件区分上述两类文件,以便于对每类文件采用最优的差异比较方式。
S13、当获得的文件中包括第二类子文件时,服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件。
其中,第一差异数据文件为包含有服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较后,获得的差异数据。也即,第一差异数据文件是获得的该差异数据生成的文件。
S14、当获得的文件中包括第三类子文件时,服务器对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件。
其中,第二差异数据文件为包含有服务器对新版本压缩文件中的第三类子文件以 及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较后,获得的差异数据。也即,第二差异数据文件是获得的该差异数据生成的文件。
上述第一类子文件、第一差异数据文件和第二差异数据文件的集合,即为记录旧版本压缩文件和新版本压缩文件之间的差异信息的增量文件;每个第一类子文件、每个第一差异数据文件以及每个第二差异数据文件分别为一个增量子文件。需要说明的是,在实际使用中,有可能得到的文件为上述第一类子文件、第一差异数据文件和第二差异数据文件中的部分而非全部,同样地,得到的该部分文件的集合即为记录旧版本压缩文件和新版本压缩文件之间的差异信息的增量文件。如,仅包括第一类子文件的集合、仅包括第一差异数据文件的集合、仅包括第二差异数据文件的集合;又或者,仅包括第一类子文件和第一差异数据文件的集合、仅包括第一类子文件和第二差异数据文件的集合、仅包括第一差异数据文件和第二差异数据文件的集合,依此类推。
本实施例中,对于第一类子文件,由于旧版本压缩文件中不存在第一类子文件,即:相对于旧版本压缩文件,新版本压缩文件中的第一类子文件为新增文件。因此,对于第一类子文件,不需要执行差异比较操作,直接将该第一类子文件作为增量文件的一个子文件即可。
本实施例中,对于满足预设解压条件的第二类子文件,采用先解压后比较的差异比较方式,可以减小相应的增量子文件的大小,进而减小增量文件的大小;对于不满足预设解压条件的第三类子文件,采用直接比较方式,可以缩短差异比较所用的时间,提高增量文件的生成效率,进而提高增量升级效率。
本申请实施例中,对不同类型的新版本子文件和旧版本子文件执行不同的差异比较操作,可以达到兼顾增量子文件大小和差异比较效率的目的。
S15、服务器根据得到的第一类子文件、第一差异数据文件和第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
可选地,服务器可以将得到的所有增量子文件压缩为一个文件。例如,将第一类子文件、第一差异数据文件和第二差异数据文件压缩为一个文件,得到压缩文件形式的增量文件,以便于完整准确地发送/下载该增量文件。同样,当得到的只有第一类子文件、第一差异数据文件和第二差异数据文件中的部分文件时,将得到的部分文件压缩为一个文件即可。当然,也可以不进行合并压缩,每个增量子文件单独存在。也即,增量文件中包括多个单独的上述文件。
S16、客户端从服务器获取增量文件,该增量文件包括上述第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种。
S17、客户端根据获取到的增量文件中的子文件的文件类型,对获取到的增量文 件和自身存储的旧版本压缩文件执行合并操作,得到新版本压缩文件。
本实施例中,以增量文件中同时包括第一类子文件、第一差异数据文件和第二差异数据文件为例,则客户端可以按照以下方式执行合并操作,得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。
可选地,客户端可以设置新版本压缩文件存储区,并按照以下方式执行合并操作:将上述第一类子文件直接存入该新版本压缩文件存储区;将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,然后将合并后的数据进行压缩,得到第一压缩子文件,并将该第一压缩子文件存入新版本压缩文件存储区;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,将合并后的数据进行压缩,得到第二压缩子文件,并将该第二压缩子文件存入新版本压缩文件存储区。合并操作执行完后,新版本压缩文件存储区中存储的文件集合即为新版本压缩文件。
参照上述新版本压缩文件获取方案,则:
当增量文件中仅包括第一类子文件时,使用第一类子文件得到新版本压缩文件。此时,可以将该第一类子文件直接作为新版本压缩文件。
当增量文件中仅包括第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;使用第一压缩子文件得到新版本压缩文件。此时,可以将该第一压缩子文件直接作为新版本压缩文件。
当增量文件中仅包括第二差异数据文件时,将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;使用第二压缩子文件得到新版本压缩文件。此时,可以直接将该第二压缩子文件直接作为新版本压缩文件。
当增量文件中仅包括第一类子文件和第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件;合并第一压缩子文件和第一类子文件,得到新版本压缩文件。
当增量文件中仅包括第一类子文件和第二差异数据文件时,将旧版本压缩文件的第三类子文件与第二差异数据文件合并,得到第二合并子文件,对第二合并子文件进行 压缩,得到第二压缩子文件;合并第二压缩子文件和第一类子文件,得到新版本压缩文件。
当增量文件中仅包括第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与第二差异数据文件合并,得到第二合并子文件,对第二合并子文件进行压缩,得到第二压缩子文件;合并第一压缩子文件和第二压缩子文件,得到新版本压缩文件。
S18、客户端使用新版本压缩文件进行文件的增量升级。
由上述技术方案可知,本申请实施例提供的增量升级方法,服务器在生成增量文件时,首先获得旧版本压缩文件和新版本压缩文件中不同类型的子文件,然后对不同类型的子文件执行不同的差异比较步骤,得到对应的差异数据文件。然后,将新版本压缩文件中存在而在旧版本压缩文件中不存在的第一类子文件作为新增数据,对不满足预设解压条件的第三类子文件采用比较效率更高的直接比较法得到对应的第二差异数据文件,对满足预设解压条件的第二类子文件采用可以使差异数据较小的解压比较法得到对应的第一差异数据文件。进而,服务器根据得到的第一类子文件、第一差异数据文件和第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。相应地,客户端从服务器获取上述第一类子文件、第一差异数据文件以及第二差异数据文件,并将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对上述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对上述第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。因此,本申请实施例根据压缩文件中子文件的类型选择对应的差异比较方式及合并操作方式,对于整个增量升级过程而言,可以达到兼顾增量文件大小和升级效率两个方面的目的。
可选地,本申请实施例中,预设解压条件可以为:文件压缩前的大小大于预设字节值且压缩率小于预设比值。但不限于此,在实际应用中,本领域技术人员可以参照该预设解压条件设置其它适当解压条件,以实现本申请的增量升级方案。
其中,预设字节可以设置为100KB,但不限于此;压缩率为文件压缩后的大小与压缩前的大小之比,可以设置为70%,但不限于此。
在本申请一个可行的实施例中,服务器在执行步骤S11至S15,得到旧版本压缩文件和新版本压缩文件之间的增量文件后,可以向与其关联的客户端发送升级提示信息,客户端接收到该升级提示信息后,下载相应的增量文件,实现对自身存储的旧版本压缩 文件的增量升级。
上述升级提示信息包括该增量文件对应的新版本压缩文件的版本信息;版本信息至少包括文件名、版本号等。可选地,客户端可以无条件下载接收到的每条升级提示信息对应的增量文件;也可以根据接收到的升级提示信息中版本信息及自身存储或安装的文件的版本信息判断是否对本地文件升级,如果需要升级,则下载该升级提示信息对应的增量文件,如果不需要升级或者不存在对应的旧版本文件,则不下载该升级提示信息对应的增量文件。
例如,客户端接收到的升级提示信息中携带的版本信息如下:文件名为uc_browser.apk、版本号为9.6.1;如果客户端自身存储或安装的文件中不存在名称为uc_browser.apk的文件,或者,存在名称为uc_browser.apk、版本号为9.6.1的文件,说明客户端不需要下载该升级提示信息对应的增量文件;如果客户端自身存储或安装的文件中存在名称为uc_browser.apk、版本号为9.6.0的文件,即版本号低于该升级提示信息对应的新版压缩文件的版本号,说明有必要对客户端中的uc_browser.apk文件进行升级,此时,客户端下载该升级提示信息对应的增量文件。
在本申请另一个可行的实施例中,客户端可以主动向服务器发送文件升级请求,服务器接收到上述文件升级请求后,向客户端发送相应的增量文件,以供客户端对自身存储的旧版本压缩文件进行增量升级。
上述文件升级请求包括客户端中存储或安装的文件的版本信息。服务器接收到来自客户端的文件升级请求后,查找是否存在对应的增量文件,如果存在,则将该增量文件发送至该客户端。可选地,如果服务器中不存在与文件升级请求对应的增量文件,服务器可以向客户端返回相应的提示信息,如“无新版本”、“当前版本已为最新版本”等。
例如,服务器接收到的文件升级请求中携带的版本信息如下:文件名为uc_browser.apk、版本号为9.6.0。如果服务器查找到自身存储有满足如下升级条件的增量文件:该增量文件对应的旧版本压缩文件和新版本压缩文件的文件名均为uc_browser.apk,且旧版本压缩文件的版本号为9.6.0、新版本压缩文件的版本号高于9.6.0(如9.6.1或9.6.2等),则服务器将该增量文件发送至客户端。如果服务器存储的增量文件均不满足上述升级条件(即增量文件对应的旧版本压缩文件/新版本压缩文件的文件名不为uc_browser.apk,或者,对应的旧版本压缩文件的版本号不为9.6.0,或者,对应的新版本压缩文件的版本号均不高于9.6.0),说明不存在更高版本的uc_browser.apk文件。此时,服务器可以向客户端返回相应的提示信息。
在本申请一个可行的实施例中,可以在完成对新版本压缩文件中所有新版本子文件的分类后,即确定每个新版本子文件的类型后,再根据分类结果生成相应的差异数据 文件。
在本申请另一可行的实施例中,还可以在确定一个新版本子文件的类型后,立即执行相应的操作以生成该新版本子文件对应的差异数据文件,如图2和图3所示。图2和图3分别为一种实施例流程图,应用于服务器,以实现旧版本压缩文件和新版本压缩文件之间的差异比较,得到相应的增量文件(即上述步骤S12至S15)。
参考图2,在本申请一个可行的实施例中,服务器根据获取到的旧版本压缩文件和新版本压缩文件生成相应的增量文件的步骤如下:
S201、判断新版本压缩文件中的新版本子文件是否已全部被读取,如果是,则结束本流程,否则执行步骤S202。
S202、读取下一个新版本子文件。
S203、判断旧版本压缩文件中是否存在与读取到的新版本子文件对应的旧版本子文件,如果存在,则执行步骤S205,否则执行步骤S204。
S204、将新版本子文件存储于用于存储增量文件的第一存储区,并返回步骤S201。
当旧版本压缩文件中不存在与读取到的新版本子文件对应的旧版本子文件时,可以判定该新版本子文件为第一类子文件。即,相对于旧版本压缩文件,该新版本子文件为新增文件,可以将其作为一个增量子文件直接写入增量文件。
S205、判断旧版本子文件和新版本子文件是否都满足预设解压条件,如果二者都满足预设解压条件,则执行步骤S206,否则执行步骤S207。
S206、将旧版本子文件和新版本子文件分别解压,比较解压后的旧版本子文件和新版本子文件,并将比较得到的第一差异数据文件存储于上述第一存储区,并返回步骤S201。
上述第一差异数据文件可以作为增量文件的一个子文件。当上述旧版本子文件和新版本子文件都满足预设解压条件时,该旧版本子文件和新版本子文件即为第二类子文件,采用解压比较法实现二者之间的差异比较,可以保证得到的增量子文件比采用直接比较法得到的增量子文件小,进而可以使得整个增量文件较小。
实际应用中,可以在判定新版本子文件为第二类子文件时,先将新版本子文件的文件数据头写入第一存储区,在经过解压、比较步骤得到第一差异数据文件后,再将该第一差异数据文件写入第一存储区,且上述第一差异数据文件和新版本子文件的文件数据头在第一存储区的存储地址连续。也即,服务器将新版本压缩文件的第二类子文件的文件数据头写入存储区;对新版本压缩文件的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据;将得到的第一差异数据写 入存储区中第二类子文件的文件数据头的存储地址之后,与第二类子文件在存储区中连续存储;根据连续存储的第二类子文件的文件数据头和第一差异数据,得到第一差异数据文件。
S207、直接比较旧版本子文件和新版本子文件,并将比较得到的第二差异数据文件存储于第一存储区,并返回步骤S201。
上述第二差异数据文件可以作为增量文件的一个子文件。当旧版本子文件不满足预设解压条件,或者,新版本子文件不满足预设解压条件,或者旧版本子文件和新版本子文件都不满足预设解压条件时,该旧版本子文件和新版本子文件即为第三类子文件,采用上述两种方法(解压比较法和直接比较法)实现旧版本子文件和新版本子文件之间的差异比较,所得到的增量子文件的大小接近或相同。因此,本申请实施例采用直接比较法实现第三类子文件之间的差异比较,可以减少差异比较所消耗的时间,提高差异比较效率,进而提高整个增量升级流程的效率。
在任意一次循环过程中,如果步骤S201的判断结果为否,即新版本压缩文件中的新版本子文件被全部读取,说明旧版本压缩文件和新版本压缩文件之间的差异比较已执行完毕,第一存储区中存储的所有数据的集合,即为用于记录旧版本压缩文件和新版本压缩文件之间的差异信息的增量文件。
在本申请另一个可行的实施例中,对于第三类子文件,还可以通过如下方法得到第二差异数据:
判断是否满足如下预设条件:连续存储(即存储地址连续)的多个新版本子文件均为第三类子文件,且与连续存储的多个新版本子文件一一对应的旧版本子文件在旧版本压缩文件中的存储位置(也即存储地址)也连续。如果满足预设条件,则将上述连续存储的多个新版本子文件构成的整体文件,和上述连续存储的多个旧版本子文件构成的另一整体文件进行差异比较。也即,服务器确定新版本压缩文件中存在存储地址连续的多个第三类子文件,以及,确定旧版本压缩文件中相对应的多个第三类子文件的存储地址也连续;将新版本压缩文件中存储地址连续的多个第三类子文件作为一个整体文件,将旧版本压缩文件中存储地址连续的多个第三类子文件作为另一个整体文件;对两个整体文件不解压直接进行差异比较,得到第二差异数据文件。
具体地,参见图3,该实施例中服务器根据获取到的旧版本压缩文件和新版本压缩文件生成相应的增量文件的步骤如下:
S201’、判断新版本压缩文件中的新版本子文件是否已全部被读取,如果是,则结束本流程,否则执行步骤S202’。
S202’、读取下一个新版本子文件。
S203’、判断旧版本压缩文件中是否存在与读取到的新版本子文件对应的旧版本子文件,如果存在,则执行步骤S205’,否则执行步骤S204’。
S204’、将新版本子文件存储于用于存储增量文件的第一存储区,并返回步骤S201’。
S205’、判断旧版本子文件和新版本子文件是否都满足预设解压条件,如果二者都满足预设解压条件,则执行步骤S206’,否则执行步骤S207’。
S206’、将旧版本子文件和新版本子文件分别解压,比较解压后的旧版本子文件和新版本子文件,并将比较得到的第一差异数据文件存储于上述第一存储区,并返回步骤S201’。
与图2所示流程不同的是,当在步骤S205’中判定结果为否,即旧版本子文件和新版本子文件不都满足预设解压条件时,执行如下步骤:
S207’、将旧版本子文件存入第一缓存区,同时将新版本子文件存入第二缓存区。
图4为本实施例中旧版本压缩文件和新版本压缩文件的存储结构示意图,图5为本实施例中第一缓存区和第二缓存区的存储结构示意图。参见图4,假设新版本压缩文件中存储地址为B01的新版本子文件file_21,与旧版本压缩文件中存储地址为A01的旧版本子文件file_11相对应,且file_21和file_11都不满足预设解压条件,则将file_11存入第一缓存区中地址为C01的区域,将file_21存入第二缓存区中地址为D01的区域,如图5所示。
S208’、判断是否同时存在下一个旧版本子文件和下一个新版本子文件,如果同时存在下一个旧版本子文件和下一个新版本子文件,则执行步骤S209’,否则执行步骤S212’。
下一个旧版本子文件是指旧版本压缩文件中满足如下条件的旧版本子文件:存储地址与最后存入第一缓存区的旧版本子文件在旧版本压缩文件中的存储地址连续;下一个新版本子文件是指新版本压缩文件中满足如下条件的新版本子文件:存储地址与最后存入第二缓存区的新版本子文件在新版本压缩文件中的存储地址连续。
如果不存在与地址A01连续的地址,或与地址A01连续的地址A02中没有数据,则判定不存在存储地址与file_11连续的下一个旧版本子文件,如果地址A02中存在旧版本子文件file_12,如图5所示,则可以判定存在存储地址与file_11连续的下一个旧版本子文件file_12。相应地,图4中,新版本子文件file_22的存储地址B02与file_21的存储地址连续,即下一个新版本子文件为file_22。因此,对于图4所示情况,可以继续执行步骤S209’。
S209’、判断下一个新版本子文件和下一个旧版本子文件是否相对应,如果对应,则执行步骤S210’,否则执行步骤S212’。
S210’、判断下一个新版本子文件和下一个旧版本子文件是否都满足预设解压条件,如果都满足,则执行步骤S212’,否则执行步骤S211’。
如果下一个新版本子文件和下一个旧版本子文件都满足预设解压条件,则二者均为第二类子文件,反之,则二者均为第三类子文件。
S211’、将下一个旧版本子文件存入第一缓存区,同时将下一个新版本子文件存入第二缓存区,并返回步骤S208’。
S212’、将第一缓存区中的旧版本子文件作为一个整体文件,第二缓存区中的新版本子文件作为另一个整体文件,直接比较两个整体文件,将得到的第二差异数据文件存入第一存储区,并返回步骤S201’。
上述第二差异数据文件同样作为增量文件的一个子文件存入第一存储区。差异比较完成后,第一存储区中存储的所有增量子文件的集合,就是用于记录旧版本压缩文件和新版本压缩文件之间的差异信息的增量文件。
仍以图4为例,在步骤S209’中判断file_12和file_22是否相对应。在file_12和file_22相对应的情况下,执行步骤S210’,判断file_12和file_22是否都满足预设解压条件。如果file_12和file_22都满足预设解压条件,则说明file_22也为第三类子文件,因此,执行步骤S211’将file_12存入第一缓存区中地址为C03的区域、将file_22存入第二缓存区地址为D03的区域,如图5所示。其中,file_11和file_12在第一缓存区中的存储地址也连续,file_21和file_22在第一缓存区中的存储地址也连续。相反地,如果步骤S208’判定不存在下一个新版本子文件和/或下一个旧版本子文件,或步骤S209’判定下一个新版本子文件和下一个旧版本子文件不对应,或者步骤S210’判定下一个新版本子文件和下一个旧版本子文件均满足预设解压条件时,说明不存在满足如下条件的下一个新版本子文件:下一个新版本子文件为第三类子文件,且下一个新版本子文件对应的旧版本子文件与待处理新版本子文件对应的旧版本子文件,在旧版本压缩文件中的存储地址连续。此时,执行步骤S212’,将第一缓存区中的所有旧版本子文件作为一个整体文件,将第二缓存区中的所有新版本子文件作为一个整体文件,通过直接比较法对上述两个整体文件执行一次差异比较,就可以得到多个新版本子文件与对应的旧版本子文件之间的差异信息。
例如,对于图4所示情况,连续存储的两个新版本子文件file_21和file_22均为第三类子文件,且与file_21对应的旧版本子文件file_11和与file_22对应旧版本子文件file_12在旧版本压缩文件中的存储地址也连续,满足上述预设条件,根据图3 所示实施例,将file_11和file_12作为一个整体文件file_1,将file_21和file_22作为一个整体文件file_2,通过直接比较法对file_1和file_2执行一次差异比较,即可得到与file_21和file_22对应的增量子文件。而根据图2所示的实施例,需要执行两次差异比较(file_11和file_21比较一次,file_12和file_22比较一次)。
可见,通过循环执行步骤S208’至S211’,可以识别出满足如下预设条件的子文件:连续存储的多个新版本子文件均为第三类子文件,且旧版本压缩文件中存在与连续存储的多个新版本子文件一一对应的旧版本子文件,且该多个旧版本子文件在旧版本压缩文件中的存储位置也连续;进而将连续存储的多个新版本子文件作为一个整体文件,将对应的多个旧版本子文件作为另一个整体文件,通过直接比较法对上述两个整体文件执行一次差异比较,就可以得到连续存储的多个第三类子文件对应的第二差异数据文件。因此,图3所示实施例可以减少差异比较的执行次数,从而进一步减少生成增量文件所需的时间,提高升级效率。
上述实施例中,服务器在执行差异比较并生成增量文件的阶段,通过对旧版本压缩文件和新版本压缩文件中的子文件进行分类处理,对不同类型的子文件采用不同的差异比较方法得到对应的差异数据文件,实现兼顾增量文件大小和升级效率的目的。
在本申请一个可行的实施例中,如图6所示,客户端根据增量文件中的数据类型执行合并操作的流程如下:
S301、读取下一个增量子文件。
上述增量子文件即增量文件的子文件,增量子文件包括上述第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种。
S302、判断是否读取到增量子文件,如果是,则执行步骤S303,否则结束本流程。
S303、判断读取到的增量子文件的类型,根据判断结果选择执行步骤S304、S305或者S310。
S304、若该增量子文件为第一类子文件,则将第一类子文件存储于第二存储区,并返回步骤S301。
其中,上述第二存储区为客户端中用于存储新版本压缩文件的存储区。
S305、若该增量子文件为第一差异数据文件,则读取上述第一差异数据文件中的文件数据头,并将该文件数据头存入第二存储区。
S306、读取旧版本压缩文件中与第一差异数据文件对应的第二类子文件。
S307、对读取到的第二类子文件执行解压操作。
S308、将解压后的第二类子文件与第一差异数据文件合并,得到第一合并子文件。
S309、对上述文件数据头和第一合并子文件进行压缩,得到第一压缩子文件,并将该第一压缩子文件存入第二存储区,并返回步骤S301。
S310、若该增量子文件为第二差异数据文件,则读取旧版本压缩文件中与第二差异数据文件对应的第三类子文件。
S311、对读取到的第三类子文件与第二类差异数据文件执行合并操作,得到第二合并子文件。
S312、对上述第二合并子文件进行压缩,得到第二压缩子文件,并将该第二压缩子文件存入第二存储区,并返回步骤S301。
上述流程结束后,即合并操作完成后,客户端的第二存储区中存储的文件集合即为本次增量升级的目标文件,也即与客户端存储的旧版本压缩文件对应的新版本压缩文件。
由以上技术方案可知,本申请实施例不仅在增量文件生成阶段,通过服务器对旧版本压缩文件和新版本压缩文件中的子文件分类,进而对不同类型的子文件采用不同的差异比较方法得到对应的差异数据文件,实现兼顾增量文件大小和升级效率的目的。而且,在客户端对增量文件和旧版本压缩文件执行合并操作时,也根据增量文件的子文件的类型采用不同的合并方法,可以进一步提高增量升级效率。
以应用于Android系统中的一种浏览器uc_browser由9.6.0版本升级到9.6.1版本为例,若基于传统的直接比较法,将两个版本的apk格式的压缩文件分别作为一个整体进行比较,则得到的增量文件大小为9410KB。若基于传统的解压比较法,将两个版本的apk格式的压缩文件全部解压后再比较,则得到的增量文件大小为937KB,且整个增量文件生成过程中,需要执行6000多次解压操作(每个版本的压缩文件包括3000多个子文件)和3000多次压缩操作(对得到的每个增量子文件执行一次单独压缩操作)。同时,在客户端执行增量文件和9.6.0版本的压缩文件的合并操作过程中,也需要执行6000多次解压操作(对3000多个增量子文件和9.6.0版本的压缩文件中3000多个子文件各执行一次)和3000多次压缩操作(对合并得到的每个子文件执行一次单独压缩操作)。
若采用本申请实施例的增量升级方法,经过分类,9.6.1版本的压缩文件中有8个子文件为第二类子文件,需要解压后再比较,故只需执行16次解压操作(两个版本的压缩文件各8次)和1次压缩操作(将所有增量子文件压缩为一个增量文件),且增量文件大小为881KB。相应地,在客户端执行合并操作过程中,只需执行9次解压操作(对增量文件执行1次解压,对9.6.0版本的压缩文件执行8次解压)和8次压缩操作(对 8个通过先解压再合并的方式得到的子文件各执行一次)。
通过以上实例对比可知,相对于传统基于直接比较法实现增量升级的方法,本申请实施例可以减小增量文件的大小;相对于传统基于解压比较法实现增量升级的方法,本申请实施例可以降低操作复杂度,提高升级效率。
参照图7,本申请实施例提供了另一种增量升级方法,包括如下步骤:
S41、服务器获取旧版本压缩文件和对应的新版本压缩文件。
可选地,本申请实施例可以根据文件名称和/或版本标识符确定相对应的两个压缩文件,进而根据两个压缩文件的版本号确定哪个压缩文件是旧版本压缩文件,哪个压缩文件是新版本压缩文件。
S42、服务器获得第一类子文件、第二类子文件和第三类子文件中的至少一种。
其中,上述第一类子文件为在新版本压缩文件中存在而在旧版本压缩文件中不存在的文件;上述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在的且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;上述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在的且部分或全部不满足预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件。
S43、服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件。
本申请实施例中,由于旧版本压缩文件中不存在第一类子文件,即:相对于旧版本压缩文件,新版本压缩文件中的第一类子文件为新增文件。因此,对于第一类子文件,不需要执行差异比较操作,直接将该第一类子文件作为增量文件的一个子文件即可。
上述第一类子文件、第一差异数据文件和第二差异数据文件的集合,即为记录旧版本压缩文件和新版本压缩文件之间的差异信息的增量文件。
S44、服务器将上述第一类子文件、第一差异数据文件以及第二差异数据文件发送给客户端,以供客户端对自身存储的旧版本压缩文件进行增量升级。
本申请实施例中,客户端接收到上述第一类子文件、第一差异数据文件以及第二差异数据文件,就可以按照以下方式得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二 差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。
可选地,本申请实施例中,预设解压条件可以为:文件压缩前的大小大于预设字节值且压缩率小于预设比值,但不限于此。压缩率为文件压缩后的大小与压缩前的大小之比。
在本申请一个可行的实施例中,服务器在执行完步骤S41至S43,得到旧版本压缩文件和新版本压缩文件之间的增量文件(包括第一类子文件、第一差异数据文件和第二差异数据文件)后,可以向与其关联的客户端发送升级提示信息,客户端接收到该升级提示信息后,下载相应的增量文件,实现对自身存储的旧版本压缩文件的增量升级。
在本申请另一个可行的实施例中,服务器在接收到客户端发送的文件升级请求后,向客户端发送相应的增量文件,以供客户端对自身存储的旧版本压缩文件进行增量升级。
由上述技术方案可知,本申请实施例提供的增量升级方法,服务器在执行差异比较并生成增量文件的阶段,通过对旧版本压缩文件和新版本压缩文件中的子文件进行分类处理,对不同类型的子文件采用不同的差异比较方法得到对应类型的差异数据文件,进而得到具有多种类型的子文件的增量文件,实现兼顾增量文件大小和升级效率的目的。另外,服务器将得到的增量文件发送至客户端,使得客户端可以根据增量文件的子文件的类型采用不同的合并方法,可以进一步提高增量升级效率。
如图8所示,本申请实施例还提供了一种增量升级方法,包括如下步骤:
S51、客户端从服务器获取增量文件,该增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种。
其中,第一类子文件为在新版本压缩文件中存在而在旧版本压缩文件中不存在的文件;第一差异数据文件为服务器将新版本压缩文件和旧版本压缩文件中都存在的且都满足预设解压条件的文件进行解压并进行差异比较得到的文件;第二差异数据文件为服务器将新版本压缩文件和旧版本压缩文件中都存在的且部分或全部不满足上述预设解压条件的文件不解压直接进行差异比较得到的数据。也即,第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,其中,第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,其中,第三 类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足所述预设解压条件的文件。
S52、客户端根据获取到的增量文件中的文件类型,对获取到的增量文件和自身存储的旧版本压缩文件执行合并操作,得到新版本压缩文件。
本申请实施例中,增量文件包括第一类子文件、第一差异数据文件和第二差异数据文件,客户端按照以下方式执行合并操作得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。
可选地,本申请实施例中,预设解压条件可以为:文件压缩前的大小大于预设字节值且压缩率小于预设比值,但不限于此。压缩率为文件压缩后的大小与压缩前的大小之比。
可选地,上述增量升级方法中,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件,包括以下步骤:
客户端读取并存储上述第一差异数据文件中的文件数据头;
读取旧版本压缩文件中与第一差异数据文件对应的第二类子文件;
对读取到的第二类子文件进行解压;
将解压后的第二类子文件与上述第一差异数据文件合并,得到第一合并子文件;
对上述文件数据头和第一合并子文件进行压缩,得到第一压缩子文件。
与本申请上述方法实施例相对应,本申请实施例还分别提供了一种服务器500和客户端600。如图9所示,服务器500用于生成新版本压缩文件相对于旧版本压缩文件的增量文件,客户端600获取该增量文件,执行对本地的旧版本压缩文件的增量升级。其中,客户端600获取该增量文件,可以为客户端600通过向服务器500发送文件升级请求,以使服务器500反馈相应的增量文件;也可以为服务器500在生成增量文件后,主动向客户端600发送升级提示信息,以提醒客户端600下载该增量文件,实现对本地文件的升级。
如图10所示,本申请一个可行的实施例提供的服务器500,主要,包括:第一获取模块510、第一比较模块520、第二比较模块530、和生成模块540。
其中,第一获取模块510,配置为获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件。
可选地,预设解压条件可以为:文件压缩前的大小大于预设字节值且压缩率小于预设比值,但不限于此。压缩率为文件压缩后的大小与压缩前的大小之比。
第一比较模块520,配置为当获得的文件中包括第二类子文件时,对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件。
第二比较模块530,配置为当获得的文件中包括第三类子文件时,对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件。
生成模块540,配置为根据得到的所述第一类子文件、所述第一差异数据文件以及所述第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
本申请实施例中,对于客户端,客户端接收到第一类子文件、第一差异数据文件以及第二差异数据文件后,按照以下方式得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。
优选地,一种对图10所示的服务器500进行优化后的服务器如图11所示。
在优化后的服务器500中:
优选地,第一比较模块520包括:第一写入模块5201,配置为新版本压缩文件的第二类子文件的文件数据头写入存储区;解压比较模块5202,配置为对新版本压缩文件的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据;第二写入模块5203,配置为将得到的第一差异数据写入存储区中第二类子文件的文件数据头的存储地址之后,与第二类子文件在存储区中连续存储;第一合并模块5204,配置为根据连续存储的第二类子文件的文件数据头和第一差异数据,得到 第一差异数据文件。
优选地,第二比较模块530包括:确定模块5301,配置为确定新版本压缩文件中存在存储地址连续的多个第三类子文件,以及,确定旧版本压缩文件中相对应的多个第三类子文件的存储地址也连续;整合模块5302,配置为将新版本压缩文件中存储地址连续的多个第三类子文件作为一个整体文件,将旧版本压缩文件中存储地址连续的多个第三类子文件作为另一个整体文件;直接比较模块5303,配置为对两个整体文件不解压直接进行差异比较,得到第二差异数据文件。
优选地,本实施例的服务器500还包括:触发模块550,配置为在第一获取模块510获得新版本压缩文件中的第一类子文件、第二类子文件、第三类子文件中的至少一种,和,旧版本压缩文件中的第一类子文件、第二类子文件、第三类子文件中的至少一种之前,接收客户端发送的文件升级请求;当接收到所述文件升级请求时,触发所述第一获取模块执行。
由上述技术方案可知,本申请实施例提供的服务器,在执行差异比较并生成增量文件的阶段,通过对旧版本压缩文件和新版本压缩文件中的子文件进行分类处理,对不同类型的子文件采用不同的差异比较方法得到对应类型的差异数据文件,进而得到具有多种类型的子文件的增量文件,实现兼顾增量文件大小和升级效率的目的。另外,服务器将得到的增量文件发送至客户端,使得客户端可以根据增量文件的子文件的类型采用不同的合并方法,可以进一步提高增量升级效率。
如图12所示,本申请一个可行实施例客户端600包括:第二获取模块610、第二合并模块620和增量升级模块630。
第二获取模块610,配置为从服务器获取增量文件,其中,该增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种。
其中,第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件。
第二合并模块620,配置为使用增量文件得到新版本压缩文件。第二合并模块620可以根据获取到的增量文件中的文件类型,对获取到的增量文件和自身存储的旧版本压缩文件执行合并操作,得到新版本压缩文件。
本申请实施例中,当增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,第二合并模块620按照以下方式执行合并操作,得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件。
增量升级模块630,配置为使用新版本压缩文件进行文件的增量升级。
可选地,本申请实施例中,预设解压条件可以为:文件压缩前的大小大于预设字节值且压缩率小于预设比值,但不限于此。压缩率为文件压缩后的大小与压缩前的大小之比。
优选地,在一种对图12所示的客户端600进行优化后的客户端中:
第二合并模块620使用增量文件得到新版本压缩文件还包括:
当增量文件中仅包括第一类子文件时,使用第一类子文件得到新版本压缩文件;
当增量文件中仅包括第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件;使用第一压缩子文件得到新版本压缩文件;
当增量文件中仅包括第二差异数据文件时,将旧版本压缩文件的第三类子文件与第二差异数据文件合并,得到第二合并子文件,对第二合并子文件进行压缩,得到第二压缩子文件;使用第二压缩子文件得到新版本压缩文件;
当增量文件中仅包括第一类子文件和第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件;合并第一压缩子文件和第一类子文件,得到新版本压缩文件;
当增量文件中仅包括第一类子文件和第二差异数据文件时,将旧版本压缩文件的第三类子文件与第二差异数据文件合并,得到第二合并子文件,对第二合并子文件进行压缩,得到第二压缩子文件;合并第二压缩子文件和所述第一类子文件,得到新版本压缩文件;
当增量文件中仅包括第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与第二 差异数据文件合并,得到第二合并子文件,对第二合并子文件进行压缩,得到第二压缩子文件;合并第一压缩子文件和所述第二压缩子文件,得到新版本压缩文件。
优选地,第二合并模块620将旧版本压缩文件的第二类子文件解压缩后,与第一差异数据文件合并,得到第一合并子文件,对第一合并子文件进行压缩,得到第一压缩子文件,包括:读取并存储第一差异数据文件中的文件数据头;读取旧版本压缩文件中与第一差异数据对应的第二类子文件;对读取到的第二类子文件进行解压;将解压后的第二类子文件与第一差异数据文件合并,得到第一合并子文件;对文件数据头和第一合并子文件进行压缩,得到第一压缩子文件。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。此外,根据本申请的方法还可以被实现为由CPU执行的计算机程序。在该计算机程序被CPU执行时,执行本申请的方法中限定的上述功能。
另外,本申请实施例还提供了一种具有处理器可执行的程序代码的计算机可读介质,其中,程序代码使处理器执行下述步骤:
获取旧版本压缩文件和对应的新版本压缩文件;
获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,上述第一类子文件为在新版本压缩文件中存在而在旧版本压缩文件中不存在的文件;上述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在的且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;上述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在的且部分或全部不满足预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件;
当获得的文件中包括第二类子文件时,对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;当获得的文件中包括第三类子文件时,对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件;
将上述第一类子文件、第一差异数据以及第二差异数据发送给客户端,以供客户端对自身存储的旧版本压缩文件进行增量升级。
可选地,预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;压缩率为文件压缩后的大小与压缩前的大小之比。
上述计算机可读介质可以应用于服务器。如图13所示,本申请一个可行实施例提供的服务器500,包括处理器501和上述计算机可读介质502,当服务器500中存在某 一旧版本压缩文件(如游戏的资源文件、程序的安装文件等)的新版本压缩文件时,处理器501可以执行计算机可读介质502中的程序代码,实现新版本压缩文件和旧版本压缩文件之间的差异比较,得到对应的增量文件,相对于传统的基于直接比较法和解压比较法实现差异比较的设备,既可以保证得到的增量文件较小,又可以保证差异对比的效率较高。
另外,本申请实施例还提供了一种具有处理器可执行的程序代码的计算机可读介质,其中,程序代码使处理器执行下述步骤:
从服务器获取增量文件,其中,该增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种;其中,上述第一类子文件为在新版本压缩文件中存在而在旧版本压缩文件中不存在的子文件;上述第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件:
根据获取到的增量文件中的文件类型,对获取到的增量文件和自身存储的旧版本压缩文件执行合并操作,得到新版本压缩文件;其中,当增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,按照以下方式执行合并操作,得到新版本压缩文件:将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与上述第二差异数据文件合并,得到第二合并子文件,对该第二合并子文件进行压缩,得到第二压缩子文件;合并上述第一压缩子文件、第二压缩子文件以及第一类子文件,得到新版本压缩文件;
使用新版本压缩文件进行文件的增量升级。
可选地,预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;压缩率为文件压缩后的大小与压缩前的大小之比。
可选地,上述将旧版本压缩文件的第二类子文件解压缩后,与上述第一差异数据文件合并,得到第一合并子文件,对该第一合并子文件进行压缩,得到第一压缩子文件,包括:客户端读取并存储所述第一差异数据文件中的文件数据头;读取旧版本压缩文件中与第一差异数据文件对应的第二类子文件;对读取到的第二类子文件进行解压;将解压后的第二类子文件与上述第一差异数据文件合并,得到第一合并子文件;对上述文件 数据头和第一合并子文件进行压缩,得到第一压缩子文件。
上述计算机可读介质可以应用于客户端。如图14所示,本申请一可行实施例提供的客户端600,包括处理器601和上述计算机可读介质602,处理器601执行计算机可读介质602中的程序代码,执行对客户端600中的旧版本压缩文件和对应的增量文件的合并操作,得到相应的新版本压缩文件,实现对旧版本压缩文件的增量升级。
此外,应该明白的是,本文的计算机可读介质(例如,存储器)可以是易失性存储器或非易失性存储器,或者可以包括易失性存储器和非易失性存储器两者。作为例子而非限制性的,非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦写可编程ROM(EEPROM)或快闪存储器。易失性存储器可以包括随机存取存储器(RAM),该RAM可以充当外部高速缓存存储器。作为例子而非限制性的,RAM可以以多种形式获得,比如同步RAM(DRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据速率SDRAM(DDR SDRAM)、增强SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)以及直接Rambus RAM(DRRAM)。所公开的方面的存储设备意在包括但不限于这些和其它合适类型的存储器。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本申请的具体实施方式,使本领域技术人员能够理解或实现本申请。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (22)

  1. 一种增量升级方法,包括:
    服务器获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足所述预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件;
    当获得的文件中包括第二类子文件时,服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;
    当获得的文件中包括第三类子文件时,服务器对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件;
    服务器根据得到的第一类子文件、第一差异数据文件和第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
  2. 根据权利要求1所述的增量升级方法,其中,所述预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;其中,所述压缩率为文件压缩后的大小与压缩前的大小之比。
  3. 根据权利要求1所述的增量升级方法,其中,服务器对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件的步骤包括:
    服务器将新版本压缩文件的第二类子文件的文件数据头写入存储区;
    对新版本压缩文件的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据;
    将得到的第一差异数据写入存储区中第二类子文件的文件数据头的存储地址之后,与第二类子文件在存储区中连续存储;根据连续存储的第二类子文件的文件数据头和第一差异数据,得到第一差异数据文件。
  4. 根据权利要求1所述的增量升级方法,其中,服务器对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到 第二差异数据文件的步骤包括:
    服务器确定新版本压缩文件中存在存储地址连续的多个第三类子文件,以及,确定旧版本压缩文件中相对应的多个第三类子文件的存储地址也连续;
    将新版本压缩文件中存储地址连续的多个第三类子文件作为一个整体文件,将旧版本压缩文件中存储地址连续的多个第三类子文件作为另一个整体文件;
    对两个整体文件不解压直接进行差异比较,得到第二差异数据文件。
  5. 根据权利要求1所述的增量升级方法,其中,在服务器获得第一类子文件、第二类子文件、第三类子文件中的至少一种的步骤之前,所述方法还包括:
    服务器接收客户端发送的文件升级请求;
    当接收到所述文件升级请求时,服务器执行所述获得第一类子文件、第二类子文件、第三类子文件中的至少一种的步骤。
  6. 一种增量升级方法,包括:
    客户端从服务器获取增量文件,其中,所述增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;所述第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足所述预设解压条件的文件;
    所述客户端使用增量文件得到新版本压缩文件,包括:当所述增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第一压缩子文件、所述第二压缩子文件以及所述第一类子文件,得到新版本压缩文件;
    使用新版本压缩文件进行文件的增量升级。
  7. 根据权利要求6所述的增量升级方法,其中,所述客户端使用增量文件得到新版 本压缩文件还包括:
    当所述增量文件中仅包括第一类子文件时,使用所述第一类子文件得到新版本压缩文件;
    当所述增量文件中仅包括第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;使用第一压缩子文件得到新版本压缩文件;
    当所述增量文件中仅包括第二差异数据文件时,将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;使用所述第二压缩子文件得到新版本压缩文件;
    当所述增量文件中仅包括第一类子文件和第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;合并所述第一压缩子文件和所述第一类子文件,得到新版本压缩文件;
    当所述增量文件中仅包括第一类子文件和第二差异数据文件时,将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第二压缩子文件和所述第一类子文件,得到新版本压缩文件;
    当所述增量文件中仅包括第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第一压缩子文件和所述第二压缩子文件,得到新版本压缩文件。
  8. 根据权利要求6或7所述的增量升级方法,其中,所述将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件的步骤,包括:
    客户端读取并存储所述第一差异数据文件中的文件数据头;
    读取旧版本压缩文件中与第一差异数据文件对应的第二类子文件;
    对读取到的第二类子文件进行解压;
    将解压后的第二类子文件与所述第一差异数据文件合并,得到第一合并子文件;
    对所述文件数据头和第一合并子文件进行压缩,得到所述第一压缩子文件。
  9. 根据权利要求6所述的增量升级方法,其中,所述预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;其中,所述压缩率为文件压缩后的大小与压缩前的大小之比。
  10. 一种服务器,包括:
    第一获取模块,配置为获得第一类子文件、第二类子文件、第三类子文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件,包括新版本压缩文件中的第二类子文件和旧版本压缩文件中的第二类子文件;所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件,包括新版本压缩文件中的第三类子文件和旧版本压缩文件中的第三类子文件;
    第一比较模块,配置为当获得的文件中包括第二类子文件时,对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据文件;
    第二比较模块,配置为当获得的文件中包括第三类子文件时,对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较,得到第二差异数据文件;
    生成模块,配置为根据得到的所述第一类子文件、所述第一差异数据文件以及所述第二差异数据文件中的至少一种,生成增量文件供客户端进行文件的增量升级。
  11. 根据权利要求10所述的服务器,其中,所述预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;其中,所述压缩率为文件压缩后的大小与压缩前的大小之比。
  12. 根据权利要求10所述的服务器,其中,所述第一比较模块包括:
    第一写入模块,配置为新版本压缩文件的第二类子文件的文件数据头写入存储区;
    解压比较模块,配置为对新版本压缩文件的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较,得到第一差异数据;
    第二写入模块,配置为将得到的第一差异数据写入存储区中第二类子文件的文件数据头的存储地址之后,与第二类子文件在存储区中连续存储;
    第一合并模块,配置为根据连续存储的第二类子文件的文件数据头和第一差异数据,得到第一差异数据文件。
  13. 根据权利要求10所述的服务器,其中,所述第二比较模块包括:
    确定模块,配置为确定新版本压缩文件中存在存储地址连续的多个第三类子文件,以及,确定旧版本压缩文件中相对应的多个第三类子文件的存储地址也连续;
    整合模块,配置为将新版本压缩文件中存储地址连续的多个第三类子文件作为一个整体文件,将旧版本压缩文件中存储地址连续的多个第三类子文件作为另一个整体文件;
    直接比较模块,配置为对两个整体文件不解压直接进行差异比较,得到第二差异数据文件。
  14. 根据权利要求10所述的服务器,其中,所述服务器还包括:
    触发模块,配置为在所述第一获取模块获得第一类子文件、第二类子文件、第三类子文件中的至少一种之前,接收客户端发送的文件升级请求;当接收到所述文件升级请求时,触发所述第一获取模块执行。
  15. 一种客户端,包括:
    第二获取模块,配置为从服务器获取增量文件,其中,所述增量文件包括第一类子文件、第一差异数据文件以及第二差异数据文件中的至少一种;其中,所述第一类子文件为新版本压缩文件中存在而旧版本压缩文件中不存在的文件;所述第一差异数据文件为对新版本压缩文件中的第二类子文件以及对应的旧版本压缩文件中的第二类子文件解压并进行差异比较得到的文件,所述第二类子文件为新版本压缩文件和旧版本压缩文件中都存在且都满足预设解压条件的文件;所述第二差异数据文件为对新版本压缩文件中的第三类子文件以及对应的旧版本压缩文件中的第三类子文件不解压直接进行差异比较得到的文件,所述第三类子文件为新版本压缩文件和旧版本压缩文件中都存在且部分或全部不满足预设解压条件的文件;
    第二合并模块,配置为使用增量文件得到新版本压缩文件,包括:当所述增量文件中包括第一类子文件、第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第一压缩子文件、所述第二压缩子文件以及所述第一类子文件,得到新版本压缩文件;
    增量升级模块,配置为使用新版本压缩文件进行文件的增量升级。
  16. 根据权利要求15所述的客户端,其中,所述第二合并模块使用增量文件得到新 版本压缩文件还包括:
    当所述增量文件中仅包括第一类子文件时,使用所述第一类子文件得到新版本压缩文件;
    当所述增量文件中仅包括第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;使用所述第一压缩子文件得到新版本压缩文件;
    当所述增量文件中仅包括第二差异数据文件时,将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;使用所述第二压缩子文件得到新版本压缩文件;
    当所述增量文件中仅包括第一类子文件和第一差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;合并所述第一压缩子文件和所述第一类子文件,得到新版本压缩文件;
    当所述增量文件中仅包括第一类子文件和第二差异数据文件时,将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第二压缩子文件和所述第一类子文件,得到新版本压缩文件;
    当所述增量文件中仅包括第一差异数据文件和第二差异数据文件时,将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件;将旧版本压缩文件的第三类子文件与所述第二差异数据文件合并,得到第二合并子文件,对所述第二合并子文件进行压缩,得到第二压缩子文件;合并所述第一压缩子文件和所述第二压缩子文件,得到新版本压缩文件。
  17. 根据权利要求15或16所述的客户端,其中,所述第二合并模块将旧版本压缩文件的第二类子文件解压缩后,与所述第一差异数据文件合并,得到第一合并子文件,对所述第一合并子文件进行压缩,得到第一压缩子文件,包括:
    读取并存储所述第一差异数据文件中的文件数据头;
    读取旧版本压缩文件中与第一差异数据对应的第二类子文件;
    对读取到的第二类子文件进行解压;
    将解压后的第二类子文件与所述第一差异数据文件合并,得到第一合并子文件;
    对所述文件数据头和第一合并子文件进行压缩,得到所述第一压缩子文件。
  18. 根据权利要求15所述的客户端,其中,所述预设解压条件包括:文件压缩前的大小大于预设字节值,且压缩率小于预设比值;其中,所述压缩率为文件压缩后的大小与压缩前的大小之比。
  19. 一种包含程序指令的计算机程序,当所述计算机程序在服务器上运行时,引发所述服务器执行根据权利要求1-5中任一项所述的增量升级方法。
  20. 一种计算机可读介质,其中存储了根据权利要求19所述的计算机程序。
  21. 一种包含程序指令的计算机程序,当所述计算机程序在客户端上运行时,引发所述客户端执行根据权利要求6-9中任一项所述的增量升级方法。
  22. 一种计算机可读介质,其中存储了根据权利要求21所述的计算机程序。
PCT/CN2014/086816 2014-05-30 2014-09-18 增量升级方法及装置 WO2015180304A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/315,272 US10048959B2 (en) 2014-05-30 2014-09-18 Method and apparatus for incremental upgrade

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410238919.4 2014-05-30
CN201410238919.4A CN105404521B (zh) 2014-05-30 2014-05-30 一种增量升级方法及相关装置

Publications (1)

Publication Number Publication Date
WO2015180304A1 true WO2015180304A1 (zh) 2015-12-03

Family

ID=54697990

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/086816 WO2015180304A1 (zh) 2014-05-30 2014-09-18 增量升级方法及装置

Country Status (3)

Country Link
US (1) US10048959B2 (zh)
CN (1) CN105404521B (zh)
WO (1) WO2015180304A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558156A (zh) * 2019-01-15 2019-04-02 重庆德科电子仪表有限公司 一种汽车仪表升级优化方法
CN110389773A (zh) * 2018-04-23 2019-10-29 比亚迪股份有限公司 软件发布及部署方法、装置及系统
WO2021079975A1 (ja) * 2019-10-23 2021-04-29 ソニー株式会社 表示システム、表示装置、表示方法、及び、移動装置
CN113326059A (zh) * 2020-02-28 2021-08-31 腾讯科技(深圳)有限公司 一种资源更新方法、装置及存储介质

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105404521B (zh) 2014-05-30 2017-05-31 广州市动景计算机科技有限公司 一种增量升级方法及相关装置
CN105930197A (zh) * 2016-06-28 2016-09-07 乐视控股(北京)有限公司 一种软件升级的方法及电子设备
CN106354525B (zh) * 2016-08-11 2019-10-01 深圳市宜搜科技发展有限公司 应用软件安装包差分存储方法及系统
CN106844479B (zh) * 2016-12-23 2020-07-07 光锐恒宇(北京)科技有限公司 文件的压缩、解压方法及装置
CN106708581A (zh) * 2016-12-27 2017-05-24 北京奇虎科技有限公司 应用的更新包生成方法、装置和应用的更新方法、装置
CN106685718A (zh) * 2016-12-30 2017-05-17 杭州迪普科技股份有限公司 配置切换方法及装置
CN108279941B (zh) 2016-12-31 2021-06-15 阿里巴巴集团控股有限公司 一种应用程序的压缩方法和装置
CN106648712A (zh) * 2017-02-27 2017-05-10 百度在线网络技术(北京)有限公司 增量更新包的生成方法、装置和服务器
US10394548B2 (en) 2017-07-25 2019-08-27 Aurora Labs Ltd. Assembling data deltas in vehicle ECUs and managing interdependencies between software versions in vehicle ECUs using tool chain
CN107391145A (zh) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 升级包制作方法及装置、升级文件的方法及装置
CN109542493A (zh) * 2017-09-22 2019-03-29 华为技术有限公司 一种镜像升级方法及设备
CN107704311A (zh) * 2017-09-27 2018-02-16 郑州云海信息技术有限公司 一种虚拟机内存迁移方法及其装置
US10241903B1 (en) * 2017-11-15 2019-03-26 Accenture Global Solutions Limited Parallel testing and reporting system
US11321080B2 (en) * 2018-07-19 2022-05-03 Huawei Technologies Co., Ltd. Patch package generation method and device
KR102626253B1 (ko) * 2018-11-23 2024-01-17 현대자동차주식회사 Ota를 이용한 차량용 소프트웨어 업데이트 방법 및 장치
CN111258620B (zh) * 2018-11-30 2022-02-22 中兴通讯股份有限公司 差分升级包的生成方法、装置和设备
CN111324660B (zh) * 2018-12-13 2024-05-24 杭州海康威视系统技术有限公司 数据同步方法、装置、电子设备及机器可读存储介质
US11416232B2 (en) * 2019-09-03 2022-08-16 Google Llc Accelerating application and sub-package installations
CN111142903B (zh) * 2019-12-23 2023-09-22 杭州安恒信息技术股份有限公司 一种基于文件对比的配置文件交互式更新方法及装置
WO2021128269A1 (zh) * 2019-12-27 2021-07-01 深圳市欢太科技有限公司 文件处理方法、文件处理装置、移动终端及服务器
CN113127017B (zh) * 2019-12-30 2024-07-12 西安诺瓦星云科技股份有限公司 系统升级方法、装置及系统
US11599551B2 (en) 2020-03-30 2023-03-07 Oracle International Corporation Deserialization of stream objects using multiple deserialization algorithms
US11477258B2 (en) * 2020-03-30 2022-10-18 Oracle International Corporation Serialization of objects using multiple serialization algorithms
CN111580851B (zh) * 2020-06-24 2024-12-06 腾讯科技(深圳)有限公司 一种数据管理的方法以及相关装置
CN111984597B (zh) * 2020-08-19 2023-12-08 安徽鸿程光电有限公司 文件存储方法、装置、设备和介质
CN112818656B (zh) * 2021-01-26 2023-10-27 北京百度网讯科技有限公司 数据差异对比方法、装置、设备、介质和计算机程序产品
US11256480B1 (en) 2021-02-09 2022-02-22 Oracle International Corporation Deserialization of stream objects using constant-foldable method handles
US11288045B1 (en) 2021-02-09 2022-03-29 Oracle International Corporation Object creation from structured data using indirect constructor invocation
CN113377711B (zh) * 2021-06-29 2024-04-30 云洗电子商务有限公司 数据处理方法、装置、设备及计算机可读存储介质
US20230185859A1 (en) * 2021-12-13 2023-06-15 Toshiba Tec Kabushiki Kaisha Document management device, document management method, and non-transitory recording medium
WO2024176011A1 (en) * 2023-02-22 2024-08-29 International Business Machines Corporation Object storage deduplication

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523268A (zh) * 2011-12-08 2012-06-27 北京新媒传信科技有限公司 一种客户端升级方法和系统
CN103051723A (zh) * 2012-12-27 2013-04-17 广州市动景计算机科技有限公司 一种增量升级方法及服务器、终端
CN103095838A (zh) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 一种通过下载增量升级包来升级安卓智能手机软件的方法
CN103714105A (zh) * 2012-09-14 2014-04-09 哈曼贝克自动系统股份有限公司 更新导航装置的数据库的方法和装置
CN103713928A (zh) * 2013-12-31 2014-04-09 优视科技有限公司 增量文件生成方法、应用程序安装文件更新方法及装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7898442B1 (en) * 1997-05-30 2011-03-01 International Business Machines Corporation On-line data compression analysis and regulation
US6493871B1 (en) * 1999-09-16 2002-12-10 Microsoft Corporation Method and system for downloading updates for software installation
US7143115B2 (en) * 2003-04-15 2006-11-28 Pocket Soft, Inc. Method and apparatus for finding differences between two computer files efficiently in linear time and for using these differences to update computer files
TWI255420B (en) * 2004-12-22 2006-05-21 Mitac Technology Corp Software package system
EP1934729B1 (en) * 2005-10-06 2021-06-23 Red Bend Ltd. Methods and systems for updating content including a compressed version
KR101426710B1 (ko) * 2006-07-14 2014-09-23 삼성전자주식회사 휴대단말기의 버전정보 갱신 장치 및 방법
US8756195B2 (en) * 2009-08-27 2014-06-17 The Boeing Company Universal delta set management
US8639671B2 (en) * 2010-06-29 2014-01-28 Teradata Us, Inc. Database compression
WO2012056493A1 (en) * 2010-10-26 2012-05-03 Hitachi, Ltd. File management method and computer system
US20120131566A1 (en) * 2010-11-23 2012-05-24 Microsoft Corporation Efficient virtual application update
US20140007074A1 (en) * 2012-06-27 2014-01-02 Google Inc. Methods for updating applications
US9170804B2 (en) * 2012-07-05 2015-10-27 Nokia Technologies Oy Method and apparatus for modifying compressed files
EP2778905A1 (en) * 2013-03-15 2014-09-17 Dialog Semiconductor B.V. Integrated circuit with a patching function
CN103336703B (zh) * 2013-07-08 2018-09-18 惠州Tcl移动通信有限公司 生成升级包的方法、服务器、软件升级方法、移动终端
CN105404521B (zh) 2014-05-30 2017-05-31 广州市动景计算机科技有限公司 一种增量升级方法及相关装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523268A (zh) * 2011-12-08 2012-06-27 北京新媒传信科技有限公司 一种客户端升级方法和系统
CN103714105A (zh) * 2012-09-14 2014-04-09 哈曼贝克自动系统股份有限公司 更新导航装置的数据库的方法和装置
CN103051723A (zh) * 2012-12-27 2013-04-17 广州市动景计算机科技有限公司 一种增量升级方法及服务器、终端
CN103095838A (zh) * 2013-01-16 2013-05-08 福州博远无线网络科技有限公司 一种通过下载增量升级包来升级安卓智能手机软件的方法
CN103713928A (zh) * 2013-12-31 2014-04-09 优视科技有限公司 增量文件生成方法、应用程序安装文件更新方法及装置

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389773A (zh) * 2018-04-23 2019-10-29 比亚迪股份有限公司 软件发布及部署方法、装置及系统
CN109558156A (zh) * 2019-01-15 2019-04-02 重庆德科电子仪表有限公司 一种汽车仪表升级优化方法
CN109558156B (zh) * 2019-01-15 2021-07-27 重庆德科电子仪表有限公司 一种汽车仪表升级优化方法
WO2021079975A1 (ja) * 2019-10-23 2021-04-29 ソニー株式会社 表示システム、表示装置、表示方法、及び、移動装置
CN113326059A (zh) * 2020-02-28 2021-08-31 腾讯科技(深圳)有限公司 一种资源更新方法、装置及存储介质
CN113326059B (zh) * 2020-02-28 2024-04-26 腾讯科技(深圳)有限公司 一种资源更新方法、装置及存储介质

Also Published As

Publication number Publication date
CN105404521A (zh) 2016-03-16
US10048959B2 (en) 2018-08-14
CN105404521B (zh) 2017-05-31
US20170249140A1 (en) 2017-08-31

Similar Documents

Publication Publication Date Title
WO2015180304A1 (zh) 增量升级方法及装置
KR102007070B1 (ko) 메모리 관리 시의 중복 제거를 위해서 기준 세트로 기준 블록을 취합하는 기법
JP6316974B2 (ja) フラッシュメモリ圧縮
US9507811B2 (en) Compressed data page with uncompressed data fields
US20240004838A1 (en) Quality score compression for improving downstream genotyping accuracy
CN112732650B (zh) 文件分片方法及装置
US20130067237A1 (en) Providing random access to archives with block maps
US9977598B2 (en) Electronic device and a method for managing memory space thereof
JP2013541774A (ja) ウェブサイトスキャンデバイスおよびウェブサイトスキャン方法
CN105204781A (zh) 压缩方法、装置和设备
US20200117642A1 (en) Determining optimal data size for data deduplication operation
US9355250B2 (en) Method and system for rapidly scanning files
CN111177271B (zh) kafka数据持久化到hdfs的数据存储方法、装置、计算机设备
US10915534B2 (en) Extreme value computation
JP2002529849A (ja) データ処理リソースを供給された内蔵システムにおいて実行可能な中間オブジェクトコードプログラムのためのデータ圧縮方法、および、この方法に対応しかつマルチアプリケーションを備えた内蔵システム
US20120271802A1 (en) Forward compatibility guaranteed data compression and decompression method and apparatus thereof
US20170123678A1 (en) Garbage Collection for Reference Sets in Flash Storage Systems
KR20170010810A (ko) 플래시 메모리 내에 데이터를 판독/기록하기 위한 방법, 장치 및 사용자 장비
CN106293542B (zh) 一种文件解压缩的方法及装置
CN105320669B (zh) 数据存储、读取方法及数据存储、读取装置
CN114816219A (zh) 数据写入和读取方法、装置及数据读写系统
CN110377276B (zh) 源代码文件管理方法及设备
CN109992469A (zh) 一种合并日志的方法及装置
CN107577474B (zh) 升级文件的处理方法及装置、电子设备
CN109189345B (zh) 一种在线数据整理方法、装置、设备及存储介质

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: 14893238

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 15315272

Country of ref document: US

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03.05.2017)

122 Ep: pct application non-entry in european phase

Ref document number: 14893238

Country of ref document: EP

Kind code of ref document: A1