WO2019076293A1 - Differential upgrading method, device and system - Google Patents

Differential upgrading method, device and system Download PDF

Info

Publication number
WO2019076293A1
WO2019076293A1 PCT/CN2018/110404 CN2018110404W WO2019076293A1 WO 2019076293 A1 WO2019076293 A1 WO 2019076293A1 CN 2018110404 W CN2018110404 W CN 2018110404W WO 2019076293 A1 WO2019076293 A1 WO 2019076293A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
upgrade
terminal device
original
version
Prior art date
Application number
PCT/CN2018/110404
Other languages
French (fr)
Chinese (zh)
Inventor
陈二磊
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2019076293A1 publication Critical patent/WO2019076293A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a method, apparatus, and system for differential upgrade.
  • Over-the-air technology is a technology for upgrading systems through the Internet to download upgrade packages.
  • a terminal device that uses the above OTA technology for system upgrade, such as a mobile phone, a tablet computer, a smart watch, and a smart TV, downloads an upgrade package of the system from a server via the Internet, and upgrades the system of the terminal device by using the downloaded upgrade package.
  • One upgrade method is a full upgrade
  • the other upgrade method is a differential upgrade.
  • the terminal device downloads the full-scale upgrade package from the server, and the full-scale upgrade package includes all the data of the target version after the system upgrade, the data volume of the full-scale upgrade package is large, and the time required to download the full-scale upgrade package is required. Long; and after upgrading the system according to the full upgrade package, the hardware of the terminal device may not be able to support the upgraded system, resulting in security problems of the terminal device.
  • the terminal device downloads the differential upgrade package from the server, and the differential upgrade package can reflect the difference between the system before the upgrade and the system of the upgrade target version.
  • the data of the differential upgrade package is small, and the time required for downloading the differential data packet is short; and the data that cannot be supported by the hardware of the terminal device does not exist in the differential data packet, and the security of the terminal device is avoided after the upgrade. problem.
  • the differential upgrade method the data of the part of the original version of the system that has data difference with the target version of the system is not modified, and is consistent with the original data in the original version of the system. If it has been modified, the differential upgrade method cannot be used.
  • the technical problem to be solved by the present application is to provide a method, device and system for differential upgrade, so that when a part of the terminal device in which data difference exists is modified, the system of the terminal device is first repaired, and the repaired terminal device is The system is differentially upgraded.
  • the present application provides a method for differential upgrade, including:
  • the terminal device obtains the repair data of the differential upgrade package and the differential upgrade package and the upgrade object.
  • the upgrade object is an object in the original version of the system, and the data of the target version has a data difference, and the repair data is the original data of the upgrade object in the original version of the system. ;
  • the terminal device repairs the terminal device system by using the repair data, and obtains the repaired system, and the repaired system is consistent with the original version of the system;
  • the terminal device uses the differential upgrade package to upgrade the system from the original version to the target version.
  • the repairing data of the upgrade object by the terminal device includes:
  • the terminal device obtains verification data of the upgrade object, and the verification data corresponds to the original data;
  • the terminal device verifies, according to the verification data, whether the current data of the upgrade object in the terminal device is consistent with the original data
  • the terminal device acquires the repair data of the upgrade object.
  • the repairing data of the upgrade object by the terminal device includes:
  • the terminal device sends the identification information of the upgrade object to the server;
  • the terminal device receives the repair data of the upgrade object returned by the server according to the identification information.
  • the identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
  • the verification data is a hash value of the original data
  • the terminal device verifies, according to the verification data, whether the current data of the upgrade object in the terminal device is consistent with the original data of the upgrade object in the original version of the system, including:
  • the terminal device acquires a hash value of the current data
  • the terminal device verifies whether the hash value of the current data is consistent with the check data
  • the terminal device determines that the current data is consistent with the original data; if the hash value of the current data is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
  • the application further provides a differential upgrade method, including:
  • the system obtains the original version of the system before the terminal device is upgraded, and the upgraded target version of the system;
  • the server determines the upgrade object according to the original version of the system and the target version of the system, and the upgrade object is an object of the original version of the system, and the data of the target version of the system is different;
  • the server obtains the repair data of the differential upgrade package and the upgrade object, and the repair data is the original data of the upgrade object in the original version of the system;
  • the server sends the repair data of the differential upgrade package and the upgrade object to the terminal device.
  • the server obtains the repair data of the upgrade object, including:
  • the server obtains verification data of the upgrade object, and the verification data corresponds to the original data
  • the server sends the verification data of the upgrade object to the terminal device
  • the server receives the identifier information of the upgrade object sent by the terminal device;
  • the server obtains the repair data of the upgrade object according to the identification information of the upgrade object.
  • the verification data of the upgrade object is a hash value of the original data.
  • the present application further provides a device for differential upgrade, which is applied to a terminal device, including:
  • the first obtaining module is configured to obtain the repair data of the differential upgrade package and the upgrade object.
  • the upgrade object is an object in the original version of the system, and the data is different from the target version of the system, and the repair data is the original of the upgrade object in the original version of the system. data;
  • the repair module is used to repair the system of the terminal device by using the repair data, and obtain the repaired system, and the repaired system is consistent with the original version of the system;
  • the upgrade module is used to upgrade the system from the original version to the target version by using the differential upgrade package.
  • it includes:
  • a first acquiring unit configured to obtain verification data of the upgrade object, where the verification data corresponds to the original data
  • a first checking unit configured to verify, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data
  • the second obtaining unit is configured to obtain the repair data of the upgrade object when the current data is inconsistent with the original data.
  • the first obtaining module includes:
  • a sending unit configured to send identifier information of the upgrade object to the server
  • the receiving unit is configured to receive repair data of the upgrade object returned by the server according to the identifier information.
  • the identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
  • the verification data is a hash value of the original data
  • the verification unit includes:
  • a check subunit configured to verify whether the hash value of the current data is consistent with the check data; if the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; If the hash value is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
  • the application further provides a differential upgrading apparatus, which is applied to a server, where the apparatus includes:
  • a second obtaining module configured to acquire a system of the original version before the terminal device is upgraded, and a system of the upgraded target version
  • a determining module configured to determine an upgrade object according to a system of the original version of the system and the target version, where the upgrade object is an object of a data difference between the original version of the system and the target version of the system;
  • a third obtaining module configured to obtain repair data of the differential upgrade package and the upgrade object, where the repair data is original data of the upgrade object in the original version of the system;
  • the sending module is configured to send the repair data of the differential upgrade package and the upgrade object to the terminal device.
  • the third obtaining module includes:
  • a third acquiring unit configured to obtain verification data of the upgrade object, where the verification data corresponds to the original data
  • a sending unit configured to send verification data of the upgrade object to the terminal device
  • a second checking unit configured to check current data of the upgrade object in the terminal device according to the check data, and when the original data is inconsistent, the server receives the identifier information of the upgrade object sent by the terminal device;
  • the fourth obtaining unit is configured to obtain the repair data of the upgrade object according to the identifier information of the upgrade object.
  • the verification data of the upgrade object is a hash value of the original data.
  • the application provides a differential upgrade system, including:
  • the terminal device includes: the device provided by the foregoing third aspect;
  • the server and the server include the device provided in the above fourth aspect.
  • the object with the difference between the original version of the system and the target version is used as the upgrade object, and the repair data of the upgrade object is obtained, and the repair data is used to the terminal.
  • the system of the device is repaired, and the repaired system of the terminal device is obtained.
  • the repaired system of the terminal device is consistent with the original version of the system, and the repaired system of the terminal device is differentially upgraded, thereby repairing the system.
  • the repaired data is used to repair the system of the terminal device to ensure that the repaired system of the terminal device is consistent with the original version of the system, thereby ensuring that the terminal device can be upgraded using the differential upgrade method.
  • FIG. 1 is a schematic structural diagram of a system for differential upgrade according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of another method for differential upgrade provided by an embodiment of the present application.
  • FIG. 4 is a flowchart of a method for performing a differential upgrade according to an embodiment of the present disclosure
  • FIG. 5 is a structural diagram of an apparatus for differential upgrade applied to a terminal device according to an embodiment of the present disclosure
  • FIG. 6 is a structural diagram of a device for differential upgrade applied to a server according to an embodiment of the present disclosure
  • FIG. 7 is a schematic diagram of a differential upgrade system according to an embodiment of the present disclosure.
  • FIG. 8 is a block diagram of a partial structure of a related mobile phone according to an embodiment of the present application.
  • the embodiment of the present application provides a method, an apparatus, and a system for differential upgrade.
  • the embodiments provided by the present application are described below with reference to the accompanying drawings.
  • the original version of the system refers to the system installed on the terminal device before the terminal device is updated, for example, emui5.0.
  • the target version of the system refers to the system installed on the terminal device after the terminal device is updated, for example, emui8.0.
  • the system actually used refers to the system actually used on the terminal device before the terminal device is updated.
  • the system actually used has the same system version as the original version of the system, for example, both are emui5.0. If the original version of the system is installed on the terminal device, the data in the system is modified during the use process, resulting in the actual use of the system; if the original version of the system is installed on the terminal device, the In the process, no modifications were made to the system, and the actual system used was the same as the original version.
  • the upgrade of the system refers to the process of updating the system used by the terminal device from the original version to the target version.
  • Differential upgrade refers to the process of implementing the system based on the data difference between the system before the upgrade and the system of the target version after the upgrade.
  • the upgrade object refers to the object that has data difference with the target version of the system in the original version of the system.
  • the server stores the system of the original version before the upgrade of the terminal device, and also stores the system of the target version after the upgrade of the terminal device, compares the system of the original version with the system of the target version, and determines the system of the original version, and
  • the target version of the system has data difference objects, that is, the upgrade target of the system differential upgrade for the terminal device.
  • the upgrade object can be a file or a block.
  • Raw data refers to the data in the system of the original version of the system at the time of installation.
  • Repair data refers to the original data of the upgrade object in the original version of the system.
  • the repair data packet refers to the data packet sent by the server to the terminal device before the differential upgrade, which is used to repair the system actually used.
  • the data corresponding to the upgrade object in the repaired system is the same as the system installed in the original version of the system. Some of the data is exactly the same.
  • a differential upgrade package refers to a data packet sent by a server to a terminal device to implement differential upgrade of the terminal device.
  • the OTA differential upgrade technology is a technology that implements system upgrade based on the difference between the original version of the system before the upgrade and the data of the target version after the upgrade.
  • the server When using OTA differential upgrade, the server only sends a differential upgrade package to the terminal device.
  • the differential upgrade package can reflect the data difference between the original version of the system and the target version of the system.
  • the original version of the system includes data a, b, and c.
  • the target version of the system includes data a, b, c'
  • the differential upgrade package includes data c'. That is to say, the OTA differential upgrade is based on the original version of the system. Therefore, when the OTA differential upgrade is applied to the terminal device, the upgrade target of the terminal device is not modified.
  • the upgrade target refers to the terminal device.
  • the original version of the system there is a difference in data from the target version of the system.
  • the original version of the system includes file A, file B, and file C.
  • the target version of the system includes file A, file B, and file C'.
  • the object is file C. If the system used by the terminal device has been cracked, or an eMMC (embedded multi media card) data hopping occurs, the system data of the original version used by the terminal device is changed, and if the terminal device is upgraded, If the data changes, the data foundation of the OTA differential upgrade changes, and the differential upgrade package cannot be used for differential upgrade.
  • eMMC embedded multi media card
  • the embodiment of the present application provides an implementation solution of a differential upgrade, where the terminal device obtains the repair data of the upgrade object, where the repair data is the original data of the upgrade object in the original version of the terminal device, and uses the repair data.
  • the system actually used by the terminal device is repaired, and the repaired system is obtained.
  • the repaired system is consistent with the original version of the system, and the repaired system is differentially upgraded, and the repaired system is upgraded from the original version to the target version.
  • the system of the terminal device is first repaired, the system of the terminal device is restored to be consistent with the original version of the system, and the system of the repaired terminal device is differentially upgraded to ensure that the system is upgraded by using a differential upgrade mode. Effectiveness.
  • the system includes: a server 100 and a terminal device 110.
  • the server 100 includes a system of the original version of the terminal device 110 and a system of the target version.
  • the server 100 can compare the system of the original version with the system of the target version, determine the upgrade object, and obtain the upgrade object from the original version of the system.
  • the repair data is sent to the terminal device 110 for the repair data of the upgrade object.
  • the terminal device 110 repairs the system by using the repair data of the upgrade object, and then performs differential upgrade on the repaired system.
  • the server 100 may be an application service provider or a terminal device provider;
  • the terminal device 110 may be a PDA (Personal Digital Assistant) or a POS (Point of Sales) such as a mobile phone, a tablet computer, a smart watch, a smart TV, or the like. , sales terminal), car computer, TV, wearable device, AR, VR device, etc.
  • PDA Personal Digital Assistant
  • POS Point of Sales
  • FIG. 2 is a flowchart of a method for differential upgrade according to an embodiment of the present application, including the following steps:
  • Step 201 The server acquires a system of the original version before the terminal device is upgraded, and a system of the upgraded target version.
  • Step 202 The server determines, according to the system of the original version and the system of the target version, the upgrade object, where the upgrade object is an object of the original version, and the data of the target version is different.
  • the version of the system in order to continuously meet the needs of the end user and modify some bugs, the version of the system is continuously updated, and the version of the system of the terminal device before the update is called the original version, and the system of the updated terminal device is updated.
  • the version is called the target version.
  • the process of updating the system of the terminal device from the original version to the target version is the upgrade of the system.
  • the upgrade message of the system may be sent by the server to the user, or may be obtained by the terminal device querying the server.
  • the server stores the system of the original version before the upgrade of the terminal device, and also stores the system of the target version after the upgrade of the terminal device, compares the system of the original version with the system of the target version, and determines the system of the original version, and
  • the target version of the system has data difference objects, that is, the upgrade target of the system differential upgrade for the terminal device.
  • the upgrade type of the upgrade object is replacement, that is, the upgrade object exists in the system of the original version and the target version, but the data in the upgrade object differs between the system of the original version and the system of the target version.
  • the server compares and finds that the object A is included in the system of the original version of the terminal device, and the target version of the system also includes the object A. If the data in the object A is different, the object A is determined to be the upgrade object, and the upgrade object is The upgrade type of A is replacement.
  • the server compares and finds that the object A is included in the system of the original version of the terminal device, and the object A does not include the object A in the target version, and the object A is determined to be the upgrade object, and the upgrade type of the upgrade object A is increased.
  • the upgrade type of the upgrade is increased, that is, the objects existing in the target version of the system do not exist in the original version of the system. That is to say, this kind of differential upgrade is to add an object based on the original version of the system, and the added object is not an object in the original version of the system, so it cannot be used as an upgrade object.
  • the server compares and finds that the object A is included in the system of the target version of a terminal device, but the object A is not included in the original version of the system, and it can be determined that the type of the upgrade is increased, but because the object A is in the original version of the system. Does not exist in it, object A cannot be used as an upgrade object.
  • the identifier of the upgrade object does not change, but the data in the upgrade object may change.
  • the identifier of the upgrade object refers to the identifier of the file.
  • the identifier of the upgrade object is the file identifier abc of the file.
  • the file with the file identifier abc exists in the target version of the system, but the data in the file identified as abc has changed. .
  • the identifier of the upgrade object refers to the identifier of the block.
  • the identifier of the upgrade object is the file identifier block X of the block.
  • the target version of the system also has a block whose block identifier is block X, but the data in the block identified as block X has already been A change has occurred.
  • Step 203 The server sends the repair data of the upgrade object to the terminal device, where the repair data may be the original data of the upgrade object in the original version of the system.
  • Step 204 The terminal device repairs the system of the terminal device by using the repair data, and obtains the repaired system.
  • the repair data is the original data of the upgrade object in the original version of the system.
  • the repair data is the original data of the file determined to be the upgrade object in the original version of the system;
  • the repair data is The raw data of the block determined to be the upgrade object in the original version of the system.
  • the server determines the original data of the upgrade object in the original version of the system.
  • the storage address of the original data may be determined according to the identifier of the upgrade object, and then a storage area is determined according to the storage address.
  • the original data of the upgrade object in the original version of the system is obtained from the storage area, and the original data of the upgrade object in the original version of the system is recorded as the repair data of the upgrade object.
  • the repair data of the upgrade object including the storage address of the upgrade object, and the like, and the original data of the upgrade object in the original version of the system.
  • the server sends the repair data of the upgrade object to the terminal device, and the terminal device determines the object to be repaired according to the repair data of the upgrade object received.
  • the identifier of the file may be a file name or the like, and the repair data is the original data of the file in the original version of the system.
  • the terminal device determines the file to be repaired according to the received file name or the cultural storage address, and uses the repair data of the file to overwrite the data of the file in the terminal device to complete the repair.
  • the block identifier includes the block offset address, the storage address of the file to which the block belongs, the total length of the block data, the start block number, and the end block number, and the repair data is the block in the original.
  • the raw data in the version of the system.
  • the terminal device determines the block to be repaired according to the received block offset address, the storage address of the file to which the block belongs, the total length of the block data, the starting block number, and the ending block number, and the repair data of the block is used to overwrite the terminal device. Block the data and complete the repair.
  • the block to be repaired may be determined, and the block identifier may include only the block.
  • the total length of the data and the end block number may also include the total length of the block data and the end block number, which are not limited in this application.
  • the upgrade object when the upgrade object is a block, the upgrade object includes multiple blocks, and multiple blocks are contiguous in the file.
  • the starting block number refers to the number of the block arranged in the top position in the file
  • the ending block number refers to the number of the block arranged in the last position in the file.
  • a terminal device receives the repair data of the upgrade object sent by the server, where the upgrade object is a block, and the identifier of the block is: the storage address of the file to which the block belongs: 1000, the block offset address: 120, the total length of the block data: 555, starting block number: 1364, ending block number: 1368.
  • the terminal device finds the file to which the block belongs according to the storage address 1000 of the file to which the block belongs; then, according to the block offset address 120, determines the starting block, that is, the block corresponding to the starting block number; and then, from the starting block number 1364 To the end block number 1368, five consecutive blocks are upgraded objects, and the total length of the data in these five blocks is 555.
  • the repair data of the above five blocks in the terminal device is replaced by the repair data of the received five blocks, and the repair of the above five blocks is completed.
  • the system used before the repair and the system used after the repair are the original versions, but the data of the system actually used before the repair of the terminal device may exist with the data of the system originally used by the original version. Data differences.
  • the data of the system actually used before the repair of the terminal device is defined as the current data, and the data of the system originally used by the original version is the original data.
  • the repair data of the upgrade object is used to overwrite the current data corresponding to the upgrade object in the current data. For example, if the current data of the system actually used before the repair of a terminal device includes the upgrade object A, and the current data in the upgrade object A is xxy, the repair data of the upgrade object A is used, that is, the original data of the upgrade object A in the system is xy. After the current data xxy is overwritten, the current data in the upgrade object A in the system of the terminal device is consistent with the original data, and both are xy.
  • the repair data of the upgrade object is added. For example, if the current data of the system actually used before the repair of a terminal device does not include the upgrade object A, that is, the current data in the upgrade object A is empty, the repair data of the upgrade object A is upgraded, that is, the upgrade object A corresponds to the used object.
  • the original data xy of the system is added to the current data where the upgrade object A should be located. After the addition, the current data in the upgrade object A in the system of the terminal device is consistent with the original data, both of which are xy.
  • the repaired system is consistent with the original version of the system and is the basis for differential upgrade of the terminal device system.
  • the original data in the system of the original version of the terminal device refers to the unmodified data corresponding to the upgrade object when the original version was originally released, and the terminal device can adopt the differential upgrade mode based on the original data of the original version. , upgrade from the original version to the target version. Any change in the original data of the upgrade object of the original version of the terminal device will cause the differential upgrade package to be unusable and cannot be upgraded by differential upgrade. Therefore, in the embodiment of the present application, before the differential upgrade is performed, the repair data of the upgrade object to be upgraded is acquired, and the system of the original version of the terminal device is repaired to ensure the data of the upgrade object in the terminal device, and the original version.
  • the raw data of the system is consistent, ensuring the effectiveness of differential upgrades.
  • file 123 contains data a, b1, and file 123 exists in the target version of the system, including data a', b', and the upgrade object is file 123.
  • the original data of the file 123 is a, b
  • the repair data is the original data a, b corresponding to the file 123;
  • the terminal device uses the original data a, b in the file 123 to overwrite the current in the file 123.
  • the data a and b1 are repaired, and the current data in the upgrade object file 123 after the repair is consistent with the original data, and the data is a and b, that is, the repaired system is consistent with the original version system.
  • block 1000 contains data a1, b, c, and in the target version of the system, block 1000 also contains data a', b', c', and the upgrade object is block 1000.
  • the original data of the block 1000 is a, b, and c
  • the repair data is the original data a, b, and c corresponding to the block 1000; the terminal device uses the original data a, b, and c in the block 1000 to cover the block 1000.
  • the current data a1, b, and c complete the repair of the block 1000, and the current data in the upgraded object block 1000 after the repair is consistent with the original data, all of which are a, b, and c, that is, the repaired system is consistent with the original version system.
  • the current data and the original data are the current data and the original data corresponding to the upgrade object.
  • the repair is performed, only the upgrade object is used, and the current data of the upgrade object is repaired by using the repair data of the upgrade object, so that The current data corresponding to the upgrade object is consistent with the original data corresponding to the upgrade object.
  • the other non-upgrade object parts of the system whether the repaired data is consistent with the data of the original version, the application is not concerned.
  • Step 205 The terminal device uses the differential upgrade package sent by the server to upgrade the system from the original version to the target version. Through the step 204, the terminal device obtains the repaired system, and ensures that the current data in the terminal device is consistent with the original data of the original version of the system, and meets the preconditions of the differential upgrade.
  • the terminal device receives the differential upgrade package sent by the server, and uses the differential upgrade package to perform differential upgrade on the upgrade object.
  • the differential upgrade can be a file-based differential upgrade, the file differential upgrade is a file-based upgrade, or a block-based differential upgrade, and the block differential upgrade is an upgrade based on blocks in the file.
  • the method for differential upgrade includes repair data and a differential upgrade package.
  • upgrading first use the repair data to repair the system of the terminal device, and ensure that the current data corresponding to the upgrade object in the terminal device is consistent with the original data in the original version of the system; on this basis, the differential upgrade package is used. After the upgrade is completed, the system of the terminal device is upgraded from the original version to the target version.
  • the differential upgrade method in order to avoid the differential upgrade failure caused by the original data of the original version used by the terminal device being modified, before the terminal device adopts the differential upgrade, the original version of the system is acquired, and the target version is The upgraded object of the system is different, and the system of the terminal device is repaired by using the repair data of the upgrade object, and the system is repaired to be consistent with the original version of the system, and then the repaired system is differentially upgraded. Repairing first and then differentially upgrading ensures the effectiveness of the differential upgrade mode for the terminal device.
  • the example is the repair data of the default upgrade object, which is inconsistent with the current data of the upgrade object in the system actually used by the terminal device.
  • the repair data of all the upgrade objects is obtained from the server, and the repair data is used.
  • the current data of the upgrade object is repaired, and then the differential upgrade package is used for differential upgrade, which ensures the effectiveness of the upgrade using the differential upgrade method.
  • the repair data of the upgraded object may be completely consistent with the current data of the upgraded object in the system actually used by the terminal device, and thus the system of the terminal device is not required to be repaired.
  • the differential upgrade package is used for differential upgrade.
  • the repair data of the upgrade object may be inconsistent with the current data of the upgrade object in the system actually used by the terminal device, instead of all being inconsistent, only the current data is inconsistent with the original data.
  • the upgrade object is fixed and then differentially upgraded using a differential upgrade package. Therefore, in order to further reduce the amount of data and the number of repairs of the repair data, a verification step may be added to determine whether the upgrade object needs to be repaired.
  • a verification step may be added to determine whether the upgrade object needs to be repaired.
  • the method for differential upgrade provided by the embodiment of the present application includes:
  • Step 301 The terminal device acquires verification data of the upgrade object, where the verification data corresponds to the original data of the upgrade object.
  • the verification data corresponds to the original data of the upgrade object in the original version of the terminal device.
  • the verification data of one upgrade object is the original data of the upgrade object itself; in another case, an upgrade The checksum data of the object is the hash value of the original data of the upgrade object.
  • the server learns the original version of the terminal device, the server compares the original version of the system with the target version of the system to obtain an upgrade object; the server obtains the original data corresponding to the upgrade object in the original version of the system; The original data is directly used as the verification data of the upgrade object, or a hash value is used to calculate the hash value of the original data, and the hash value is used as the verification data of the upgrade object.
  • Step 302 The terminal device verifies, according to the verification data, the current data of the upgrade object in the terminal device, whether it is consistent with the original data. If not, step 303 is performed; if yes, step 305 is performed.
  • the current data refers to the current data corresponding to the upgrade object on the system actually used by the terminal device.
  • the current data corresponding to the upgrade object in the terminal device may be inconsistent with the original data of the upgrade object. Therefore, the terminal device must first verify the upgrade object and verify the Whether the original data of the upgrade object has changed.
  • the verification data is the original data of the upgrade object.
  • the original data of the upgrade object is compared with the current data of the upgrade object in the terminal device, and if the original data and the current data are completely consistent, It means that the original data of the upgrade object has not changed; if the original data is not completely consistent with the current data, it means that the original data of the upgrade object has been modified.
  • the original data is the original data in the file corresponding to the original version of the terminal device; and the current data is the original version of the system actually used on the terminal device, the file corresponding to the file Current data in .
  • the verification process is to compare whether the original data corresponding to each file is consistent with the current data. If the current data of a file is modified on the basis of the original data, the verification result of the file is inconsistent; The current data of the files is still the original data when the original version of the system was installed, and has not been modified. Then, the verification result of the file is consistent.
  • the original data is the original version of the terminal device, and the original data in the block corresponding to the block; and the current data is the original version of the system actually used on the terminal device, the block corresponding to the block Current data in .
  • the verification process is to compare whether the original data corresponding to each block is consistent with the current data. If the current data of a block is modified on the basis of the original data, the verification result of the block is inconsistent; The current data of the block is still the original data when the original version of the system is installed, and has not been modified. Then, the check result of the block is consistent.
  • step 302 when the verification data is a hash value of the original data, step 302 includes:
  • the terminal device obtains a hash value of the current data, and checks whether the hash value of the current data is consistent with the check data.
  • the terminal device acquires the current data of the upgrade object, and then uses the same hash algorithm to calculate the hash value of the current data, and the obtained upgrade.
  • the hash value of the original data of the object is compared. If the hash value of the original data is completely consistent with the hash value of the current data, it indicates that the original data of the upgrade object is also consistent with the current data, that is, the original data of the upgrade object. No change occurs; if the check data is inconsistent with the hash value of the current data, it means that the original data of the upgrade object is not completely consistent with the current data, that is, the original data of the upgrade object has been modified.
  • the verification data is the original version of the terminal device, and the file corresponds to the hash value of the original data calculated by the hash algorithm, and the current data corresponding to the file is obtained. After that, the hash value of the current data needs to be calculated according to the same hash algorithm.
  • the process of verification is to compare whether the check data corresponding to each file and the hash value of the current data are consistent.
  • the check data in the file is The hash value of the current data is inconsistent, that is, the check result of the file is inconsistent; if the current data of a file is still the original data when the original version is installed, the hash of the check data and the current data in the file The values are the same, that is, the verification result of the file is consistent.
  • the verification data is the original version of the terminal device, and the block corresponds to the hash value of the original data calculated by the hash algorithm, and the current data corresponding to the block is obtained. After that, the hash value of the current data needs to be calculated according to the same hash algorithm.
  • the verification process is to compare whether the check data corresponding to each block and the hash value of the current data are consistent.
  • the check data in the block is The hash value of the current data is inconsistent, that is, the check result of the block is inconsistent; if the current data of a block is still the original data when the original version is installed, the hash of the check data and the current data in the block The values are the same, that is, the check result of the block is consistent.
  • Step 303 The terminal device acquires the repair data of the upgrade object.
  • the original data corresponding to the upgraded object is modified in the system of the original version actually used by the terminal device, and the terminal device needs to obtain the modified upgrade object corresponding to the upgraded object. Fix the data.
  • the upgrade object When the current data of an upgrade object is inconsistent with the original data, the upgrade object needs to be repaired to ensure that the current data of the upgrade object is consistent with the original data, and the differential upgrade can be used for the upgrade object.
  • the server needs to obtain the upgrade target. Upgrade the repair data of the object.
  • the terminal device obtains the repair data of the upgrade object from the server, it only needs to obtain the repair data of the upgrade object whose current data is inconsistent with the original data, and does not need to acquire the repair data of the upgrade object whose current data is consistent with the original data.
  • the repair data of the upgrade object of the terminal device includes:
  • Step 303A The terminal device sends the identifier information of the upgrade object to the server.
  • Step 303B The server returns the repair data of the upgrade object to the terminal device according to the identifier information.
  • the identification information of the upgrade object refers to the information that can identify the upgrade object.
  • the identifier of the upgrade object is the identifier of the file, such as the file name.
  • the identifier of the upgrade object is the identifier of the block, such as the block offset address and the block.
  • the terminal device sends the identifier information of the upgrade object to the server; after receiving the identifier information of the upgrade object, the server obtains the original version from the server side through the identifier information.
  • the original data corresponding to the identification information is returned to the terminal device as repair data.
  • the upgrade object is a file
  • the name X of the file is the identifier of the file
  • the terminal device sends X to the server, and the server finds the corresponding data in the original version according to the identifier X.
  • the file whose name is X is returned to the terminal device as the repair data.
  • the upgrade object is block
  • the block number N is the block.
  • the identifier is sent by the terminal device to the server, and the server finds a block named N in the original version of the system according to the identifier N, and returns the data in the block N as the repair data to the terminal device.
  • Step 304 The terminal device repairs the system of the terminal device by using the above repair data, and obtains the repaired system.
  • the repair of the system in which the terminal device is actually used in step 304 is consistent with the description of step 204 in the embodiment shown in FIG. 2 of the present application, and details are not described herein again.
  • Step 305 The terminal device uses the differential upgrade package sent by the server to upgrade the system from the original version to the target version.
  • step 305 The difference between the terminal device and the terminal device in step 305 is the same as that in step 205 in the embodiment shown in FIG. 2, and details are not described herein again.
  • upgrade object when the upgrade object is a block, for the original version of the terminal device, there are upgrade objects: block1000, block1001, block1002, and block1003, where block1000 includes data A1 and B, and block1001 includes data C, D, block1002. Data E1 and F1 are included, and block 1003 contains data G and H.
  • the check data obtained by the terminal device is the original data with the block identifier, specifically: the check data of block 1000 is A, B, the check data of block 1001 is C, D, and the check data of block 1002 is E, F, block 1003 check data is G, H; the terminal device compares the current data of each upgrade object with the original data according to the above check data, specifically: the current data of block 1000 is A1, B, block 1001 The current data is C, D, the current data of block 1002 is E1, F1, the current data of block 1003 is G, H, and the identifier of the upgrade object whose current data is inconsistent with the original data is block 1000, block 1002; terminal device block1000
  • the identification information of the block 1002 is sent to the server, and the server returns the original data A and B of the block 1000 corresponding to the identification information and the original data E and F of the block 1002 as the repair data to the terminal device according to the identification information of the block; the terminal device Using the received repair data, the current data of block 1000 and block 1002
  • upgrade object is a file
  • file 123 contains data A, B
  • file 234 contains data C
  • D file
  • file 345 contains data E, F.
  • the verification data obtained by the terminal device is the original data with the file name, specifically: the verification data of the file 123 is A, B, the verification data of the file 234 is C, D, and the verification data of the file 345 is E,
  • the terminal device compares the current data of each upgrade object with the original data according to the verification data, specifically: the current data A, B and the original data A, B of the file 123, the current data C, D of the file 234 and The original data C, D, the current data E, F of the file 345 and the original data E, F, the current data and the original data are all consistent; at this time, the terminal device will directly use the differential upgrade package sent by the server to perform the above upgrade object.
  • the corresponding upgrade target data is: A', B', C', D', E', F'.
  • the verification data of the upgrade object is described by taking the original data of the upgrade object as an example, and the verification data of the upgrade object is the implementation manner of the hash value of the original data of the upgrade object. Similar, no more details here.
  • the upgrade object is acquired, and the current data and the original data corresponding to the upgrade object are verified.
  • the original data of the upgraded object that is inconsistent is verified as the repair data, and the original version of the system actually used by the terminal device is repaired.
  • a method for differential upgrade provided by an embodiment of the present application includes:
  • step 401 the server 100 generates verification data of the upgrade object according to the original data corresponding to the upgrade object.
  • Step 402 Send the verification data of the upgrade object to the terminal device 110.
  • the server 100 requests the terminal device 110 for the version number of the system currently used by the terminal device 110.
  • the server 100 obtains the original data of the original version of the system corresponding to the version number according to the version number of the terminal device 110, and the server obtains the target data of the target version of the system, compares the original data with the target data, and obtains the original version.
  • an object with data difference from the target version of the system is used as an upgrade target.
  • the server 100 After determining the upgrade object, the server 100 obtains the original data corresponding to the upgrade object in the original version of the system, performs hash operation on the original data of each upgrade object, and obtains a hash value corresponding to the upgrade object, as the upgrade target school. Test the data. The verification data of the obtained upgrade target is transmitted to the terminal device 110.
  • Step 403 The terminal device 110 determines the upgrade object to be repaired according to the verification data of the upgrade object.
  • the terminal device 110 obtains the current data corresponding to the upgrade object in the system actually used by the terminal device 110, calculates a hash value of the current data, and verifies whether the check data corresponding to the same upgrade object is consistent with the hash value of the current data, if not consistent. , the upgrade object is used as the upgrade object to be repaired.
  • Step 404 the terminal device 110 sends the upgrade object to be repaired to the server 100.
  • the upgrade object to be repaired here refers to an upgrade object whose current data is inconsistent with the original data, and may be a file that changes in the terminal device 110 or a block that changes in the terminal device 110.
  • Step 405 The server 100 sends the repair upgrade package and the differential upgrade package to the terminal device 110, where the repair upgrade package includes original data corresponding to the upgrade object to be repaired in the original version of the system; the differential upgrade package includes required for differential upgrade. Target data corresponding to all upgrade objects.
  • the main technical idea of the differential upgrade technology is to compare the data difference between the system version on the terminal device and the system target version on the server, and to upgrade the data difference in units of files or blocks. Therefore, the differential upgrade package is similar to the structure of the fix pack. It does not involve the same data portion in two different versions of the system, and the volume of the package can be upgraded to a minimum.
  • the prerequisite for the differential upgrade is that the actual used system is consistent with the data of the corresponding upgrade object in the original system. Therefore, it is necessary to repair the actual used system first, and repair the current data of the upgrade object to be consistent with the original data of the upgrade object.
  • the repair upgrade package includes repair data, and the repair data is the original data of the upgrade object corresponding to the identifier information.
  • the bolded data is the starting block number and the ending block number.
  • the original data corresponding to the upgrade object is extracted from the original version system, and a corresponding repair upgrade package is generated, specifically: Recover("/dev/block/bootdevice/by-name/system","3181",”555",”411364",”411366")
  • the first parameter represents the block offset address that needs to be repaired
  • the parameter represents the storage address of the file to which the block belongs
  • the third parameter represents the total length of the block data
  • the last two parameters represent the starting block number and the ending block number corresponding to the repair data; indicating that the repair data is from the block number 411364 to the block number.
  • 411366 a total of three blocks of data.
  • the structure of the present application is not specifically limited in any embodiment of the present application. Any form of upgrade package structure can be used to clearly and simply guide the terminal device to complete the upgrade and repair of the specified upgrade object. It is within the scope of the embodiments of the present application.
  • the data packaged by the upgrade object in the target version of the system is packaged into data packets.
  • the data content of the object in the differential upgrade package reflects the upgrade type of the upgrade object.
  • the upgrade type can be: replace, add, delete, and so on.
  • step 405 may only be performed and steps 401-404 may not be performed.
  • the repair upgrade package includes the original data corresponding to all upgrade objects in the original version of the system. The upgrade object is repaired regardless of whether the current data corresponding to the upgrade object differs from the original data.
  • step 406 the terminal device 110 performs repair of the data by using the repair upgrade package.
  • step 407 the terminal device 110 performs the differential upgrade by using the differential upgrade package.
  • the upgrade process is: replacing the object in the original version of the terminal device with the object in the differential upgrade package.
  • the original version of the system and the target version of the system have objects: block1000, block1001, block1002, block1003, wherein block1000 contains data A, B, block 1001 contains data C, D, block 1002 contains Data E, F, and block 1003 contain data G and H.
  • the difference upgrade package includes the object block 1000, block 1001, block 1002, and block 1003, and the data in the above object is: block 1000 data is A', B', block 1001 data is C', D', block 1002 data is E', F ', the data of block1003 is G', H'.
  • the differential upgrade package is used for differential upgrade.
  • the specific differential upgrade process is: for the object block1000, replace the original data A and B with the data in the differential upgrade package for A' and B'; for the object block1001, use the data in the differential upgrade package.
  • the upgrade process is: adding the object corresponding to the differential upgrade package to the corresponding location in the system of the original version of the terminal device.
  • the added object only exists in the system with the target version, and does not exist in the original version of the system.
  • block 1000, block 1001, and block 1002 are present, wherein block 1000 includes data A and B, block 1001 includes data C and D, block 1002 includes data E and F, and differential upgrade package includes upgrade.
  • the type is the added object: block1003, and the added position is: adjacent to block 1002 and after block 1002, the data in block 1003 is: G', H'.
  • the differential upgrade is performed by using the differential upgrade package.
  • the specific differential upgrade process is: for the target block 1003, the data in the differential upgrade package is G', H' is added to the data E and F of the block 1002.
  • the corresponding data in the target version of the system is: A, B, C, D, E, F, G', H', and the differential upgrade is completed.
  • the upgrade process is: deleting the corresponding object in the original version of the terminal device by using the delete instruction of the object in the differential upgrade package.
  • the original version of a terminal device there are: block1000, block1001, block1002, block1003, where block1000 contains data A, B, block 1001 contains data C, D, block 1002 contains data E, F, block 1003 contains data G, H.
  • the differential upgrade package contains the object block1000 and a "delete" instruction.
  • the differential upgrade is performed by using the differential upgrade package.
  • the specific differential upgrade process is: for the object block 1000, the original data A and B are deleted according to the "delete" command corresponding to the block 1000 in the differential upgrade package.
  • the corresponding data in the target version of the system is: C, D, E, F, G, and H, and the differential upgrade is completed.
  • the type of differential upgrade corresponding to all objects included in a differential upgrade package may be only one of adding, deleting, and replacing, or there may be any two or three of adding, deleting, and replacing. It is not limited here.
  • each object in the differential upgrade package may be upgraded according to the upgrade type corresponding to the object.
  • the system actually used by the terminal device is verified, and the upgrade object whose verification result is inconsistent is repaired, and then the repaired system is differentially upgraded;
  • the upgrade target with the same result is directly upgraded.
  • the effectiveness of using the differential upgrade method for system upgrade is improved.
  • the amount of repaired data and the number of repairs are further reduced, so that the repair of the upgrade object is more targeted, and the differential upgrade process is generally reduced. The amount of data.
  • the volume is less than 10% of the full upgrade package of the same version. Even if the corresponding repair data is added, the volume of the upgrade package is much smaller than the volume of the full upgrade package. Therefore, the difference of the embodiment of the present application is
  • the upgrade method can reduce the amount of downloaded data of the terminal device, shorten the download time of the upgrade package, and improve the efficiency and effectiveness of the differential upgrade to improve the user experience.
  • the embodiment of the present application further provides a differential upgrade device, which will be described in detail below with reference to the accompanying drawings.
  • FIG. 5 is a structural diagram of a differential upgrade apparatus according to an embodiment of the present disclosure, which is applied to a terminal device, where the apparatus includes: a first obtaining module 501, configured to acquire repair data of a differential upgrade package and an upgrade object, where the upgrade object is In the original version of the system, there is an object difference in data from the target version of the system, and the repair data is the original data of the upgrade object in the original version of the system.
  • a first obtaining module 501 configured to acquire repair data of a differential upgrade package and an upgrade object, where the upgrade object is In the original version of the system, there is an object difference in data from the target version of the system, and the repair data is the original data of the upgrade object in the original version of the system.
  • the repairing module 502 is configured to repair the system of the actual use of the terminal device by using the repair data, and obtain the repaired system, and the repaired system is consistent with the original version of the system.
  • the upgrade module 503 is configured to upgrade the system from the original version to the target version by using the differential upgrade package.
  • the foregoing first obtaining module 501 includes:
  • a first acquiring unit configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data
  • a first checking unit configured to verify, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data
  • the second obtaining unit is configured to acquire the repair data of the upgrade object when the current data is inconsistent with the original data.
  • the foregoing first obtaining module 501 includes:
  • a sending unit configured to send identifier information of the upgrade object to the server
  • the receiving unit is configured to receive repair data of the upgrade object returned by the server according to the identifier information.
  • the identifier information of the upgrade object includes an identifier of the file or an identifier of the block block.
  • the verification unit when the verification data is a hash value of the original data, the verification unit includes:
  • a check subunit configured to verify whether the hash value of the current data is consistent with the check data; if the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; If the hash value is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
  • the embodiment of the present application further provides another differential upgrading apparatus, which is applied to a server, as shown in FIG. 6, which is a result diagram of the apparatus, and the apparatus includes:
  • the second obtaining module 601 is configured to acquire a system of the original version before the terminal device is upgraded, and a system of the upgraded target version.
  • the determining module 602 is configured to determine an upgrade object according to a system of the original version and a target version, where the upgrade object is an object in the system of the original version that has data difference from the target version of the system.
  • the third obtaining module 603 is configured to obtain the repair data of the differential upgrade package and the upgrade object, where the repair data is the original data of the upgrade object in the original version of the system.
  • the sending module 604 is configured to send the differential upgrade package and the repair data of the upgrade object to the terminal device.
  • the foregoing third obtaining module 603 includes:
  • a third acquiring unit configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data
  • a sending unit configured to send verification data of the upgrade object to the terminal device
  • a second checking unit configured to check current data of the upgrade object in the terminal device according to the check data, and when the original data is inconsistent, the server receives the identifier information of the upgrade object sent by the terminal device;
  • the fourth obtaining unit is configured to obtain the repair data of the upgrade object according to the identifier information of the upgrade object.
  • the verification data of the upgrade object is a hash value of the original data.
  • FIG. 7 is a schematic diagram of a differential upgrade system provided by an embodiment of the present application, where the system includes:
  • the terminal device 701 includes: the differential upgrade device shown in FIG. 5;
  • the server 702 includes the differential upgrading apparatus shown in FIG. 6 described above.
  • the embodiment of the present application relates to a terminal device, which may include a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and the like.
  • a terminal device which may include a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and the like.
  • FIG. 8 is a block diagram showing a part of the structure of the mobile phone 800 related to the embodiment of the present application.
  • the mobile phone 800 includes an RF (Radio Frequency) circuit 810, a memory 820, other input devices 830, a display screen 840, a sensor 850, an audio circuit 860, an I/O subsystem 870, a processor 880, and a power supply. 890 and other components.
  • RF Radio Frequency
  • the structure of the mobile phone shown in FIG. 8 does not constitute a limitation on the mobile phone, and may include more or less components than those illustrated, or combine some components, or split some components, or Different parts are arranged.
  • the display screen 840 is a User Interface (UI) and that the handset 800 can include fewer user interfaces than illustrated or less.
  • UI User Interface
  • the components of the mobile phone 800 will be specifically described below with reference to FIG. 8:
  • the RF circuit 810 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, it is processed by the processor 880. In addition, the uplink data is designed to be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like.
  • RF circuitry 810 can also communicate with the network and other devices via wireless communication.
  • the wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
  • the memory 820 can be used to store software programs and modules, and the processor 880 executes various functional applications and data processing of the mobile phone 800 by running software programs and modules stored in the memory 820.
  • the memory 820 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored. Data created according to the use of the mobile phone 800 (such as audio data, phone book, etc.).
  • memory 820 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • Other input devices 830 can be used to receive input numeric or character information, as well as generate key signal inputs related to user settings and function controls of handset 800.
  • other input devices 830 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and light mice (the light mouse is not sensitive to display visual output).
  • function keys such as volume control buttons, switch buttons, etc.
  • trackballs mice, joysticks, and light mice (the light mouse is not sensitive to display visual output).
  • Other input devices 830 are coupled to other input device controllers 871 of I/O subsystem 870 for signal interaction with processor 880 under the control of other device input controllers 871.
  • Display 840 can be used to display information entered by the user or information provided to the user as well as various menus of handset 800, and can also accept user input.
  • the specific display screen 840 can include a display panel 841 and a touch panel 842.
  • the display panel 841 can be configured by using an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like.
  • the touch panel 842 also referred to as a touch screen, a touch sensitive screen, etc., can collect contact or non-contact operations on or near the user (eg, the user uses any suitable object or accessory such as a finger, a stylus, etc.
  • the operation in the vicinity of the touch panel 842 may also include a somatosensory operation; the operation includes a single point control operation, a multi-point control operation, and the like, and drives the corresponding connection device according to a preset program.
  • the touch panel 842 can include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation and posture of the user, and detects a signal brought by the touch operation, and transmits a signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts the signal into a processor. The processed information is sent to the processor 880 and can receive commands from the processor 880 and execute them.
  • the touch panel 842 can be implemented by using various types such as resistive, capacitive, infrared, and surface acoustic waves, and the touch panel 842 can be implemented by any technology developed in the future.
  • the touch panel 842 can cover the display panel 841, and the user can display the content according to the display panel 841 (the display content includes, but is not limited to, a soft keyboard, a virtual mouse, a virtual button, an icon, etc.) on the display panel 841. Covered When operating on or near the touch panel 842, the touch panel 842 detects a touch operation thereon or nearby, and transmits it to the processor 880 through the I/O subsystem 870 to determine the type of touch event to determine the user.
  • processor 880 provides a corresponding visual output on display panel 841 through I/O subsystem 870 in accordance with user input in accordance with the type of touch event.
  • the touch panel 842 and the display panel 841 are two independent components to implement the input and input functions of the mobile phone 800, in some embodiments, the touch panel 842 can be integrated with the display panel 841. The input and output functions of the mobile phone 800 are implemented.
  • the handset 800 can also include at least one type of sensor 850, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 when the mobile phone 800 moves to the ear. / or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.
  • the mobile phone 800 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
  • An audio circuit 860, a speaker 861, and a microphone 862 can provide an audio interface between the user and the handset 800.
  • the audio circuit 860 can transmit the converted audio data to the speaker 861 and convert it into a sound signal output by the speaker 861.
  • the microphone 862 converts the collected sound signal into a signal, which is received by the audio circuit 860.
  • the audio data is converted to audio data, which is then output to RF circuitry 808 for transmission to, for example, another handset, or audio data is output to memory 820 for further processing.
  • the I/O subsystem 870 is used to control external devices for input and output, and may include other device input controllers 871, sensor controllers 872, and display controllers 873.
  • one or more other input control device controllers 871 receive signals from other input devices 830 and/or send signals to other input devices 830, which may include physical buttons (press buttons, rocker buttons, etc.) , dial, slide switch, joystick, click wheel, light mouse (light mouse is a touch-sensitive surface that does not display visual output, or an extension of a touch-sensitive surface formed by a touch screen). It is worth noting that other input control device controllers 871 can be connected to any one or more of the above devices.
  • Display controller 873 in I/O subsystem 870 receives signals from display 840 and/or transmits signals to display 840. After the display screen 840 detects the user input, the display controller 873 converts the detected user input into an interaction with the user interface object displayed on the display screen 840, ie, implements human-computer interaction. Sensor controller 872 can receive signals from one or more sensors 850 and/or send signals to one or more sensors 850.
  • the processor 880 is the control center of the handset 800, which connects various portions of the entire handset using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 820, and recalling data stored in the memory 820,
  • the mobile phone 800 performs various functions and processing data to perform overall monitoring of the mobile phone.
  • the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like.
  • the modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 880.
  • the mobile phone 800 also includes a power source 890 (such as a battery) that supplies power to the various components.
  • a power source 890 such as a battery
  • the power source can be logically coupled to the processor 880 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.
  • the mobile phone 800 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A differential upgrading method, device and system, the method being specifically: before a terminal device upgrades a system from an original version to a target version by means of differential upgrade, using an object in the original version of the system which is different from the target version of the system as an upgrade object; acquiring repair data for the upgrade object, and repairing the system of the terminal device using the repair data to obtain a repaired system of the terminal device which is consistent with the original version of the system; and then performing a differential upgrade on the repaired system of the terminal device so as to upgrade the repaired system from the original version to the target version. The described method uses the repair data to repair the system of the terminal device, which ensures that the repaired system of the terminal device is consistent with the original version of the system, thereby being able to ensure that the terminal device may upgrade the system by using a differential upgrade mode.

Description

一种差分升级的方法、装置及系统Method, device and system for differential upgrade
本申请要求于2017年10月16日提交中国专利局、申请号为201710963842.0、发明名称为“一种升级的方法和设备”的中国专利申请的优先权,以及要求于2017年12月27日提交中国专利局、申请号为201711450650.6、发明名称为“一种差分升级的方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese Patent Application filed on October 16, 2017, the Chinese Patent Office, Application No. 201710963842.0, and the invention titled "An Upgrade Method and Equipment", and the request to be submitted on December 27, 2017. The priority of the Chinese Patent Application, which is incorporated herein by reference.
技术领域Technical field
本申请涉及通信技术领域,特别是涉及一种差分升级的方法、装置及系统。The present application relates to the field of communications technologies, and in particular, to a method, apparatus, and system for differential upgrade.
背景技术Background technique
空中下载技术(over-the-air technology,OTA),是一种通过互联网下载升级包进行系统升级的技术。采用上述OTA技术进行系统升级的终端设备,例如手机,平板电脑,智能手表,以及智能电视等,通过互联网从服务器下载系统的升级包,利用所下载的升级包对该终端设备的系统进行升级。Over-the-air technology (OTA) is a technology for upgrading systems through the Internet to download upgrade packages. A terminal device that uses the above OTA technology for system upgrade, such as a mobile phone, a tablet computer, a smart watch, and a smart TV, downloads an upgrade package of the system from a server via the Internet, and upgrades the system of the terminal device by using the downloaded upgrade package.
采用OTA技术进行系统升级时,存在两种升级方式。一种升级方式是全量升级,另一种升级方式是差分升级。采用全量升级方式时,终端设备从服务器下载全量升级包,该全量升级包中包括系统升级后的目标版本的所有的数据,该全量升级包的数据量大,下载该全量升级包所需的时间长;并且,根据该全量升级包对系统进行升级后,终端设备的硬件可能无法支持升级后的系统,导致终端设备存在安全问题。There are two upgrade methods when using OTA technology for system upgrade. One upgrade method is a full upgrade, and the other upgrade method is a differential upgrade. When the full-scale upgrade mode is adopted, the terminal device downloads the full-scale upgrade package from the server, and the full-scale upgrade package includes all the data of the target version after the system upgrade, the data volume of the full-scale upgrade package is large, and the time required to download the full-scale upgrade package is required. Long; and after upgrading the system according to the full upgrade package, the hardware of the terminal device may not be able to support the upgraded system, resulting in security problems of the terminal device.
采用差分升级方式时,终端设备从服务器下载差分升级包,该差分升级包能够体现升级前的原版本的系统,与升级后的目标版本的系统之间的差异。该差分升级包的数据量小,下载该差分数据包所需的时间短;并且,该终端设备的硬件不能支持的数据,也不会存在该差分数据包中,避免终端设备升级后存在安全性问题。When the differential upgrade mode is adopted, the terminal device downloads the differential upgrade package from the server, and the differential upgrade package can reflect the difference between the system before the upgrade and the system of the upgrade target version. The data of the differential upgrade package is small, and the time required for downloading the differential data packet is short; and the data that cannot be supported by the hardware of the terminal device does not exist in the differential data packet, and the security of the terminal device is avoided after the upgrade. problem.
但是,采用差分升级方式,要求原版本的系统中,与目标版本的系统存在数据差异的部分的数据没有被修改过,与原版本的系统中的原始数据一致,若存在数据差异的部分的数据被修改过,则该差分升级方式则无法使用。However, with the differential upgrade method, the data of the part of the original version of the system that has data difference with the target version of the system is not modified, and is consistent with the original data in the original version of the system. If it has been modified, the differential upgrade method cannot be used.
发明内容Summary of the invention
本申请解决的技术问题在于提供一种差分升级的方法、装置和系统,从而,在终端设备中存在数据差异的部分被修改过时,先对终端设备的系统进行修复,在对修复后的终端设备的系统进行差分升级。The technical problem to be solved by the present application is to provide a method, device and system for differential upgrade, so that when a part of the terminal device in which data difference exists is modified, the system of the terminal device is first repaired, and the repaired terminal device is The system is differentially upgraded.
第一方面,本申请提供了一种差分升级的方法,包括:In a first aspect, the present application provides a method for differential upgrade, including:
终端设备获取差分升级包和差分升级包和升级对象的修复数据,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象,修复数据是升级对象在原版本的系统中的原始数据;The terminal device obtains the repair data of the differential upgrade package and the differential upgrade package and the upgrade object. The upgrade object is an object in the original version of the system, and the data of the target version has a data difference, and the repair data is the original data of the upgrade object in the original version of the system. ;
终端设备利用修复数据修复终端设备的系统,获得修复后的系统,修复后的系统与原版本的系统一致;The terminal device repairs the terminal device system by using the repair data, and obtains the repaired system, and the repaired system is consistent with the original version of the system;
终端设备利用差分升级包,将系统从原版本升级到目标版本。The terminal device uses the differential upgrade package to upgrade the system from the original version to the target version.
可选地,终端设备获取升级对象的修复数据包括:Optionally, the repairing data of the upgrade object by the terminal device includes:
终端设备获取升级对象的校验数据,校验数据对应于原始数据;The terminal device obtains verification data of the upgrade object, and the verification data corresponds to the original data;
终端设备根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据是否一致;The terminal device verifies, according to the verification data, whether the current data of the upgrade object in the terminal device is consistent with the original data;
当前数据与原始数据不一致时,终端设备获取升级对象的修复数据。When the current data is inconsistent with the original data, the terminal device acquires the repair data of the upgrade object.
可选地,终端设备获取升级对象的修复数据包括:Optionally, the repairing data of the upgrade object by the terminal device includes:
终端设备将升级对象的标识信息发送至服务器;The terminal device sends the identification information of the upgrade object to the server;
终端设备接收服务器根据标识信息返回的升级对象的修复数据。The terminal device receives the repair data of the upgrade object returned by the server according to the identification information.
可选地,升级对象的标识信息包括文件的标识或块block的标识。Optionally, the identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
可选地,校验数据是原始数据的哈希值,终端设备根据校验数据,校验升级对象在终端设备中的当前数据,与升级对象在原版本的系统中的原始数据是否一致包括:Optionally, the verification data is a hash value of the original data, and the terminal device verifies, according to the verification data, whether the current data of the upgrade object in the terminal device is consistent with the original data of the upgrade object in the original version of the system, including:
终端设备获取当前数据的哈希值;The terminal device acquires a hash value of the current data;
终端设备校验当前数据的哈希值与校验数据是否一致;The terminal device verifies whether the hash value of the current data is consistent with the check data;
若当前数据的哈希值与校验数据一致,则终端设备确定当前数据与原始数据一致;若当前数据的哈希值与校验数据不一致,则终端设备确定当前数据与原始数据不一致。If the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; if the hash value of the current data is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
第二方面,本申请还提供了一种差分升级方法,包括:In a second aspect, the application further provides a differential upgrade method, including:
服务器获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统;The system obtains the original version of the system before the terminal device is upgraded, and the upgraded target version of the system;
服务器根据原版本的系统和目标版本的系统确定升级对象,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象;The server determines the upgrade object according to the original version of the system and the target version of the system, and the upgrade object is an object of the original version of the system, and the data of the target version of the system is different;
服务器获取差分升级包和升级对象的修复数据,修复数据是升级对象在原版本的系统中的原始数据;The server obtains the repair data of the differential upgrade package and the upgrade object, and the repair data is the original data of the upgrade object in the original version of the system;
服务器向终端设备发送差分升级包和升级对象的修复数据。The server sends the repair data of the differential upgrade package and the upgrade object to the terminal device.
可选地,服务器获取升级对象的修复数据包括:Optionally, the server obtains the repair data of the upgrade object, including:
服务器获取升级对象的校验数据,校验数据对应于原始数据;The server obtains verification data of the upgrade object, and the verification data corresponds to the original data;
服务器将升级对象的校验数据发送至终端设备;The server sends the verification data of the upgrade object to the terminal device;
当终端设备根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据不一致时,服务器接收终端设备发送的升级对象的标识信息;When the terminal device verifies the current data of the upgrade object in the terminal device according to the check data, and the inconsistency with the original data, the server receives the identifier information of the upgrade object sent by the terminal device;
服务器根据升级对象的标识信息,获取升级对象的修复数据。The server obtains the repair data of the upgrade object according to the identification information of the upgrade object.
可选地,升级对象的校验数据是原始数据的哈希值。Optionally, the verification data of the upgrade object is a hash value of the original data.
第三方面,本申请还提供了一种差分升级的装置,应用于终端设备,包括:In a third aspect, the present application further provides a device for differential upgrade, which is applied to a terminal device, including:
第一获取模块,用于获取差分升级包和升级对象的修复数据,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象,修复数据是升级对象在原版本的系统中的原始数据;The first obtaining module is configured to obtain the repair data of the differential upgrade package and the upgrade object. The upgrade object is an object in the original version of the system, and the data is different from the target version of the system, and the repair data is the original of the upgrade object in the original version of the system. data;
修复模块,用于利用修复数据修复终端设备的系统,获得修复后的系统,修复后的系统与原版本的系统一致;The repair module is used to repair the system of the terminal device by using the repair data, and obtain the repaired system, and the repaired system is consistent with the original version of the system;
升级模块,用于利用差分升级包,将系统从原版本升级到目标版本。The upgrade module is used to upgrade the system from the original version to the target version by using the differential upgrade package.
可选地,包括:Optionally, it includes:
第一获取单元,用于获取升级对象的校验数据,校验数据对应于原始数据;a first acquiring unit, configured to obtain verification data of the upgrade object, where the verification data corresponds to the original data;
第一校验单元,用于根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据是否一致;a first checking unit, configured to verify, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data;
第二获取单元,用于当前数据与原始数据不一致时,获取升级对象的修复数据。The second obtaining unit is configured to obtain the repair data of the upgrade object when the current data is inconsistent with the original data.
可选地,第一获取模块,包括:Optionally, the first obtaining module includes:
发送单元,用于将升级对象的标识信息发送至服务器;a sending unit, configured to send identifier information of the upgrade object to the server;
接收单元,用于接收服务器根据标识信息返回的升级对象的修复数据。The receiving unit is configured to receive repair data of the upgrade object returned by the server according to the identifier information.
可选地,升级对象的标识信息包括文件的标识或块block的标识。Optionally, the identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
可选地,校验数据是原始数据的哈希值,校验单元,包括:Optionally, the verification data is a hash value of the original data, and the verification unit includes:
获取子单元,用于获取当前数据的哈希值;Obtain a subunit for obtaining a hash value of the current data;
校验子单元,用于校验当前数据的哈希值与校验数据是否一致;若当前数据的哈希值与校验数据一致,则终端设备确定当前数据与原始数据一致;若当前数据的哈希值与校验数据不一致,则终端设备确定当前数据与原始数据不一致。a check subunit, configured to verify whether the hash value of the current data is consistent with the check data; if the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; If the hash value is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
第四方面,本申请还提供了一种差分升级装置,应用于服务器,装置包括:In a fourth aspect, the application further provides a differential upgrading apparatus, which is applied to a server, where the apparatus includes:
第二获取模块,用于获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统;a second obtaining module, configured to acquire a system of the original version before the terminal device is upgraded, and a system of the upgraded target version;
确定模块,用于根据原版本的系统和目标版本的系统确定升级对象,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象;a determining module, configured to determine an upgrade object according to a system of the original version of the system and the target version, where the upgrade object is an object of a data difference between the original version of the system and the target version of the system;
第三获取模块,用于获取差分升级包和升级对象的修复数据,修复数据是升级对象在原版本的系统中的原始数据;a third obtaining module, configured to obtain repair data of the differential upgrade package and the upgrade object, where the repair data is original data of the upgrade object in the original version of the system;
发送模块,用于向终端设备发送差分升级包和升级对象的修复数据。The sending module is configured to send the repair data of the differential upgrade package and the upgrade object to the terminal device.
可选地,第三获取模块,包括:Optionally, the third obtaining module includes:
第三获取单元,用于获取升级对象的校验数据,校验数据对应于原始数据;a third acquiring unit, configured to obtain verification data of the upgrade object, where the verification data corresponds to the original data;
发送单元,用于将升级对象的校验数据发送至终端设备;a sending unit, configured to send verification data of the upgrade object to the terminal device;
第二校验单元,用于根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据不一致时,服务器接收终端设备发送的升级对象的标识信息;a second checking unit, configured to check current data of the upgrade object in the terminal device according to the check data, and when the original data is inconsistent, the server receives the identifier information of the upgrade object sent by the terminal device;
第四获取单元,用于根据升级对象的标识信息,获取升级对象的修复数据。The fourth obtaining unit is configured to obtain the repair data of the upgrade object according to the identifier information of the upgrade object.
可选地,升级对象的校验数据是原始数据的哈希值。Optionally, the verification data of the upgrade object is a hash value of the original data.
第五方面,本申请提供了一种差分升级系统,包括:In a fifth aspect, the application provides a differential upgrade system, including:
终端设备,终端设备包括:上述第三方面提供的装置;The terminal device includes: the device provided by the foregoing third aspect;
服务器,服务器包括:上述第四方面提供的装置。The server and the server include the device provided in the above fourth aspect.
由上述内容可知,本申请存在以下有益效果:As can be seen from the above, the present application has the following beneficial effects:
终端设备采用差分升级将系统由原版本升级到目标版本之前,将原版本的系统中,与目标版本的系统存在差异的对象作为升级对象,获取该升级对象的修复数据,利用该修复数据对终端设备的系统进行修复,获得终端设备的修复后的系统,该终端设备的修复后的系统与原版本的系统一致,再对该终端设备的修复后的系统进行差分升级,从而将修复后的系统从原版本升级到目标版本。利用修复数据对终端设备的系统进行修复,确保终端设备的修复后的系统,与原版本的系统一致,从而,能够确保该终端设备可以使用差分升级方式对系统进行升级。Before the terminal device is upgraded from the original version to the target version by using the differential upgrade, the object with the difference between the original version of the system and the target version is used as the upgrade object, and the repair data of the upgrade object is obtained, and the repair data is used to the terminal. The system of the device is repaired, and the repaired system of the terminal device is obtained. The repaired system of the terminal device is consistent with the original version of the system, and the repaired system of the terminal device is differentially upgraded, thereby repairing the system. Upgrade from the original version to the target version. The repaired data is used to repair the system of the terminal device to ensure that the repaired system of the terminal device is consistent with the original version of the system, thereby ensuring that the terminal device can be upgraded using the differential upgrade method.
附图说明DRAWINGS
为了更清楚地说明本申请的技术方案,下面将对本申请实施例描述中所需要使用的附图作简单地介绍。In order to more clearly illustrate the technical solutions of the present application, the drawings to be used in the description of the embodiments of the present application will be briefly described below.
图1为本申请实施例提供的一种差分升级的系统结构示意图;FIG. 1 is a schematic structural diagram of a system for differential upgrade according to an embodiment of the present disclosure;
图2为本申请实施例提供的一种差分升级的方法的流程图;2 is a flowchart of a method for differential upgrade according to an embodiment of the present application;
图3为本申请实施例提供的另一种差分升级的方法的流程图;FIG. 3 is a flowchart of another method for differential upgrade provided by an embodiment of the present application;
图4为本申请实施例提供的一种差分升级的方法场景实施例流程图;FIG. 4 is a flowchart of a method for performing a differential upgrade according to an embodiment of the present disclosure;
图5为本申请实施例提供的应用于终端设备的一种差分升级的装置的结构图;FIG. 5 is a structural diagram of an apparatus for differential upgrade applied to a terminal device according to an embodiment of the present disclosure;
图6为本申请实施例提供的应用于服务器的一种差分升级的装置的结构图;FIG. 6 is a structural diagram of a device for differential upgrade applied to a server according to an embodiment of the present disclosure;
图7为本申请实施例提供的一种差分升级的系统的示意图;FIG. 7 is a schematic diagram of a differential upgrade system according to an embodiment of the present disclosure;
图8为本申请实施例提供的相关的手机的部分结构的框图。FIG. 8 is a block diagram of a partial structure of a related mobile phone according to an embodiment of the present application.
具体实施方式Detailed ways
为了给出确保终端设备能够采用差分升级的实现方案,本申请实施例提供了一种差分升级的方法、装置和系统,以下结合说明书附图对本申请所提供的实施例进行说明。In order to provide an implementation scheme for ensuring that the terminal device can adopt the differential upgrade, the embodiment of the present application provides a method, an apparatus, and a system for differential upgrade. The embodiments provided by the present application are described below with reference to the accompanying drawings.
为了使本申请技术方案的描述便于理解,下面先对本申请涉及的名称概念进行介绍。In order to make the description of the technical solution of the present application easy to understand, the concept of the name involved in the present application is first introduced below.
原版本的系统,是指在终端设备更新前,该终端设备上安装的系统,例如,emui5.0。The original version of the system refers to the system installed on the terminal device before the terminal device is updated, for example, emui5.0.
目标版本的系统,是指在终端设备更新后,该终端设备上安装的系统,例如,emui8.0。The target version of the system refers to the system installed on the terminal device after the terminal device is updated, for example, emui8.0.
实际使用的系统,是指在终端设备更新前,该终端设备上实际正在使用的系统。实际使用的系统与原版本的系统对应的系统版本相同,例如,均为emui5.0。如果在终端设备上安装了原版本系统后,在使用的过程中,对该系统中的数据进行了修改,产生了实际使用的系统;如果在终端设备上安装了原版本系统后,在使用的过程中,对该系统没有进行任何修改,那么,实际使用的系统与原版本的系统一致。The system actually used refers to the system actually used on the terminal device before the terminal device is updated. The system actually used has the same system version as the original version of the system, for example, both are emui5.0. If the original version of the system is installed on the terminal device, the data in the system is modified during the use process, resulting in the actual use of the system; if the original version of the system is installed on the terminal device, the In the process, no modifications were made to the system, and the actual system used was the same as the original version.
系统的升级,是指终端设备使用的系统从原版本更新到目标版本的过程。The upgrade of the system refers to the process of updating the system used by the terminal device from the original version to the target version.
差分升级,是指根据升级前原版本的系统与升级后目标版本的系统的数据差异,实现系统的过程。Differential upgrade refers to the process of implementing the system based on the data difference between the system before the upgrade and the system of the target version after the upgrade.
升级对象,是指在原版本的系统中,与目标版本的系统存在数据差异的对象。服务器中存储有终端设备升级前的原版本的系统,还存储有该终端设备升级后的目标版本的系统,将原版本的系统和目标版本的系统进行比较,确定出原版本的系统中,与目标版本的系统存在数据差异的对象,即为此次终端设备进行系统差分升级的升级对象。具体的,升级对象可以是文件,也可以是block。The upgrade object refers to the object that has data difference with the target version of the system in the original version of the system. The server stores the system of the original version before the upgrade of the terminal device, and also stores the system of the target version after the upgrade of the terminal device, compares the system of the original version with the system of the target version, and determines the system of the original version, and The target version of the system has data difference objects, that is, the upgrade target of the system differential upgrade for the terminal device. Specifically, the upgrade object can be a file or a block.
原始数据,是指原版本系统在安装时系统中的数据。Raw data refers to the data in the system of the original version of the system at the time of installation.
当前数据,是指实际使用的系统中的数据。Current data refers to the data in the system actually used.
修复数据,是指升级对象在原版本的系统中的原始数据。Repair data refers to the original data of the upgrade object in the original version of the system.
修复数据包,是指差分升级前,由服务器发送给终端设备的,用于修复实际使用的系统的数据包,修复后的系统中升级对象对应的数据与原版本的系统安装时的系统中该部分数据完全一致。The repair data packet refers to the data packet sent by the server to the terminal device before the differential upgrade, which is used to repair the system actually used. The data corresponding to the upgrade object in the repaired system is the same as the system installed in the original version of the system. Some of the data is exactly the same.
差分升级包,是指由服务器发送给终端设备的,用于实现终端设备的差分升级的数据包。A differential upgrade package refers to a data packet sent by a server to a terminal device to implement differential upgrade of the terminal device.
OTA差分升级技术,是根据升级前原版本的系统,与升级后目标版本的系统的数据差异,实现系统升级的技术。采用OTA差分升级时,服务器仅给终端设备发送差分升级包,该差分升级包能体现原版本的系统与目标版本的系统之间的数据差异,例如,原版本的系统包括数据a,b,c,目标版本的系统包括数据a,b,c’,则差分升级包包括数据c’。也就是说,OTA差分升级是以原版本的系统为基础进行升级,因此,对终端设备采用OTA差分升级时,要求终端设备的升级对象没有被修改过,该升级对象指的是终端设备所采用的原版本的系统中,与目标版本的系统存在数据差异的部分,例如原版本的系统包括文件A、文件B和文件C,目标版本的系统包括文件A、文件B和文件C’,则升级对象为文件C。若终端设备所采用的系统,曾被破解,或者发生过eMMC(embedded multi media card)数据跳变,会导致该终端设备所采用的原版本的系统数据发生改变,若该终端设备的升级对象的数据发生改变,则OTA差分升级的数据基础发生变化,则无法采用该差分升级包进行差分升级。The OTA differential upgrade technology is a technology that implements system upgrade based on the difference between the original version of the system before the upgrade and the data of the target version after the upgrade. When using OTA differential upgrade, the server only sends a differential upgrade package to the terminal device. The differential upgrade package can reflect the data difference between the original version of the system and the target version of the system. For example, the original version of the system includes data a, b, and c. The target version of the system includes data a, b, c', and the differential upgrade package includes data c'. That is to say, the OTA differential upgrade is based on the original version of the system. Therefore, when the OTA differential upgrade is applied to the terminal device, the upgrade target of the terminal device is not modified. The upgrade target refers to the terminal device. In the original version of the system, there is a difference in data from the target version of the system. For example, the original version of the system includes file A, file B, and file C. The target version of the system includes file A, file B, and file C'. The object is file C. If the system used by the terminal device has been cracked, or an eMMC (embedded multi media card) data hopping occurs, the system data of the original version used by the terminal device is changed, and if the terminal device is upgraded, If the data changes, the data foundation of the OTA differential upgrade changes, and the differential upgrade package cannot be used for differential upgrade.
为了解决上述问题,本申请实施例提供了差分升级的实现方案,终端设备获取升级对象的修复数据,该修复数据是该升级对象在终端设备的原版本的系统中的原始数据,利用上述修复数据修复终端设备实际使用的系统,获得修复后的系统,该修复后的系统与原版本的系统一致,对上述修复后的系统进行差分升级,将修复后的系统从原版本升级到目标版本。本申请实施例中,先对终端设备的系统进行修复,将终端设备的系统修复至与原版本的系统一致,再对修复后的终端设备的系统进行差分升级,确保采用差分升级方式对系统升级的有效性。In order to solve the above problem, the embodiment of the present application provides an implementation solution of a differential upgrade, where the terminal device obtains the repair data of the upgrade object, where the repair data is the original data of the upgrade object in the original version of the terminal device, and uses the repair data. The system actually used by the terminal device is repaired, and the repaired system is obtained. The repaired system is consistent with the original version of the system, and the repaired system is differentially upgraded, and the repaired system is upgraded from the original version to the target version. In the embodiment of the present application, the system of the terminal device is first repaired, the system of the terminal device is restored to be consistent with the original version of the system, and the system of the repaired terminal device is differentially upgraded to ensure that the system is upgraded by using a differential upgrade mode. Effectiveness.
下面先对本申请实施例的系统进行介绍,具体参见图1,该系统包括:服务器100,终端设备110。其中,服务器100,包含终端设备110的原版本的系统和目标版本的系统,服务器100可以比较原版本的系统以及目标版本的系统,确定出升级对象,并从原版本的系统中,获取升级对象的修复数据,将该升级对象的修复数据发送至终端设备110。终端设备110利用该升级对象的修复数据,对系统进行修复,再对修复后的系统进行差分升级。具体的,服务器100可以是应用程序服务提供商或者终端设备提供商;终端设备110可以是手机、平板电脑、智能手表、智能电视等PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑、TV、可穿戴设备、AR、VR设备等。The system of the embodiment of the present application is first introduced. Referring to FIG. 1 in detail, the system includes: a server 100 and a terminal device 110. The server 100 includes a system of the original version of the terminal device 110 and a system of the target version. The server 100 can compare the system of the original version with the system of the target version, determine the upgrade object, and obtain the upgrade object from the original version of the system. The repair data is sent to the terminal device 110 for the repair data of the upgrade object. The terminal device 110 repairs the system by using the repair data of the upgrade object, and then performs differential upgrade on the repaired system. Specifically, the server 100 may be an application service provider or a terminal device provider; the terminal device 110 may be a PDA (Personal Digital Assistant) or a POS (Point of Sales) such as a mobile phone, a tablet computer, a smart watch, a smart TV, or the like. , sales terminal), car computer, TV, wearable device, AR, VR device, etc.
下面结合附图对本申请实施例进行详细说明。The embodiments of the present application are described in detail below with reference to the accompanying drawings.
图2为本申请实施例提供的一种差分升级的方法流程图,包括以下步骤:FIG. 2 is a flowchart of a method for differential upgrade according to an embodiment of the present application, including the following steps:
步骤201,服务器获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统。Step 201: The server acquires a system of the original version before the terminal device is upgraded, and a system of the upgraded target version.
步骤202,服务器根据原版本的系统和目标版本的系统确定升级对象,其中,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象。Step 202: The server determines, according to the system of the original version and the system of the target version, the upgrade object, where the upgrade object is an object of the original version, and the data of the target version is different.
在终端设备的系统中,为了不断满足终端用户的需求,以及修改一些BUG,系统的版本会不断更新,更新前的该终端设备的系统的版本称为原版本,更新后的该终端设备的系统的版本称为目标版本。终端设备的系统从原版本更新到目标版本的过程,即为系统的升级。系统的升级消息可以是服务器推送给用户的,也可以是终端设备查询服务器获得的。In the system of the terminal device, in order to continuously meet the needs of the end user and modify some bugs, the version of the system is continuously updated, and the version of the system of the terminal device before the update is called the original version, and the system of the updated terminal device is updated. The version is called the target version. The process of updating the system of the terminal device from the original version to the target version is the upgrade of the system. The upgrade message of the system may be sent by the server to the user, or may be obtained by the terminal device querying the server.
服务器中存储有终端设备升级前的原版本的系统,还存储有该终端设备升级后的目标版本的系统,将原版本的系统和目标版本的系统进行比较,确定出原版本的系统中,与目标版本的系统存在数据差异的对象,即为此次终端设备进行系统差分升级的升级对象。The server stores the system of the original version before the upgrade of the terminal device, and also stores the system of the target version after the upgrade of the terminal device, compares the system of the original version with the system of the target version, and determines the system of the original version, and The target version of the system has data difference objects, that is, the upgrade target of the system differential upgrade for the terminal device.
如果升级对象的升级类型为替换,即,该升级对象在原版本的系统和目标版本的系统中都存在,但是该升级对象中的数据,在原版本的系统和目标版本的系统中存在差异。例如,服务器通过比较,发现在某终端设备的原版本的系统中包含对象A,目标版本的系统中也包含对象A,对象A中的数据不同,则确定出对象A为升级对象,且升级对象A的升级类型为替换。If the upgrade type of the upgrade object is replacement, that is, the upgrade object exists in the system of the original version and the target version, but the data in the upgrade object differs between the system of the original version and the system of the target version. For example, the server compares and finds that the object A is included in the system of the original version of the terminal device, and the target version of the system also includes the object A. If the data in the object A is different, the object A is determined to be the upgrade object, and the upgrade object is The upgrade type of A is replacement.
如果升级对象的类型为删除,即,该升级对象在原版本的系统中存在,而在目标版本的系统中不存在。例如,服务器通过比较,发现在某终端设备的原版本的系统中包含对象A,目标版本的系统中不包含对象A,则确定出对象A为升级对象,且升级对象A的升级类型为增加。If the type of the upgrade object is Delete, that is, the upgrade object exists in the original version of the system and does not exist in the target version of the system. For example, the server compares and finds that the object A is included in the system of the original version of the terminal device, and the object A does not include the object A in the target version, and the object A is determined to be the upgrade object, and the upgrade type of the upgrade object A is increased.
此外,还有一种可能的情况:升级的升级类型为增加,即,目标版本的系统中存在的对象,在原版本的系统中不存在。也就是说,该种差分升级是在原版本的系统的基础上增加对象,该增加的对象,不是原版本的系统中的对象,故不能作为升级对象。例如,服务器通过比较,发现在某终端设备的目标版本的系统中包含对象A,但是在原版本的系统中不包含对象A,则可以确定出升级的类型为增加,但是因为对象A在原版本的系统中不存在,对象A不能作为升级对象。In addition, there is a possibility that the upgrade type of the upgrade is increased, that is, the objects existing in the target version of the system do not exist in the original version of the system. That is to say, this kind of differential upgrade is to add an object based on the original version of the system, and the added object is not an object in the original version of the system, so it cannot be used as an upgrade object. For example, the server compares and finds that the object A is included in the system of the target version of a terminal device, but the object A is not included in the original version of the system, and it can be determined that the type of the upgrade is increased, but because the object A is in the original version of the system. Does not exist in it, object A cannot be used as an upgrade object.
在具体实现时,升级对象可以是文件,也可以是文件中的block,其中,block一般为4K=4096字节,是文件中的最小逻辑存储单元。终端设备的系统在升级前后,升级对象的标识不发生变化,但是升级对象中的数据可能发生改变。其中,如果升级对象是文件,则升级对象的标识指文件的标识。例如,升级对象为文件时,升级对象的标识是该文件的文件标识abc,升级之后,目标版本的系统中还存在文件标识为abc的文件,但是标识为abc的文件中的数据已经发生了改变。如果升级对象是block,则升级对象的标识指block的标识。例如,升级对象为block时,升级对象的标识是该block的文件标识block X,升级之后,目标版本的系统中还存在block标识为block X的block,但是标识为block X的block中的数据已经发生了改变。In the specific implementation, the upgrade object can be a file, or a block in the file, wherein the block is generally 4K=4096 bytes, which is the smallest logical storage unit in the file. Before and after the system of the terminal device, the identifier of the upgrade object does not change, but the data in the upgrade object may change. Wherein, if the upgrade object is a file, the identifier of the upgrade object refers to the identifier of the file. For example, when the upgrade object is a file, the identifier of the upgrade object is the file identifier abc of the file. After the upgrade, the file with the file identifier abc exists in the target version of the system, but the data in the file identified as abc has changed. . If the upgrade object is a block, the identifier of the upgrade object refers to the identifier of the block. For example, when the upgrade object is block, the identifier of the upgrade object is the file identifier block X of the block. After the upgrade, the target version of the system also has a block whose block identifier is block X, but the data in the block identified as block X has already been A change has occurred.
步骤203,服务器向终端设备发送升级对象的修复数据,该修复数据可以是升级对象在原版本的系统中的原始数据。Step 203: The server sends the repair data of the upgrade object to the terminal device, where the repair data may be the original data of the upgrade object in the original version of the system.
步骤204,终端设备利用该修复数据修复终端设备的系统,获得修复后的系统。Step 204: The terminal device repairs the system of the terminal device by using the repair data, and obtains the repaired system.
修复数据是升级对象在原版本的系统中的原始数据,当升级对象是文件时,修复数据是被确定为升级对象的文件在原版本的系统中的原始数据;当升级对象是block时,修复数据是被确定为升级对象的block在原版本的系统中的原始数据。The repair data is the original data of the upgrade object in the original version of the system. When the upgrade object is a file, the repair data is the original data of the file determined to be the upgrade object in the original version of the system; when the upgrade object is a block, the repair data is The raw data of the block determined to be the upgrade object in the original version of the system.
服务器在步骤202中确定出升级对象后,确定该升级对象在原版本的系统中的原始数据,例如,可以根据该升级对象的标识确定该原始数据的存储地址,再根据该存储地址确定一个存储区域,从该存储区域中获得该升级对象在原版本的系统中的原始数据,将该升级对象在原版本的系统中的原始数据,记作升级对象的修复数据。升级对象的修复数据,包括升级对象的存储地址等标识与该升级对象在原版本的系统中的原始数据的对应关系。服务器将升级对象的修复数据发送给终端设备,终端设备根据接收到的升级对象的修复数据,确定需要修复的对象。After determining the upgrade object in step 202, the server determines the original data of the upgrade object in the original version of the system. For example, the storage address of the original data may be determined according to the identifier of the upgrade object, and then a storage area is determined according to the storage address. The original data of the upgrade object in the original version of the system is obtained from the storage area, and the original data of the upgrade object in the original version of the system is recorded as the repair data of the upgrade object. The repair data of the upgrade object, including the storage address of the upgrade object, and the like, and the original data of the upgrade object in the original version of the system. The server sends the repair data of the upgrade object to the terminal device, and the terminal device determines the object to be repaired according to the repair data of the upgrade object received.
当升级对象是文件时,文件的修复数据中,文件的标识可以是文件名称等,修复数据为 文件在原版本的系统中的原始数据。终端设备根据接收到的文件名称或者文化存储地址,确定将要修复的文件,利用该文件的修复数据覆盖终端设备中该文件的数据,完成修复。When the upgrade object is a file, in the repair data of the file, the identifier of the file may be a file name or the like, and the repair data is the original data of the file in the original version of the system. The terminal device determines the file to be repaired according to the received file name or the cultural storage address, and uses the repair data of the file to overwrite the data of the file in the terminal device to complete the repair.
当升级对象是block时,block的修复数据中,block的标识包括block偏移地址、block所属的文件的存储地址,block数据总长度,起始block编号,以及结束block编号,修复数据为block在原版本的系统中的原始数据。终端设备根据接收到的block偏移地址、block所属的文件的存储地址、block数据总长度、起始block编号以及结束block编号,确定将要修复的block,利用该block的修复数据覆盖终端设备中该block的数据,完成修复。需要说明的是,升级对象为block时,除了block起始编号以外,还依据block数据总长度和结束block编号中的任意一项,都可以确定出将要修复的block,block的标识可以仅包括block数据总长度和结束block编号中的任意一个,也可以同时包括block数据总长度和结束block编号,在本申请中不作限定。When the upgrade object is a block, in the repair data of the block, the block identifier includes the block offset address, the storage address of the file to which the block belongs, the total length of the block data, the start block number, and the end block number, and the repair data is the block in the original. The raw data in the version of the system. The terminal device determines the block to be repaired according to the received block offset address, the storage address of the file to which the block belongs, the total length of the block data, the starting block number, and the ending block number, and the repair data of the block is used to overwrite the terminal device. Block the data and complete the repair. It should be noted that when the upgrade object is a block, in addition to the block start number, according to any one of the block data total length and the end block number, the block to be repaired may be determined, and the block identifier may include only the block. The total length of the data and the end block number may also include the total length of the block data and the end block number, which are not limited in this application.
这里需要说明的是,升级对象是block时,该升级对象包括多个block,并且多个block在文件中是连续的。起始block编号指的是在文件中排列在最靠前位置的block的编号,结束block编号指的是在文件中排列在最后位置的block的编号。It should be noted here that when the upgrade object is a block, the upgrade object includes multiple blocks, and multiple blocks are contiguous in the file. The starting block number refers to the number of the block arranged in the top position in the file, and the ending block number refers to the number of the block arranged in the last position in the file.
例如,某终端设备接收到服务器发送的升级对象的修复数据,其中,升级对象为block,block的标识为:block所属的文件的存储地址:1000,block偏移地址:120,block数据总长度:555,起始block编号:1364,结束block编号:1368。首先,终端设备根据block所属的文件的存储地址1000,找到block所属的文件;然后按照block偏移地址120,确定起始block,即起始block编号对应的block;接着,从起始block编号1364到结束block编号1368,连续的5个block均为升级对象,这5个block中数据总长度为555。利用所接收的5个block的修复数据,替换终端设备中上述5个block中的数据,完成对上述5个block的修复。For example, a terminal device receives the repair data of the upgrade object sent by the server, where the upgrade object is a block, and the identifier of the block is: the storage address of the file to which the block belongs: 1000, the block offset address: 120, the total length of the block data: 555, starting block number: 1364, ending block number: 1368. First, the terminal device finds the file to which the block belongs according to the storage address 1000 of the file to which the block belongs; then, according to the block offset address 120, determines the starting block, that is, the block corresponding to the starting block number; and then, from the starting block number 1364 To the end block number 1368, five consecutive blocks are upgraded objects, and the total length of the data in these five blocks is 555. The repair data of the above five blocks in the terminal device is replaced by the repair data of the received five blocks, and the repair of the above five blocks is completed.
对于一个终端设备来说,修复前所使用的系统与修复后所使用的系统都是原版本,但是该终端设备修复前实际使用的系统的数据,与原版本最初所使用的系统的数据可能存在数据差异。定义该终端设备修复前实际使用的系统的数据为当前数据,原版本最初所使用的系统的数据为原始数据。For an end device, the system used before the repair and the system used after the repair are the original versions, but the data of the system actually used before the repair of the terminal device may exist with the data of the system originally used by the original version. Data differences. The data of the system actually used before the repair of the terminal device is defined as the current data, and the data of the system originally used by the original version is the original data.
在修复过程中,若终端设备的系统的当前数据中存在升级对象,则利用升级对象的修复数据,覆盖该当前数据中升级对象对应的当前数据。例如,某终端设备修复前实际使用的系统的当前数据中包括升级对象A,升级对象A中的当前数据为xxy,则利用升级对象A的修复数据,即升级对象A在该系统的原始数据xy,覆盖当前数据xxy,覆盖后,终端设备的系统中升级对象A中的当前数据与原始数据一致,均为xy。During the repair process, if there is an upgrade object in the current data of the system of the terminal device, the repair data of the upgrade object is used to overwrite the current data corresponding to the upgrade object in the current data. For example, if the current data of the system actually used before the repair of a terminal device includes the upgrade object A, and the current data in the upgrade object A is xxy, the repair data of the upgrade object A is used, that is, the original data of the upgrade object A in the system is xy. After the current data xxy is overwritten, the current data in the upgrade object A in the system of the terminal device is consistent with the original data, and both are xy.
若终端设备的系统的当前数据中不存在升级对象,则添加该升级对象的修复数据。例如,某终端设备修复前实际使用的系统的当前数据中不包括升级对象A,即升级对象A中的当前数据为空,则将升级对象A的修复数据,即升级对象A对应于所使用的系统的原始数据xy,添加到当前数据中升级对象A应该处于的位置,添加后,终端设备的系统中升级对象A中的当前数据与原始数据一致,均为xy。If the upgrade object does not exist in the current data of the system of the terminal device, the repair data of the upgrade object is added. For example, if the current data of the system actually used before the repair of a terminal device does not include the upgrade object A, that is, the current data in the upgrade object A is empty, the repair data of the upgrade object A is upgraded, that is, the upgrade object A corresponds to the used object. The original data xy of the system is added to the current data where the upgrade object A should be located. After the addition, the current data in the upgrade object A in the system of the terminal device is consistent with the original data, both of which are xy.
修复后的系统与原版本的系统一致,是终端设备的系统进行差分升级的基础。终端设备的原版本的系统中的原始数据,是指该原版本最初发布时,升级对象对应的没有被修改过的数据,终端设备在该原版本的原始数据的基础上,才能采用差分升级方式,从原版本升级到 目标版本。无论终端设备原版本的升级对象的原始数据发生任何改变,都将造成差分升级包无法使用,无法采用差分升级方式进行升级。因此,本申请实施例中,在进行差分升级之前,先获取所要升级的升级对象的修复数据,对终端设备的原版本的系统进行修复,确保终端设备中该升级对象的数据,与原版本的系统的原始数据一致,进而确保采用差分升级的有效性。The repaired system is consistent with the original version of the system and is the basis for differential upgrade of the terminal device system. The original data in the system of the original version of the terminal device refers to the unmodified data corresponding to the upgrade object when the original version was originally released, and the terminal device can adopt the differential upgrade mode based on the original data of the original version. , upgrade from the original version to the target version. Any change in the original data of the upgrade object of the original version of the terminal device will cause the differential upgrade package to be unusable and cannot be upgraded by differential upgrade. Therefore, in the embodiment of the present application, before the differential upgrade is performed, the repair data of the upgrade object to be upgraded is acquired, and the system of the original version of the terminal device is repaired to ensure the data of the upgrade object in the terminal device, and the original version. The raw data of the system is consistent, ensuring the effectiveness of differential upgrades.
举例来说,对于原版本的系统中存在对象:文件123,文件123包含数据a、b1,目标版本的系统中也存在文件123,包含数据a’、b’,则升级对象就是文件123。在原版本的系统中,可知文件123的原始数据为a、b,则修复数据是文件123对应的原始数据a、b;终端设备利用文件123中的原始数据a、b,覆盖文件123中的当前数据a、b1,完成修复,且修复后升级对象文件123中的当前数据与原始数据一致,均为数据a、b,即修复后的系统与原版本系统一致。For example, for the original version of the system, there are objects: file 123, file 123 contains data a, b1, and file 123 exists in the target version of the system, including data a', b', and the upgrade object is file 123. In the original version of the system, it can be known that the original data of the file 123 is a, b, and the repair data is the original data a, b corresponding to the file 123; the terminal device uses the original data a, b in the file 123 to overwrite the current in the file 123. The data a and b1 are repaired, and the current data in the upgrade object file 123 after the repair is consistent with the original data, and the data is a and b, that is, the repaired system is consistent with the original version system.
举例来说,对于原版本的系统中存在对象:block1000,block1000包含数据a1、b、c,目标版本的系统中也存在block1000包含数据a’、b’、c’,则升级对象就是block1000。在原版本的系统中,可知block1000的原始数据为a、b、c,则修复数据是block1000对应的原始数据a、b、c;终端设备利用block1000中的原始数据a、b、c,覆盖block1000中的当前数据a1、b、c,完成对block1000的修复,且修复后升级对象block1000中的当前数据与原始数据一致,均为a、b、c,即修复后的系统与原版本系统一致。For example, for the original version of the system, there is an object: block 1000, block 1000 contains data a1, b, c, and in the target version of the system, block 1000 also contains data a', b', c', and the upgrade object is block 1000. In the original version of the system, it can be known that the original data of the block 1000 is a, b, and c, and the repair data is the original data a, b, and c corresponding to the block 1000; the terminal device uses the original data a, b, and c in the block 1000 to cover the block 1000. The current data a1, b, and c complete the repair of the block 1000, and the current data in the upgraded object block 1000 after the repair is consistent with the original data, all of which are a, b, and c, that is, the repaired system is consistent with the original version system.
需要说明的是,上述当前数据和原始数据,均为升级对象对应的当前数据和原始数据,进行修复时,只是针对升级对象,利用升级对象的修复数据对该升级对象的当前数据进行修复,使升级对象对应的当前数据与升级对象对应的原始数据一致,至于系统的其他非升级对象部分,进行修复与否,修复后的数据与原版本的数据是否一致,本申请并不关注。It should be noted that the current data and the original data are the current data and the original data corresponding to the upgrade object. When the repair is performed, only the upgrade object is used, and the current data of the upgrade object is repaired by using the repair data of the upgrade object, so that The current data corresponding to the upgrade object is consistent with the original data corresponding to the upgrade object. As for the other non-upgrade object parts of the system, whether the repaired data is consistent with the data of the original version, the application is not concerned.
步骤205,终端设备利用服务器发送的差分升级包,将系统从原版本升级到目标版本。通过步骤204,终端设备得到修复后的系统,确保终端设备中当前数据与原版本的系统的原始数据一致,满足差分升级的前提条件。Step 205: The terminal device uses the differential upgrade package sent by the server to upgrade the system from the original version to the target version. Through the step 204, the terminal device obtains the repaired system, and ensures that the current data in the terminal device is consistent with the original data of the original version of the system, and meets the preconditions of the differential upgrade.
终端设备接收到服务器发送的差分升级包,利用该差分升级包,对升级对象进行差分升级。该差分升级可以是基于文件的差分升级,文件差分升级是以文件为单位进行的升级;也可以是基于block的差分升级,block差分升级是以文件中的block为单位的升级。The terminal device receives the differential upgrade package sent by the server, and uses the differential upgrade package to perform differential upgrade on the upgrade object. The differential upgrade can be a file-based differential upgrade, the file differential upgrade is a file-based upgrade, or a block-based differential upgrade, and the block differential upgrade is an upgrade based on blocks in the file.
由上述技术方案可知,本申请实施例提供的差分升级的方法中,包含修复数据和差分升级包。在升级时,首先利用修复数据对终端设备的系统进行修复,确保终端设备中的升级对象对应的当前数据与原版本的系统中该处的原始数据一致;在此基础上,再采用差分升级包进行差分升级,升级完成之后,终端设备的系统从原版本升级为目标版本。It can be seen from the above technical solution that the method for differential upgrade provided by the embodiment of the present application includes repair data and a differential upgrade package. When upgrading, first use the repair data to repair the system of the terminal device, and ensure that the current data corresponding to the upgrade object in the terminal device is consistent with the original data in the original version of the system; on this basis, the differential upgrade package is used. After the upgrade is completed, the system of the terminal device is upgraded from the original version to the target version.
本申请实施例提供的差分升级方法,为了避免由于终端设备所使用的原版本的原始数据被修改导致的差分升级失败,在终端设备采用差分升级之前,获取原版本的系统中,与目标版本的系统存在差异的升级对象,并利用该升级对象的修复数据对终端设备的系统进行修复,修复到与原版本的系统一致,再对该修复后的系统进行差分升级。先修复,再差分升级,能够确保该终端设备使用差分升级方式的有效性。In the differential upgrade method provided by the embodiment of the present application, in order to avoid the differential upgrade failure caused by the original data of the original version used by the terminal device being modified, before the terminal device adopts the differential upgrade, the original version of the system is acquired, and the target version is The upgraded object of the system is different, and the system of the terminal device is repaired by using the repair data of the upgrade object, and the system is repaired to be consistent with the original version of the system, and then the repaired system is differentially upgraded. Repairing first and then differentially upgrading ensures the effectiveness of the differential upgrade mode for the terminal device.
在上述本申请实施例中,终端设备进行差分升级前,需要对该终端设备的系统进行修复。上述实例中,为了更好的理解本申请技术方案的优点,所举的例子,都是默认升级对象的修复数据,与终端设备实际使用的系统中升级对象的当前数据不一致。上述提供的实现方式的 实际应用场景下,无论升级对象的修复数据,与终端设备实际使用的系统中升级对象的当前数据是否一致,都要从服务器获取所有升级对象的修复数据,利用修复数据对升级对象的当前数据进行修复,然后才采用差分升级包进行差分升级,确保了使用差分升级方式进行升级的有效性。In the foregoing embodiment of the present application, before the terminal device performs the differential upgrade, the system of the terminal device needs to be repaired. In the above example, in order to better understand the advantages of the technical solution of the present application, the example is the repair data of the default upgrade object, which is inconsistent with the current data of the upgrade object in the system actually used by the terminal device. In the actual application scenario of the implementation provided above, whether the repair data of the upgrade object is consistent with the current data of the upgrade object in the system actually used by the terminal device, the repair data of all the upgrade objects is obtained from the server, and the repair data is used. The current data of the upgrade object is repaired, and then the differential upgrade package is used for differential upgrade, which ensures the effectiveness of the upgrade using the differential upgrade method.
但是,在实际进行差分升级时,可能升级对象的修复数据,与终端设备实际使用的系统中升级对象的当前数据是完全一致的,此时就不需要对终端设备的系统进行修复,即可直接利用差分升级包进行差分升级;也可能存在部分升级对象的修复数据,与终端设备实际使用的系统中升级对象的当前数据不一致,而不是所有的都不一致,则只需要对当前数据与原始数据不一致的升级对象进行修复,然后利用差分升级包进行差分升级。故,为了能进一步减少修复数据的数据量和修复次数,可以增加校验步骤,以确定是否需要对升级对象进行修复,具体参见本申请下面一个实施例提供的差分升级方法。However, when the differential upgrade is actually performed, the repair data of the upgraded object may be completely consistent with the current data of the upgraded object in the system actually used by the terminal device, and thus the system of the terminal device is not required to be repaired. The differential upgrade package is used for differential upgrade. The repair data of the upgrade object may be inconsistent with the current data of the upgrade object in the system actually used by the terminal device, instead of all being inconsistent, only the current data is inconsistent with the original data. The upgrade object is fixed and then differentially upgraded using a differential upgrade package. Therefore, in order to further reduce the amount of data and the number of repairs of the repair data, a verification step may be added to determine whether the upgrade object needs to be repaired. For details, refer to the differential upgrade method provided in one embodiment of the present application.
如图3所示,在一个例子中,本申请实施例提供的差分升级的方法,包括:As shown in FIG. 3, in an example, the method for differential upgrade provided by the embodiment of the present application includes:
步骤301,终端设备获取升级对象的校验数据,该校验数据与升级对象的原始数据对应。Step 301: The terminal device acquires verification data of the upgrade object, where the verification data corresponds to the original data of the upgrade object.
校验数据与升级对象在终端设备的原版本的系统中的原始数据相对应,一种情况下,一个升级对象的校验数据为该升级对象的原始数据本身;另一种情况下,一个升级对象的校验数据,是该升级对象的原始数据的哈希值。在具体实现时,服务器在获悉终端设备的原版本的系统后,将原版本的系统与目标版本的系统进行比较,得到升级对象;服务器在原版本的系统中,获取升级对象对应的原始数据;将原始数据直接作为升级对象的校验数据,或者,利用哈希算法,计算该原始数据的哈希值,将该哈希值作为升级对象的校验数据。The verification data corresponds to the original data of the upgrade object in the original version of the terminal device. In one case, the verification data of one upgrade object is the original data of the upgrade object itself; in another case, an upgrade The checksum data of the object is the hash value of the original data of the upgrade object. In a specific implementation, after the server learns the original version of the terminal device, the server compares the original version of the system with the target version of the system to obtain an upgrade object; the server obtains the original data corresponding to the upgrade object in the original version of the system; The original data is directly used as the verification data of the upgrade object, or a hash value is used to calculate the hash value of the original data, and the hash value is used as the verification data of the upgrade object.
需要说明的是,校验数据采用原始数据的哈希值表示,实际上实现了对原始数据的压缩,缩小了校验数据的数据量,节约了校验数据占用的存储空间,进而减少了传输校验数据的时间。步骤302,终端设备根据上述校验数据,校验升级对象在终端设备中的当前数据,与原始数据是否一致,如果否,执行步骤303;如果是,执行步骤305。It should be noted that the verification data is represented by the hash value of the original data, actually realizing the compression of the original data, reducing the data amount of the verification data, saving the storage space occupied by the verification data, thereby reducing the transmission. The time to verify the data. Step 302: The terminal device verifies, according to the verification data, the current data of the upgrade object in the terminal device, whether it is consistent with the original data. If not, step 303 is performed; if yes, step 305 is performed.
当前数据,是指在终端设备实际使用的系统上,升级对象对应的当前数据。在发生eMMC数据跳变或者被破解等情况下,可能会导致终端设备中升级对象对应的当前数据,与升级对象的原始数据不一致,因此,终端设备先要对升级对象进行校验,校验该升级对象的原始数据是否发生过改变。The current data refers to the current data corresponding to the upgrade object on the system actually used by the terminal device. In the case of eMMC data hopping or being hacked, the current data corresponding to the upgrade object in the terminal device may be inconsistent with the original data of the upgrade object. Therefore, the terminal device must first verify the upgrade object and verify the Whether the original data of the upgrade object has changed.
在一种实现方式中,校验数据为升级对象的原始数据本身,此时,将升级对象的原始数据,与终端设备中该升级对象的当前数据进行比较,若原始数据和当前数据完全一致,则表示该升级对象的原始数据没有发生改变;若原始数据与当前数据不完全一致,则表示该升级对象的原始数据曾被修改。In an implementation manner, the verification data is the original data of the upgrade object. In this case, the original data of the upgrade object is compared with the current data of the upgrade object in the terminal device, and if the original data and the current data are completely consistent, It means that the original data of the upgrade object has not changed; if the original data is not completely consistent with the current data, it means that the original data of the upgrade object has been modified.
当升级对象是文件时,原始数据为终端设备的原版本的系统中,该文件对应的文件中的原始数据;而当前数据为终端设备上实际使用的原版本的系统中,该文件对应的文件中的当前数据。校验的过程就是比较每个文件对应的原始数据和当前数据是否一致,如果某个文件的当前数据在原始数据的基础上进行了修改,那么,对该文件的校验结果为不一致;如果某个文件的当前数据还是在原版本系统安装时的原始数据,没有被修改过,那么,对该文件的校验结果为一致。When the upgrade object is a file, the original data is the original data in the file corresponding to the original version of the terminal device; and the current data is the original version of the system actually used on the terminal device, the file corresponding to the file Current data in . The verification process is to compare whether the original data corresponding to each file is consistent with the current data. If the current data of a file is modified on the basis of the original data, the verification result of the file is inconsistent; The current data of the files is still the original data when the original version of the system was installed, and has not been modified. Then, the verification result of the file is consistent.
当升级对象是block时,原始数据为终端设备的原版本的系统中,该block对应的block 中的原始数据;而当前数据为终端设备上实际使用的原版本的系统中,该block对应的block中的当前数据。校验的过程就是比较每个block对应的原始数据和当前数据是否一致,如果某个block的当前数据在原始数据的基础上进行了修改,那么,对该block的校验结果为不一致;如果某个block的当前数据还是在原版本系统安装时的原始数据,没有被修改过,那么,对该block的校验结果为一致。When the upgrade object is a block, the original data is the original version of the terminal device, and the original data in the block corresponding to the block; and the current data is the original version of the system actually used on the terminal device, the block corresponding to the block Current data in . The verification process is to compare whether the original data corresponding to each block is consistent with the current data. If the current data of a block is modified on the basis of the original data, the verification result of the block is inconsistent; The current data of the block is still the original data when the original version of the system is installed, and has not been modified. Then, the check result of the block is consistent.
在另一种实现方式中,当校验数据为原始数据的哈希值时,步骤302包括:In another implementation, when the verification data is a hash value of the original data, step 302 includes:
终端设备获取当前数据的哈希值,校验该当前数据的哈希值与校验数据是否一致。The terminal device obtains a hash value of the current data, and checks whether the hash value of the current data is consistent with the check data.
当校验数据为升级对象的原始数据的哈希值时,终端设备将获取升级对象的当前数据,然后,利用相同的哈希算法,计算出当前数据的哈希值,与获取到的该升级对象的原始数据的哈希值进行比较,若原始数据的哈希值和当前数据的哈希值完全一致,则表示该升级对象的原始数据与当前数据也是一致的,即该升级对象的原始数据没有发生改变;若校验数据与当前数据的哈希值不一致,则表示该升级对象的原始数据与当前数据是不完全一致的,即该升级对象的原始数据曾被修改。When the verification data is a hash value of the original data of the upgrade object, the terminal device acquires the current data of the upgrade object, and then uses the same hash algorithm to calculate the hash value of the current data, and the obtained upgrade. The hash value of the original data of the object is compared. If the hash value of the original data is completely consistent with the hash value of the current data, it indicates that the original data of the upgrade object is also consistent with the current data, that is, the original data of the upgrade object. No change occurs; if the check data is inconsistent with the hash value of the current data, it means that the original data of the upgrade object is not completely consistent with the current data, that is, the original data of the upgrade object has been modified.
当升级对象是文件时,校验数据为终端设备的原版本的系统中,该文件对应原始数据通过哈希算法,计算得到的原始数据的哈希值;而在获取到该文件对应的当前数据后,需要按照相同的哈希算法,计算得到当前数据的哈希值。校验的过程就是比较每个文件对应的校验数据和当前数据的哈希值是否一致,如果某个文件的当前数据在原始数据的基础上进行了修改,那么,该文件中校验数据与当前数据的哈希值不一致,即对该文件的校验结果为不一致;如果某个文件的当前数据还是在原版本系统安装时的原始数据,那么,该文件中校验数据与当前数据的哈希值一致,即对该文件的校验结果为一致。When the upgrade object is a file, the verification data is the original version of the terminal device, and the file corresponds to the hash value of the original data calculated by the hash algorithm, and the current data corresponding to the file is obtained. After that, the hash value of the current data needs to be calculated according to the same hash algorithm. The process of verification is to compare whether the check data corresponding to each file and the hash value of the current data are consistent. If the current data of a file is modified on the basis of the original data, the check data in the file is The hash value of the current data is inconsistent, that is, the check result of the file is inconsistent; if the current data of a file is still the original data when the original version is installed, the hash of the check data and the current data in the file The values are the same, that is, the verification result of the file is consistent.
当升级对象是block时,校验数据为终端设备的原版本的系统中,该block对应原始数据通过哈希算法,计算得到的原始数据的哈希值;而在获取到该block对应的当前数据后,需要按照相同的哈希算法,计算得到当前数据的哈希值。校验的过程就是比较每个block对应的校验数据和当前数据的哈希值是否一致,如果某个block的当前数据在原始数据的基础上进行了修改,那么,该block中校验数据与当前数据的哈希值不一致,即对该block的校验结果为不一致;如果某个block的当前数据还是在原版本系统安装时的原始数据,那么,该block中校验数据与当前数据的哈希值一致,即对该block的校验结果为一致。When the upgrade object is a block, the verification data is the original version of the terminal device, and the block corresponds to the hash value of the original data calculated by the hash algorithm, and the current data corresponding to the block is obtained. After that, the hash value of the current data needs to be calculated according to the same hash algorithm. The verification process is to compare whether the check data corresponding to each block and the hash value of the current data are consistent. If the current data of a block is modified on the basis of the original data, then the check data in the block is The hash value of the current data is inconsistent, that is, the check result of the block is inconsistent; if the current data of a block is still the original data when the original version is installed, the hash of the check data and the current data in the block The values are the same, that is, the check result of the block is consistent.
步骤303,终端设备获取升级对象的修复数据。Step 303: The terminal device acquires the repair data of the upgrade object.
当升级对象的当前数据与升级对象的原始数据不一致时,说明终端设备实际使用的原版本的系统中,有升级对象对应的原始数据被修改过,需要终端设备获取被修改过的升级对象对应的修复数据。When the current data of the upgraded object is inconsistent with the original data of the upgraded object, the original data corresponding to the upgraded object is modified in the system of the original version actually used by the terminal device, and the terminal device needs to obtain the modified upgrade object corresponding to the upgraded object. Fix the data.
当一个升级对象的当前数据与原始数据不一致时,需要对该升级对象进行修复,确保该升级对象的当前数据与原始数据一致,才能对该升级对象使用差分升级,此时,需要从服务器获取该升级对象的修复数据。当一个升级对象的当前数据与原始数据一致时,则不需要对该升级对象进行修复,直接对该升级对象升级即可。由此可知,终端设备从服务器获取升级对象的修复数据时,只需要获取当前数据与原始数据不一致的升级对象的修复数据即可,无需获取当前数据与原始数据一致的升级对象的修复数据。When the current data of an upgrade object is inconsistent with the original data, the upgrade object needs to be repaired to ensure that the current data of the upgrade object is consistent with the original data, and the differential upgrade can be used for the upgrade object. In this case, the server needs to obtain the upgrade target. Upgrade the repair data of the object. When the current data of an upgrade object is consistent with the original data, the upgrade object does not need to be repaired, and the upgrade object can be directly upgraded. Therefore, when the terminal device obtains the repair data of the upgrade object from the server, it only needs to obtain the repair data of the upgrade object whose current data is inconsistent with the original data, and does not need to acquire the repair data of the upgrade object whose current data is consistent with the original data.
若只存在一部分升级对象的当前数据与原始数据不一致,则无需获取所有升级对象的修 复数据,只需要获取部分升级对象的修复数据,在这种实现场景下,与图2所示的实施例相比,减少获取升级对象的修复数据的数量。If only the current data of the upgrade object is inconsistent with the original data, it is not necessary to obtain the repair data of all the upgrade objects, and only the repair data of the partial upgrade object is acquired. In this implementation scenario, the embodiment shown in FIG. Than, reduce the number of repair data for getting upgraded objects.
当升级对象的当前数据与升级对象的原始数据不一致时,终端设备获取升级对象的修复数据包括:When the current data of the upgrade object is inconsistent with the original data of the upgrade object, the repair data of the upgrade object of the terminal device includes:
步骤303A,终端设备将升级对象的标识信息发送至服务器;Step 303A: The terminal device sends the identifier information of the upgrade object to the server.
步骤303B,服务器根据上述标识信息,返回升级对象的修复数据给终端设备。Step 303B: The server returns the repair data of the upgrade object to the terminal device according to the identifier information.
升级对象的标识信息,是指能够标识该升级对象的信息。当升级对象为文件时,升级对象的标识信息是文件的标识,如:文件名称等;当升级对象为block时,升级对象的标识信息是block的标识,如:block偏移地址、block所属的文件的存储地址、block数据总长度、起始block编号以及结束block编号等。The identification information of the upgrade object refers to the information that can identify the upgrade object. When the upgrade object is a file, the identifier of the upgrade object is the identifier of the file, such as the file name. When the upgrade object is a block, the identifier of the upgrade object is the identifier of the block, such as the block offset address and the block. The storage address of the file, the total length of the block data, the starting block number, and the ending block number.
对于当前数据与原始数据不一致的升级对象的情况,终端设备将该升级对象的标识信息发送给服务器;服务器接收到升级对象的标识信息后,通过标识信息,从服务器侧获取原版本的系统中该标识信息对应的原始数据,作为修复数据,返回给终端设备。For the case of the upgrade object whose current data is inconsistent with the original data, the terminal device sends the identifier information of the upgrade object to the server; after receiving the identifier information of the upgrade object, the server obtains the original version from the server side through the identifier information. The original data corresponding to the identification information is returned to the terminal device as repair data.
例如,对于升级对象为文件,当文件X对应的当前数据与原始数据不一致时,该文件的名称X为文件的标识,终端设备将X发送给服务器,服务器根据标识X找到在原版本的系统中对应的名称为X的文件,并将该文件X中的数据作为修复数据返回给终端设备;对于升级对象为block,当block N对应的当前数据与原始数据不一致时,该block的编号N为该block的标识,终端设备将N发送给服务器,服务器根据标识N找到在原版本的系统中对应的名称为N的block,并将该block N中的数据作为修复数据返回给终端设备。For example, if the upgrade object is a file, when the current data corresponding to the file X is inconsistent with the original data, the name X of the file is the identifier of the file, and the terminal device sends X to the server, and the server finds the corresponding data in the original version according to the identifier X. The file whose name is X is returned to the terminal device as the repair data. If the upgrade object is block, when the current data corresponding to block N is inconsistent with the original data, the block number N is the block. The identifier is sent by the terminal device to the server, and the server finds a block named N in the original version of the system according to the identifier N, and returns the data in the block N as the repair data to the terminal device.
步骤304,终端设备利用上述修复数据,修复终端设备的系统,获得修复后的系统。步骤304对终端设备的实际使用的系统的修复,与本申请图2所示的实施例中步骤204的描述一致,这里不再赘述。Step 304: The terminal device repairs the system of the terminal device by using the above repair data, and obtains the repaired system. The repair of the system in which the terminal device is actually used in step 304 is consistent with the description of step 204 in the embodiment shown in FIG. 2 of the present application, and details are not described herein again.
步骤305,终端设备利用服务器发送的差分升级包,将系统从原版本升级到目标版本。Step 305: The terminal device uses the differential upgrade package sent by the server to upgrade the system from the original version to the target version.
步骤305中对终端设备进行差分升级,与本申请图2所示的实施例中步骤205的描述一致,这里不再赘述。The difference between the terminal device and the terminal device in step 305 is the same as that in step 205 in the embodiment shown in FIG. 2, and details are not described herein again.
举例说明,当升级对象为block时,对于某个终端设备原版本的系统中,存在升级对象:block1000、block1001、block1002、block1003,其中,block1000包含数据A1、B,block1001包含数据C、D,block1002包含数据E1、F1,block1003包含数据G、H。终端设备获取到的校验数据为带block标识的原始数据,具体为:block 1000的校验数据为A、B,block 1001的校验数据为C、D,block 1002的校验数据为E、F,block 1003的校验数据为G、H;终端设备根据上述校验数据,比较每个升级对象的当前数据与原始数据是否一致,具体为:block 1000的当前数据为A1、B,block 1001的当前数据为C、D,block 1002的当前数据为E1、F1,block 1003的当前数据为G、H,得到当前数据与原始数据不一致的升级对象的标识为block 1000、block 1002;终端设备block1000、block1002的标识信息发送到服务器,服务器依据block的标识信息,将该标识信息对应的block1000的原始数据A、B,以及block 1002的原始数据E、F,作为修复数据返回给终端设备;终端设备利用接收到的修复数据,对终端设备的系统中,block 1000、block 1002的当前数据进行修复,获得修复后的系统;利用服务器发送的差分升级包对上述升级对象进行升级,升级后的目标版本中,对应的升级对象的数 据为:A’、B’、C’、D’、E’、F’、G’、H’。For example, when the upgrade object is a block, for the original version of the terminal device, there are upgrade objects: block1000, block1001, block1002, and block1003, where block1000 includes data A1 and B, and block1001 includes data C, D, block1002. Data E1 and F1 are included, and block 1003 contains data G and H. The check data obtained by the terminal device is the original data with the block identifier, specifically: the check data of block 1000 is A, B, the check data of block 1001 is C, D, and the check data of block 1002 is E, F, block 1003 check data is G, H; the terminal device compares the current data of each upgrade object with the original data according to the above check data, specifically: the current data of block 1000 is A1, B, block 1001 The current data is C, D, the current data of block 1002 is E1, F1, the current data of block 1003 is G, H, and the identifier of the upgrade object whose current data is inconsistent with the original data is block 1000, block 1002; terminal device block1000 The identification information of the block 1002 is sent to the server, and the server returns the original data A and B of the block 1000 corresponding to the identification information and the original data E and F of the block 1002 as the repair data to the terminal device according to the identification information of the block; the terminal device Using the received repair data, the current data of block 1000 and block 1002 are repaired in the system of the terminal device, and the repaired system is obtained. The upgrade object is upgraded by using the differential upgrade package sent by the server. In the upgraded target version, the corresponding upgrade object data is: A', B', C', D', E', F', G' , H'.
可见:由于block1001和block1003这两个升级对象中的数据没有被修改,仍然是原始数据,因此通过校验操作之后,将不会对block1001和block1003再进行修复的过程,直接利用差分升级包进行差分升级即可;只对于block1000和block1002这样的校验不一致的升级对象,进行针对性的进行修复和差分升级。It can be seen that since the data in the two upgrade objects block1001 and block1003 are not modified, it is still the original data. Therefore, after the verification operation, the process of repairing block1001 and block1003 will not be performed, and the differential upgrade package is directly used for the difference. Upgrade can be performed; only for the upgrade objects with inconsistent verification such as block1000 and block1002, perform targeted repair and differential upgrade.
当升级对象为文件时,对于某个终端设备原版本的系统中,存在升级对象:文件123、文件234、文件345,其中,文件123包含数据A、B,文件234包含数据C、D,文件345包含数据E、F。终端设备获取到的校验数据为带文件名称的原始数据,具体为:文件123的校验数据为A、B,文件234的校验数据为C、D,文件345的校验数据为E、F;终端设备根据上述校验数据,比较每个升级对象的当前数据与原始数据是否一致,具体为:文件123当前数据A、B与原始数据A、B,文件234的当前数据C、D与原始数据C、D,文件345的当前数据E、F与原始数据E、F,得到当前数据与原始数据全部一致;此时,终端设备将直接利用服务器发送的差分升级包,对上述升级对象进行升级,升级后的目标版本中,对应的升级对象的数据为:A’、B’、C’、D’、E’、F’。When the upgrade object is a file, in the system of the original version of a terminal device, there are upgrade objects: file 123, file 234, file 345, wherein file 123 contains data A, B, and file 234 contains data C, D, file. 345 contains data E, F. The verification data obtained by the terminal device is the original data with the file name, specifically: the verification data of the file 123 is A, B, the verification data of the file 234 is C, D, and the verification data of the file 345 is E, The terminal device compares the current data of each upgrade object with the original data according to the verification data, specifically: the current data A, B and the original data A, B of the file 123, the current data C, D of the file 234 and The original data C, D, the current data E, F of the file 345 and the original data E, F, the current data and the original data are all consistent; at this time, the terminal device will directly use the differential upgrade package sent by the server to perform the above upgrade object. In the upgraded target version, the corresponding upgrade target data is: A', B', C', D', E', F'.
可见:由于文件123、文件234、文件345三个升级对象中的当前数据,相对于原始数据,都没有发生改变,因此通过校验操作之后,不必对任意的升级对象进行修复,直接利用服务器发送的差分升级包进行差分升级即可。It can be seen that the current data in the three upgrade objects of file 123, file 234, and file 345 has not changed with respect to the original data. Therefore, after the verification operation, it is not necessary to repair any upgrade object, and directly use the server to send The differential upgrade package can be differentially upgraded.
这里需要说明的是,上述实例中,升级对象的校验数据,以该升级对象的原始数据为例进行说明,升级对象的校验数据,为该升级对象的原始数据的哈希值的实现方式类似,这里不再赘述。It should be noted that, in the above example, the verification data of the upgrade object is described by taking the original data of the upgrade object as an example, and the verification data of the upgrade object is the implementation manner of the hash value of the original data of the upgrade object. Similar, no more details here.
在上述本申请实施例中,为了避免由于终端设备的版本数据发生改变导致的升级失败,在终端设备采用差分升级之前,获取升级对象,对升级对象对应的当前数据和原始数据进行校验,将校验不一致的升级对象的原始数据作为修复数据,对终端设备实际使用的原版本的系统进行修复。通过上述校验,减少了修复的数据量和修复次数,进一步减少了差分升级过程的数据量,针对性的提升了差分升级的效率和有效性。In the foregoing embodiment of the present application, in order to avoid the upgrade failure caused by the change of the version data of the terminal device, before the terminal device adopts the differential upgrade, the upgrade object is acquired, and the current data and the original data corresponding to the upgrade object are verified. The original data of the upgraded object that is inconsistent is verified as the repair data, and the original version of the system actually used by the terminal device is repaired. Through the above verification, the amount of repaired data and the number of repairs are reduced, the data volume of the differential upgrade process is further reduced, and the efficiency and effectiveness of the differential upgrade are specifically improved.
参见图4,在一个应用场景中,本申请实施例提供的差分升级的方法,包括:Referring to FIG. 4, in an application scenario, a method for differential upgrade provided by an embodiment of the present application includes:
步骤401,服务器100根据升级对象对应的原始数据,生成该升级对象的校验数据。In step 401, the server 100 generates verification data of the upgrade object according to the original data corresponding to the upgrade object.
步骤402:将该升级对象的校验数据发送至终端设备110。Step 402: Send the verification data of the upgrade object to the terminal device 110.
具体实现时,服务器100向终端设备110索要该终端设备110当前实际使用的系统的版本号。服务器100根据该终端设备110的版本号,获得该版本号对应的原版本的系统的原始数据,服务器获取目标版本的系统的目标数据,将原始数据与目标数据进行比对,获得该原版本的系统中,与目标版本的系统存在数据差异的对象,作为升级对象。In a specific implementation, the server 100 requests the terminal device 110 for the version number of the system currently used by the terminal device 110. The server 100 obtains the original data of the original version of the system corresponding to the version number according to the version number of the terminal device 110, and the server obtains the target data of the target version of the system, compares the original data with the target data, and obtains the original version. In the system, an object with data difference from the target version of the system is used as an upgrade target.
服务器100确定升级对象后,获取该升级对象在原版本的系统中对应的原始数据,对每个升级对象的原始数据进行哈希运算,获得该升级对象对应的哈希值,作为该升级对象的校验数据。将所得的升级对象的校验数据,发送至终端设备110。After determining the upgrade object, the server 100 obtains the original data corresponding to the upgrade object in the original version of the system, performs hash operation on the original data of each upgrade object, and obtains a hash value corresponding to the upgrade object, as the upgrade target school. Test the data. The verification data of the obtained upgrade target is transmitted to the terminal device 110.
步骤403,终端设备110根据升级对象的校验数据,确定待修复的升级对象。Step 403: The terminal device 110 determines the upgrade object to be repaired according to the verification data of the upgrade object.
终端设备110获取升级对象在终端设备110实际使用的系统中对应的当前数据,计算当 前数据的哈希值,校验同一升级对象对应的校验数据与当前数据的哈希值是否一致,如果不一致,则将该升级对象作为待修复的升级对象。The terminal device 110 obtains the current data corresponding to the upgrade object in the system actually used by the terminal device 110, calculates a hash value of the current data, and verifies whether the check data corresponding to the same upgrade object is consistent with the hash value of the current data, if not consistent. , the upgrade object is used as the upgrade object to be repaired.
步骤404,终端设备110将待修复的升级对象发送至服务器100。Step 404, the terminal device 110 sends the upgrade object to be repaired to the server 100.
此处待修复的升级对象,是指当前数据与原始数据不一致的升级对象,可以是在终端设备110中发生改变的文件,也可以是在终端设备110中发生改变的block。The upgrade object to be repaired here refers to an upgrade object whose current data is inconsistent with the original data, and may be a file that changes in the terminal device 110 or a block that changes in the terminal device 110.
步骤405,服务器100将修复升级包和差分升级包发送至终端设备110,该修复升级包包括待修复的升级对象在原版本的系统中对应的原始数据;该差分升级包包括差分升级时所需的所有升级对象对应的目标数据。Step 405: The server 100 sends the repair upgrade package and the differential upgrade package to the terminal device 110, where the repair upgrade package includes original data corresponding to the upgrade object to be repaired in the original version of the system; the differential upgrade package includes required for differential upgrade. Target data corresponding to all upgrade objects.
差分升级技术的主要技术思想是:通过比较终端设备上的系统版本与服务器上的系统目标版本的数据差异,针对数据差异的部分,以文件或者block为单位进行升级。因此,差分升级包类似于补丁包的结构,不涉及两个不同版本的系统中相同的数据部分,可以最大程度较少升级包的体积。The main technical idea of the differential upgrade technology is to compare the data difference between the system version on the terminal device and the system target version on the server, and to upgrade the data difference in units of files or blocks. Therefore, the differential upgrade package is similar to the structure of the fix pack. It does not involve the same data portion in two different versions of the system, and the volume of the package can be upgraded to a minimum.
差分升级的前提条件是:实际使用的系统与原始系统中对应的升级对象的数据一致。故,需要对实际使用的系统先进行修复,将升级对象对象的当前数据修复到与升级对象的原始数据一致。The prerequisite for the differential upgrade is that the actual used system is consistent with the data of the corresponding upgrade object in the original system. Therefore, it is necessary to repair the actual used system first, and repair the current data of the upgrade object to be consistent with the original data of the upgrade object.
其中,修复升级包包含修复数据,修复数据即标识信息对应的升级对象的原始数据。The repair upgrade package includes repair data, and the repair data is the original data of the upgrade object corresponding to the identifier information.
举例来说,对于升级对象为block,在服务器100的原版本系统中存在数据:For example, for the upgrade object to be block, there is data in the original version of the server 100:
imgdiff 2988 193 532207507257845300946f991021812b9df8cf68Imgdiff 2988 193 532207507257845300946f991021812b9df8cf68
3b898296759f6d169c18ca868e7e1f8324f58eb1 2,411364,411366 2 2,411364,4113663b898296759f6d169c18ca868e7e1f8324f58eb1 2,411364,411366 2 2,411364,411366
其中加粗的数据为起始block编号与结束block编号,根据起始block编号与结束block编号,从原版本系统中提取出升级对象对应的原始数据,并生成对应的修复升级包,具体为:recover("/dev/block/bootdevice/by-name/system","3181","555",”411364”,”411366”),第一个参数代表需要修复的block偏移地址,第二个参数代表block所属的文件的存储地址,第三个参数代表block数据总长度,最后两个参数表示修复数据对应的起始block编号和结束block编号;表示修复数据是从block编号为411364到block编号为411366共三个block中的数据。The bolded data is the starting block number and the ending block number. According to the starting block number and the ending block number, the original data corresponding to the upgrade object is extracted from the original version system, and a corresponding repair upgrade package is generated, specifically: Recover("/dev/block/bootdevice/by-name/system","3181","555","411364","411366"), the first parameter represents the block offset address that needs to be repaired, the second The parameter represents the storage address of the file to which the block belongs, the third parameter represents the total length of the block data, and the last two parameters represent the starting block number and the ending block number corresponding to the repair data; indicating that the repair data is from the block number 411364 to the block number. For 411366 a total of three blocks of data.
不管是差分升级包还是修复升级包,在本申请实施例中都不对其结构做具体限定,任意形式的升级包结构,只要能够清楚、简捷的指导终端设备完成指定升级对象的升级和修复,都在本申请实施例描述的范围之内。Regardless of whether it is a differential upgrade package or a repair upgrade package, the structure of the present application is not specifically limited in any embodiment of the present application. Any form of upgrade package structure can be used to clearly and simply guide the terminal device to complete the upgrade and repair of the specified upgrade object. It is within the scope of the embodiments of the present application.
对于差分升级包,是指由升级对象在目标版本的系统中对应的数据打包成的数据包,相对于升级对象,差分升级包中的对象的数据内容,体现该升级对象的升级类型,具体的升级类型可以是:替换、增加、删除等。For the differential upgrade package, the data packaged by the upgrade object in the target version of the system is packaged into data packets. Compared with the upgrade object, the data content of the object in the differential upgrade package reflects the upgrade type of the upgrade object. The upgrade type can be: replace, add, delete, and so on.
在另一个实例中,可以仅执行步骤405,不执行步骤401-404。仅执行步骤405时,该修复升级包包括所有升级对象在原版本的系统中对应的原始数据。无论升级对象对应的当前数据与原始数据是否存在差异,都对该升级对象进行修复。In another example, step 405 may only be performed and steps 401-404 may not be performed. When only step 405 is performed, the repair upgrade package includes the original data corresponding to all upgrade objects in the original version of the system. The upgrade object is repaired regardless of whether the current data corresponding to the upgrade object differs from the original data.
步骤406,终端设备110利用修复升级包进行数据修复。In step 406, the terminal device 110 performs repair of the data by using the repair upgrade package.
修复的过程,具体可参见图2所述的实施例的描述,这里不再赘述。For details of the process of the repair, refer to the description of the embodiment described in FIG. 2, and details are not described herein again.
步骤407,终端设备110利用差分升级包完成差分升级。In step 407, the terminal device 110 performs the differential upgrade by using the differential upgrade package.
对于某个差分升级包中的对象,如果该对象的升级类型为替换,则升级的过程为:用差 分升级包中的该对象替换终端设备原版本的系统中的该对象。举例来说:对于某个终端设备中,原版本的系统与目标版本的系统都存在对象:block1000、block1001、block1002、block1003,其中,block1000包含数据A、B,block1001包含数据C、D,block1002包含数据E、F,block1003包含数据G、H。差分升级包中包含对象block1000、block1001、block1002、block1003,且上述对象中的数据为:block1000的数据为A’、B’,block1001的数据为C’、D’,block1002的数据为E’、F’,block1003的数据为G’、H’。利用差分升级包进行差分升级,具体的差分升级过程为:对于对象block1000,用差分升级包中的数据为A’、B’替换原始数据A、B;对于对象block1001,用差分升级包中的数据为C’、D’替换原始数据C、D;对于对象block1002,用差分升级包中的数据为E’、F’替换原始数据E、F;对于对象block1003,用差分升级包中的数据为G’、H’替换原始数据G、H。差分升级后,目标版本的系统中对应的数据为:A’、B’、C’、D’、E’、F’、G’、H’,完成差分升级。For an object in a differential upgrade package, if the upgrade type of the object is replacement, the upgrade process is: replacing the object in the original version of the terminal device with the object in the differential upgrade package. For example, for a certain terminal device, the original version of the system and the target version of the system have objects: block1000, block1001, block1002, block1003, wherein block1000 contains data A, B, block 1001 contains data C, D, block 1002 contains Data E, F, and block 1003 contain data G and H. The difference upgrade package includes the object block 1000, block 1001, block 1002, and block 1003, and the data in the above object is: block 1000 data is A', B', block 1001 data is C', D', block 1002 data is E', F ', the data of block1003 is G', H'. The differential upgrade package is used for differential upgrade. The specific differential upgrade process is: for the object block1000, replace the original data A and B with the data in the differential upgrade package for A' and B'; for the object block1001, use the data in the differential upgrade package. Replace the original data C, D for C', D'; for the object block1002, replace the original data E, F with the data in the differential upgrade package for E', F'; for the object block1003, use the data in the differential upgrade package for G ', H' replaces the original data G, H. After the differential upgrade, the corresponding data in the target version of the system is: A', B', C', D', E', F', G', H', and the differential upgrade is completed.
对于某个差分升级包中的对象,如果该对象的升级类型为增加,则升级的过程为:将差分升级包中的该对象对应增加到终端设备原版本的系统中对应的位置。需要说明的是,增加的对象只存在与目标版本的系统中,在原版本的系统中并不存在。举例来说:对于某个终端设备原版本的系统中存在block1000、block1001、block1002,其中,block1000包含数据A、B,block1001包含数据C、D,block1002包含数据E、F;差分升级包中包含升级类型为增加的对象:block1003,增加的位置为:与block1002相邻且在block1002之后,block1003中的数据为:G’、H’。利用差分升级包进行差分升级,具体的差分升级过程为:对于对象block1003,将差分升级包中的数据为G’、H’增加到block1002的数据E、F之后。差分升级后,目标版本的系统中对应的数据为:A、B、C、D、E、F、G’、H’,完成差分升级。For an object in a differential upgrade package, if the upgrade type of the object is increased, the upgrade process is: adding the object corresponding to the differential upgrade package to the corresponding location in the system of the original version of the terminal device. It should be noted that the added object only exists in the system with the target version, and does not exist in the original version of the system. For example, for a system of the original version of a terminal device, block 1000, block 1001, and block 1002 are present, wherein block 1000 includes data A and B, block 1001 includes data C and D, block 1002 includes data E and F, and differential upgrade package includes upgrade. The type is the added object: block1003, and the added position is: adjacent to block 1002 and after block 1002, the data in block 1003 is: G', H'. The differential upgrade is performed by using the differential upgrade package. The specific differential upgrade process is: for the target block 1003, the data in the differential upgrade package is G', H' is added to the data E and F of the block 1002. After the differential upgrade, the corresponding data in the target version of the system is: A, B, C, D, E, F, G', H', and the differential upgrade is completed.
对于某个差分升级包中的对象,如果该对象的升级类型为删除,则升级的过程为:用差分升级包中的该对象的删除指令,删除终端设备原版本的系统中对应的对象。举例来说:对于某个终端设备原版本的系统中存在:block1000、block1001、block1002、block1003,其中,block1000包含数据A、B,block1001包含数据C、D,block1002包含数据E、F,block1003包含数据G、H。差分升级包中包含对象block1000以及一个“delete”的指令。利用差分升级包进行差分升级,具体的差分升级过程为:对于对象block1000,依据差分升级包中block1000对应的“delete”指令,将原始数据A、B删除。差分升级后,目标版本的系统中对应的数据为:C、D、E、F、G、H,完成差分升级。For an object in a differential upgrade package, if the upgrade type of the object is deleted, the upgrade process is: deleting the corresponding object in the original version of the terminal device by using the delete instruction of the object in the differential upgrade package. For example, for the original version of a terminal device, there are: block1000, block1001, block1002, block1003, where block1000 contains data A, B, block 1001 contains data C, D, block 1002 contains data E, F, block 1003 contains data G, H. The differential upgrade package contains the object block1000 and a "delete" instruction. The differential upgrade is performed by using the differential upgrade package. The specific differential upgrade process is: for the object block 1000, the original data A and B are deleted according to the "delete" command corresponding to the block 1000 in the differential upgrade package. After the differential upgrade, the corresponding data in the target version of the system is: C, D, E, F, G, and H, and the differential upgrade is completed.
在具体实现时,一个差分升级包中包含的所有对象对应的差分升级的类型,可能只有增加、删除、替换中的一种,也可能有增加、删除、替换中的任意两种或者三种,在这里不作限定,具体进行差分升级的过程中,针对差分升级包中的每个对象,按照该对象对应的升级类型进行升级即可。In a specific implementation, the type of differential upgrade corresponding to all objects included in a differential upgrade package may be only one of adding, deleting, and replacing, or there may be any two or three of adding, deleting, and replacing. It is not limited here. In the process of performing the differential upgrade, each object in the differential upgrade package may be upgraded according to the upgrade type corresponding to the object.
,通过本申请实施例的方法,在差分升级之前,先对终端设备实际使用的系统进行校验,对于校验结果不一致的升级对象,进行修复,然后对修复后的系统进行差分升级;对于校验结果一致的升级对象,直接进行差分升级。一方面,提高了使用差分升级方式进行系统升级的有效性,另一方面,进一步减少了修复数据量和修复次数,使升级对象的修复更有针对性,从总体上减小了差分升级过程的数据量。According to the method of the embodiment of the present application, before the differential upgrade, the system actually used by the terminal device is verified, and the upgrade object whose verification result is inconsistent is repaired, and then the repaired system is differentially upgraded; The upgrade target with the same result is directly upgraded. On the one hand, the effectiveness of using the differential upgrade method for system upgrade is improved. On the other hand, the amount of repaired data and the number of repairs are further reduced, so that the repair of the upgrade object is more targeted, and the differential upgrade process is generally reduced. The amount of data.
对于大部分的差分升级包,体积不到相同版本的全量升级包的10%,即使加上对应的修 复数据,升级包的体积也远小于全量升级包的体积,因此,本申请实施例的差分升级方法,可以减少终端设备的下载数据量,缩短升级包下载时间,并且提升了差分升级的效率和有效性,提升用户体验。For most of the differential upgrade packages, the volume is less than 10% of the full upgrade package of the same version. Even if the corresponding repair data is added, the volume of the upgrade package is much smaller than the volume of the full upgrade package. Therefore, the difference of the embodiment of the present application is The upgrade method can reduce the amount of downloaded data of the terminal device, shorten the download time of the upgrade package, and improve the efficiency and effectiveness of the differential upgrade to improve the user experience.
本申请实施例还提供了一种差分升级装置,下面结合附图对其进行详细说明。The embodiment of the present application further provides a differential upgrade device, which will be described in detail below with reference to the accompanying drawings.
图5为本申请实施例提供的一种差分升级装置的结构图,应用于终端设备,该装置包括:第一获取模块501,用于获取差分升级包和升级对象的修复数据,其中,升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象,修复数据是升级对象在原版本的系统中的原始数据。FIG. 5 is a structural diagram of a differential upgrade apparatus according to an embodiment of the present disclosure, which is applied to a terminal device, where the apparatus includes: a first obtaining module 501, configured to acquire repair data of a differential upgrade package and an upgrade object, where the upgrade object is In the original version of the system, there is an object difference in data from the target version of the system, and the repair data is the original data of the upgrade object in the original version of the system.
修复模块502,用于利用修复数据修复终端设备的实际使用的系统,获得修复后的系统,该修复后的系统与原版本的系统一致。The repairing module 502 is configured to repair the system of the actual use of the terminal device by using the repair data, and obtain the repaired system, and the repaired system is consistent with the original version of the system.
升级模块503,用于利用差分升级包,将系统从原版本升级到目标版本。The upgrade module 503 is configured to upgrade the system from the original version to the target version by using the differential upgrade package.
可选地,上述第一获取模块501,包括:Optionally, the foregoing first obtaining module 501 includes:
第一获取单元,用于获取升级对象的校验数据,该校验数据对应于所述原始数据;a first acquiring unit, configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data;
第一校验单元,用于根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据是否一致;a first checking unit, configured to verify, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data;
第二获取单元,用于当当前数据与原始数据不一致时,获取升级对象的修复数据。The second obtaining unit is configured to acquire the repair data of the upgrade object when the current data is inconsistent with the original data.
可选地,上述第一获取模块501,包括:Optionally, the foregoing first obtaining module 501 includes:
发送单元,用于将升级对象的标识信息发送至服务器;a sending unit, configured to send identifier information of the upgrade object to the server;
接收单元,用于接收服务器根据标识信息返回的升级对象的修复数据。The receiving unit is configured to receive repair data of the upgrade object returned by the server according to the identifier information.
其中,升级对象的标识信息包括文件的标识或块block的标识。The identifier information of the upgrade object includes an identifier of the file or an identifier of the block block.
在具体实现时,校验数据是原始数据的哈希值时,上述校验单元,包括:In the specific implementation, when the verification data is a hash value of the original data, the verification unit includes:
获取子单元,用于获取当前数据的哈希值;Obtain a subunit for obtaining a hash value of the current data;
校验子单元,用于校验当前数据的哈希值与校验数据是否一致;若当前数据的哈希值与校验数据一致,则终端设备确定当前数据与原始数据一致;若当前数据的哈希值与校验数据不一致,则终端设备确定当前数据与原始数据不一致。a check subunit, configured to verify whether the hash value of the current data is consistent with the check data; if the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; If the hash value is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
此外,本申请实施例还提供了另一种差分升级装置,应用于服务器,如图6所示,为该装置的结果图,该装置包括:In addition, the embodiment of the present application further provides another differential upgrading apparatus, which is applied to a server, as shown in FIG. 6, which is a result diagram of the apparatus, and the apparatus includes:
第二获取模块601,用于获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统。The second obtaining module 601 is configured to acquire a system of the original version before the terminal device is upgraded, and a system of the upgraded target version.
确定模块602,用于根据原版本的系统和目标版本的系统确定升级对象,该升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象。The determining module 602 is configured to determine an upgrade object according to a system of the original version and a target version, where the upgrade object is an object in the system of the original version that has data difference from the target version of the system.
第三获取模块603,用于获取差分升级包和升级对象的修复数据,其中,修复数据是升级对象在原版本的系统中的原始数据。The third obtaining module 603 is configured to obtain the repair data of the differential upgrade package and the upgrade object, where the repair data is the original data of the upgrade object in the original version of the system.
发送模块604,用于向终端设备发送差分升级包和升级对象的修复数据。The sending module 604 is configured to send the differential upgrade package and the repair data of the upgrade object to the terminal device.
可选地,上述第三获取模块603,包括:Optionally, the foregoing third obtaining module 603 includes:
第三获取单元,用于获取升级对象的校验数据,该校验数据对应于原始数据;a third acquiring unit, configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data;
发送单元,用于将升级对象的校验数据发送至终端设备;a sending unit, configured to send verification data of the upgrade object to the terminal device;
第二校验单元,用于根据校验数据,校验升级对象在终端设备中的当前数据,与原始数据不一致时,服务器接收终端设备发送的升级对象的标识信息;a second checking unit, configured to check current data of the upgrade object in the terminal device according to the check data, and when the original data is inconsistent, the server receives the identifier information of the upgrade object sent by the terminal device;
第四获取单元,用于根据升级对象的标识信息,获取升级对象的修复数据。The fourth obtaining unit is configured to obtain the repair data of the upgrade object according to the identifier information of the upgrade object.
在具体实现时,升级对象的校验数据是原始数据的哈希值。In the specific implementation, the verification data of the upgrade object is a hash value of the original data.
以上是对本申请实施例提供的差分升级装置的介绍,具体实现方式可以参见上文所示方法实施例中的描述,达到的效果与上述方法实施例一致,这里不再赘述。The above is a description of the differential upgrade device provided in the embodiment of the present application. For the specific implementation, refer to the description in the method embodiment shown above, and the effect is consistent with the foregoing method embodiment, and details are not described herein again.
与上述本申请实施例提供的方法相对应,本申请实施例还提供了一种差分升级系统。请参阅图7,为本申请实施例所提供的差分升级系统的示意图,该系统包括:Corresponding to the method provided in the foregoing embodiment of the present application, the embodiment of the present application further provides a differential upgrade system. FIG. 7 is a schematic diagram of a differential upgrade system provided by an embodiment of the present application, where the system includes:
终端设备701,包括:上述图5所示的差分升级装置;The terminal device 701 includes: the differential upgrade device shown in FIG. 5;
服务器702,包括:上述图6所示的差分升级装置。The server 702 includes the differential upgrading apparatus shown in FIG. 6 described above.
对本申请实施例提供的差分升级系统的具体介绍,可以参见上文图5和图6所示装置实施例中的描述,达到的效果与上述方法实施例一致,这里不再赘述。For a detailed description of the differential upgrade system provided by the embodiment of the present application, refer to the description in the device embodiment shown in FIG. 5 and FIG. 6 above, and the effect achieved is consistent with the foregoing method embodiment, and details are not described herein again.
本申请实施例涉及一种终端设备,该终端设备可以包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等。The embodiment of the present application relates to a terminal device, which may include a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, and the like.
以终端设备是手机为例,图8示出的是与本申请实施例相关的手机800的部分结构的框图。参考图8,手机800包括、RF(Radio Frequency,射频)电路810、存储器820、其他输入设备830、显示屏840、传感器850、音频电路860、I/O子系统870、处理器880、以及电源890等部件。本领域技术人员可以理解,图8中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。本领领域技术人员可以理解显示屏840属于用户界面(UI,User Interface),且手机800可以包括比图示或者更少的用户界面。Taking the terminal device as a mobile phone as an example, FIG. 8 is a block diagram showing a part of the structure of the mobile phone 800 related to the embodiment of the present application. Referring to FIG. 8, the mobile phone 800 includes an RF (Radio Frequency) circuit 810, a memory 820, other input devices 830, a display screen 840, a sensor 850, an audio circuit 860, an I/O subsystem 870, a processor 880, and a power supply. 890 and other components. It will be understood by those skilled in the art that the structure of the mobile phone shown in FIG. 8 does not constitute a limitation on the mobile phone, and may include more or less components than those illustrated, or combine some components, or split some components, or Different parts are arranged. Those skilled in the art will appreciate that the display screen 840 is a User Interface (UI) and that the handset 800 can include fewer user interfaces than illustrated or less.
下面结合图8对手机800的各个构成部件进行具体的介绍:The components of the mobile phone 800 will be specifically described below with reference to FIG. 8:
RF电路810可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器880处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、LNA(Low Noise Amplifier,低噪声放大器)、双工器等。此外,RF电路810还可以通过无线通信与网络和其他设备通信。所述无线通信可以使用任一通信标准或协议,包括但不限于GSM(Global System of Mobile communication,全球移动通讯系统)、GPRS(General Packet Radio Service,通用分组无线服务)、CDMA(Code Division Multiple Access,码分多址)、WCDMA(Wideband Code Division Multiple Access,宽带码分多址)、LTE(Long Term Evolution,长期演进)、电子邮件、SMS(Short Messaging Service,短消息服务)等。The RF circuit 810 can be used for receiving and transmitting signals during the transmission or reception of information or during a call. Specifically, after receiving the downlink information of the base station, it is processed by the processor 880. In addition, the uplink data is designed to be sent to the base station. Generally, RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, an LNA (Low Noise Amplifier), a duplexer, and the like. In addition, RF circuitry 810 can also communicate with the network and other devices via wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access). , Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), e-mail, SMS (Short Messaging Service), and the like.
存储器820可用于存储软件程序以及模块,处理器880通过运行存储在存储器820的软件程序以及模块,从而执行手机800的各种功能应用以及数据处理。存储器820可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图象播放功能等)等;存储数据区可存储根据手机800的使用所 创建的数据(比如音频数据、电话本等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 820 can be used to store software programs and modules, and the processor 880 executes various functional applications and data processing of the mobile phone 800 by running software programs and modules stored in the memory 820. The memory 820 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may be stored. Data created according to the use of the mobile phone 800 (such as audio data, phone book, etc.). Moreover, memory 820 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
其他输入设备830可用于接收输入的数字或字符信息,以及产生与手机800的用户设置以及功能控制有关的键信号输入。具体地,其他输入设备830可包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)等中的一种或多种。其他输入设备830与I/O子系统870的其他输入设备控制器871相连接,在其他设备输入控制器871的控制下与处理器880进行信号交互。 Other input devices 830 can be used to receive input numeric or character information, as well as generate key signal inputs related to user settings and function controls of handset 800. Specifically, other input devices 830 may include, but are not limited to, a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and light mice (the light mouse is not sensitive to display visual output). One or more of a surface, or an extension of a touch sensitive surface formed by a touch screen. Other input devices 830 are coupled to other input device controllers 871 of I/O subsystem 870 for signal interaction with processor 880 under the control of other device input controllers 871.
显示屏840可用于显示由用户输入的信息或提供给用户的信息以及手机800的各种菜单,还可以接受用户输入。具体的显示屏840可包括显示面板841,以及触控面板842。其中显示面板841可以采用LCD(Liquid Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板841。触控面板842,也称为触摸屏、触敏屏等,可收集用户在其上或附近的接触或者非接触操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板842上或在触控面板842附近的操作,也可以包括体感操作;该操作包括单点控制操作、多点控制操作等操作类型。),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板842可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位、姿势,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成处理器能够处理的信息,再送给处理器880,并能接收处理器880发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板842,也可以采用未来发展的任何技术实现触控面板842。进一步的,触控面板842可覆盖显示面板841,用户可以根据显示面板841显示的内容(该显示内容包括但不限于,软键盘、虚拟鼠标、虚拟按键、图标等等),在显示面板841上覆盖的当触控面板842上或者附近进行操作,触控面板842检测到在其上或附近的触摸操作后,通过I/O子系统870传送给处理器880以确定触摸事件的类型以确定用户输入,随后处理器880根据触摸事件的类型在显示面板根据用户输入通过I/O子系统870在显示面板841上提供相应的视觉输出。虽然在图8中,触控面板842与显示面板841是作为两个独立的部件来实现手机800的输入和输入功能,但是在某些实施例中,可以将触控面板842与显示面板841集成而实现手机800的输入和输出功能。 Display 840 can be used to display information entered by the user or information provided to the user as well as various menus of handset 800, and can also accept user input. The specific display screen 840 can include a display panel 841 and a touch panel 842. The display panel 841 can be configured by using an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. The touch panel 842, also referred to as a touch screen, a touch sensitive screen, etc., can collect contact or non-contact operations on or near the user (eg, the user uses any suitable object or accessory such as a finger, a stylus, etc. on the touch panel 842 Or the operation in the vicinity of the touch panel 842 may also include a somatosensory operation; the operation includes a single point control operation, a multi-point control operation, and the like, and drives the corresponding connection device according to a preset program. Optionally, the touch panel 842 can include two parts: a touch detection device and a touch controller. Wherein, the touch detection device detects the touch orientation and posture of the user, and detects a signal brought by the touch operation, and transmits a signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts the signal into a processor. The processed information is sent to the processor 880 and can receive commands from the processor 880 and execute them. In addition, the touch panel 842 can be implemented by using various types such as resistive, capacitive, infrared, and surface acoustic waves, and the touch panel 842 can be implemented by any technology developed in the future. Further, the touch panel 842 can cover the display panel 841, and the user can display the content according to the display panel 841 (the display content includes, but is not limited to, a soft keyboard, a virtual mouse, a virtual button, an icon, etc.) on the display panel 841. Covered When operating on or near the touch panel 842, the touch panel 842 detects a touch operation thereon or nearby, and transmits it to the processor 880 through the I/O subsystem 870 to determine the type of touch event to determine the user. Input, and then processor 880 provides a corresponding visual output on display panel 841 through I/O subsystem 870 in accordance with user input in accordance with the type of touch event. Although in FIG. 8, the touch panel 842 and the display panel 841 are two independent components to implement the input and input functions of the mobile phone 800, in some embodiments, the touch panel 842 can be integrated with the display panel 841. The input and output functions of the mobile phone 800 are implemented.
手机800还可包括至少一种传感器850,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板841的亮度,接近传感器可在手机800移动到耳边时,关闭显示面板841和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机800还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The handset 800 can also include at least one type of sensor 850, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may close the display panel 841 when the mobile phone 800 moves to the ear. / or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity. It can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching, related Game, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc. As for the mobile phone 800 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here Let me repeat.
音频电路860、扬声器861,麦克风862可提供用户与手机800之间的音频接口。音频电 路860可将接收到的音频数据转换后的信号,传输到扬声器861,由扬声器861转换为声音信号输出;另一方面,麦克风862将收集的声音信号转换为信号,由音频电路860接收后转换为音频数据,再将音频数据输出至RF电路808以发送给比如另一手机,或者将音频数据输出至存储器820以便进一步处理。An audio circuit 860, a speaker 861, and a microphone 862 can provide an audio interface between the user and the handset 800. The audio circuit 860 can transmit the converted audio data to the speaker 861 and convert it into a sound signal output by the speaker 861. On the other hand, the microphone 862 converts the collected sound signal into a signal, which is received by the audio circuit 860. The audio data is converted to audio data, which is then output to RF circuitry 808 for transmission to, for example, another handset, or audio data is output to memory 820 for further processing.
I/O子系统870用来控制输入输出的外部设备,可以包括其他设备输入控制器871、传感器控制器872、显示控制器873。可选的,一个或多个其他输入控制设备控制器871从其他输入设备830接收信号和/或者向其他输入设备830发送信号,其他输入设备830可以包括物理按钮(按压按钮、摇臂按钮等)、拨号盘、滑动开关、操纵杆、点击滚轮、光鼠(光鼠是不显示可视输出的触摸敏感表面,或者是由触摸屏形成的触摸敏感表面的延伸)。值得说明的是,其他输入控制设备控制器871可以与任一个或者多个上述设备连接。所述I/O子系统870中的显示控制器873从显示屏840接收信号和/或者向显示屏840发送信号。显示屏840检测到用户输入后,显示控制器873将检测到的用户输入转换为与显示在显示屏840上的用户界面对象的交互,即实现人机交互。传感器控制器872可以从一个或者多个传感器850接收信号和/或者向一个或者多个传感器850发送信号。The I/O subsystem 870 is used to control external devices for input and output, and may include other device input controllers 871, sensor controllers 872, and display controllers 873. Optionally, one or more other input control device controllers 871 receive signals from other input devices 830 and/or send signals to other input devices 830, which may include physical buttons (press buttons, rocker buttons, etc.) , dial, slide switch, joystick, click wheel, light mouse (light mouse is a touch-sensitive surface that does not display visual output, or an extension of a touch-sensitive surface formed by a touch screen). It is worth noting that other input control device controllers 871 can be connected to any one or more of the above devices. Display controller 873 in I/O subsystem 870 receives signals from display 840 and/or transmits signals to display 840. After the display screen 840 detects the user input, the display controller 873 converts the detected user input into an interaction with the user interface object displayed on the display screen 840, ie, implements human-computer interaction. Sensor controller 872 can receive signals from one or more sensors 850 and/or send signals to one or more sensors 850.
处理器880是手机800的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行手机800的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器880可包括一个或多个处理单元;优选的,处理器880可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器880中。The processor 880 is the control center of the handset 800, which connects various portions of the entire handset using various interfaces and lines, by running or executing software programs and/or modules stored in the memory 820, and recalling data stored in the memory 820, The mobile phone 800 performs various functions and processing data to perform overall monitoring of the mobile phone. Optionally, the processor 880 may include one or more processing units; preferably, the processor 880 may integrate an application processor and a modem processor, where the application processor mainly processes an operating system, a user interface, an application, and the like. The modem processor primarily handles wireless communications. It will be appreciated that the above described modem processor may also not be integrated into the processor 880.
手机800还包括给各个部件供电的电源890(比如电池),优选的,电源可以通过电源管理系统与处理器880逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。The mobile phone 800 also includes a power source 890 (such as a battery) that supplies power to the various components. Preferably, the power source can be logically coupled to the processor 880 through a power management system to manage functions such as charging, discharging, and power consumption through the power management system.
尽管未示出,手机800还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown, the mobile phone 800 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.

Claims (17)

  1. 一种差分升级的方法,其特征在于,所述方法包括:A method for differential upgrade, the method comprising:
    终端设备获取差分升级包和升级对象的修复数据,所述升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象,所述修复数据是所述升级对象在所述原版本的系统中的原始数据;The terminal device acquires the repair data of the differential upgrade package and the upgrade object, where the upgrade object is an object in the system of the original version, where the data is different from the target version, and the repair data is the upgrade object in the original version. Raw data in the system;
    所述终端设备利用所述修复数据修复所述终端设备的系统,获得修复后的系统,所述修复后的系统与所述原版本的系统一致;The terminal device repairs the system of the terminal device by using the repair data, and obtains a repaired system, where the repaired system is consistent with the original version of the system;
    所述终端设备利用所述差分升级包,将系统从原版本升级到目标版本。The terminal device uses the differential upgrade package to upgrade the system from the original version to the target version.
  2. 根据权利要求1所述的方法,其特征在于,所述终端设备获取升级对象的修复数据包括:The method according to claim 1, wherein the acquiring, by the terminal device, the repair data of the upgrade object comprises:
    所述终端设备获取所述升级对象的校验数据,所述校验数据对应于所述原始数据;The terminal device acquires verification data of the upgrade object, where the verification data corresponds to the original data;
    所述终端设备根据所述校验数据,校验所述升级对象在所述终端设备中的当前数据,与所述原始数据是否一致;The terminal device verifies, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data;
    当所述当前数据与所述原始数据不一致时,所述终端设备获取所述升级对象的修复数据。When the current data is inconsistent with the original data, the terminal device acquires repair data of the upgrade object.
  3. 根据权利要求2所述的方法,其特征在于,所述终端设备获取所述升级对象的修复数据包括:The method according to claim 2, wherein the acquiring, by the terminal device, the repair data of the upgrade object comprises:
    所述终端设备将所述升级对象的标识信息发送至服务器;Sending, by the terminal device, the identifier information of the upgrade object to a server;
    所述终端设备接收所述服务器根据所述标识信息返回的所述升级对象的修复数据。The terminal device receives repair data of the upgrade object returned by the server according to the identifier information.
  4. 根据权利要求3所述的方法,其特征在于,The method of claim 3 wherein:
    所述升级对象的标识信息包括文件的标识或块block的标识。The identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
  5. 根据权利要求2-3任意一项所述的方法,其特征在于,所述校验数据是所述原始数据的哈希值,所述终端设备根据所述校验数据,校验所述升级对象在所述终端设备中的当前数据,与所述升级对象在所述原版本的系统中的原始数据是否一致包括:The method according to any one of claims 2-3, wherein the verification data is a hash value of the original data, and the terminal device verifies the upgrade object according to the verification data. Whether the current data in the terminal device is consistent with the original data of the upgrade object in the original version of the system includes:
    所述终端设备获取所述当前数据的哈希值;The terminal device acquires a hash value of the current data;
    所述终端设备校验所述当前数据的哈希值与所述校验数据是否一致;The terminal device checks whether the hash value of the current data is consistent with the check data;
    若所述当前数据的哈希值与所述校验数据一致,则所述终端设备确定所述当前数据与所述原始数据一致;若所述当前数据的哈希值与所述校验数据不一致,则所述终端设备确定所述当前数据与所述原始数据不一致。If the hash value of the current data is consistent with the check data, the terminal device determines that the current data is consistent with the original data; if the hash value of the current data is inconsistent with the check data And the terminal device determines that the current data is inconsistent with the original data.
  6. 一种差分升级方法,其特征在于,所述方法包括:A differential upgrade method, the method comprising:
    服务器获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统;The system obtains the original version of the system before the terminal device is upgraded, and the upgraded target version of the system;
    所述服务器根据所述原版本的系统和所述目标版本的系统确定升级对象,所述升级对象是所述原版本的系统中,与所述目标版本的系统存在数据差异的对象;Determining, by the server, an upgrade object according to the system of the original version and the system of the target version, where the upgrade object is an object that has data difference with a system of the target version in the system of the original version;
    所述服务器获取所述差分升级包和升级对象的修复数据,所述修复数据是所述升级对象在所述原版本的系统中的原始数据;The server acquires the repair data of the differential upgrade package and the upgrade object, where the repair data is original data of the upgrade object in the original version of the system;
    所述服务器向所述终端设备发送所述差分升级包和升级对象的修复数据。The server sends the differential upgrade package and the repair data of the upgrade object to the terminal device.
  7. 根据权利要求6所述的方法,其特征在于,所述服务器获取升级对象的修复数据包括:The method according to claim 6, wherein the obtaining the repair data of the upgrade object by the server comprises:
    所述服务器获取所述升级对象的校验数据,所述校验数据对应于所述原始数据;The server acquires verification data of the upgrade object, where the verification data corresponds to the original data;
    所述服务器将所述升级对象的校验数据发送至所述终端设备;Sending, by the server, verification data of the upgrade object to the terminal device;
    当所述终端设备根据所述校验数据,校验所述升级对象在所述终端设备中的当前数据,与所述原始数据不一致时,所述服务器接收所述终端设备发送的所述升级对象的标识信息;When the terminal device verifies the current data of the upgrade object in the terminal device according to the check data, if the original data is inconsistent with the original data, the server receives the upgrade object sent by the terminal device. Identification information;
    所述服务器根据所述升级对象的标识信息,获取所述升级对象的修复数据。The server acquires the repair data of the upgrade object according to the identifier information of the upgrade object.
  8. 根据权利要求7所述的方法,其特征在于,The method of claim 7 wherein:
    所述升级对象的校验数据是所述原始数据的哈希值。The verification data of the upgrade object is a hash value of the original data.
  9. 一种差分升级的装置,其特征在于,应用于终端设备,所述装置包括:A differential upgrade device is characterized in that it is applied to a terminal device, and the device includes:
    第一获取模块,用于获取差分升级包和升级对象的修复数据,所述升级对象是原版本的系统中,与目标版本的系统存在数据差异的对象,所述修复数据是所述升级对象在所述原版本的系统中的原始数据;a first obtaining module, configured to acquire repair data of the differential upgrade package and the upgrade object, where the upgrade object is an object in the system of the original version, where the data is different from the target version, and the repair data is Raw data in the original version of the system;
    修复模块,用于利用所述修复数据修复所述终端设备的系统,获得修复后的系统,所述修复后的系统与所述原版本的系统一致;a repairing module, configured to repair the system of the terminal device by using the repair data, to obtain a repaired system, where the repaired system is consistent with the original version of the system;
    升级模块,用于利用所述差分升级包,将系统从原版本升级到目标版本。An upgrade module for upgrading the system from the original version to the target version by using the differential upgrade package.
  10. 根据权利要求9所述的装置,其特征在于,所述第一获取模块,包括:The device according to claim 9, wherein the first obtaining module comprises:
    第一获取单元,用于获取所述升级对象的校验数据,所述校验数据对应于所述原始数据;a first acquiring unit, configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data;
    第一校验单元,用于根据所述校验数据,校验所述升级对象在所述终端设备中的当前数据,与所述原始数据是否一致;a first checking unit, configured to check, according to the verification data, whether current data of the upgrade object in the terminal device is consistent with the original data;
    第二获取单元,用于当所述当前数据与所述原始数据不一致时,获取所述升级对象的修复数据。a second acquiring unit, configured to acquire repair data of the upgrade object when the current data is inconsistent with the original data.
  11. 根据权利要求10所述的装置,其特征在于,所述第一获取模块,包括:The device according to claim 10, wherein the first obtaining module comprises:
    发送单元,用于将所述升级对象的标识信息发送至服务器;a sending unit, configured to send identifier information of the upgrade object to a server;
    接收单元,用于接收所述服务器根据所述标识信息返回的所述升级对象的修复数据。And a receiving unit, configured to receive repair data of the upgrade object returned by the server according to the identifier information.
  12. 根据权利要求11所述的装置,其特征在于,The device of claim 11 wherein:
    所述升级对象的标识信息包括文件的标识或块block的标识。The identification information of the upgrade object includes an identifier of the file or an identifier of the block block.
  13. 根据权利要求10-11任意一项所述的装置,其特征在于,所述校验数据是所述原始数据的哈希值,所述校验单元,包括:The device according to any one of claims 10-11, wherein the verification data is a hash value of the original data, and the verification unit comprises:
    获取子单元,用于获取所述当前数据的哈希值;Obtaining a subunit, configured to obtain a hash value of the current data;
    校验子单元,用于校验所述当前数据的哈希值与所述校验数据是否一致;若所述当前数据的哈希值与所述校验数据一致,则所述终端设备确定所述当前数据与所述原始数据一致;若所述当前数据的哈希值与所述校验数据不一致,则所述终端设备确定所述当前数据与所述原始数据不一致。a check subunit, configured to check whether a hash value of the current data is consistent with the check data; if the hash value of the current data is consistent with the check data, the terminal device determines The current data is consistent with the original data; if the hash value of the current data is inconsistent with the check data, the terminal device determines that the current data is inconsistent with the original data.
  14. 一种差分升级装置,其特征在于,应用于服务器,所述装置包括:A differential upgrading device is characterized in that it is applied to a server, and the device includes:
    第二获取模块,用于获取终端设备升级前的原版本的系统,以及升级后的目标版本的系统;a second obtaining module, configured to acquire a system of the original version before the terminal device is upgraded, and a system of the upgraded target version;
    确定模块,用于根据所述原版本的系统和所述目标版本的系统确定升级对象,所述升级对象是所述原版本的系统中,与所述目标版本的系统存在数据差异的对象;a determining module, configured to determine, according to the system of the original version and the system of the target version, an upgrade object, where the upgrade object is an object of a data difference between the system of the original version and the target version;
    第三获取模块,用于获取所述差分升级包和升级对象的修复数据,所述修复数据是所述升级对象在所述原版本的系统中的原始数据;a third obtaining module, configured to acquire repair data of the differential upgrade package and the upgrade object, where the repair data is original data of the upgrade object in the original version of the system;
    发送模块,用于向所述终端设备发送所述差分升级包和升级对象的修复数据。And a sending module, configured to send, to the terminal device, the repair data of the differential upgrade package and the upgrade object.
  15. 根据权利要求14所述的装置,其特征在于,所述第三获取模块,包括:The device according to claim 14, wherein the third obtaining module comprises:
    第三获取单元,用于获取所述升级对象的校验数据,所述校验数据对应于所述原始数据;a third acquiring unit, configured to acquire verification data of the upgrade object, where the verification data corresponds to the original data;
    发送单元,用于将所述升级对象的校验数据发送至所述终端设备;a sending unit, configured to send verification data of the upgrade object to the terminal device;
    第二校验单元,用于根据所述校验数据,校验所述升级对象在所述终端设备中的当前数据,与所述原始数据不一致时,所述服务器接收所述终端设备发送的所述升级对象的标识信息;a second checking unit, configured to check current data of the upgrade object in the terminal device according to the check data, where the server receives the location sent by the terminal device when the original data is inconsistent with the original data The identification information of the upgrade object;
    第四获取单元,用于根据所述升级对象的标识信息,获取所述升级对象的修复数据。The fourth obtaining unit is configured to acquire the repair data of the upgrade object according to the identifier information of the upgrade object.
  16. 根据权利要求15所述的装置,其特征在于,The device of claim 15 wherein:
    所述升级对象的校验数据是所述原始数据的哈希值。The verification data of the upgrade object is a hash value of the original data.
  17. 一种差分升级系统,其特征在于,包括:A differential upgrade system, comprising:
    终端设备,所述终端设备包括:上述权利要求9-13任意一项所述的装置;a terminal device, comprising: the device according to any one of claims 9-13;
    服务器,所述服务器包括:上述权利要求14-16任意一项所述的装置。A server comprising: the apparatus of any of the preceding claims 14-16.
PCT/CN2018/110404 2017-10-16 2018-10-16 Differential upgrading method, device and system WO2019076293A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201710963842.0 2017-10-16
CN201710963842 2017-10-16
CN201711450650.6A CN109672655A (en) 2017-10-16 2017-12-27 A kind of method, apparatus and system of difference upgrading
CN201711450650.6 2017-12-27

Publications (1)

Publication Number Publication Date
WO2019076293A1 true WO2019076293A1 (en) 2019-04-25

Family

ID=66141586

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/110404 WO2019076293A1 (en) 2017-10-16 2018-10-16 Differential upgrading method, device and system

Country Status (2)

Country Link
CN (1) CN109672655A (en)
WO (1) WO2019076293A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111611002A (en) * 2020-04-27 2020-09-01 深圳市广和通无线股份有限公司 Data upgrading method and device, computer equipment and storage medium
CN112199107A (en) * 2020-11-04 2021-01-08 北京声智科技有限公司 OTA (over the air) upgrading method and related equipment
CN112631633A (en) * 2021-01-07 2021-04-09 南方电网数字电网研究院有限公司 Function module upgrading method and device based on double-core intelligent electric meter
CN112804071A (en) * 2019-11-13 2021-05-14 中兴通讯股份有限公司 On-line upgrading method, upgrading file providing method, equipment and storage medium
CN115102856A (en) * 2022-05-24 2022-09-23 福建星云电子股份有限公司 Internet of things equipment upgrading method and system

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111124464B (en) * 2019-11-19 2024-05-17 红石阳光(北京)科技股份有限公司 Method, system and computer readable storage medium for differential upgrade of embedded system
CN111538523A (en) * 2020-04-20 2020-08-14 Tcl海外电子(惠州)有限公司 Differential upgrading method, device and storage medium
CN114780129A (en) * 2022-05-25 2022-07-22 歌尔股份有限公司 Differential upgrade repairing method and device, electronic equipment and readable storage medium
CN114880011A (en) * 2022-05-25 2022-08-09 歌尔股份有限公司 OTA (over the air) upgrading method and device, electronic equipment and readable storage medium
CN114816495A (en) * 2022-05-25 2022-07-29 歌尔股份有限公司 OTA (over the air) upgrading method and device, electronic equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693139A (en) * 2011-03-25 2012-09-26 比亚迪股份有限公司 Method and system for wirelessly upgrading mobile phone software
CN104267978A (en) * 2014-09-16 2015-01-07 青岛海信移动通信技术股份有限公司 Method and device for generating differential packet
CN105138347A (en) * 2015-07-17 2015-12-09 广东欧珀移动通信有限公司 Difference upgrade patch generating method, software upgrading method and corresponding apparatus
CN105335181A (en) * 2014-08-06 2016-02-17 中兴通讯股份有限公司 OTA upgrade realization method and terminal

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9891907B2 (en) * 2014-07-07 2018-02-13 Harman Connected Services, Inc. Device component status detection and illustration apparatuses, methods, and systems
CN104216736A (en) * 2014-08-14 2014-12-17 小米科技有限责任公司 Method and device for incremental upgrading and terminal device
CN106484453B (en) * 2015-09-02 2021-04-20 中兴通讯股份有限公司 Method and device for realizing system upgrading
CN105700927B (en) * 2016-01-15 2019-04-23 青岛海信移动通信技术股份有限公司 Version upgrading method, terminal device and version server

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102693139A (en) * 2011-03-25 2012-09-26 比亚迪股份有限公司 Method and system for wirelessly upgrading mobile phone software
CN105335181A (en) * 2014-08-06 2016-02-17 中兴通讯股份有限公司 OTA upgrade realization method and terminal
CN104267978A (en) * 2014-09-16 2015-01-07 青岛海信移动通信技术股份有限公司 Method and device for generating differential packet
CN105138347A (en) * 2015-07-17 2015-12-09 广东欧珀移动通信有限公司 Difference upgrade patch generating method, software upgrading method and corresponding apparatus

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112804071A (en) * 2019-11-13 2021-05-14 中兴通讯股份有限公司 On-line upgrading method, upgrading file providing method, equipment and storage medium
CN112804071B (en) * 2019-11-13 2024-09-06 南京中兴新软件有限责任公司 Online upgrade method, upgrade file providing method, device and storage medium
CN111611002A (en) * 2020-04-27 2020-09-01 深圳市广和通无线股份有限公司 Data upgrading method and device, computer equipment and storage medium
CN111611002B (en) * 2020-04-27 2024-02-09 深圳市广和通无线股份有限公司 Data upgrading method, device, computer equipment and storage medium
CN112199107A (en) * 2020-11-04 2021-01-08 北京声智科技有限公司 OTA (over the air) upgrading method and related equipment
CN112631633A (en) * 2021-01-07 2021-04-09 南方电网数字电网研究院有限公司 Function module upgrading method and device based on double-core intelligent electric meter
CN115102856A (en) * 2022-05-24 2022-09-23 福建星云电子股份有限公司 Internet of things equipment upgrading method and system

Also Published As

Publication number Publication date
CN109672655A (en) 2019-04-23

Similar Documents

Publication Publication Date Title
WO2019076293A1 (en) Differential upgrading method, device and system
CN106598584B (en) Method, device and system for processing resource file
CN103473163B (en) application program detection method and device
CN112865956B (en) Certificate updating method and device, terminal equipment and server
WO2019037724A1 (en) Method for upgrading application of mobile terminal, storage device, and mobile terminal
CN108280341B (en) Channel number adding and installation package checking method and device
CN103455343A (en) Method and device for updating application programs
CN106850800B (en) Method for determining download path and client
WO2015035947A1 (en) Method for realizing cellphone without card, cellphone and server
US20150067669A1 (en) Method for managing application and electronic device thereof
WO2018058436A1 (en) Method for loading software program, user terminal and storage medium
WO2021098360A1 (en) Application control method, electronic device, and server
US20200310771A1 (en) Application Processing Method for Terminal Device, and Terminal Device
CN109521920B (en) Application icon control method and terminal equipment
CN106953898B (en) Method and device for acquiring software package
WO2018049894A1 (en) Data transmission method and device
CN107844318B (en) Upgrading method of operating system, mobile terminal and server
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
CN110609694A (en) BUG repairing method and device, terminal equipment and storage medium
CN116679967B (en) Firmware upgrading method and device for basic input/output system
CN111522575B (en) Application program upgrading method and electronic equipment
TW201500916A (en) Method and device for software repair
US9742901B2 (en) Method, apparatus and terminal device for obtaining call log
CN108132844B (en) Plug-in downloading method and device
CN110737476A (en) terminal restarting method and device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18868089

Country of ref document: EP

Kind code of ref document: A1