Android App Updates 新技術 File-by-File patching 可減省 65% 數據量

Google 在年初宣佈採用了新的運算法 bsdiff algorithm 可以將 App Update 所需的數據量大幅減省,較一整個 APK 的數據量達 47%。

Today, we’re excited to share a new approach that goes further — File-by-File patching. App Updates using File-by-File patching are, on average, 65% smaller than the full app, and in some cases more than 90% smaller.

最新 Google 再加入了新技術 File-by-File patching,可以較一整個 APK 更新節省達 65% 數據量,在部份情況更可達 90%。對用家而言,更新 App 時用少了數據當然好呢。

In order to get the new version of the app, Google Play sends your device a patch that describes the differences between the old and new versions of the app.

解壓, 比較, 更新, 再壓縮
Android Apps 是 APK 檔案形式發佈,APK 檔案本身就是一個壓縮檔案,內裏包含著各個不同的檔案。File-by-File patching 就是逐一比對內裏的檔案並只下載當中有新增或修改的部份。由於不能直接比較已壓縮的檔案,所以過程需要將新檔案和舊檔案解壓,再計算找出兩者之間的分別。跟著就可以將舊檔案解壓,加上改動的部份之後再進行壓縮。

由於需要涉及壓縮和運算程序,所以需要耗用裝置的運算能力,對於一些新的裝置 (例如 2015 或之後推出),重新壓縮 1MB 只需約 1秒,較舊的裝置則需要多一點時間。下面是一些 Apps 更新方法的比較,File-by-File Patch 明顯可以減省更多數據量。

App Updates File by File Patching

現在這個 File-by-File Patching 新方法只會應用於 Auto-Updates,即是在背景運行的情況,例如半夜裝置在充電情況下用家並不在使用裝置時,這樣可減少對用家使用裝置的影響。

Source: Android Developers

發佈留言