WO2014180425A1 - 文件系统升级包制作方法、升级方法及装置、终端 - Google Patents

文件系统升级包制作方法、升级方法及装置、终端 Download PDF

Info

Publication number
WO2014180425A1
WO2014180425A1 PCT/CN2014/079300 CN2014079300W WO2014180425A1 WO 2014180425 A1 WO2014180425 A1 WO 2014180425A1 CN 2014079300 W CN2014079300 W CN 2014079300W WO 2014180425 A1 WO2014180425 A1 WO 2014180425A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
package
target
type
file system
Prior art date
Application number
PCT/CN2014/079300
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 EP14795338.4A priority Critical patent/EP3086225B1/en
Priority to US15/104,618 priority patent/US10204108B2/en
Publication of WO2014180425A1 publication Critical patent/WO2014180425A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/122File system administration, e.g. details of archiving or snapshots using management policies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a file system upgrade package manufacturing method, an upgrade method, apparatus, and terminal.
  • BACKGROUND With the rapid pace of terminal manufacturers releasing new terminals, the software version of the listed terminal inevitably has some bugs or parts that need to improve the user experience, and even some fatal faults need to be repaired.
  • the software of the terminal device can be upgraded by using the FOTA (Firmware Update Over the Air) method, the upgrade scheme is increasingly rich, and the upgrade requirements are becoming more and more complicated. It also includes the upgrade requirements for the File System.
  • FOTA Firmware Update Over the Air
  • the method of upgrading the file system based on FOTA technology in the industry adopts the method of differential upgrade.
  • a differential upgrade package is generated by using a differential algorithm between the original file system to be upgraded and the target file system formed after the upgrade, and the differential upgrade is used in the actual upgrade process of the terminal device.
  • the package upgrades the original file system of the terminal device to the target file system.
  • the differential algorithm Since the differential algorithm is used, it can only be upgraded between the fixed original file system and the target file system.
  • the technical problem to be solved by the present invention is to provide a file system upgrade package manufacturing method, an upgrade method, a device, and a terminal, which are used to solve the disadvantages that the FOTA cannot upgrade a dynamic file in the prior art.
  • the present invention provides a file system upgrade package manufacturing method, including: Obtaining file information of each source file in the file system to be upgraded; determining an operation type of the target file corresponding to the source file according to file information of each of the source files, where the operation type includes a dynamic type, a static type, and a new type One of the three; when the operation type of the target file is a dynamic type or a new type, compressing the target file to form a file compression package, and when the operation type of the target file is a static type, according to the target
  • the difference between the file and its corresponding source file is subjected to a difference operation to form a file difference packet; each of the file compression package and each of the file difference packets are packaged to form a file system upgrade package.
  • the obtaining the file information of each source file in the file system to be upgraded includes: obtaining the file information of each source file in the file system to be upgraded by reading the configuration file.
  • the file system upgrade package includes a package body, where the package body includes data information and index information of each file compression package, data information and index information of each file difference package, where each The operation type parameter of the target file is included in each of the index information.
  • the packetizing the file compression package and each of the file difference packets to form a file system upgrade package specifically includes: writing an operation type of each of the target files to a corresponding file compression package index information or file.
  • the packet information is packaged into a file system upgrade package, where the index information is located in the package body, and the data information and the index information of each of the file compression packets are packaged into a file system upgrade package.
  • the data information is located in the second half of the package.
  • the packet further includes deletion indication information, configured to indicate that the corresponding source file is deleted.
  • the present invention further provides a file system upgrade method, including: parsing a downloaded file system upgrade package, to determine an operation type of each target file in the file system upgrade package, where the operation type includes a dynamic type, One of a static type and a new type, the file system upgrade package includes a file compression package and a file difference package, and each of the target files corresponds to a file compression package or a file difference package;
  • the operation type is a dynamic type or a new type
  • the file compression package corresponding to the target file is decompressed to form an object file to complete the upgrade at the terminal;
  • the operation type of the target file is a static type
  • the terminal is The source file in the file system to be upgraded and the corresponding file difference package are restored and calculated to form an object file in the terminal to complete the upgrade.
  • the parsing the downloaded file system upgrade package to determine the operation type of each target file in the file system upgrade package includes: unpacking the file system upgrade package, and separating the packet header and the package body,
  • the package includes data information and index information of each of the file compression packages, data information and index information of each of the file difference packets, and an operation type parameter of each of the target files is included in each of the index information;
  • the operation type of each object file in the file system upgrade package is determined by reading index information in the package body. Further, after the file system upgrade package is unpacked, and the packet header and the package body are separated, the operation of determining each target file in the file system upgrade package by reading index information in the package body is determined.
  • the method further includes: verifying, by using an upgrade package check code in the header, the file system upgrade package to determine whether the file system upgrade package is correctly downloaded.
  • decompressing the file compression package corresponding to the target file to form an object file in the terminal to complete the upgrade specifically includes: The file compression package corresponding to the target file is decompressed to form a target file; the formed target file is verified by using the target file check code in the index information; if the verification is passed, the target file is used instead of the source file. Upgrade, if the verification fails, discard the target file and abandon the upgrade.
  • the present invention further provides a file system upgrade package creation device, including: an obtaining unit, configured to obtain file information of each source file in the file system to be upgraded; and a determining unit, configured to obtain each according to the acquiring unit Determining, by the file information of the source file, an operation type of the target file corresponding to the source file, the operation type includes one of a dynamic type, a static type, and a newly added type; and a file packing unit, configured to be When the operation type of the target file is a dynamic type or a new type, the target file is compressed to form a file compression package, and when the operation type of the target file is a static type, according to the target file and its corresponding source file Between the differences, a differential operation is performed to form a file difference packet; a file system packing unit is configured to package each of the file compression package and each of the file difference packets to form a file system upgrade package.
  • the acquiring unit is specifically configured to obtain file information of each source file in the file system to be upgraded by reading a configuration file.
  • the file system upgrade package includes a package body, where the package body includes data information and index information of each file compression package, data information and index information of each file difference package, and each target object. The operation type parameter of the file is included in each of the index information.
  • the file system packaging unit specifically includes: a writing module, configured to write an operation type of each of the target files into a corresponding file compression package index information or a file differential package index information; and a packaging module, configured to Data information and index information of each of the file compression packets, data information and index information of each of the file difference packets are packaged to form a file system upgrade package, wherein the index information is located in a first half of the package body, and the data is Information is located in the second half of the enclosure.
  • the package further includes deletion indication information, and is set to indicate that the corresponding source file is deleted.
  • the present invention provides a file system upgrading apparatus, including: a parsing unit, configured to parse a downloaded file system upgrade package, to determine an operation type of each target file in the file system upgrade package,
  • the operation type includes one of a dynamic type, a static type, and a new type.
  • the file system upgrade package includes a file compression package and a file differential package, and each of the target files is combined with a file compression package or a file differential package.
  • the decompression unit is configured to: when the operation type of the target file is a dynamic type or a new type, decompress the file compression package corresponding to the target file to form an object file in the terminal to complete the upgrade;
  • the operation type of the target file is a static type
  • the source file in the file system to be upgraded of the terminal and the corresponding file difference package are restored and calculated to form an object file in the terminal to complete the upgrade.
  • the parsing unit includes: an unpacking module, configured to unpack the file system upgrade package, and separate a packet header and a package body, where the packet body includes data information and index information of each file compression package.
  • the apparatus further includes: an upgrade package verification module, configured to check the file system upgrade package by using an upgrade package check code in the header to determine whether the file system upgrade package is correctly download.
  • the decompressing unit specifically includes: a decompression module, configured to decompress a file compression package corresponding to the target file to form a target file; and an object file verification module configured to utilize a target in the index information
  • the file check code is used to verify the target file formed by decompressing the decompression module; and the upgrade module is configured to complete the upgrade by using the target file instead of the source file if the target file verification module passes the verification. If the verification fails, discard the target file and abandon the upgrade.
  • the present invention further provides a terminal, where the terminal includes any file system upgrading apparatus provided by an embodiment of the present invention.
  • the file system upgrade package manufacturing method, the upgrade method and device, and the terminal provided by the embodiment of the present invention can obtain file information of each source file in the file system to be upgraded, and determine the target file corresponding to the source file according to the file information.
  • An operation type when the operation type of the target file is a dynamic type or a new type, compressing the target file to form a file compression package, and when the operation type of the target file is a static type, according to the target file and
  • the difference between the corresponding source files is differentially operated to form a file difference packet, so that the dynamic type and the newly typed object file are distinguished from the static type object file, so that the target files of different operation types can be
  • the production into the upgrade package greatly expands the scope of the file system upgrade through FOTA.
  • FIG. 1 is a flowchart of a method for fabricating a file system upgrade package according to an embodiment of the present invention
  • 2 is a schematic diagram of a file system upgrade package made by using the file system upgrade package manufacturing method provided by the embodiment of the present invention
  • FIG. 3 is a schematic structural view of the packet header of FIG. 2
  • FIG. 5 is a schematic diagram of a file system upgrade method according to an embodiment of the present invention
  • FIG. 6 is a schematic structural diagram of a file system upgrade package creation apparatus according to an embodiment of the present invention
  • an embodiment of the present invention provides a file system upgrade package manufacturing method, which includes the following steps S11-S14.
  • the file system upgrade package manufacturing method provided by the embodiment of the present invention first obtains file information of each source file in the file system to be upgraded, and determines an operation type of the target file corresponding to the source file according to the file information, when the target When the operation type of the file is a dynamic type or a new type, the target file is compressed to form a file compression package, and when the operation type of the target file is a static type, according to the target file and its corresponding source file The difference is performed to form a file difference package, and then the file compression package and each of the file difference packages are packaged to form a file system upgrade package, so that the dynamic type and the newly added type object file are static.
  • the target files of the type are differentiated, so that the target files of different operation types can be created into the upgrade package, which greatly expands the scope of file system upgrade by FOTA.
  • the upgrade package of the file system is generally prepared by the software provider, and is downloaded and run by the terminal on the server to complete the upgrade of the file system of the terminal.
  • the terminal has its own file system at the factory.
  • the software provider keeps relevant records for the source files of the file system and the specific installation location of each source file in the terminal. Therefore, when upgrading the file system, the software The provider can fully grasp the source files of the to-be-upgraded and the various file information of the target files formed after the upgrade, thereby making a file system compression package by using the file information.
  • the file information of each source file can be recorded through the configuration file.
  • the configuration file can be obtained by reading the configuration file.
  • the file information may include a file size, a storage location, an operation type, an access right, a check code, and the like.
  • the operation type is a parameter set according to whether the file can be changed by the user. For files that cannot be changed by the user, the operation type is static type, and for files that can be changed by the user's settings, the operation type is dynamic.
  • the operation type of the target file formed after the upgrade may be determined according to the operation type of the source file to be upgraded. For example, if the source file is of a dynamic type, the upgraded target file is also of a dynamic type, and may be operated according to a dynamic type. Make an upgrade package. It is worth noting that since the target file is an upgrade or improvement of the source file, some target files may belong to the newly added file, and there is no corresponding source file. The newly added file is neither dynamic type. It is not a static type, but is defined as another type, that is, a new type. In the embodiment of the present invention, the operation type of the target file is divided into three types: a dynamic type, a static type, and a new type.
  • step S13 target files of different operation types are correspondingly formed into different file upgrade packages.
  • the operation type of the target file is a dynamic type, it indicates that the source file can be changed by the user, and the corresponding source files of different terminals are not the same.
  • the difference algorithm is not applicable. Therefore, the source file can be ignored and the target file directly compressed to form a file compression package.
  • the operation type of the target file is a new type, it indicates that the source file does not exist in the file system to be upgraded. Therefore, the target file may be directly compressed to form a file compression package.
  • the source file cannot be modified by the user, and the source file still maintains the factory setting, so the difference between the target file and its corresponding source file can be determined. , perform differential operations to form a file differential package.
  • the file compression package and the file difference package can be packaged to form a file system upgrade package.
  • the specific structure of the file system upgrade package is not limited by the embodiment of the present invention.
  • the structure of the upgrade package created by the upgrade package manufacturing method of the embodiment may be as shown in FIG. 2 to FIG. 4.
  • the file system upgrade package in this embodiment is mainly composed of a packet header and a package body.
  • the package includes data information and index information of each of the file compression packages, data information and index information of each of the file difference packets, wherein index information of each of the file compression packages and each of the file upgrade packages
  • the operation information of the corresponding target file is included in the index information.
  • the header mainly describes the header length of the entire file system upgrade package, the length of the package, the number of file compression packets, the number of file differential packets, the total length of the upgrade packet check code and index information, and so on.
  • the file system upgrade package includes data information and index information of each of the file compression packages (for dynamic type files or newly added types files), data information and index information of each of the file difference packages (for static type files),
  • the index information of each of the file compression packages and the index information of each of the file upgrade packages include an operation type parameter of the corresponding target file.
  • the index information may include, for example, a source file path corresponding to each file difference packet and file compression package, a check code of the source and destination files, a permission of the source and destination files, an operation type, and the like; the data information mainly includes a file compression package. Or valid data for the file differential package to upgrade the source file.
  • the index information and the data information may be stored in the package in a suitable manner as needed, but preferably, as shown in the figure
  • the data information of each file difference packet and file compression package is located in the second half of the package body, and the index information of each file difference packet and file compression package is located in the first half of the package body, so that the file system upgrade package is read.
  • the index information can be read first, so that the information such as the check code of the corresponding file can be obtained more quickly, which is beneficial to improving the verification speed and reducing the resource consumption.
  • the package may further include deletion indication information, configured to indicate that the corresponding source file is deleted.
  • packaging the file compression package and each of the file difference packets to form a file system upgrade package may specifically include the following steps 1-2.
  • Step 1 Write the operation type of each of the target files to the corresponding file compression package index information or file differential package index information.
  • Step 2 packet data information and index information of each file compression package, data information of each of the file difference packets, and index information are packaged into a file system upgrade package, where the index information is located in the first half of the package body. The data information is located in the second half of the enclosure.
  • an embodiment of the present invention further provides a file system upgrade method. As shown in FIG. 5, the method may include the following steps S21-S23.
  • S21 parsing the downloaded file system upgrade package, to determine an operation type of each target file in the file system upgrade package, where the operation type includes one of a dynamic type, a static type, and a new type, and the file system
  • the upgrade package includes a file compression package and a file differential package, and each of the target files corresponds to a file compression package or a file difference package.
  • the file system upgrade method provided by the embodiment of the present invention is capable of determining an operation type of each target file in the file system upgrade package by parsing the downloaded file system upgrade package, when the operation type of the target file is a dynamic type or When a new type is added, the file compression package corresponding to the target file is decompressed to form an object file to be upgraded in the terminal, and when the operation type of the target file is a static type, the source in the file system to be upgraded of the terminal is used.
  • step S21 the downloaded file system upgrade package is parsed to determine the operation type of each target file in the file system upgrade package, which may include the following steps 1 - 2.
  • Step 1 Unpacking the file system upgrade package, separating a packet header and a package body, where the package body includes data information and index information of each file compression package, and data information and index information of each file difference package.
  • the operation type parameter of each of the target files is included in each of the index information.
  • Step 2 Determine an operation type of each target file in the file system upgrade package by reading index information in the package body.
  • the file system upgrade package is downloaded from the server by the terminal, an error may occur during the data transfer process, resulting in an error in the downloaded file system upgrade package. If the file system is rushed with such an upgrade package, The upgrade can have a serious impact.
  • the upgrade method may further include: verifying, by using the upgrade package check code in the header, the file system upgrade package to determine whether the file system upgrade package is correctly download. If it is correct, perform the following operations.
  • the upgrade method used is different for target files of different operation types.
  • the operation type of the target file is a static type
  • the source file in the file system to be upgraded of the terminal and the corresponding file difference package may be restored and calculated to form an object file in the terminal to complete the upgrade
  • the operation type of the target file is a dynamic type or a new type
  • the file compression package corresponding to the target file needs to be decompressed to form an object file to complete the upgrade.
  • the method for upgrading the corresponding source file may include the following steps 1 - 3.
  • Step 1 Decompress the file compression package corresponding to the target file to form an object file.
  • Step 2 Verify the formed target file by using the target file check code in the index information.
  • Step 3 If the verification is passed, the upgrade is performed by using the target file instead of the source file, and if the verification fails, the target file is discarded and the upgrade is abandoned. Correspondingly, as shown in FIG.
  • the present invention further provides a file system upgrade package making apparatus, including: an obtaining unit 11 configured to obtain file information of each source file in the file system to be upgraded; and a determining unit 12 configured to The file information of each of the source files acquired by the obtaining unit determines an operation type of the target file corresponding to the source file, and the operation type includes one of a dynamic type, a static type, and a newly added type;
  • the unit 13 is configured to compress the target file to form a file compression package when the operation type of the target file is a dynamic type or a new type, and when the operation type of the target file is a static type, according to the target
  • the difference between the file and its corresponding source file is subjected to a difference operation to form a file difference packet;
  • the file system packing unit 14 is configured to package each of the file compression package and each of the file difference packets to form a file system upgrade package.
  • the file system upgrade package creating apparatus provided by the embodiment of the present invention, the obtaining unit 11 is capable of acquiring file information of each source file in the file system to be upgraded, and the determining unit 12 is capable of determining the target file corresponding to the source file according to the file information.
  • the file packaging unit 13 can compress the target file to form a file compression package, when the operation class of the target file
  • the file packing unit 13 can perform a difference operation according to the difference between the target file and its corresponding source file to form a file difference package
  • the file system packing unit 14 can compress each of the file files and
  • Each of the file difference packets is packaged to form a file system upgrade package, so that the dynamic type and the newly typed object file are distinguished from the static type object file, so that the target files of different operation types can be created into the upgrade package.
  • the scope of file system upgrade through FOTA is greatly expanded.
  • the obtaining unit 11 is specifically configured to obtain file information of each source file in the file system to be upgraded by reading a configuration file.
  • the file system upgrade package includes a package body, and the package body includes data information and index information of each of the file compression packages, data information and index information of each of the file difference packets, and operation type of each of the target files. Parameters are included in each of the index information. Further, the package further includes deletion indication information, and is set to indicate that the corresponding source file is deleted.
  • the file system packaging unit 14 specifically includes: a writing module, configured to write an operation type of each of the target files into a corresponding file compression package index information or a file differential package index information; and a packaging module, configured to Data information and index information of each of the file compression packets, data information and index information of each of the file difference packets are packaged to form a file system upgrade package, wherein the index information is located in a first half of the package body, and the data is Information is located in the second half of the enclosure.
  • the present invention further provides a file system upgrading apparatus, including: a parsing unit 21, configured to parse a downloaded file system upgrade package, to determine each target file in the file system upgrade package.
  • the operation type includes one of a dynamic type, a static type, and a new type
  • the file system upgrade package includes a file compression package and a file differential package, each of the target files and a file compression package or a
  • the file compression package 22 is configured to: when the operation type of the target file is a dynamic type or a new type, decompress the file compression package corresponding to the target file to form a target file in the terminal.
  • the upgrade unit 23 is configured to: when the operation type of the target file is a static type, restore the source file in the file system to be upgraded of the terminal and the corresponding file difference package to form a target in the terminal. The file is upgraded.
  • the file system upgrading apparatus can determine the operation type of each target file in the file system upgrade package by parsing the downloaded file system upgrade package by the parsing unit 21, when the operation type of the target file is When the dynamic type or the new type is added, the decompression unit 22 can decompress the file compression package corresponding to the target file to complete the upgrade by forming the target file in the terminal, and when the operation type of the target file is a static type, the restoration unit 23: The source file in the file system to be upgraded of the terminal and the corresponding file difference package are restored and calculated, so that the target file is formed in the terminal to complete the upgrade, so that the dynamic type and the newly added type are The object file is distinguished from the static type of object file, greatly expanding the scope of the file system upgrade through FOTA.
  • the parsing unit 21 may include: an unpacking module, configured to unpack the file system upgrade package, and separate the packet header and the package body, where the packet body includes data information and index information of each file compression package. Data information and index information of each of the file difference packets, an operation type parameter of each of the object files is included in each of the index information; and a determining module is configured to determine by reading index information in the object body The type of operation of each object file in the file system upgrade package.
  • the file system upgrading apparatus provided by the embodiment of the present invention may further include: an upgrade package verification module, configured to perform verification of the file system upgrade package by using an upgrade package check code in the packet header to determine Whether the file system upgrade package is correctly downloaded.
  • the decompression unit 22 may further include: a decompression module, configured to decompress a file compression package corresponding to the target file to form an object file; and an object file verification module configured to utilize the target in the index information
  • the file check code is used to verify the target file formed by decompressing the decompression module; and the upgrade module is configured to complete the upgrade by using the target file instead of the source file if the target file verification module passes the verification. If the verification fails, discard the target file and abandon the upgrade.
  • the embodiment of the present invention further provides a terminal, where the terminal includes any file system upgrading apparatus provided in the foregoing embodiment, and thus the corresponding beneficial effects can also be achieved, and the foregoing has been described in detail. No longer.
  • the file type information of each source file in the file system to be upgraded is obtained, and the operation type of the target file corresponding to the source file is determined, when the operation type of the target file is dynamic type or new When the type is increased, the target file is compressed to form a file compression package.
  • the operation type of the target file is a static type, a difference operation is performed according to the difference between the target file and the corresponding source file to form a file.
  • the difference package, the dynamic type and the new type of object file are distinguished from the static type object file, so that the target files of different operation types can be made into the upgrade package, which greatly expands the file system upgrade through FOTA mode.

Abstract

一种文件系统升级包制作方法、升级方法及装置、终端,涉及通信技术领域,用以解决现有技术中FOTA不能对动态文件进行升级的弊端。所述制作方法包括:获取待升级文件系统中各个源文件的文件信息;根据各个所述源文件的文件信息确定与所述源文件对应的目标文件的操作类型,所述操作类型包括动态类型、静态类型、新增类型三者之一;当所述目标文件的操作类型为动态类型或新增类型时,压缩所述目标文件以形成文件压缩包,当所述目标文件的操作类型为静态类型时,根据所述目标文件及其对应的源文件之间的差异,进行差分运算以形成文件差分包;将各所述文件压缩包和各所述文件差分包打包形成文件系统升级包。

Description

文件系统升级包制作方法、 升级方法及装置、 终端 技术领域 本发明涉及通信技术领域, 特别是涉及一种文件系统升级包制作方法、 升级方法 及装置、 终端。 背景技术 随着终端制造商发布新终端上市的节奏越来越快, 上市终端的软件版本难免存在 一些 Bug或者亟待提高用户体验的部分, 甚至会有一些致命故障亟待修复。 一般可以 采用 FOTA (无线固件升级, Firmware Update Over the Air) 方法对终端设备的软件进 行升级, 升级方案日渐丰富, 升级需求也日趋复杂。 其中, 也包含了对文件系统(File System) 的升级需求。 目前业界基于 FOTA技术进行文件系统升级的方法, 都是采用差分升级的方式。 即,在提供升级包时, 需要在待升级的原文件系统和升级后形成的目标文件系统之间, 通过某种差分算法生成差分升级包, 在终端设备的实际升级过程中, 利用该差分升级 包将终端设备的原文件系统升级到目标文件系统。 这样, 由于升级包只涉及到两个版 本文件系统之间有差异的部分,相同部分不纳入升级范围,使得制作出的升级包较小, 能实现快速的下载和升级。 然而, 这种升级方法也存在着一个限制: 由于是采用差分算法, 只能在固定的原 文件系统与目标文件系统之间进行升级。 也就是说, 当需要升级终端设备中某些动态 文件 (如最终用户可以通过菜单更改的默认网络制式、 默认锁屏时长、 默认浏览器接 入点等配置项) 时, 由于源文件系统已经被用户更改, 制作升级包的软件提供商或者 服务器都不能确定源文件的具体状况, 因此, 也就不能针对源文件与目标文件的差别 来使用差分算法制作出差分升级包, 在很大程度上制约了可以通过 FOTA方式进行的 文件系统升级的范围。 发明内容 本发明要解决的技术问题是提供一种文件系统升级包制作方法、升级方法及装置、 终端, 用以解决现有技术中 FOTA不能对动态文件进行升级的弊端。 为达上述目的, 一方面, 本发明提供一种文件系统升级包制作方法, 包括: 获取待升级文件系统中各个源文件的文件信息; 根据各个所述源文件的文件信息 确定与所述源文件对应的目标文件的操作类型, 所述操作类型包括动态类型、 静态类 型、 新增类型三者之一; 当所述目标文件的操作类型为动态类型或新增类型时, 压缩 所述目标文件以形成文件压缩包, 当所述目标文件的操作类型为静态类型时, 根据所 述目标文件及其对应的源文件之间的差异, 进行差分运算以形成文件差分包; 将各所 述文件压缩包和各所述文件差分包打包形成文件系统升级包。 可选的, 所述获取待升级文件系统中各个源文件的文件信息具体包括: 通过读取 配置文件获取所述待升级文件系统中各个源文件的文件信息。 可选的, 所述文件系统升级包包括包体, 所述包体包括各所述文件压缩包的数据 信息及索引信息、 各所述文件差分包的数据信息及索引信息, 其中, 每个所述目标文 件的操作类型参数包含于各所述索引信息中。 可选的, 所述将各所述文件压缩包和各所述文件差分包打包形成文件系统升级包 具体包括: 将每个所述目标文件的操作类型写入对应的文件压缩包索引信息或文件差 分包索引信息; 将各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数 据信息及索引信息打包形成文件系统升级包, 其中, 所述索引信息位于所述包体的前 半部分, 所述数据信息位于所述包体的后半部分。 可选的, 所述包体还包括删除指示信息, 用于指示将对应的源文件删除。 另一方面, 本发明还提供一种文件系统升级方法, 包括: 解析下载的文件系统升 级包, 以确定所述文件系统升级包中每个目标文件的操作类型, 所述操作类型包括动 态类型、 静态类型、 新增类型三者之一, 所述文件系统升级包包括文件压缩包和文件 差分包, 每个所述目标文件与一个文件压缩包或者一个文件差分包相对应; 当所述目 标文件的操作类型为动态类型或新增类型时, 对所述目标文件对应的文件压缩包解压 缩, 以在终端形成目标文件完成升级; 当所述目标文件的操作类型为静态类型时, 将 终端的待升级文件系统中的源文件与对应的文件差分包进行还原计算, 以在所述终端 中形成目标文件完成升级。 可选的, 所述解析下载的文件系统升级包, 以确定所述文件系统升级包中每个目 标文件的操作类型具体包括: 对所述文件系统升级包拆包, 分离出包头和包体, 所述 包体包括各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息及 索引信息, 每个所述目标文件的操作类型参数包含于各所述索引信息中; 通过读取所 述包体中的索引信息确定所述文件系统升级包中每个目标文件的操作类型。 进一步的, 所述对所述文件系统升级包拆包, 分离出包头和包体之后, 所述通过 读取所述包体中的索引信息确定所述文件系统升级包中每个目标文件的操作类型之 前, 所述方法还包括: 利用所述包头中的升级包校验码对所述文件系统升级包进行校 验, 以确定所述文件系统升级包是否被正确下载。 可选的, 所述当所述目标文件的操作类型为动态类型或新增类型时, 对所述目标 文件对应的文件压缩包解压缩, 以在终端形成目标文件完成升级具体包括: 对所述目 标文件对应的文件压缩包解压缩形成目标文件; 利用所述索引信息中的目标文件校验 码对形成的所述目标文件进行校验; 如果校验通过, 用所述目标文件代替源文件完成 升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 另一方面, 本发明还提供一种文件系统升级包制作装置, 包括: 获取单元, 设置 为获取待升级文件系统中各个源文件的文件信息; 确定单元, 设置为根据所述获取单 元获取的各个所述源文件的文件信息,确定与所述源文件对应的目标文件的操作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一; 文件打包单元, 设置为 当所述目标文件的操作类型为动态类型或新增类型时, 压缩所述目标文件以形成文件 压缩包, 当所述目标文件的操作类型为静态类型时, 根据所述目标文件及其对应的源 文件之间的差异, 进行差分运算以形成文件差分包; 文件系统打包单元, 设置为将各 所述文件压缩包和各所述文件差分包打包形成文件系统升级包。 可选的, 所述获取单元, 具体设置为通过读取配置文件获取所述待升级文件系统 中各个源文件的文件信息。 可选的, 所述文件系统升级包包括包体, 所述包体包括各所述文件压缩包的数据 信息及索引信息、 各所述文件差分包的数据信息及索引信息, 每个所述目标文件的操 作类型参数包含于各所述索引信息中。 具体的, 所述文件系统打包单元具体包括: 写入模块, 设置为将每个所述目标文 件的操作类型写入对应的文件压缩包索引信息或文件差分包索引信息; 打包模块, 设 置为将各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息及索 引信息打包形成文件系统升级包, 其中, 所述索引信息位于所述包体的前半部分, 所 述数据信息位于所述包体的后半部分。 可选的, 所述包体还包括删除指示信息, 设置为指示将对应的源文件删除。 另一方面, 本发明还提供一种文件系统升级装置, 包括: 解析单元, 设置为解析 下载的文件系统升级包, 以确定所述文件系统升级包中每个目标文件的操作类型, 所 述操作类型包括动态类型、 静态类型、 新增类型三者之一, 所述文件系统升级包包括 文件压缩包和文件差分包, 每个所述目标文件与一个文件压缩包或者一个文件差分包 相对应; 解压缩单元, 设置为当所述目标文件的操作类型为动态类型或新增类型时, 对所述目标文件对应的文件压缩包解压缩, 以在终端形成目标文件完成升级; 还原单 元, 设置为当所述目标文件的操作类型为静态类型时, 将终端的待升级文件系统中的 源文件与对应的文件差分包进行还原计算, 以在所述终端中形成目标文件完成升级。 可选的, 所述解析单元包括: 拆包模块, 设置为对所述文件系统升级包拆包, 分 离出包头和包体, 所述包体包括各所述文件压缩包的数据信息及索引信息、 各所述文 件差分包的数据信息及索引信息, 每个所述目标文件的操作类型参数包含于各所述索 引信息中; 确定模块, 设置为通过读取所述包体中的索引信息确定所述文件系统升级 包中每个目标文件的操作类型。 进一步地, 所述装置还包括: 升级包校验模块, 设置为利用所述包头中的升级包 校验码对所述文件系统升级包进行校验,以确定所述文件系统升级包是否被正确下载。 可选的, 所述解压缩单元具体包括: 解压缩模块, 设置为对所述目标文件对应的 文件压缩包解压缩形成目标文件; 目标文件校验模块, 设置为利用所述索引信息中的 目标文件校验码对所述解压缩模块解压缩后形成的所述目标文件进行校验;升级模块, 设置为如果所述目标文件校验模块校验通过, 用所述目标文件代替源文件完成升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 另一方面, 本发明还提供一种终端, 所述终端包括本发明实施例提供的任一种文 件系统升级装置。 本发明的实施例提供的文件系统升级包制作方法、 升级方法及装置、 终端, 能够 获取待升级文件系统中各个源文件的文件信息, 根据该文件信息确定与所述源文件对 应的目标文件的操作类型, 当所述目标文件的操作类型为动态类型或新增类型时, 压 缩所述目标文件以形成文件压缩包, 当所述目标文件的操作类型为静态类型时, 根据 所述目标文件及其对应的源文件之间的差异, 进行差分运算以形成文件差分包, 这样 将动态类型和新增类型的目标文件与静态类型的目标文件相区分处理, 使得不同操作 类型的目标文件都能够被制作到升级包中, 大大扩展了通过 FOTA方式进行文件系统 升级的范围。 附图说明 图 1 是本发明的实施例提供的文件系统升级包制作方法的一种流程图; 图 2 是使用本发明的实施例提供的文件系统升级包制作方法制作的文件系统升 级包的一种示意图; 图 3 是图 2中的包头的结构示意图; 图 4 是图 2中的包体的结构示意图; 图 5是本发明的实施例提供的文件系统升级方法的一种流程图; 图 6 是本发明的实施例提供的文件系统升级包制作装置的一种结构示意图; 图 7是本发明的实施例提供的文件系统升级装置的一种结构示意图。 具体实施方式 以下结合附图, 对本发明进行进一步详细说明。 应当理解, 此处所描述的具体实 施例仅仅用以解释本发明, 并不限定本发明。 如图 1 所示,本发明的实施例提供一种文件系统升级包制作方法, 包括以下步骤 Sll-S14。
511 , 获取待升级文件系统中各个源文件的文件信息。
512,根据各个所述源文件的文件信息确定与所述源文件对应的目标文件的操作类 型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一。
513 , 当所述目标文件的操作类型为动态类型或新增类型时,压缩所述目标文件以 形成文件压缩包, 当所述目标文件的操作类型为静态类型时, 根据所述目标文件及其 对应的源文件之间的差异, 进行差分运算以形成文件差分包。
514, 将各所述文件压缩包和各所述文件差分包打包形成文件系统升级包。 本发明的实施例提供的文件系统升级包制作方法, 首先获取待升级文件系统中各 个源文件的文件信息,根据该文件信息确定与所述源文件对应的目标文件的操作类型, 当所述目标文件的操作类型为动态类型或新增类型时, 压缩所述目标文件以形成文件 压缩包, 当所述目标文件的操作类型为静态类型时, 根据所述目标文件及其对应的源 文件之间的差异, 进行差分运算以形成文件差分包, 再将各所述文件压缩包和各所述 文件差分包打包形成文件系统升级包, 这样将动态类型和新增类型的目标文件与静态 类型的目标文件相区分处理,使得不同操作类型的目标文件都能够被制作到升级包中, 大大扩展了通过 FOTA方式进行文件系统升级的范围。 需要说明的是, 文件系统的升级包一般是由软件提供商制作, 通过服务器上供终 端下载、 运行以完成对终端的文件系统的升级的。 终端在出厂时已经自带了一定的文 件系统, 软件提供商对于该文件系统的源文件以及各源文件在终端中的具体安装位置 都保留了相关记录, 因此, 在进行文件系统升级时, 软件提供商可以全面掌握待升级 的源文件以及升级后形成的目标文件的各种文件信息, 从而利用这些文件信息制作文 件系统压缩包。 在待升级的文件系统中, 可以通过配置文件记录各个源文件的文件信息, 则在步 骤 S11中, 当需要获取待升级文件系统中各个源文件的文件信息时, 可以通过读取该 配置文件获取所述待升级文件系统中各个源文件的文件信息。 可选的, 这些文件信息 可以包括文件的大小、 存储位置、 操作类型、 访问权限、 校验码等。 其中, 操作类型 是根据该文件是否可以被用户更改而设置的参数。 对于用户无法更改的文件, 其操作 类型为静态类型, 对于可以通过用户的设置而更改的文件, 其操作类型为动态类型。 可以根据待升级的源文件的操作类型来确定升级以后形成的目标文件的操作类型, 例 如, 如果源文件是动态类型的, 则升级后的目标文件也是动态类型的, 可以按照动态 类型的操作方法制作升级包。值得注意的是, 由于目标文件是对源文件的升级或改进, 因此, 可能有些目标文件是属于新增的文件, 并没有与其相对应的源文件, 这种新增 的文件既不属于动态类型也不属于静态类型, 而是被定义为另一种类型, 即新增类型。 本发明的实施例中, 将目标文件的操作类型分为动态类型、 静态类型和新增类型 三种, 对于不同的操作类型采用不同的升级包制作方法, 以便使文件系统中的所有文 件都能够使用该方法制作出的升级包进行升级。 具体的, 在步骤 S13中, 不同操作类型的目标文件对应形成不同的文件升级包。 当所述目标文件的操作类型为动态类型时, 说明源文件是能够被用户改动的, 不同的 终端的相应源文件不尽相同, 对这样的源文件进行升级时并不适用于差分运算法, 因 此, 可以忽略源文件, 而直接压缩所述目标文件以形成文件压缩包。 当所述目标文件 的操作类型为新增类型时, 说明待升级的文件系统中, 根本不存在该源文件, 因此也 可以直接压缩所述目标文件以形成文件压缩包。 当所述目标文件的操作类型为静态类 型时, 说明源文件是不能被用户修改的, 源文件仍然保持着出厂时的设置, 因此可以 根据所述目标文件及其对应的源文件之间的差异, 进行差分运算以形成文件差分包。 在针对每个目标文件制作出相应的文件差分包或文件压缩包后, 在步骤 S14中, 即可将这些文件压缩包和文件差分包打包形成文件系统升级包。 文件系统升级包的具 体结构本发明的实施例并不对其进行限制。 例如, 在本发明的一个实施例中, 通过本 实施例的升级包制作方法制作的升级包的结构可如图 2-图 4所示。 其中, 图 2文件系 统升级包整体结构, 图 3为图 2中的包头的具体结构, 图 4为图 2中的包体的具体结 构。 结合图 2至图 4可知, 本实施例中的文件系统升级包主要由包头和包体两部分组 成。 包体包括各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信 息及索引信息, 其中, 每个所述文件压缩包的索引信息和每个所述文件升级包的索引 信息中都包括对应的目标文件的操作类型参数。 包头主要描述整个文件系统升级包的 包头长度、 包体长度、 文件压缩包个数, 文件差分包个数, 升级包校验码和索引信息 的总长度等。 这些包头信息主要用于对整个文件系统进行解析。 文件系统升级包包体包括各所述文件压缩包(对于动态类型文件或新增类型文件) 的数据信息及索引信息、 各所述文件差分包 (对于静态类型文件) 的数据信息及索引 信息, 其中, 每个所述文件压缩包的索引信息和每个所述文件升级包的索引信息中都 包括对应的目标文件的操作类型参数。 其中, 索引信息例如可包括各文件差分包和文件压缩包所对应的源文件路径、 源 和目标文件的校验码、 源和目标文件的权限、 操作类型等信息; 数据信息主要包括文 件压缩包或文件差分包对源文件进行升级的有效数据。 索引信息和数据信息可以根据需要以适合的方式存储于包体中, 但优选的, 如图
4 所示, 各个文件差分包和文件压缩包的数据信息位于包体的后半部分, 而各个文件 差分包和文件压缩包的索引信息位于包体的前半部分, 这样, 读取文件系统升级包包 体时, 首先能读取到这些索引信息, 使得能较快速获知相应文件的校验码等信息, 有 利于提高校验速度、 减小资源消耗。 可选的, 所述包体还可包括删除指示信息, 用于指示将对应的源文件删除。 具体而言, 在步骤 S14中, 将各所述文件压缩包和各所述文件差分包打包形成文 件系统升级包具体可包括以下步骤 1-2。 步骤 1, 将每个所述目标文件的操作类型写入对应的文件压缩包索引信息或文件 差分包索引信息。 步骤 2, 将各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据 信息及索引信息打包形成文件系统升级包, 其中, 所述索引信息位于所述包体的前半 部分, 所述数据信息位于所述包体的后半部分。 相应的, 本发明的实施例还提供一种文件系统升级方法, 如图 5所示, 该方法可 包括以下步骤 S21-S23。
S21 ,解析下载的文件系统升级包, 以确定所述文件系统升级包中每个目标文件的 操作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一, 所述文件系 统升级包包括文件压缩包和文件差分包, 每个所述目标文件与一个文件压缩包或者一 个文件差分包相对应。 S22, 当所述目标文件的操作类型为动态类型或新增类型时,对所述目标文件对应 的文件压缩包解压缩, 以在终端形成目标文件完成升级。
S23 , 当所述目标文件的操作类型为静态类型时,将终端的待升级文件系统中的源 文件与对应的文件差分包进行还原计算, 以在所述终端中形成目标文件完成升级。 本发明的实施例提供的文件系统升级方法, 能够通过解析下载的文件系统升级包 来确定所述文件系统升级包中每个目标文件的操作类型, 当所述目标文件的操作类型 为动态类型或新增类型时, 对所述目标文件对应的文件压缩包解压缩, 以在终端形成 目标文件完成升级, 当所述目标文件的操作类型为静态类型时, 将终端的待升级文件 系统中的源文件与对应的文件差分包进行还原计算, 以在所述终端中形成目标文件完 成升级, 这样将动态类型和新增类型的目标文件与静态类型的目标文件相区分处理, 大大扩展了通过 FOTA方式进行文件系统升级的范围。 具体而言, 在步骤 S21中, 解析下载的文件系统升级包, 以确定所述文件系统升 级包中每个目标文件的操作类型可包括以下步骤 1-步骤 2。 步骤 1, 对所述文件系统升级包拆包, 分离出包头和包体, 所述包体包括各所述 文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息及索引信息, 每个 所述目标文件的操作类型参数包含于各所述索引信息中。 步骤 2, 通过读取所述包体中的索引信息确定所述文件系统升级包中每个目标文 件的操作类型。 考虑到文件系统升级包是由终端从服务器下载来的, 数据传输过程中可能会产生 错误而导致下载到的文件系统升级包出错, 如果贸然用这样的升级包对文件系统进行 升级可能产生严重的影响。 为了避免这种情况发生, 优选的, 在所述对所述文件系统 升级包拆包, 分离出包头和包体之后, 在通过读取所述包体中的索引信息确定所述文 件系统升级包中每个目标文件的操作类型之前, 该升级方法还可包括: 利用所述包头 中的升级包校验码对所述文件系统升级包进行校验, 以确定所述文件系统升级包是否 被正确下载。如果正确, 再进行后面的操作, 如果不正确就要停止后面的一系列操作, 而对文件系统升级包重新下载。 可选的, 对于不同操作类型的目标文件, 所采用的升级方法也不相同。 例如, 当 所述目标文件的操作类型为静态类型时, 可以将终端的待升级文件系统中的源文件与 对应的文件差分包进行还原计算, 以在所述终端中形成目标文件完成升级, 而当所述 目标文件的操作类型为动态类型或新增类型时, 就需要对所述目标文件对应的文件压 缩包解压缩, 以在终端形成目标文件完成升级。 具体而言, 对操作类型为动态类型或新增类型的目标文件而言, 升级相应的源文 件的方法可包括以下步骤 1-步骤 3。 步骤 1, 对所述目标文件对应的文件压缩包解压缩形成目标文件。 步骤 2, 利用所述索引信息中的目标文件校验码对形成的所述目标文件进行校验。 步骤 3, 如果校验通过, 用所述目标文件代替源文件完成升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 相应的, 如图 6所示, 本发明还提供一种文件系统升级包制作装置, 包括: 获取 单元 11, 设置为获取待升级文件系统中各个源文件的文件信息; 确定单元 12, 设置为 根据所述获取单元获取的各个所述源文件的文件信息, 确定与所述源文件对应的目标 文件的操作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一; 文件 打包单元 13, 设置为当所述目标文件的操作类型为动态类型或新增类型时, 压缩所述 目标文件以形成文件压缩包, 当所述目标文件的操作类型为静态类型时, 根据所述目 标文件及其对应的源文件之间的差异, 进行差分运算以形成文件差分包; 文件系统打 包单元 14, 设置为将各所述文件压缩包和各所述文件差分包打包形成文件系统升级 包。 本发明的实施例提供的文件系统升级包制作装置,获取单元 11能够获取待升级文 件系统中各个源文件的文件信息,确定单元 12能够根据该文件信息确定与所述源文件 对应的目标文件的操作类型, 当所述目标文件的操作类型为动态类型或新增类型时, 文件打包单元 13能够压缩所述目标文件以形成文件压缩包,当所述目标文件的操作类 型为静态类型时,文件打包单元 13能够根据所述目标文件及其对应的源文件之间的差 异,进行差分运算以形成文件差分包,文件系统打包单元 14能够将各所述文件压缩包 和各所述文件差分包打包形成文件系统升级包, 这样将动态类型和新增类型的目标文 件与静态类型的目标文件相区分处理, 使得不同操作类型的目标文件都能够被制作到 升级包中, 大大扩展了通过 FOTA方式进行文件系统升级的范围。 具体的, 获取单元 11, 具体可设置为通过读取配置文件获取所述待升级文件系统 中各个源文件的文件信息。 所述文件系统升级包包括包体, 所述包体包括各所述文件压缩包的数据信息及索 引信息、 各所述文件差分包的数据信息及索引信息, 每个所述目标文件的操作类型参 数包含于各所述索引信息中。 进一步的, 所述包体还包括删除指示信息, 设置为指示 将对应的源文件删除。 可选的, 文件系统打包单元 14具体包括: 写入模块, 设置为将每个所述目标文件 的操作类型写入对应的文件压缩包索引信息或文件差分包索引信息; 打包模块, 设置 为将各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息及索引 信息打包形成文件系统升级包, 其中, 所述索引信息位于所述包体的前半部分, 所述 数据信息位于所述包体的后半部分。 相应的, 如图 7所示, 本发明还提供一种文件系统升级装置, 包括: 解析单元 21, 设置为解析下载的文件系统升级包, 以确定所述文件系统升级包中每个目标文件的操 作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一, 所述文件系统 升级包包括文件压缩包和文件差分包, 每个所述目标文件与一个文件压缩包或者一个 文件差分包相对应; 解压缩单元 22, 设置为当所述目标文件的操作类型为动态类型或 新增类型时, 对所述目标文件对应的文件压缩包解压缩, 以在终端形成目标文件完成 升级; 还原单元 23, 设置为当所述目标文件的操作类型为静态类型时, 将终端的待升 级文件系统中的源文件与对应的文件差分包进行还原计算, 以在所述终端中形成目标 文件完成升级。 本发明的实施例提供的文件系统升级装置,能够通过解析单元 21解析下载的文件 系统升级包来确定所述文件系统升级包中每个目标文件的操作类型, 当所述目标文件 的操作类型为动态类型或新增类型时,解压缩单元 22能够对所述目标文件对应的文件 压缩包解压缩, 以在终端形成目标文件完成升级, 当所述目标文件的操作类型为静态 类型时,还原单元 23能够将终端的待升级文件系统中的源文件与对应的文件差分包进 行还原计算, 以在所述终端中形成目标文件完成升级, 这样将动态类型和新增类型的 目标文件与静态类型的目标文件相区分处理, 大大扩展了通过 FOTA方式进行文件系 统升级的范围。 具体而言, 解析单元 21可包括: 拆包模块, 设置为对所述文件系统升级包拆包, 分离出包头和包体, 所述包体包括各所述文件压缩包的数据信息及索引信息、 各所述 文件差分包的数据信息及索引信息, 每个所述目标文件的操作类型参数包含于各所述 索引信息中; 确定模块, 设置为通过读取所述包体中的索引信息确定所述文件系统升 级包中每个目标文件的操作类型。 进一步的, 本发明实施例提供的文件系统升级装置还可包括: 升级包校验模块, 设置为利用所述包头中的升级包校验码对所述文件系统升级包进行校验, 以确定所述 文件系统升级包是否被正确下载。 可选的, 解压缩单元 22具体可包括: 解压缩模块, 设置为对所述目标文件对应的 文件压缩包解压缩形成目标文件; 目标文件校验模块, 设置为利用所述索引信息中的 目标文件校验码对所述解压缩模块解压缩后形成的所述目标文件进行校验;升级模块, 设置为如果所述目标文件校验模块校验通过, 用所述目标文件代替源文件完成升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 相应的, 本发明的实施例还提供一种终端, 所述终端包括上述实施例提供的任一 种文件系统升级装置, 因此也能达到相应的有益效果, 前文已经进行了详细的说明, 此处不再赘述。 尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员将意识到 各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限于上述实施例。 工业实用性 本发明实施例中, 通过获取待升级文件系统中各个源文件的文件信息, 确定与所 述源文件对应的目标文件的操作类型, 当所述目标文件的操作类型为动态类型或新增 类型时, 压缩所述目标文件以形成文件压缩包, 当所述目标文件的操作类型为静态类 型时, 根据所述目标文件及其对应的源文件之间的差异, 进行差分运算以形成文件差 分包, 这样将动态类型和新增类型的目标文件与静态类型的目标文件相区分处理, 使 得不同操作类型的目标文件都能够被制作到升级包中, 大大扩展了通过 FOTA方式进 行文件系统升级的范围。 因此, 具有工业实用性。

Claims

权 利 要 求 书 、 一种文件系统升级包制作方法, 包括:
获取待升级文件系统中各个源文件的文件信息;
根据各个所述源文件的文件信息确定与所述源文件对应的目标文件的操作 类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一;
当所述目标文件的操作类型为动态类型或新增类型时, 压缩所述目标文件 以形成文件压缩包, 当所述目标文件的操作类型为静态类型时, 根据所述目标 文件及其对应的源文件之间的差异, 进行差分运算以形成文件差分包;
将各所述文件压缩包和各所述文件差分包打包形成文件系统升级包。 、 根据权利要求 1所述的方法, 其中, 所述获取待升级文件系统中各个源文件的 文件信息包括:
通过读取配置文件获取所述待升级文件系统中各个源文件的文件信息。 、 根据权利要求 1所述的方法, 其中, 所述文件系统升级包包括包体, 所述包体 包括各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息 及索引信息, 其中, 每个所述目标文件的操作类型参数包含于各所述索引信息 中。 、 根据权利要求 3所述的方法, 其中, 所述将各所述文件压缩包和各所述文件差 分包打包形成文件系统升级包包括:
将每个所述目标文件的操作类型写入对应的文件压缩包索引信息或文件差 分包索引信息;
将各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信 息及索引信息打包形成文件系统升级包, 其中, 所述索引信息位于所述包体的 前半部分, 所述数据信息位于所述包体的后半部分。 、 根据权利要求 3所述的方法, 其中, 所述包体还包括删除指示信息, 用于指示 将对应的源文件删除。 、 一种文件系统升级方法, 包括: 解析下载的文件系统升级包, 以确定所述文件系统升级包中每个目标文件 的操作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一, 所 述文件系统升级包包括文件压缩包和文件差分包, 每个所述目标文件与一个文 件压缩包或者一个文件差分包相对应;
当所述目标文件的操作类型为动态类型或新增类型时, 对所述目标文件对 应的文件压缩包解压缩, 以在终端形成目标文件完成升级;
当所述目标文件的操作类型为静态类型时, 将终端的待升级文件系统中的 源文件与对应的文件差分包进行还原计算, 以在所述终端中形成目标文件完成 升级。 、 根据权利要求 6所述的方法, 其中, 所述解析下载的文件系统升级包, 以确定 所述文件系统升级包中每个目标文件的操作类型包括:
对所述文件系统升级包拆包, 分离出包头和包体, 所述包体包括各所述文 件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息及索引信息, 每个所述目标文件的操作类型参数包含于各所述索引信息中;
通过读取所述包体中的索引信息确定所述文件系统升级包中每个目标文件 的操作类型。 、 根据权利要求 7所述的方法, 其中, 所述对所述文件系统升级包拆包, 分离出 包头和包体之后, 所述通过读取所述包体中的索引信息确定所述文件系统升级 包中每个目标文件的操作类型之前, 所述方法还包括:
利用所述包头中的升级包校验码对所述文件系统升级包进行校验, 以确定 所述文件系统升级包是否被正确下载。 、 根据权利要求 6所述的方法, 其中, 所述当所述目标文件的操作类型为动态类 型或新增类型时, 对所述目标文件对应的文件压缩包解压缩, 以在终端形成目 标文件完成升级包括:
对所述目标文件对应的文件压缩包解压缩形成目标文件;
利用所述索引信息中的目标文件校验码对形成的所述目标文件进行校验; 如果校验通过, 用所述目标文件代替源文件完成升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 0、 一种文件系统升级包制作装置, 包括: 获取单元, 设置为获取待升级文件系统中各个源文件的文件信息; 确定单元, 设置为根据所述获取单元获取的各个所述源文件的文件信息, 确定与所述源文件对应的目标文件的操作类型, 所述操作类型包括动态类型、 静态类型、 新增类型三者之一;
文件打包单元, 设置为当所述目标文件的操作类型为动态类型或新增类型 时, 压缩所述目标文件以形成文件压缩包, 当所述目标文件的操作类型为静态 类型时, 根据所述目标文件及其对应的源文件之间的差异, 进行差分运算以形 成文件差分包;
文件系统打包单元, 设置为将各所述文件压缩包和各所述文件差分包打包 形成文件系统升级包。 、 根据权利要求 10所述的装置, 其中, 所述获取单元, 具体设置为通过读取配置 文件获取所述待升级文件系统中各个源文件的文件信息。 、 根据权利要求 10所述的装置, 其中, 所述文件系统升级包包括包体, 所述包体 包括各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据信息 及索引信息, 每个所述目标文件的操作类型参数包含于各所述索引信息中。 、 根据权利要求 12所述的装置, 其中, 所述文件系统打包单元包括:
写入模块, 设置为将每个所述目标文件的操作类型写入对应的文件压缩包 索引信息或文件差分包索引信息;
打包模块, 设置为将各所述文件压缩包的数据信息及索引信息、 各所述文 件差分包的数据信息及索引信息打包形成文件系统升级包, 其中, 所述索引信 息位于所述包体的前半部分, 所述数据信息位于所述包体的后半部分。 、 根据权利要求 12所述的装置, 其中, 所述包体还包括删除指示信息, 设置为指 示将对应的源文件删除。 、 一种文件系统升级装置, 包括:
解析单元, 设置为解析下载的文件系统升级包, 以确定所述文件系统升级 包中每个目标文件的操作类型, 所述操作类型包括动态类型、 静态类型、 新增 类型三者之一, 所述文件系统升级包包括文件压缩包和文件差分包, 每个所述 目标文件与一个文件压缩包或者一个文件差分包相对应; 解压缩单元,设置为当所述目标文件的操作类型为动态类型或新增类型时, 对所述目标文件对应的文件压缩包解压缩, 以在终端形成目标文件完成升级; 还原单元, 设置为当所述目标文件的操作类型为静态类型时, 将终端的待 升级文件系统中的源文件与对应的文件差分包进行还原计算, 以在所述终端中 形成目标文件完成升级。 、 根据权利要求 15所述的装置, 其中, 所述解析单元包括: 拆包模块, 设置为对所述文件系统升级包拆包, 分离出包头和包体, 所述 包体包括各所述文件压缩包的数据信息及索引信息、 各所述文件差分包的数据 信息及索引信息,每个所述目标文件的操作类型参数包含于各所述索引信息中; 确定模块, 设置为通过读取所述包体中的索引信息确定所述文件系统升级 包中每个目标文件的操作类型。 、 根据权利要求 16所述的装置, 其中, 还包括: 升级包校验模块, 设置为利用所述包头中的升级包校验码对所述文件系统 升级包进行校验, 以确定所述文件系统升级包是否被正确下载。 、 根据权利要求 15所述的装置, 其中, 所述解压缩单元包括: 解压缩模块, 设置为对所述目标文件对应的文件压缩包解压缩形成目标文 件;
目标文件校验模块, 设置为利用所述索引信息中的目标文件校验码对所述 解压缩模块解压缩后形成的所述目标文件进行校验;
升级模块, 设置为如果所述目标文件校验模块校验通过, 用所述目标文件 代替源文件完成升级, 如果校验不通过, 丢弃所述目标文件放弃升级。 种终端, 所述终端包括权利要求 15-18中任一项所述的文件系统升级装置。
PCT/CN2014/079300 2013-12-16 2014-06-05 文件系统升级包制作方法、升级方法及装置、终端 WO2014180425A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP14795338.4A EP3086225B1 (en) 2013-12-16 2014-06-05 File system upgrade package production method, upgrade method, device and terminal
US15/104,618 US10204108B2 (en) 2013-12-16 2014-06-05 Method and apparatus for manufacturing file system update package, method and apparatus for updating file system update package, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310690650.9A CN104714819B (zh) 2013-12-16 2013-12-16 文件系统升级包制作方法、升级方法及装置、终端
CN201310690650.9 2013-12-16

Publications (1)

Publication Number Publication Date
WO2014180425A1 true WO2014180425A1 (zh) 2014-11-13

Family

ID=51866805

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/079300 WO2014180425A1 (zh) 2013-12-16 2014-06-05 文件系统升级包制作方法、升级方法及装置、终端

Country Status (4)

Country Link
US (1) US10204108B2 (zh)
EP (1) EP3086225B1 (zh)
CN (1) CN104714819B (zh)
WO (1) WO2014180425A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018039875A1 (zh) * 2016-08-29 2018-03-08 北京小米移动软件有限公司 应用升级包获取方法及装置
CN111552489A (zh) * 2020-03-31 2020-08-18 支付宝(杭州)信息技术有限公司 用户态文件系统热升级方法、装置、服务器及介质
CN111949303A (zh) * 2020-07-06 2020-11-17 深圳市华曦达科技股份有限公司 升级包处理方法、装置、电子设备及存储介质

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8450529B2 (en) 2008-10-02 2013-05-28 Covidien Lp Branched polyamines and formulations thereof for use in medical devices
CN106569843A (zh) * 2015-10-12 2017-04-19 青岛海信移动通信技术股份有限公司 一种生成ota中间包的方法及装置
CN106610839B (zh) * 2015-10-21 2020-10-30 阿里巴巴集团控股有限公司 发布升级包的方法、轻量升级方法、装置及系统
CN105487907A (zh) * 2015-12-07 2016-04-13 青岛海信电器股份有限公司 一种差分包的制作方法和装置
CN105740016B (zh) * 2016-01-28 2020-08-25 腾讯科技(深圳)有限公司 应用程序的增量发布方法和装置、升级方法和装置
JP6662169B2 (ja) * 2016-04-18 2020-03-11 富士通株式会社 符号化プログラム、符号化方法、符号化装置、検索プログラム、検索方法および検索装置
CN106445826A (zh) * 2016-10-14 2017-02-22 深圳天珑无线科技有限公司 差分包制作方法和差分包制作装置
CN106648766B (zh) * 2016-12-07 2020-07-28 京信通信系统(中国)有限公司 基于文件夹的补丁升级包生成及差分升级方法和装置
JP6784636B2 (ja) * 2017-04-13 2020-11-11 日立オートモティブシステムズ株式会社 制御装置、プログラム更新システム、プログラム更新方法
CN107391145A (zh) * 2017-07-27 2017-11-24 中兴通讯股份有限公司 升级包制作方法及装置、升级文件的方法及装置
CN109426521A (zh) * 2017-08-21 2019-03-05 深圳市中兴微电子技术有限公司 一种无线终端版本升级系统及方法
TWI634483B (zh) * 2017-09-14 2018-09-01 和碩聯合科技股份有限公司 檔案合成方法、檔案還原方法以及使用此些方法的電子裝置
CN107885519A (zh) * 2017-11-09 2018-04-06 上海奕瑞光电子科技股份有限公司 平板探测器的firmware打包、升级方法、系统、存储介质及平板探测器
CN108228225B (zh) * 2017-12-29 2021-07-02 北京元心科技有限公司 差分包的生成方法、装置及相应终端
CN110007937B (zh) * 2018-01-05 2022-09-16 网宿科技股份有限公司 一种系统更新的方法和系统
US11356532B1 (en) * 2018-08-10 2022-06-07 Meta Platforms, Inc. Systems and methods for packaging web resources
CN112262556B (zh) * 2018-11-01 2022-01-21 华为技术有限公司 模型文件的管理方法和终端设备
CN111104151B (zh) * 2019-11-26 2023-02-28 深圳市华卓智能科技有限公司 一种基于Shell脚本的Git代码简化的管理方法
CN110990046A (zh) * 2019-11-29 2020-04-10 惠州市德赛西威汽车电子股份有限公司 一种基于动态文件的升级方法
CN111722858A (zh) * 2020-05-27 2020-09-29 科华恒盛股份有限公司 在线升级方法及终端设备
CN112925559B (zh) * 2021-04-09 2023-10-20 网易(杭州)网络有限公司 资源打包方法、装置、介质及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294385A1 (en) * 2006-06-08 2007-12-20 Vivek Kapadekar Device management in a network
CN101778376A (zh) * 2009-12-31 2010-07-14 中兴通讯股份有限公司 一种实现固件无线更新的方法及装置
CN102025708A (zh) * 2009-09-22 2011-04-20 华为技术有限公司 一种升级方法、装置和系统
CN102693145A (zh) * 2012-05-31 2012-09-26 红石阳光(北京)科技有限公司 用于嵌入式系统的差分升级方法
CN102831001A (zh) * 2012-09-11 2012-12-19 北京百纳威尔科技有限公司 软件升级包的制作方法及装置、程序的升级方法及设备
CN103513998A (zh) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 升级包生成方法和装置、动态文件差分升级的方法和终端

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6493871B1 (en) * 1999-09-16 2002-12-10 Microsoft Corporation Method and system for downloading updates for software installation
US7814474B2 (en) * 2000-11-17 2010-10-12 Hewlett-Packard Development Company, L.P. Updatable mobile handset based on Linux with compression and decompression techniques
US7739679B2 (en) * 2004-04-06 2010-06-15 Hewlett-Packard Development Company, L.P. Object ordering tool for facilitating generation of firmware update friendly binary image
US7543118B1 (en) * 2004-05-07 2009-06-02 Hewlett-Packard Development Company, L.P. Multiple variance platform for the management of mobile devices
US7958502B2 (en) * 2005-08-05 2011-06-07 Hewlett-Packard Development Company, L.P. Efficient generator of update packages for mobile devices that uses non-ELF preprocessing
KR101359834B1 (ko) * 2005-10-06 2014-02-07 레드 밴드 리미티드 압축 버전을 포함하는 내용을 업데이트하는 방법 및시스템들
US7814486B2 (en) * 2006-06-20 2010-10-12 Google Inc. Multi-thread runtime system
DE102010011344B4 (de) * 2010-03-12 2015-08-27 Artec Computer Gmbh Verfahren zur Herstellung und Verwaltung eines großvolumigen Langzeitarchivs
KR20110104383A (ko) * 2010-03-16 2011-09-22 삼성전자주식회사 펌웨어 업데이트 서비스 장치 및 방법
US9020487B2 (en) * 2010-10-14 2015-04-28 At&T Mobility Ii Llc Over-the-air content management of wireless equipment in confined-coverage wireless networks
WO2011127845A2 (zh) * 2011-05-04 2011-10-20 华为终端有限公司 一种移动通信终端间进行系统升级的方法、系统及终端
US9170804B2 (en) * 2012-07-05 2015-10-27 Nokia Technologies Oy Method and apparatus for modifying compressed files
US20140059534A1 (en) * 2012-08-22 2014-02-27 General Electric Company Method and system for software management
GB2507751A (en) * 2012-11-07 2014-05-14 Ibm Storing data files in a file system which provides reference data files
CN103336703B (zh) * 2013-07-08 2018-09-18 惠州Tcl移动通信有限公司 生成升级包的方法、服务器、软件升级方法、移动终端
US9069641B2 (en) * 2013-09-17 2015-06-30 Blackberry Limited Updating firmware on mobile devices
US9778926B2 (en) * 2014-10-30 2017-10-03 Google Inc. Minimizing image copying during partition updates
US9934020B2 (en) * 2015-03-10 2018-04-03 International Business Machines Corporation Intelligent mobile application update
US9952851B2 (en) * 2015-03-10 2018-04-24 International Business Machines Corporation Intelligent mobile application update
US10860310B2 (en) * 2015-09-30 2020-12-08 Apple Inc. Software updating
JP6852148B2 (ja) * 2016-09-14 2021-03-31 ユー−ブロックス、アクチエンゲゼルシャフトu−blox AG ソフトウェアアップデートシステム、ファームウェアオーバーザエアーアップデートシステム、及び、クライアントデバイスをアップデートする方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070294385A1 (en) * 2006-06-08 2007-12-20 Vivek Kapadekar Device management in a network
CN102025708A (zh) * 2009-09-22 2011-04-20 华为技术有限公司 一种升级方法、装置和系统
CN101778376A (zh) * 2009-12-31 2010-07-14 中兴通讯股份有限公司 一种实现固件无线更新的方法及装置
CN102693145A (zh) * 2012-05-31 2012-09-26 红石阳光(北京)科技有限公司 用于嵌入式系统的差分升级方法
CN103513998A (zh) * 2012-06-25 2014-01-15 中兴通讯股份有限公司 升级包生成方法和装置、动态文件差分升级的方法和终端
CN102831001A (zh) * 2012-09-11 2012-12-19 北京百纳威尔科技有限公司 软件升级包的制作方法及装置、程序的升级方法及设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3086225A4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018039875A1 (zh) * 2016-08-29 2018-03-08 北京小米移动软件有限公司 应用升级包获取方法及装置
CN111552489A (zh) * 2020-03-31 2020-08-18 支付宝(杭州)信息技术有限公司 用户态文件系统热升级方法、装置、服务器及介质
CN111552489B (zh) * 2020-03-31 2022-04-26 支付宝(杭州)信息技术有限公司 用户态文件系统热升级方法、装置、服务器及介质
CN111949303A (zh) * 2020-07-06 2020-11-17 深圳市华曦达科技股份有限公司 升级包处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
EP3086225A4 (en) 2016-12-07
CN104714819A (zh) 2015-06-17
EP3086225B1 (en) 2018-10-31
US10204108B2 (en) 2019-02-12
US20160313989A1 (en) 2016-10-27
EP3086225A1 (en) 2016-10-26
CN104714819B (zh) 2019-11-15

Similar Documents

Publication Publication Date Title
WO2014180425A1 (zh) 文件系统升级包制作方法、升级方法及装置、终端
JP6236533B2 (ja) 差分アップデートパッケージの作成方法及び装置、システム差分アップデート方法及び装置
WO2013189312A1 (zh) 升级包生成方法和装置、动态文件差分升级的方法和终端
TWI687867B (zh) 用於可信執行環境的可信應用產生及安裝方法
WO2016192197A1 (zh) 一种终端的软件升级方法、装置、系统和计算机存储介质
WO2017036228A1 (zh) 一种实现系统升级的方法及装置
AU2011205480B2 (en) Operating system auto-update procedure
CN106648766B (zh) 基于文件夹的补丁升级包生成及差分升级方法和装置
AU2010358328B2 (en) Processing devices and methods for transmitting and receiving data
WO2012024963A1 (zh) 基于固件空中传输技术的固件处理方法、装置及系统
WO2016082547A1 (zh) 一种升级文件制作方法及装置和升级文件获取方法及装置
JP2016522601A5 (zh)
CN112560017B (zh) 一种使用三级证书认证实现apk统一签名的方法
WO2016202000A1 (zh) 差分回退升级方法及装置
WO2016173128A1 (zh) 一种软件版本的下载方法及装置、存储介质
CN111857790A (zh) 一种固件升级方法、装置及计算机设备
WO2014134989A2 (zh) 一种Android终端及其实现升级的方法
WO2018076769A1 (zh) 一种信息处理方法和装置
CN108170461A (zh) 差分升级包生成方法、差分升级方法及装置
US8413132B2 (en) Techniques for resolving read-after-write (RAW) conflicts using backup area
CN104077158B (zh) 安装插件的方法及装置
WO2016177075A1 (zh) 一种业务数据关联关系校验方法、装置及可读存储介质
WO2014176731A1 (en) Method and apparatus for upgrading application
CN106775802B (zh) 海量小文件快速更新的方法及其系统
CN106648784A (zh) 一种基于android系统的OTA升级方法及系统、android终端

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

Country of ref document: EP

Kind code of ref document: A1

REEP Request for entry into the european phase

Ref document number: 2014795338

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2014795338

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 15104618

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE