作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2020, Vol. 46 ›› Issue (10): 210-215. doi: 10.19678/j.issn.1000-3428.0056426

• 体系结构与软件技术 • 上一篇    下一篇

一种改进的固件增量更新算法

王豫新a,b, 高美凤a,b   

  1. 江南大学 a. 轻工过程先进控制教育部重点实验室;b. 物联网工程学院, 江苏 无锡 214122
  • 收稿日期:2019-10-28 修回日期:2019-12-02 发布日期:2019-12-03
  • 作者简介:王豫新(1993-),男,硕士研究生,主研方向为嵌入式系统应用与开发、物联网技术;高美凤,副教授、博士。
  • 基金资助:
    国家自然科学基金(61373126)。

An Improved Incremental Update Algorithm for Firmware

WANG Yuxina,b, GAO Meifenga,b   

  1. a. Key Laboratory of Advanced Process Control for Light Industry (Ministry of Education);b. School of Internet of Things Engineering, Jiangnan University, Wuxi, Jiangsu 214122, China
  • Received:2019-10-28 Revised:2019-12-02 Published:2019-12-03

摘要: 针对bsdiff算法在嵌入式设备固件更新中构建新版本固件时内存消耗大的问题,提出一种节约内存的增量更新算法。利用改进的bsdiff算法的补丁文件格式,避免应用补丁文件时记录并频繁计算地址偏移量。将bsdiff算法中的并行解压过程更换为串行解压,并通过分批处理数据以减小需要的辅助空间。同时,将非对称的无损压缩算法应用到改进后的增量更新算法的压缩与解压缩过程,降低由于解压缩补丁文件而造成的较大内存消耗。实验结果表明,与bsdiff算法、xdelta算法、vcdiff算法、zdelta算法相比,该算法能够有效减少构建新版本固件时的内存消耗,且具有良好的压缩性能。

关键词: 增量更新, 内存消耗, 固件, 嵌入式设备, 无损压缩, 补丁文件

Abstract: In order to solve the high memory consumption of bsdiff algorithm when building new versions of firmware in the firmware update of embedded devices,this paper proposes an incremental update algorithm that saves memory.The improved patch file format of the bsdiff algorithm is used to avoid recording and calculating the address offset frequently in the application of the patch files.The parallel decompression process in the bsdiff algorithm is replaced by serial decompression,and the required auxiliary space is reduced by processing data in batches.At the same time,the asymmetric lossless compression algorithm is applied to the compression and decompression process of the improved incremental update algorithm,which reduces the memory consumption caused by the decompression of patch files.Experimental results show that,compared with bsdiff algorithm,xdelta algorithm,vcdif algorithm and zdelta algorithm,the proposed algorithm can effectively reduce the memory consumption when building new versions of firmware,and has good compression performance.

Key words: incremental update, memory consumption, firmware, embedded device, lossless compression, patch file

中图分类号: