WO2017036183A1 - Differential upgrade package processing method and device, upgrade method, system and device - Google Patents

Differential upgrade package processing method and device, upgrade method, system and device Download PDF

Info

Publication number
WO2017036183A1
WO2017036183A1 PCT/CN2016/082654 CN2016082654W WO2017036183A1 WO 2017036183 A1 WO2017036183 A1 WO 2017036183A1 CN 2016082654 W CN2016082654 W CN 2016082654W WO 2017036183 A1 WO2017036183 A1 WO 2017036183A1
Authority
WO
WIPO (PCT)
Prior art keywords
version
upgrade package
differential upgrade
data
difference data
Prior art date
Application number
PCT/CN2016/082654
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 WO2017036183A1 publication Critical patent/WO2017036183A1/en

Links

Images

Classifications

    • 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

  • This document relates to but not limited to the field of communications, and in particular, to a method and device for processing a differential upgrade package, and an upgrade method, system and device.
  • the FOTA (Firmware Over-The-Air) technology of mobile terminals is a very frequently used technology in mobile terminals, and plays an important role in system version maintenance. Assume that there are versions V1 and V2. The V1-V2 differential upgrade package has been released. Now that the V3 version is new, the method for users to upgrade to V3 is as follows: Mode 1 is upgraded through V1-V2 and V2-V3. Step upgrade, mode 2 is upgrade through V1-V3, V2-V3, called cross-version upgrade. In the current technology, with the increase of the new version, the mode 1 is very simple to control on the release and test.
  • Mode 2 is a way that all vendors should choose.
  • scheme one all system versions are put on the server, and when the terminal requests, the corresponding differential upgrade package is generated and then sent to the terminal; scheme 2, on the server
  • the differential upgrade packages are packaged and delivered to the terminal.
  • the terminal upgrades one by one according to all the packaged packets, and finally upgrades to the latest version.
  • the embodiment of the invention provides a method and a device for processing a differential upgrade package, and an upgrade method, a system and a device, which can at least solve the problem of a large workload of the upgrade package in the related art.
  • the method further includes:
  • the second differential upgrade package is deleted.
  • the generating, by the first differential upgrade package and the pre-stored second differential upgrade package, the third differential upgrade package includes:
  • the second replacement data Is data in the first version replaced by the second version;
  • the second difference data is difference data of the second version relative to the first version;
  • the generating, according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data, generating the third differential upgrade package includes :
  • the third difference data is difference data of the third version relative to the first version; a first end point of a location range of the second difference data is a starting position of the second difference data The length of the location range is the length of the second difference data;
  • the third replacement data Is data in the first version replaced by the third version: when the starting position of the first replacement data is within a range of positions of the second replacement data, the start of the third replacement data a position is a starting position of the second replacement data; when a starting position of the first replacement data is smaller than a starting position of the second replacement data, a starting position of the third replacement data is the a difference between a starting position of the first replacement data and an increased length of the second version relative to the first version;
  • determining a length of the third replacement data by: when a starting position of the first replacement data is in the When the location of the replacement data is within the range of the location, the length of the third replacement data is the length of the second replacement data; when the starting location of the first replacement data is less than the starting location of the second replacement data
  • the length of the third replacement data is a sum of a length of the first replacement data exceeding a length of an end position of the second difference data and a length of the second replacement data;
  • the first endpoint of the location range of the second replacement data is a start bit of the second difference data
  • the length of the location range of the second replacement data is the length of the second difference data.
  • the synthesizing the first difference data into the second difference data to obtain the third differential data corresponding to the third differential upgrade package includes:
  • the difference data of the overlap of the first difference data and the second difference data and the remaining difference data of the second difference data other than the overlap difference data constitute the third difference data.
  • the third replacement data Is data in the first version that is replaced by the third version
  • the length of the first replacement data is taken as the length of the third replacement data.
  • inserting the first difference data into the second difference data to obtain the third difference data includes:
  • the first difference data is taken as the third difference data.
  • An upgrade system including: a server, a client;
  • the client is configured to send an upgrade request to the server to upgrade a first version of the specified software to a third version
  • the server is configured to store a second differential upgrade package of the first version to the second version of the specified software, and receive a first difference from the second version of the specified software to the third version
  • the third differential upgrade package that generates the first version of the specified software to the third version is triggered; and after the upgrade request is received, the third differential upgrade package is sent to the Client.
  • the server is further configured to delete the second differential upgrade package after the third differential upgrade package is generated.
  • a processing device for a differential upgrade package comprising:
  • the first receiving module is configured to receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
  • a sending module configured to send the third differential upgrade package of the first version to the third version of the specified software to the client, where the third differential upgrade package passes the first differential upgrade package and Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software
  • the device further includes:
  • And deleting the module configured to delete the second differential upgrade package after the third differential upgrade package is generated.
  • An upgrade device comprising:
  • a second receiving module configured to receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server;
  • the third differential upgrade package is the first differential upgrade package and the server by the server Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software a differential upgrade package of the first version to the second version, the third version is higher than the second version, and the second version is higher than the first version;
  • an upgrade module configured to upgrade the first version of the specified software to the third version according to the third differential upgrade package.
  • a storage medium arranged to store program code for performing the above method.
  • the first differential upgrade package of the second version to the third version when the client needs to upgrade from the first version to the third version, the first differential upgrade package of the second version to the third version, and the pre-stored first version to the second version of the second version
  • the differential upgrade package is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client, which solves the problem that the upgrade package is produced and maintained in the related art.
  • the purpose of reducing the workload of the upgrade package production and maintenance is achieved, the efficiency of the version upgrade is improved, and the maintenance cost is reduced.
  • FIG. 1 is a flowchart of a method of processing a differential upgrade package according to an embodiment of the present invention
  • FIG. 2 is a flow chart of an upgrade method according to an embodiment of the present invention.
  • FIG. 3 is a schematic flow chart of a method for fabricating a differential upgrade package according to an alternative embodiment of the present invention.
  • FIG. 4 is a schematic diagram of generating patch data in a third differential upgrade package according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an upgrade system according to an embodiment of the present invention.
  • FIG. 6 is a structural block diagram of a processing apparatus of a differential upgrade package according to an embodiment of the present invention.
  • FIG. 7 is a structural block diagram of an upgrade apparatus according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for processing a differential upgrade package according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps S102 to S104:
  • Step S102 Receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version.
  • Step S104 The third differential upgrade package of the first version to the third version of the specified software is sent to the client, where the third differential upgrade package passes the first differential upgrade package and Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software The differential upgrade package of the first version to the second version, wherein the third version is higher than the second version, and the second version is higher than the first version.
  • Steps S102 to S104 may be, but are not limited to, being executed by a server.
  • the client needs to upgrade the specified software from the first version to the third version, by specifying the first differential upgrade package of the second version to the third version of the software, and the pre-stored designated software.
  • the second differential upgrade package of the first version to the second version is used to generate a third differential upgrade package in which the specified software is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client.
  • the invention solves the problem that the workload of the upgrade package production and maintenance in the related art is large, and achieves the purpose of reducing the workload of the upgrade package production and maintenance, improves the efficiency of the version upgrade, and reduces the maintenance cost.
  • the generating process of the foregoing third differential upgrade package may be performed on the server, and before the generating, the first differential upgrade package needs to be uploaded to the server, when the server receives the first differential upgrade package. , the process of generating the third differential upgrade package described above can be triggered.
  • the method further includes: deleting the second differential upgrade package after the third differential upgrade package is generated.
  • the third differential upgrade package may be generated in the following manner:
  • the second version replaces the data
  • the second difference data is the difference data of the second version relative to the first version
  • the third version replaces the data; the first difference data is the third version relative to the second version Difference data;
  • the generating the third differential upgrade package according to the location and the length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data may include:
  • the first difference data exists in the location range of the second difference data
  • the first difference data is synthesized into the second difference data to obtain third difference data corresponding to the third differential upgrade package, where the third difference data is The difference data of the third version relative to the first version; wherein the first end point of the position range of the second difference data is the start position of the second difference data, and the length of the position range is the length of the second difference data ;
  • the location of the third replacement data in the third differential upgrade package is determined by the third mode, wherein the third replacement data is the third version in the first version Version-replaced data: when the starting position of the first replacement data is within the position range of the second replacement data, the starting position of the third replacement data is the starting position of the second replacement data; when the first replacement data starts When the start position is smaller than the start position of the second replacement data, the start position of the third replacement data is the difference between the start position of the first replacement data and the length of the second version relative to the first version;
  • the length of the third replacement data is determined by: when the starting position of the first replacement data is within the position range of the second replacement data, The length of the third replacement data is the length of the second replacement data; when the starting position of the first replacement data is smaller than the starting position of the second replacement data, the length of the third replacement data is the length of the first replacement data exceeds the second difference a sum of a length of the end position of the data and a length of the second replacement data; wherein the first end point of the position range of the second replacement data is the start position of the second difference data, and the length of the position range of the second replacement data is The length of the second difference data.
  • generating the third differential upgrade package according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data may include: if the second difference is If the first difference data does not exist in the location range of the data, the first difference data is inserted into the second difference data to obtain third difference data corresponding to the third differential upgrade package; wherein the third difference data is the third version relative to a difference data of the first version; a starting end point of the position range of the second difference data is a starting position of the second difference data, and a length of the position range is a length of the second difference data;
  • inserting the first difference data into the second difference data to obtain the third difference data may include: using the first difference data as the third difference data.
  • FIG. 2 is a flowchart of an upgrade method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps S202-S204:
  • Step S202 Receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server, where the third differential upgrade package is a second differential upgrade that is pre-stored by the server by using the first differential upgrade package and the server. Packet generation, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software to the The second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version;
  • Step S204 upgrading the first version of the specified software to the third version according to the third differential upgrade package.
  • the steps S202-S204 may be, but are not limited to, being performed by a terminal where the client or the client is located.
  • the generating process of the foregoing third differential upgrade package may be performed on the server, and before the generating, the first differential upgrade package needs to be uploaded to the server, when the server receives the first differential upgrade package. , the process of generating the third differential upgrade package described above can be triggered.
  • the server may also be deleted. Differential upgrade package.
  • the first version is version 1, the second version is version 2, the third version is version 4; the client needs to upgrade version 1 to version 4, and the server stores a version 1 upgrade to version 2 differential upgrade.
  • the package (equivalent to the second differential upgrade package described above) triggers generation of a differential upgrade package of version 1 to version 4 when the server receives a version 2 to version 4 differential upgrade package (equivalent to the first differential upgrade package described above).
  • (equivalent to the third differential upgrade package described above) after the generation, retain the first differential upgrade package, the third differential upgrade package, and delete the second differential upgrade package, so that the server stores version 1 and version 2 respectively to the version.
  • the server does not need to put all the versions on the server, and the upgrade package is not required to be packaged and sent to the client when the client requests the upgrade, but only the differential upgrade package is needed.
  • Stored in the server, and when needed to upgrade to the latest version generate a differential upgrade package from all the old versions to the latest version, and deliver the latest differential upgrade package of the corresponding version to the client, according to the latest differential upgrade package. Upgrade can save a lot of storage space, reduce the cost of server maintenance, and also have the advantage of differential upgrade.
  • the method for generating the third differential upgrade package by the server through the foregoing first differential upgrade package and the second differential upgrade package is the same as the method for generating the embodiment shown in FIG. 1 , and details are not described herein again.
  • the embodiment of the present invention provides an optional differential upgrade package processing method.
  • V1-V2 represents a differential upgrade package of V1 to V2 (corresponding to the second differential upgrade package in the embodiment shown in FIG. 1)
  • V2-V3 represents a differential upgrade package of V2 to V3 (corresponding to the embodiment shown in FIG. 1)
  • V1-V3 represents a differential upgrade package of V1 to V3 (corresponding to the third differential upgrade package in the embodiment shown in FIG. 1).
  • FIG. 3 is a schematic flowchart of a method for fabricating a differential upgrade package according to an alternative embodiment of the present invention. As shown in FIG. 3, the main steps of the method include the following S302-S306:
  • Step S302 reading the position and length of the patch data of the difference file in the V1-V2 differential upgrade package (corresponding to the position and length of the second replacement data in the embodiment shown in FIG. 1), and obtaining the position in the corresponding file in the V2 version. And length (corresponding to the position and length of the second difference data in the embodiment shown in FIG. 1), and recorded;
  • the new patch data is synthesized as follows: the position and length of the patch data of the difference file in the V1-V2 differential upgrade package recorded in step S302 in the V2 corresponding file (corresponding to the second difference in the embodiment shown in FIG. 1) The position range of the data is determined. If the corresponding file in V3 is within the length range starting from the position (corresponding to the position range of the second difference data in the embodiment shown in FIG. 1), there is patch data (corresponding to FIG. 1). In the first difference data in the embodiment, the patch data of the V3 corresponding file (corresponding to the first difference data in the embodiment shown in FIG. 1) is synthesized into the patch data of the V2 corresponding file (corresponding to FIG. 1).
  • the patch data of the file in V3 (corresponding to the first difference data in the embodiment shown in FIG. 1) does not have the patch data of the difference file in the V1-V2 differential upgrade package at The V2 corresponds to the position range in the file (corresponding to the position range of the second difference data in the embodiment shown in FIG. 1), and the patch data (corresponding to the first difference data in the embodiment shown in FIG. 1) is taken as New patch data Into.
  • Step S306 generating a differential upgrade package of V1-V3 (corresponding to the third differential upgrade package in the embodiment shown in FIG. 1).
  • step S304 the new patch data (corresponding to the third replacement data and the third difference data corresponding to the third differential upgrade package in the embodiment shown in FIG. 1) are also different according to different situations, and FIG. 4 is based on the present invention.
  • a schematic diagram of generating patch data in the third differential upgrade package provided by the embodiment of the present invention is as shown in FIG. 4.
  • the flow is as follows: v1-v2 in the left figure indicates that the V1 version needs to be replaced.
  • the position and length of the data (corresponding to the position and length of the second replacement data in the embodiment shown in FIG. 1), and v2 represents the difference data of V2 with respect to V1 (corresponding to the second difference data in the embodiment shown in FIG.
  • v2-v3 indicates the position and length of the data to be replaced in the v2 version (corresponding to the position and length of the first replacement data in the embodiment shown in FIG. 1).
  • V1 represents the difference data of V3 with respect to V2 (corresponding to the first difference data in the embodiment shown in Fig. 1).
  • the newly generated differential upgrade package is shown in the right figure, and v1-v3 indicates the position and length of the data to be replaced in the V1 version (corresponding to the position and length of the third replacement data in the embodiment shown in FIG. 1).
  • V3 represents the difference data of V3 with respect to V1 (corresponding to the third difference data in the embodiment shown in Fig. 1).
  • the starting position and length of v1-v3 are determined by v1-v2, v2 and v2-v3, and the position determining method: if the starting position of v2-v3 is in the range of v2 Inside, the starting position of v1-v3 is the starting position of v1-v2; if the starting position of v2-v3 is to the left of v2, the starting position of v1-v3 is the starting position of v2-v3 minus the current position
  • the length of V2 is increased relative to V1; the length is determined by the method: if the length of v2-v3 is in the range of v2, the final length is the length of v1-v2.
  • the difference data of V3 with respect to V1 is obtained by combining the difference data of V2 with respect to V1 and the difference data of V3 with respect to V2, and the combination is as follows: the difference data of V3 with respect to V2 is covered to the overlap of the difference data of V2 with respect to V1 The rest is used directly.
  • the starting position of v1-v3 is obtained by how much the starting position of v2-v3 corresponds to how the current position of V2 changes relative to V1.
  • the data length and difference data are kept as v2-v3.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A more general implementation.
  • the essential or contributing portion of the technical solution of the embodiments of the present invention may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM, a magnetic disk, or a magnetic disk).
  • the method includes the one or more instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present invention.
  • An upgrade system is further provided in the embodiment of the present invention, and the system is used to implement the foregoing embodiment. And optional embodiments, which have already been described, are not described again.
  • the system includes: a server 52, a client 54; the client 54 is configured to send a message to the server 52 that specifies software. Upgrading a version to a third version of the upgrade request; the server 52 is configured to store a second differential upgrade package of the first version to the second version of the specified software, upon receiving the second version of the specified software to the first The third differential upgrade package of the third version is triggered to generate a third differential upgrade package of the first version to the third version of the specified software; and the third differential upgrade package is sent to the upgrade request when the upgrade request is received The client 54.
  • the server 52 passes the first differential upgrade package of the second version to the third version and the pre-stored first version to the second version.
  • the second differential upgrade package is configured to generate a third differential upgrade package that is upgraded from the first version to the third version, and then directly delivers the third differential upgrade package to the client 54 to solve the related art upgrade package creation and
  • the problem of maintaining a large workload has reduced the workload of the upgrade package production and maintenance, improved the efficiency of the version upgrade, and reduced the maintenance cost.
  • the server 52 may be further configured to delete the second differential upgrade package after generating the third differential upgrade package.
  • the first version is version 1, the second version is version 2, the third version is version 4; the client 54 needs to upgrade version 1 to version 4, and the server 52 stores version 1 upgrade to version 2 a differential upgrade package (corresponding to the second differential upgrade package described above), when the server 52 receives the version 2 to version 4 differential upgrade package (corresponding to the first differential upgrade package described above), triggering generation of version 1 to version 4
  • the differential upgrade package (equivalent to the third differential upgrade package described above), after the generation, retains the first differential upgrade package, the third differential upgrade package, and deletes the second differential upgrade package, so that the server 52 stores the version 1 and the version.
  • the server 52 stores all the old versions to the latest version of the differential upgrade package.
  • the latest differential upgrade package of the corresponding version is directly sent to the client 54.
  • a processing device for the differential upgrade package is further provided, and the device is configured to implement the foregoing embodiment, and details are not described herein.
  • the term "module” can be a combination of software and/or hardware that implements a predetermined function.
  • the devices described in the following embodiments are generally implemented in software, hardware, or a combination of software and hardware, is also possible and conceivable.
  • FIG. 6 is a structural block diagram of a processing apparatus of a differential upgrade package according to an embodiment of the present invention. As shown in FIG. 6, the apparatus includes:
  • the sending module 64 is connected to the receiving module 62, and is configured to send the third differential upgrade package of the first version to the third version of the specified software to the client, where the third differential upgrade package passes a first differential upgrade package and a pre-stored second differential upgrade package, wherein the first differential upgrade package is a differential upgrade package of the second version to the third version of the specified software, and the second differential upgrade package is A version to a second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version.
  • the receiving module 62 receives the request that the client needs to upgrade from the first version to the third version, the first differential upgrade package through the second version to the third version, and the first stored in advance
  • the second differential upgrade package of the version to the second version is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the sending module 64 directly delivers the third differential upgrade package to the client 54.
  • the invention solves the problem that the workload of the upgrade package production and maintenance in the related art is large, and achieves the purpose of reducing the workload of the upgrade package production and maintenance, improves the efficiency of the version upgrade, and reduces the maintenance cost.
  • the foregoing device may be applied to a server or may be applied to other devices. But it is not limited to this.
  • the apparatus may further include: a deleting module, configured to delete the second differential upgrade package after the third differential upgrade package is generated.
  • FIG. 7 is a structural block diagram of an upgrade device according to an embodiment of the present invention. As shown in FIG. 7, the device includes:
  • the second receiving module 72 is configured to receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server, where the third differential upgrade package is the first differential upgrade package and the server Generating a second differential upgrade package pre-stored by the server, where the first differential upgrade package is a differential upgrade package of the second version to the third version of the specified software, and the second differential upgrade package is the specified software a differential upgrade package of the first version to the second version, wherein the third version is higher than the second version, and the second version is higher than the first version;
  • the upgrade module 74 is configured to upgrade the first version of the specified software to the third version according to the third differential upgrade package.
  • the above device may be disposed on the client.
  • FIG. 8 is a flowchart of processing a differential upgrade package by an upgrade system according to an alternative embodiment of the present invention. As shown in FIG. 8, the process flow includes the following steps S802-S808:
  • Step S802 uploading a differential upgrade package of the latest version and the previous version
  • Step S804 the server reads all existing differential upgrade packages
  • Step S806 generating a differential upgrade package of all the old versions to the latest version
  • Step S808 The corresponding upgrade package is delivered according to the terminal request information.
  • the V2 differential upgrade package retains the V2-V3 differential upgrade package.
  • V1-V3 and V2-V3 differential upgrade packages on the server.
  • the V1-V3 upgrade package is delivered.
  • the V2-V3 upgrade package is delivered.
  • the server automatically generates a differential upgrade package for V1-V4 and V2-V4 and upgrades the corresponding user request.
  • each of the foregoing modules may be implemented by software or hardware.
  • the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
  • the embodiment of the invention further provides a storage medium.
  • the foregoing storage medium may be configured to store program code for performing the following steps:
  • the third differential upgrade package of the first version to the third version of the specified software is sent to the client, where the third differential upgrade package passes the first differential upgrade package and pre-stored a second differential upgrade package is generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first part of the specified software A version to the second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version.
  • the foregoing storage medium may include, but is not limited to, a USB flash drive, a ROM (Read-Only Memory), a RAM (Random Access Memory), a mobile hard disk, and a magnetic device.
  • a USB flash drive a ROM (Read-Only Memory), a RAM (Random Access Memory), a mobile hard disk, and a magnetic device.
  • ROM Read-Only Memory
  • RAM Random Access Memory
  • mobile hard disk a magnetic device.
  • each module or step of the above-described embodiments of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device or distributed across multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different.
  • the steps shown or described herein are performed sequentially, or they are separately fabricated into integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module.
  • embodiments of the invention are not limited to any specific combination of hardware and software.
  • the first differential upgrade package of the second version to the third version when the client needs to upgrade from the first version to the third version, the first differential upgrade package of the second version to the third version, and the pre-stored first version to the second version of the second version
  • the differential upgrade package is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client, which solves the problem that the upgrade package is produced and maintained in the related art.
  • the purpose of reducing the workload of the upgrade package production and maintenance is achieved, the efficiency of the version upgrade is improved, and the maintenance cost is reduced.

Abstract

A differential upgrade package processing method and device, upgrade method, system and device. The differential upgrade package processing method comprises: receiving an upgrade request sent by a client, wherein the upgrade request is used to indicate the request of the client to upgrade a first version of a specified software to a third version; issuing a third differential upgrade package for upgrading the first version of the specified software to the third version to the client, wherein the third differential upgrade package is generated through a first differential upgrade package and a pre-stored second differential upgrade package, the first differential upgrade package is a differential upgrade package used to upgrade a second version of the specified software to the third version, the second differential upgrade package is a differential upgrade package used to upgrade the first version of the specified software to the second version, the third version is higher than the second version, and the second version is higher than the first version.

Description

差分升级包的处理方法及装置,升级方法、系统及装置Method and device for processing differential upgrade package, upgrade method, system and device 技术领域Technical field
本文涉及但不限于通信领域,尤其涉及一种差分升级包的处理方法及装置,升级方法、系统及装置。This document relates to but not limited to the field of communications, and in particular, to a method and device for processing a differential upgrade package, and an upgrade method, system and device.
背景技术Background technique
移动终端的FOTA(Firmware Over-The-Air,空中下载软件升级)技术是现在移动终端中使用非常频繁的技术,对于系统版本维护起着重要作用。假设存在版本V1,V2,目前已发布V1-V2的差分升级包,现在新出了V3版本,则用户要升级到V3的方法有:方式1是通过V1-V2、V2-V3升级,称为阶梯升级,方式2是通过V1-V3、V2-V3升级,称为跨版本升级。目前的技术中,随着新版本的增加,方式1在版本发布与测试上控制都非常简单,每个新版本发布只需要测试前一个版本到新版本功能正常即可,但是对于用户而言,如果V1要升级到V3则需要先升级到V2,严重影响用户的体验;方式2对于用户体验有明显改善,但是如果每个新版本都要制作所有旧版本的跨版本升级包,无论是升级包制作还是升级包上传服务器以及升级包测试都是不小的工作量,特别是升级包增多后,由于是人为操作,很容易出现问题。The FOTA (Firmware Over-The-Air) technology of mobile terminals is a very frequently used technology in mobile terminals, and plays an important role in system version maintenance. Assume that there are versions V1 and V2. The V1-V2 differential upgrade package has been released. Now that the V3 version is new, the method for users to upgrade to V3 is as follows: Mode 1 is upgraded through V1-V2 and V2-V3. Step upgrade, mode 2 is upgrade through V1-V3, V2-V3, called cross-version upgrade. In the current technology, with the increase of the new version, the mode 1 is very simple to control on the release and test. Each new version only needs to test the previous version to the new version, but for the user, If V1 is to be upgraded to V3, you need to upgrade to V2 first, which seriously affects the user experience. Mode 2 has a significant improvement on the user experience, but if each new version has to make all the old version of the cross-version upgrade package, whether it is an upgrade package Production or upgrade package upload server and upgrade package test are not small workload, especially after the increase of upgrade package, because it is human operation, it is easy to have problems.
在用户体验至上的时代,方式2是所有厂商都应该选择的方式,为了解决方式2即跨版本升级带来的版本维护问题,在相关技术中,也提出过一些解决办法,在相关技术中,主要提出了两种解决跨版本升级维护问题的方案:方案一,将所有的系统版本放到服务器上,在终端请求时,生成对应的差分升级包然后下发给终端;方案二,服务器上的差分升级包打包到一起下发给终端,终端根据打包后的所有差分包,逐个进行升级,最后升级到最新版本。In the era of user experience first, Mode 2 is a way that all vendors should choose. In order to solve the problem of version 2 maintenance caused by cross-version upgrade, some solutions have been proposed in related technologies. In related technologies, Two schemes for solving the problem of cross-version upgrade maintenance are proposed: scheme one, all system versions are put on the server, and when the terminal requests, the corresponding differential upgrade package is generated and then sent to the terminal; scheme 2, on the server The differential upgrade packages are packaged and delivered to the terminal. The terminal upgrades one by one according to all the packaged packets, and finally upgrades to the latest version.
尽管上述两种方案都能达到简化跨版本升级中的版本维护的工作,但是也存在相应的问题,方案一,由于要把所有的版本都放到服务器上,就会导致服务器需要很大的容量来保存,随着版本的增多,所需容量也会越来越大;方案二,可以减少对服务器容量的需求,但是由于其直接将每个版本的差分升级包打包到一起,可能存在过多的冗余信息,随着版本的增多,由于需要 对差分升级包逐个升级,对于终端的处理要求也会增高。Although both of these solutions can simplify the maintenance of version maintenance in a cross-version upgrade, there are corresponding problems. In the first solution, since all versions are placed on the server, the server needs a large capacity. To save, as the version increases, the required capacity will be larger and larger; Option 2, can reduce the demand for server capacity, but because it directly packs each version of the differential upgrade package, there may be too much Redundant information, as the version increases, due to the need The differential upgrade package is upgraded one by one, and the processing requirements for the terminal are also increased.
针对在相关技术中的跨版本升级中升级包制作和维护工作量大的问题,目前尚未提出有效的解决方案。In view of the large workload of the upgrade package creation and maintenance in the cross-version upgrade in the related art, an effective solution has not been proposed yet.
发明内容Summary of the invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供了一种差分升级包的处理方法及装置,升级方法、系统及装置,可以至少解决相关技术中升级包制作和维护工作量大的问题。The embodiment of the invention provides a method and a device for processing a differential upgrade package, and an upgrade method, a system and a device, which can at least solve the problem of a large workload of the upgrade package in the related art.
本发明实施例采用如下技术方案。The embodiments of the present invention adopt the following technical solutions.
一种差分升级包的处理方法,包括:A method for processing a differential upgrade package, comprising:
接收客户端发送的升级请求;所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;Receiving an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。And sending, to the client, the third differential upgrade package of the first version to the third version of the specified software, where the third differential upgrade package passes the first differential upgrade package and the second pre-stored package a differential upgrade package is generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software To the second version of the differential upgrade package, the third version is higher than the second version, and the second version is higher than the first version.
可选地,所述的方法还包括:Optionally, the method further includes:
生成所述第三差分升级包后,删除所述第二差分升级包。After the third differential upgrade package is generated, the second differential upgrade package is deleted.
可选地,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成包括:Optionally, the generating, by the first differential upgrade package and the pre-stored second differential upgrade package, the third differential upgrade package includes:
读取所述第二差分升级包中第二替换数据的位置及长度,得到所述第二替换数据在所述第二版本中对应的第二差异数据的位置及长度;所述第二替换数据是所述第一版本中被所述第二版本替换的数据;所述第二差异数据是所述第二版本相对于所述第一版本的差异数据; Reading a position and a length of the second replacement data in the second differential upgrade package, and obtaining a position and a length of the second difference data corresponding to the second replacement data in the second version; the second replacement data Is data in the first version replaced by the second version; the second difference data is difference data of the second version relative to the first version;
读取所述第一差分升级包中第一替换数据的位置及长度,得到所述第一替换数据在所述第二版本中对应的第一差异数据的位置及长度;其中,所述第一替换数据是所述第二版本中被所述第三版本替换的数据;所述第一差异数据是所述第三版本相对于所述第二版本的差异数据;Reading a position and a length of the first replacement data in the first differential upgrade package, and obtaining a position and a length of the first difference data corresponding to the first replacement data in the second version; wherein, the first The replacement data is data replaced by the third version in the second version; the first difference data is difference data of the third version relative to the second version;
根据所述第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包。And generating the third differential upgrade package according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data.
可选地,所述根据第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包包括:Optionally, the generating, according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data, generating the third differential upgrade package includes :
若在所述第二差异数据的位置范围内存在所述第一差异数据,则将所述第一差异数据合成到所述第二差异数据中得到所述第三差分升级包对应的第三差异数据,所述第三差异数据是所述第三版本相对于所述第一版本的差异数据;所述第二差异数据的位置范围的第一端点为所述第二差异数据的起始位置,所述位置范围的长度为所述第二差异数据的长度;If the first difference data exists in the location range of the second difference data, synthesizing the first difference data into the second difference data to obtain a third difference corresponding to the third differential upgrade package Data, the third difference data is difference data of the third version relative to the first version; a first end point of a location range of the second difference data is a starting position of the second difference data The length of the location range is the length of the second difference data;
在所述第二差异数据的位置范围内存在所述第一差异数据的情况下,通过以下方式确定所述第三差分升级包中的第三替换数据的起始位置,所述第三替换数据是所述第一版本中被所述第三版本替换的数据:当所述第一替换数据的起始位置在所述第二替换数据的位置范围内时,所述第三替换数据的起始位置为所述第二替换数据的起始位置;当所述第一替换数据的起始位置小于所述第二替换数据的起始位置时,所述第三替换数据的起始位置为所述第一替换数据的起始位置与所述第二版本相对于所述第一版本增加的长度之差;In a case where the first difference data exists in a location range of the second difference data, determining a start position of the third replacement data in the third differential upgrade package, the third replacement data Is data in the first version replaced by the third version: when the starting position of the first replacement data is within a range of positions of the second replacement data, the start of the third replacement data a position is a starting position of the second replacement data; when a starting position of the first replacement data is smaller than a starting position of the second replacement data, a starting position of the third replacement data is the a difference between a starting position of the first replacement data and an increased length of the second version relative to the first version;
在所述第二差异数据的位置范围内存在所述第一差异数据的情况下,通过以下方式确定所述第三替换数据的长度:当所述第一替换数据的起始位置在所述第二替换数据的位置范围内时,所述第三替换数据的长度为所述第二替换数据的长度;当所述第一替换数据的起始位置小于所述第二替换数据的起始位置时,所述第三替换数据的长度为所述第一替换数据的长度超出所述第二差异数据的结束位置的长度与所述第二替换数据的长度之和;In a case where the first difference data exists in a range of the second difference data, determining a length of the third replacement data by: when a starting position of the first replacement data is in the When the location of the replacement data is within the range of the location, the length of the third replacement data is the length of the second replacement data; when the starting location of the first replacement data is less than the starting location of the second replacement data The length of the third replacement data is a sum of a length of the first replacement data exceeding a length of an end position of the second difference data and a length of the second replacement data;
所述第二替换数据的位置范围的第一端点为所述第二差异数据的起始位 置,所述第二替换数据的位置范围的长度为所述第二差异数据的长度。The first endpoint of the location range of the second replacement data is a start bit of the second difference data The length of the location range of the second replacement data is the length of the second difference data.
可选地,所述将第一差异数据合成到所述第二差异数据中得到所述第三差分升级包对应的第三差分数据包括:Optionally, the synthesizing the first difference data into the second difference data to obtain the third differential data corresponding to the third differential upgrade package includes:
将所述第一差异数据与所述第二差异数据的重叠的差异数据以及所述第二差异数据中除了所述重叠的差异数据之外的剩余差异数据组成所述第三差异数据。The difference data of the overlap of the first difference data and the second difference data and the remaining difference data of the second difference data other than the overlap difference data constitute the third difference data.
可选地,所述根据第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包包括:Optionally, the generating, according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data, generating the third differential upgrade package includes :
若在所述第二差异数据的位置范围内不存在所述第一差异数据,则将所述第一差异数据插入到所述第二差异数据中得到所述第三差分升级包对应的第三差异数据;所述第三差异数据是所述第三版本相对于所述第一版本的差异数据;所述第二差异数据的位置范围的起始端点为所述第二差异数据的起始位置,所述位置范围的长度为所述第二差异数据的长度;If the first difference data does not exist in the location range of the second difference data, inserting the first difference data into the second difference data to obtain a third corresponding to the third differential upgrade package Difference data; the third difference data is difference data of the third version relative to the first version; a starting end point of a position range of the second difference data is a starting position of the second difference data The length of the location range is the length of the second difference data;
根据所述第一替换数据的起始位置与所述第二替换数据的起始位置的变化值确定所述第三差分升级包中的第三替换数据的起始位置;所述第三替换数据是所述第一版本中被所述第三版本替换的数据;Determining a starting position of the third replacement data in the third differential upgrade package according to a change value of a start position of the first replacement data and a start position of the second replacement data; the third replacement data Is data in the first version that is replaced by the third version;
将所述第一替换数据的长度作为所述第三替换数据的长度。The length of the first replacement data is taken as the length of the third replacement data.
可选地,将所述第一差异数据插入到所述第二差异数据中得到所述第三差异数据包括:Optionally, inserting the first difference data into the second difference data to obtain the third difference data includes:
将所述第一差异数据作为所述第三差异数据。The first difference data is taken as the third difference data.
一种升级方法,包括:An upgrade method that includes:
接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;所述第三差分升级包为所述服务器通过第一差分升级包和所述服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本, 所述第二版本高于所述第一版本;Receiving a third differential upgrade package of the first version to the third version of the specified software delivered by the server; the third differential upgrade package is a second differential upgrade of the server through the first differential upgrade package and the server pre-stored Packet generation, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software to the a second version of the differential upgrade package, the third version being higher than the second version, The second version is higher than the first version;
根据所述第三差分升级包将所述指定软件的所述第一版本升级至所述第三版本。Upgrading the first version of the specified software to the third version according to the third differential upgrade package.
一种升级系统,包括:服务器,客户端;An upgrade system, including: a server, a client;
所述客户端设置成向所述服务器发送将指定软件的第一版本升级至第三版本的升级请求;The client is configured to send an upgrade request to the server to upgrade a first version of the specified software to a third version;
所述服务器设置成存储所述指定软件的所述第一版本到第二版本的第二差分升级包,在接收到所述指定软件的所述第二版本到所述第三版本的第一差分升级包时,触发生成所述指定软件的所述第一版本到所述第三版本的第三差分升级包;以及接收到所述升级请求后将所述第三差分升级包下发至所述客户端。The server is configured to store a second differential upgrade package of the first version to the second version of the specified software, and receive a first difference from the second version of the specified software to the third version When the package is upgraded, the third differential upgrade package that generates the first version of the specified software to the third version is triggered; and after the upgrade request is received, the third differential upgrade package is sent to the Client.
可选地,所述服务器,还设置成在生成所述第三差分升级包之后,删除所述第二差分升级包。Optionally, the server is further configured to delete the second differential upgrade package after the third differential upgrade package is generated.
一种差分升级包的处理装置,包括:A processing device for a differential upgrade package, comprising:
第一接收模块,设置成接收客户端发送的升级请求;所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;The first receiving module is configured to receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
发送模块,设置成将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。a sending module, configured to send the third differential upgrade package of the first version to the third version of the specified software to the client, where the third differential upgrade package passes the first differential upgrade package and Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software The differential upgrade package of the first version to the second version, the third version is higher than the second version, and the second version is higher than the first version.
可选地,所述的装置还包括:Optionally, the device further includes:
删除模块,设置成在所述第三差分升级包生成后,删除所述第二差分升级包。 And deleting the module, configured to delete the second differential upgrade package after the third differential upgrade package is generated.
一种升级装置,包括:An upgrade device comprising:
第二接收模块,设置成接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;所述第三差分升级包为所述服务器通过第一差分升级包和所述服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本;a second receiving module, configured to receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server; the third differential upgrade package is the first differential upgrade package and the server by the server Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software a differential upgrade package of the first version to the second version, the third version is higher than the second version, and the second version is higher than the first version;
升级模块,设置成根据所述第三差分升级包将所述指定软件的所述第一版本升级至所述第三版本。And an upgrade module configured to upgrade the first version of the specified software to the third version according to the third differential upgrade package.
一种存储介质,所述存储介质设置为存储用于执行上述方法的程序代码。A storage medium arranged to store program code for performing the above method.
本发明实施例在客户端需要从第一版本升级至第三版本的情况下,通过第二版本到第三版本的第一差分升级包,和预先存储的第一版本到第二版本的第二差分升级包来生成从第一版本升级至第三版本的第三差分升级包,然后直接将第三差分升级包下发给客户端,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。In the embodiment of the present invention, when the client needs to upgrade from the first version to the third version, the first differential upgrade package of the second version to the third version, and the pre-stored first version to the second version of the second version The differential upgrade package is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client, which solves the problem that the upgrade package is produced and maintained in the related art. The purpose of reducing the workload of the upgrade package production and maintenance is achieved, the efficiency of the version upgrade is improved, and the maintenance cost is reduced.
在阅读并理解了附图和详细描述后,可以明白其它方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1是根据本发明实施例的差分升级包的处理方法的流程图;1 is a flowchart of a method of processing a differential upgrade package according to an embodiment of the present invention;
图2是根据本发明实施例的升级方法的流程图;2 is a flow chart of an upgrade method according to an embodiment of the present invention;
图3是根据本发明可选实施例的差分升级包的制作方法的流程示意图;3 is a schematic flow chart of a method for fabricating a differential upgrade package according to an alternative embodiment of the present invention;
图4是根据本发明实施例提供的第三差分升级包中的补丁数据的生成示意图;4 is a schematic diagram of generating patch data in a third differential upgrade package according to an embodiment of the present invention;
图5是根据本发明实施例提供的升级系统的示意图;FIG. 5 is a schematic diagram of an upgrade system according to an embodiment of the present invention; FIG.
图6是根据本发明实施例的差分升级包的处理装置的结构框图; 6 is a structural block diagram of a processing apparatus of a differential upgrade package according to an embodiment of the present invention;
图7是根据本发明实施例提供的升级装置的结构框图;FIG. 7 is a structural block diagram of an upgrade apparatus according to an embodiment of the present invention; FIG.
图8是根据本发明可选实施例的升级系统对差分升级包的处理流程图。8 is a process flow diagram of an upgrade system for a differential upgrade package in accordance with an alternative embodiment of the present invention.
本发明的实施方式Embodiments of the invention
需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict.
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or order.
在本实施例中提供了一种差分升级包的处理方法,图1是根据本发明实施例的差分升级包的处理方法的流程图,如图1所示,该流程包括如下步骤S102~S104:In this embodiment, a method for processing a differential upgrade package is provided. FIG. 1 is a flowchart of a method for processing a differential upgrade package according to an embodiment of the present invention. As shown in FIG. 1 , the process includes the following steps S102 to S104:
步骤S102,接收客户端发送的升级请求;其中,所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;Step S102: Receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version.
步骤S104,将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,其中,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,其中,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。Step S104: The third differential upgrade package of the first version to the third version of the specified software is sent to the client, where the third differential upgrade package passes the first differential upgrade package and Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software The differential upgrade package of the first version to the second version, wherein the third version is higher than the second version, and the second version is higher than the first version.
步骤S102~S104可以但不限于由服务器执行。Steps S102 to S104 may be, but are not limited to, being executed by a server.
通过上述步骤,采用在客户端需要将指定软件从第一版本升级至第三版本的情况下,通过指定软件的第二版本到第三版本的第一差分升级包,和预先存储的指定软件的第一版本到第二版本的第二差分升级包,来生成指定软件从第一版本升级至第三版本的第三差分升级包,然后直接将第三差分升级包下发给客户端的技术方案,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。 Through the above steps, in the case where the client needs to upgrade the specified software from the first version to the third version, by specifying the first differential upgrade package of the second version to the third version of the software, and the pre-stored designated software. The second differential upgrade package of the first version to the second version is used to generate a third differential upgrade package in which the specified software is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client. The invention solves the problem that the workload of the upgrade package production and maintenance in the related art is large, and achieves the purpose of reducing the workload of the upgrade package production and maintenance, improves the efficiency of the version upgrade, and reduces the maintenance cost.
需要说明的是,上述第三差分升级包的生成过程可以是在服务器上完成的,在生成之前,需要将上述第一差分升级包上传到服务器上,当服务器接收到该第一差分升级包时,可以触发生成上述第三差分升级包的流程。It should be noted that, the generating process of the foregoing third differential upgrade package may be performed on the server, and before the generating, the first differential upgrade package needs to be uploaded to the server, when the server receives the first differential upgrade package. , the process of generating the third differential upgrade package described above can be triggered.
可选地,上述方法还包括:生成所述第三差分升级包后,删除上述第二差分升级包。Optionally, the method further includes: deleting the second differential upgrade package after the third differential upgrade package is generated.
举个例子:第一版本为版本1,第二版本为版本2,第三版本为版本4;客户端需要将版本1升级至版本4,而服务器上存储有版本1升级至版本2的差分升级包(相当于上述的第二差分升级包),当服务器接收到版本2到版本4的差分升级包(相当于上述的第一差分升级包)时,触发生成版本1到版本4的差分升级包(相当于上述的第三差分升级包),在生成之后,保留第一差分升级包,第三差分升级包,而删除第二差分升级包,这样服务器中存储有版本1和版本2分别到版本4的差分升级包,而不存储中间版本之间的差分升级包,比如版本1和2之间的差分升级包,即服务器存储了所有旧版本到最新版本的差分升级包,当客户端需要升级时,直接将下发对应版本最新的差分升级包给客户端即可。For example: the first version is version 1, the second version is version 2, the third version is version 4; the client needs to upgrade version 1 to version 4, and the server stores a version 1 upgrade to version 2 differential upgrade. The package (equivalent to the second differential upgrade package described above) triggers generation of a differential upgrade package of version 1 to version 4 when the server receives a version 2 to version 4 differential upgrade package (equivalent to the first differential upgrade package described above). (equivalent to the third differential upgrade package described above), after the generation, retain the first differential upgrade package, the third differential upgrade package, and delete the second differential upgrade package, so that the server stores version 1 and version 2 respectively to the version. 4 differential upgrade package, without storing the differential upgrade package between the intermediate versions, such as the differential upgrade package between versions 1 and 2, that is, the server stores all the old versions to the latest version of the differential upgrade package, when the client needs to be upgraded At that time, the latest differential upgrade package of the corresponding version can be directly sent to the client.
在本发明实施例中,服务器中不需要将所有版本都放到服务器上,也不需要在客户端请求升级时将需要的升级包打包在一起下发给客户端,而只需要将差分升级包存储在服务器中,并在需要升级至最新版本时,生成所有旧版本到最新版本的差分升级包,将对应版本的最新的差分升级包下发给客户端,这样节省了服务器大量的存储空间,降低了服务器的维护的成本,同时还具有差分升级的优势。In the embodiment of the present invention, the server does not need to put all the versions on the server, and the upgrade package is not required to be packaged and sent to the client when the client requests the upgrade, but only the differential upgrade package is needed. Stored in the server, and when you need to upgrade to the latest version, generate all the differential upgrade packages from the old version to the latest version, and deliver the latest differential upgrade package of the corresponding version to the client, which saves a lot of storage space of the server. Reduces the cost of server maintenance while also providing the advantage of differential upgrades.
在本发明实施例中,可以通过以下方式生成第三差分升级包:In the embodiment of the present invention, the third differential upgrade package may be generated in the following manner:
读取第二差分升级包中第二替换数据的位置及长度,得到第二替换数据在第二版本中对应的第二差异数据的位置及长度;其中,第二替换数据是第一版本中被第二版本替换的数据;第二差异数据是第二版本相对于第一版本的差异数据;Reading the position and length of the second replacement data in the second differential upgrade package, and obtaining the position and length of the second difference data corresponding to the second replacement data in the second version; wherein the second replacement data is the first version The second version replaces the data; the second difference data is the difference data of the second version relative to the first version;
读取第一差分升级包中第一替换数据的位置及长度,得到第一替换数据在第二版本中对应的第一差异数据的位置及长度;其中,第一替换数据是第二版本中被第三版本替换的数据;第一差异数据是第三版本相对于第二版本 的差异数据;Reading the position and length of the first replacement data in the first differential upgrade package, and obtaining the position and length of the first difference data corresponding to the first replacement data in the second version; wherein the first replacement data is the second version The third version replaces the data; the first difference data is the third version relative to the second version Difference data;
根据第二替换数据的位置及长度、第二差异数据、第一替换数据的位置及长度和第一差异数据,生成第三差分升级包。And generating a third differential upgrade package according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data.
在上文及后文对生成第三差分升级包的过程或方式的描述中,第一版本、第二版本、第三版本均是指所述指定软件的版本。在本发明实施例中,上述根据第二替换数据的位置及长度、第二差异数据、第一替换数据的位置及长度和第一差异数据,生成第三差分升级包可以包括:In the above description of the process or manner of generating the third differential upgrade package, the first version, the second version, and the third version all refer to the version of the specified software. In the embodiment of the present invention, the generating the third differential upgrade package according to the location and the length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data may include:
若在第二差异数据的位置范围内存在第一差异数据,则将第一差异数据合成到第二差异数据中得到第三差分升级包对应的第三差异数据,所述第三差异数据是所述第三版本相对于所述第一版本的差异数据;其中,第二差异数据的位置范围的第一端点为第二差异数据的起始位置,位置范围的长度为第二差异数据的长度;If the first difference data exists in the location range of the second difference data, the first difference data is synthesized into the second difference data to obtain third difference data corresponding to the third differential upgrade package, where the third difference data is The difference data of the third version relative to the first version; wherein the first end point of the position range of the second difference data is the start position of the second difference data, and the length of the position range is the length of the second difference data ;
在第二差异数据的位置范围内存在第一差异数据的情况下,通过以下方式确定第三差分升级包中的第三替换数据的位置,其中,第三替换数据是第一版本中被第三版本替换的数据:当第一替换数据的起始位置在第二替换数据的位置范围内时,第三替换数据的起始位置为第二替换数据的起始位置;当第一替换数据的起始位置小于第二替换数据的起始位置时,第三替换数据的起始位置为第一替换数据的起始位置与第二版本相对于第一版本增加的长度之差;In the case where the first difference data exists within the location range of the second difference data, the location of the third replacement data in the third differential upgrade package is determined by the third mode, wherein the third replacement data is the third version in the first version Version-replaced data: when the starting position of the first replacement data is within the position range of the second replacement data, the starting position of the third replacement data is the starting position of the second replacement data; when the first replacement data starts When the start position is smaller than the start position of the second replacement data, the start position of the third replacement data is the difference between the start position of the first replacement data and the length of the second version relative to the first version;
在第二差异数据的位置范围内存在第一差异数据的情况下,通过以下方式确定第三替换数据的长度:当第一替换数据的起始位置在第二替换数据的位置范围内时,第三替换数据的长度为第二替换数据的长度;当第一替换数据的起始位置小于第二替换数据的起始位置时,第三替换数据的长度为第一替换数据的长度超出第二差异数据的结束位置的长度与第二替换数据的长度之和;其中,第二替换数据的位置范围的第一端点为第二差异数据的起始位置,第二替换数据的位置范围的长度为第二差异数据的长度。In the case where the first difference data exists within the position range of the second difference data, the length of the third replacement data is determined by: when the starting position of the first replacement data is within the position range of the second replacement data, The length of the third replacement data is the length of the second replacement data; when the starting position of the first replacement data is smaller than the starting position of the second replacement data, the length of the third replacement data is the length of the first replacement data exceeds the second difference a sum of a length of the end position of the data and a length of the second replacement data; wherein the first end point of the position range of the second replacement data is the start position of the second difference data, and the length of the position range of the second replacement data is The length of the second difference data.
在本发明实施例中,将第一差异数据合成到第二差异数据中得到第三差分数据可以包括:将第一差异数据与第二差异数据的重叠的差异数据以及第二差异数据中除了重叠的差异数据之外的剩余差异数据组成第三差异数据。 In the embodiment of the present invention, the synthesizing the first difference data into the second difference data to obtain the third difference data may include: overlapping the difference data of the first difference data and the second difference data, and overlapping the second difference data The remaining difference data other than the difference data constitutes the third difference data.
在本发明实施例中,根据第二替换数据的位置及长度、第二差异数据、第一替换数据的位置及长度和第一差异数据,生成第三差分升级包可以包括:若在第二差异数据的位置范围内不存在第一差异数据,则将第一差异数据插入到第二差异数据中得到第三差分升级包对应的第三差异数据;其中,第三差异数据是第三版本相对于第一版本的差异数据;所述第二差异数据的位置范围的起始端点为所述第二差异数据的起始位置,所述位置范围的长度为所述第二差异数据的长度;In the embodiment of the present invention, generating the third differential upgrade package according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data may include: if the second difference is If the first difference data does not exist in the location range of the data, the first difference data is inserted into the second difference data to obtain third difference data corresponding to the third differential upgrade package; wherein the third difference data is the third version relative to a difference data of the first version; a starting end point of the position range of the second difference data is a starting position of the second difference data, and a length of the position range is a length of the second difference data;
根据第一替换数据的起始位置与第二替换数据的起始位置的变化值确定第三差分升级包中的第三替换数据的起始位置;其中,第三替换数据是第一版本中被第三版本替换的数据;将第一替换数据的长度作为第三替换数据的长度。Determining a starting position of the third replacement data in the third differential upgrade package according to a change value of the start position of the first replacement data and the start position of the second replacement data; wherein the third replacement data is the first version The third version replaces the data; the length of the first replacement data is taken as the length of the third replacement data.
在本发明实施例中,将第一差异数据插入到第二差异数据中得到第三差异数据可以包括:将第一差异数据作为第三差异数据。In the embodiment of the present invention, inserting the first difference data into the second difference data to obtain the third difference data may include: using the first difference data as the third difference data.
在本实施例中提供了一种升级方法,图2是根据本发明实施例的升级方法的流程图,如图2所示,该流程包括如下步骤S202~S204:An upgrade method is provided in this embodiment. FIG. 2 is a flowchart of an upgrade method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps S202-S204:
步骤S202,接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;其中第三差分升级包为所述服务器通过第一差分升级包和服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,其中,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本;Step S202: Receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server, where the third differential upgrade package is a second differential upgrade that is pre-stored by the server by using the first differential upgrade package and the server. Packet generation, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software to the The second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version;
步骤S204,根据所述第三差分升级包将所述指定软件的所述第一版本升级至所述第三版本。Step S204, upgrading the first version of the specified software to the third version according to the third differential upgrade package.
所述步骤S202~S204可以但不限于由客户端或客户端所在的终端执行。The steps S202-S204 may be, but are not limited to, being performed by a terminal where the client or the client is located.
需要说明的是,上述第三差分升级包的生成过程可以是在服务器上完成的,在生成之前,需要将上述第一差分升级包上传到服务器上,当服务器接收到该第一差分升级包时,可以触发生成上述第三差分升级包的流程。It should be noted that, the generating process of the foregoing third differential upgrade package may be performed on the server, and before the generating, the first differential upgrade package needs to be uploaded to the server, when the server receives the first differential upgrade package. , the process of generating the third differential upgrade package described above can be triggered.
需要说明的是,在服务器生成上述第三差分升级包后,还可以删除第二 差分升级包。It should be noted that after the server generates the third differential upgrade package, the second may also be deleted. Differential upgrade package.
举个例子:第一版本为版本1,第二版本为版本2,第三版本为版本4;客户端需要将版本1升级至版本4,而服务器上存储有版本1升级至版本2的差分升级包(相当于上述的第二差分升级包),当服务器接收到版本2到版本4的差分升级包(相当于上述的第一差分升级包)时,触发生成版本1到版本4的差分升级包(相当于上述的第三差分升级包),在生成之后,保留第一差分升级包,第三差分升级包,而删除第二差分升级包,这样服务器中存储有版本1和版本2分别到版本4的差分升级包,而不存储中间版本之间的差分升级包,比如版本1和2之间的差分升级包,即服务器存储了所有旧版本到最新版本的差分升级包,当客户端需要升级时,直接将下发对应版本(即本例中的版本1)最新的差分升级包(即本例中的第三差分升级包)给客户端,客户端根据该最新的差分升级包进行升级即可。For example: the first version is version 1, the second version is version 2, the third version is version 4; the client needs to upgrade version 1 to version 4, and the server stores a version 1 upgrade to version 2 differential upgrade. The package (equivalent to the second differential upgrade package described above) triggers generation of a differential upgrade package of version 1 to version 4 when the server receives a version 2 to version 4 differential upgrade package (equivalent to the first differential upgrade package described above). (equivalent to the third differential upgrade package described above), after the generation, retain the first differential upgrade package, the third differential upgrade package, and delete the second differential upgrade package, so that the server stores version 1 and version 2 respectively to the version. 4 differential upgrade package, without storing the differential upgrade package between the intermediate versions, such as the differential upgrade package between versions 1 and 2, that is, the server stores all the old versions to the latest version of the differential upgrade package, when the client needs to be upgraded The latest differential upgrade package (that is, the third differential upgrade package in this example) of the corresponding version (that is, version 1 in this example) is directly sent to the client, and the client is upgraded according to the latest differential upgrade package. It can be.
在本发明实施例中,服务器中不需要将所有版本都放到服务器上,也不需要在客户端请求升级时将需要的升级包打包在一起下发给客户端,而只需要将差分升级包存储在服务器中,并在需要升级至最新版本时,生成所有旧版本到最新版本的差分升级包,将对应版本的最新的差分升级包下发给客户端,客户端根据该最新的差分升级包进行升级即可,这样节省了服务器大量的存储空间,降低了服务器的维护的成本,同时还具有差分升级的优势。In the embodiment of the present invention, the server does not need to put all the versions on the server, and the upgrade package is not required to be packaged and sent to the client when the client requests the upgrade, but only the differential upgrade package is needed. Stored in the server, and when needed to upgrade to the latest version, generate a differential upgrade package from all the old versions to the latest version, and deliver the latest differential upgrade package of the corresponding version to the client, according to the latest differential upgrade package. Upgrade can save a lot of storage space, reduce the cost of server maintenance, and also have the advantage of differential upgrade.
对于服务器通过上述第一差分升级包和第二差分升级包生成第三差分升级包的方法与上述图1所示实施例的生成方法相同,此处不再赘述。The method for generating the third differential upgrade package by the server through the foregoing first differential upgrade package and the second differential upgrade package is the same as the method for generating the embodiment shown in FIG. 1 , and details are not described herein again.
为了更好的理解本发明实施例,以下结合可选实施例对本发明实施例进行解释。For a better understanding of the embodiments of the present invention, the embodiments of the present invention are explained below in conjunction with the alternative embodiments.
本发明实施例提供了一种可选的差分升级包的处理方法:为了便于方法说明,假设用V1、V2、V3表示三个版本,其中V1为最旧的版本,V3为最新的版本。V1-V2表示V1到V2的差分升级包(相当于图1所示实施例中的第二差分升级包),V2-V3表示V2到V3的差分升级包(相当于图1所示实施例中的第一差分升级包),V1-V3表示V1到V3的差分升级包(相当于图1所示实施例中的第三差分升级包)。The embodiment of the present invention provides an optional differential upgrade package processing method. For the convenience of the method description, it is assumed that three versions are represented by V1, V2, and V3, where V1 is the oldest version and V3 is the latest version. V1-V2 represents a differential upgrade package of V1 to V2 (corresponding to the second differential upgrade package in the embodiment shown in FIG. 1), and V2-V3 represents a differential upgrade package of V2 to V3 (corresponding to the embodiment shown in FIG. 1) The first differential upgrade package), V1-V3 represents a differential upgrade package of V1 to V3 (corresponding to the third differential upgrade package in the embodiment shown in FIG. 1).
对于差分升级包,其补丁数据结构可以分为(差异数据位置,差异数据 长度,差异数据)和(增加数据位置,增加数据长度,差异数据),以下将上述两种数据结构统称为补丁数据位置及长度,以及差异数据。图3是根据本发明可选实施例的差分升级包的制作方法的流程示意图,如图3所示,该方法主要步骤包括如下S302~S306:For differential upgrade packages, the patch data structure can be divided into (differential data location, difference data) Length, difference data) and (increase data position, increase data length, difference data), the following two data structures are collectively referred to as patch data position and length, and difference data. FIG. 3 is a schematic flowchart of a method for fabricating a differential upgrade package according to an alternative embodiment of the present invention. As shown in FIG. 3, the main steps of the method include the following S302-S306:
步骤S302,读取V1-V2差分升级包中差分文件的补丁数据位置及长度(相当于图1所示实施例中的第二替换数据的位置及长度),得到在V2版本对应文件中的位置及长度(相当于图1所示实施例中的第二差异数据的位置及长度),并记录;Step S302, reading the position and length of the patch data of the difference file in the V1-V2 differential upgrade package (corresponding to the position and length of the second replacement data in the embodiment shown in FIG. 1), and obtaining the position in the corresponding file in the V2 version. And length (corresponding to the position and length of the second difference data in the embodiment shown in FIG. 1), and recorded;
步骤S304,读取V2-V3差分升级包中相同差分文件的补丁数据位置及长度(相当于图1所示实施例中的第一替换数据的位置及长度),得到在V3版本对应文件中的位置及长度(相当于图1所示实施例中的第一差异数据的位置及长度),并记录;Step S304, reading the patch data position and length of the same differential file in the V2-V3 differential upgrade package (corresponding to the position and length of the first replacement data in the embodiment shown in FIG. 1), and obtaining the corresponding file in the V3 version corresponding file. Position and length (corresponding to the position and length of the first difference data in the embodiment shown in FIG. 1), and recording;
然后按照如下方式合成新的补丁数据:根据步骤S302记录的V1-V2差分升级包中差分文件的补丁数据在V2对应文件中的位置及长度(相当于图1所示实施例中的第二差异数据的位置范围)进行判断,如果V3中对应文件在该位置开始的长度范围内(相当于图1所示实施例中的第二差异数据的位置范围内)存在补丁数据(相当于图1所示实施例中的第一差异数据),则将V3对应文件的补丁数据(相当于图1所示实施例中的第一差异数据)合成到V2对应文件的补丁数据(相当于图1所示实施例中的第二差异数据)中,如果V3中应文件的补丁数据(相当于图1所示实施例中的第一差异数据)没有在V1-V2差分升级包中差分文件的补丁数据在V2对应文件中的位置范围(相当于图1所示实施例中的第二差异数据的位置范围)内,则将该补丁数据(相当于图1所示实施例中的第一差异数据)作为新的补丁数据插入。Then, the new patch data is synthesized as follows: the position and length of the patch data of the difference file in the V1-V2 differential upgrade package recorded in step S302 in the V2 corresponding file (corresponding to the second difference in the embodiment shown in FIG. 1) The position range of the data is determined. If the corresponding file in V3 is within the length range starting from the position (corresponding to the position range of the second difference data in the embodiment shown in FIG. 1), there is patch data (corresponding to FIG. 1). In the first difference data in the embodiment, the patch data of the V3 corresponding file (corresponding to the first difference data in the embodiment shown in FIG. 1) is synthesized into the patch data of the V2 corresponding file (corresponding to FIG. 1). In the second difference data in the embodiment, if the patch data of the file in V3 (corresponding to the first difference data in the embodiment shown in FIG. 1) does not have the patch data of the difference file in the V1-V2 differential upgrade package at The V2 corresponds to the position range in the file (corresponding to the position range of the second difference data in the embodiment shown in FIG. 1), and the patch data (corresponding to the first difference data in the embodiment shown in FIG. 1) is taken as New patch data Into.
步骤S306,生成V1-V3的差分升级包(相当于图1所示实施例中的第三差分升级包)。Step S306, generating a differential upgrade package of V1-V3 (corresponding to the third differential upgrade package in the embodiment shown in FIG. 1).
上述步骤S304中,新的补丁数据(相当于图1所示实施例中的第三差分升级包对应的第三替换数据和第三差异数据)根据不同情况生成方式也不同,图4是根据本发明实施例提供的第三差分升级包中的补丁数据的生成示意图,如图4所示,流程如下:左侧图中v1-v2表示在V1版本中需要被替换的 数据的位置及长度(相当于图1所示实施例中的第二替换数据的位置及长度),v2表示V2相对于V1的差异数据(相当于图1所示实施例中的第二差异数据),v2-v3表示在v2版本中需要被替换的数据的位置及长度(相当于图1所示实施例中的第一替换数据的位置及长度)。v1表示V3相对于V2的差异数据(相当于图1所示实施例中的第一差异数据)。右侧图中表示新生成的差分升级包,v1-v3表示在V1版本中需要被替换的数据的位置及长度(相当于图1所示实施例中的第三替换数据的位置及长度),v3表示V3相对于V1的差异数据(相当于图1所示实施例中的第三差异数据)。In the above step S304, the new patch data (corresponding to the third replacement data and the third difference data corresponding to the third differential upgrade package in the embodiment shown in FIG. 1) are also different according to different situations, and FIG. 4 is based on the present invention. A schematic diagram of generating patch data in the third differential upgrade package provided by the embodiment of the present invention is as shown in FIG. 4. The flow is as follows: v1-v2 in the left figure indicates that the V1 version needs to be replaced. The position and length of the data (corresponding to the position and length of the second replacement data in the embodiment shown in FIG. 1), and v2 represents the difference data of V2 with respect to V1 (corresponding to the second difference data in the embodiment shown in FIG. 1) ), v2-v3 indicates the position and length of the data to be replaced in the v2 version (corresponding to the position and length of the first replacement data in the embodiment shown in FIG. 1). V1 represents the difference data of V3 with respect to V2 (corresponding to the first difference data in the embodiment shown in Fig. 1). The newly generated differential upgrade package is shown in the right figure, and v1-v3 indicates the position and length of the data to be replaced in the V1 version (corresponding to the position and length of the third replacement data in the embodiment shown in FIG. 1). V3 represents the difference data of V3 with respect to V1 (corresponding to the third difference data in the embodiment shown in Fig. 1).
如果v1-v2和v2-v3存在数据交叉,则v1-v3的起始位置及长度由v1-v2,v2及v2-v3来确定,位置确定方法:如果v2-v3起始位置在v2的范围内,则v1-v3的起始位置为v1-v2的起始位置;如果v2-v3起始位置在v2左侧,则v1-v3的起始位置为v2-v3的起始位置减去当前V2中相对于V1中增加的长度;长度确定方法:如果v2-v3长度在v2范围内则最终长度即为v1-v2的长度,如果v2-v3长度在v2的范围外则最终长度为v1-v2的长度加上v2-v3超出v2的结束位置的长度。V3相对于V1的差异数据由V2相对于V1的差异数据,和V3相对于V2的差异数据合并得到,合并方式如下:将V3相对于V2的差异数据覆盖到V2相对于V1的差异数据重叠部分,剩余部分直接使用。If there is data intersection between v1-v2 and v2-v3, the starting position and length of v1-v3 are determined by v1-v2, v2 and v2-v3, and the position determining method: if the starting position of v2-v3 is in the range of v2 Inside, the starting position of v1-v3 is the starting position of v1-v2; if the starting position of v2-v3 is to the left of v2, the starting position of v1-v3 is the starting position of v2-v3 minus the current position The length of V2 is increased relative to V1; the length is determined by the method: if the length of v2-v3 is in the range of v2, the final length is the length of v1-v2. If the length of v2-v3 is outside the range of v2, the final length is v1- The length of v2 plus the length of v2-v3 beyond the end position of v2. The difference data of V3 with respect to V1 is obtained by combining the difference data of V2 with respect to V1 and the difference data of V3 with respect to V2, and the combination is as follows: the difference data of V3 with respect to V2 is covered to the overlap of the difference data of V2 with respect to V1 The rest is used directly.
如果v1-v2和v2-v3不存在数据交叉,则v1-v3的起始位置由v2-v3的起始位置对应于V2当前位置相对于V1改变了多少获得。数据长度及差异数据保持为v2-v3的。If there is no data intersection between v1-v2 and v2-v3, the starting position of v1-v3 is obtained by how much the starting position of v2-v3 corresponds to how the current position of V2 changes relative to V1. The data length and difference data are kept as v2-v3.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更普遍的实施方式。基于这样的理解,本发明实施例的技术方案本质上或者说做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括一条或多条指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A more general implementation. Based on such understanding, the essential or contributing portion of the technical solution of the embodiments of the present invention may be embodied in the form of a software product stored in a storage medium (such as a ROM/RAM, a magnetic disk, or a magnetic disk). The method includes the one or more instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present invention.
在本发明实施例中还提供了一种升级系统,该系统用于实现上述实施例 及可选实施方式,已经进行过说明的不再赘述。An upgrade system is further provided in the embodiment of the present invention, and the system is used to implement the foregoing embodiment. And optional embodiments, which have already been described, are not described again.
图5是根据本发明实施例提供的升级系统的示意图,如图5所示,该系统包括:服务器52,客户端54;所述客户端54设置成向所述服务器52发送将指定软件的第一版本升级至第三版本的升级请求;所述服务器52设置成存储所述指定软件的第一版本到第二版本的第二差分升级包,在接收到所述指定软件的第二版本到第三版本的第一差分升级包时,触发生成所述指定软件的第一版本到第三版本的第三差分升级包;以及接收到所述升级请求时将所述第三差分升级包下发至所述客户端54。5 is a schematic diagram of an upgrade system according to an embodiment of the present invention. As shown in FIG. 5, the system includes: a server 52, a client 54; the client 54 is configured to send a message to the server 52 that specifies software. Upgrading a version to a third version of the upgrade request; the server 52 is configured to store a second differential upgrade package of the first version to the second version of the specified software, upon receiving the second version of the specified software to the first The third differential upgrade package of the third version is triggered to generate a third differential upgrade package of the first version to the third version of the specified software; and the third differential upgrade package is sent to the upgrade request when the upgrade request is received The client 54.
通过上述系统,采用在客户端54需要从第一版本升级至第三版本的情况下,服务器52通过第二版本到第三版本的第一差分升级包和预先存储的第一版本到第二版本的第二差分升级包来生成从第一版本升级至第三版本的第三差分升级包,然后直接将第三差分升级包下发给客户端54的方案,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。With the above system, in the case where the client 54 needs to be upgraded from the first version to the third version, the server 52 passes the first differential upgrade package of the second version to the third version and the pre-stored first version to the second version. The second differential upgrade package is configured to generate a third differential upgrade package that is upgraded from the first version to the third version, and then directly delivers the third differential upgrade package to the client 54 to solve the related art upgrade package creation and The problem of maintaining a large workload has reduced the workload of the upgrade package production and maintenance, improved the efficiency of the version upgrade, and reduced the maintenance cost.
在本发明实施例中,上述服务器52还可以设置成在生成第三差分升级包之后,删除第二差分升级包。In the embodiment of the present invention, the server 52 may be further configured to delete the second differential upgrade package after generating the third differential upgrade package.
举个例子:第一版本为版本1,第二版本为版本2,第三版本为版本4;客户端54需要将版本1升级至版本4,而服务器52上存储有版本1升级至版本2的差分升级包(相当于上述的第二差分升级包),当服务器52接收到版本2到版本4的差分升级包(相当于上述的第一差分升级包)时,触发生成版本1到版本4的差分升级包(相当于上述的第三差分升级包),在生成之后,保留第一差分升级包,第三差分升级包,而删除第二差分升级包,这样服务器52中存储有版本1和版本2分别到版本4的差分升级包,而不存储中间版本之间的差分升级包,比如版本1和2之间的差分升级包,即服务器52存储了所有旧版本到最新版本的差分升级包,当客户端54需要升级时,直接将下发对应版本最新的差分升级包给客户端54即可。For example: the first version is version 1, the second version is version 2, the third version is version 4; the client 54 needs to upgrade version 1 to version 4, and the server 52 stores version 1 upgrade to version 2 a differential upgrade package (corresponding to the second differential upgrade package described above), when the server 52 receives the version 2 to version 4 differential upgrade package (corresponding to the first differential upgrade package described above), triggering generation of version 1 to version 4 The differential upgrade package (equivalent to the third differential upgrade package described above), after the generation, retains the first differential upgrade package, the third differential upgrade package, and deletes the second differential upgrade package, so that the server 52 stores the version 1 and the version. 2 separately to the version 4 differential upgrade package, without storing the differential upgrade package between the intermediate versions, such as the differential upgrade package between versions 1 and 2, that is, the server 52 stores all the old versions to the latest version of the differential upgrade package. When the client 54 needs to be upgraded, the latest differential upgrade package of the corresponding version is directly sent to the client 54.
在本发明实施例中,服务器52中不需要将所有版本都放到服务器52上,也不需要在客户端54请求升级时将需要的升级包打包在一起下发给客户端54,而只需要将差分升级包存储在服务器52中,并在需要升级至最新版本时, 生成所有旧版本到最新版本的差分升级包,将对应版本的最新的差分升级包下发给客户端54,这样节省了服务器52大量的存储空间,降低了服务器52的维护的成本,同时还具有差分升级的优势。In the embodiment of the present invention, the server 52 does not need to put all the versions on the server 52, and the upgrade package is not required to be packaged and sent to the client 54 when the client 54 requests the upgrade. The differential upgrade package is stored in the server 52 and when it is necessary to upgrade to the latest version, The differential upgrade package of all the old versions to the latest version is generated, and the latest differential upgrade package of the corresponding version is sent to the client 54, which saves a large amount of storage space of the server 52, reduces the maintenance cost of the server 52, and also has The advantages of differential upgrades.
对于服务器生成第三差分升级包的过程,与上述实施例中的生成方式相同,此处不再赘述。The process of generating the third differential upgrade package is the same as that in the foregoing embodiment, and details are not described herein again.
在本实施例中还提供了一种差分升级包的处理装置,该装置设置成实现上述实施例,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以为实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置普遍地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In the embodiment, a processing device for the differential upgrade package is further provided, and the device is configured to implement the foregoing embodiment, and details are not described herein. As used below, the term "module" can be a combination of software and/or hardware that implements a predetermined function. Although the devices described in the following embodiments are generally implemented in software, hardware, or a combination of software and hardware, is also possible and conceivable.
图6是根据本发明实施例的差分升级包的处理装置的结构框图,如图6所示,该装置包括:FIG. 6 is a structural block diagram of a processing apparatus of a differential upgrade package according to an embodiment of the present invention. As shown in FIG. 6, the apparatus includes:
第一接收模块62,设置成接收客户端发送的升级请求;其中,所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;The first receiving module 62 is configured to receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
发送模块64,与上述接收模块62连接,设置成将所述指定软件的第一版本到第三版本的第三差分升级包下发给所述客户端,其中,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到第三版本的差分升级包,所述第二差分升级包为第一版本到第二版本的差分升级包,其中,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。The sending module 64 is connected to the receiving module 62, and is configured to send the third differential upgrade package of the first version to the third version of the specified software to the client, where the third differential upgrade package passes a first differential upgrade package and a pre-stored second differential upgrade package, wherein the first differential upgrade package is a differential upgrade package of the second version to the third version of the specified software, and the second differential upgrade package is A version to a second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version.
通过上述装置,采用在接收模块62接收到客户端需要从第一版本升级至第三版本的请求的情况下,通过第二版本到第三版本的第一差分升级包,和预先存储的第一版本到第二版本的第二差分升级包,来生成从第一版本升级至第三版本的第三差分升级包,然后发送模块64直接将第三差分升级包下发给客户端54的方案,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。Through the above apparatus, in the case that the receiving module 62 receives the request that the client needs to upgrade from the first version to the third version, the first differential upgrade package through the second version to the third version, and the first stored in advance The second differential upgrade package of the version to the second version is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the sending module 64 directly delivers the third differential upgrade package to the client 54. The invention solves the problem that the workload of the upgrade package production and maintenance in the related art is large, and achieves the purpose of reducing the workload of the upgrade package production and maintenance, improves the efficiency of the version upgrade, and reduces the maintenance cost.
需要说明的是,上述装置可以应用在服务器上,也可以应用其他设备上, 但不限于此。It should be noted that the foregoing device may be applied to a server or may be applied to other devices. But it is not limited to this.
在本发明实施例中,上述装置还可以包括:删除模块,设置成在所述第三差分升级包生成后,删除第二差分升级包。In the embodiment of the present invention, the apparatus may further include: a deleting module, configured to delete the second differential upgrade package after the third differential upgrade package is generated.
对于生成第三差分升级包的过程,与上述实施例中的生成方式相同,此处不再赘述。The process of generating the third differential upgrade package is the same as that in the foregoing embodiment, and details are not described herein again.
在本实施例中还提供了一种升级装置,图7是根据本发明实施例提供的升级装置的结构框图,如图7所示,该装置包括:An upgrade device is also provided in this embodiment. FIG. 7 is a structural block diagram of an upgrade device according to an embodiment of the present invention. As shown in FIG. 7, the device includes:
第二接收模块72,设置成接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;其中所述第三差分升级包为所述服务器通过第一差分升级包和所述服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到第三版本的差分升级包,所述第二差分升级包为所述指定软件的第一版本到第二版本的差分升级包,其中,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本;The second receiving module 72 is configured to receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server, where the third differential upgrade package is the first differential upgrade package and the server Generating a second differential upgrade package pre-stored by the server, where the first differential upgrade package is a differential upgrade package of the second version to the third version of the specified software, and the second differential upgrade package is the specified software a differential upgrade package of the first version to the second version, wherein the third version is higher than the second version, and the second version is higher than the first version;
升级模块74,设置成根据所述第三差分升级包将所述指定软件的第一版本升级至第三版本。The upgrade module 74 is configured to upgrade the first version of the specified software to the third version according to the third differential upgrade package.
需要说明的是,上述装置可以设置于客户端。It should be noted that the above device may be disposed on the client.
通过上述装置,采用在接收模块72接收到服务器下发的从第一版本升级至第三版本的第三差分升级包,其中,该第三差分升级包是服务器通过第二版本到第三版本的第一差分升级包和预先存储的第一版本到第二版本的第二差分升级包来生成,升级版本74根据该第三差分升级包将第一版本升级到第三版本的方案,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。Through the foregoing apparatus, the third differential upgrade package that is upgraded from the first version to the third version issued by the server is received by the receiving module 72, wherein the third differential upgrade package is the server that passes the second version to the third version. The first differential upgrade package and the pre-stored first version to the second version of the second differential upgrade package are generated, and the upgrade version 74 is based on the third differential upgrade package to upgrade the first version to the third version, and the related solution is solved. In the technology, the problem of large amount of production and maintenance of the upgrade package has achieved the purpose of reducing the workload of the upgrade package production and maintenance, improving the efficiency of the version upgrade and reducing the maintenance cost.
对于服务器生成第三差分升级包的过程,与上述实施例中的生成方式相同,此处不再赘述。The process of generating the third differential upgrade package is the same as that in the foregoing embodiment, and details are not described herein again.
为了更好的理解本发明实施例,以下结合可选的实施例对本发明实施例进行解释。For a better understanding of the embodiments of the present invention, the embodiments of the present invention are explained below in conjunction with the optional embodiments.
本发明实施例提供了一个可选的升级系统;该升级系统包括:升级包制 作工具,客户端,服务器。图8是根据本发明可选实施例的升级系统对差分升级包的处理流程图,如图8所示,该处理流程包括如下步骤S802~S808:An embodiment of the present invention provides an optional upgrade system; the upgrade system includes: an upgrade package system As a tool, client, server. FIG. 8 is a flowchart of processing a differential upgrade package by an upgrade system according to an alternative embodiment of the present invention. As shown in FIG. 8, the process flow includes the following steps S802-S808:
步骤S802,上传最新版本与前一版本的差分升级包;Step S802, uploading a differential upgrade package of the latest version and the previous version;
步骤S804,服务器读取所有已存在的差分升级包;Step S804, the server reads all existing differential upgrade packages;
步骤S806,生成所有旧版本到最新版本的差分升级包;Step S806, generating a differential upgrade package of all the old versions to the latest version;
步骤S808,根据终端请求信息下发对应的升级包。Step S808: The corresponding upgrade package is delivered according to the terminal request information.
上述步骤介绍了升级包制作,服务器对升级包的处理,以及服务器对客户端的响应。升级包制作时只需要制作最新版本相对于前一版本的差分升级包(相当于上述实施例中的第一差分升级包),服务器对升级包的处理为服务器上如果已上传旧版本的差分升级包(相当于上述实施例中的第二差分升级包),当上传新版本的差分升级包(相当于上述实施例中的第一差分升级包)时,触发上述差分升级包制作工具,自动生成新的差分升级包(相当于上述实施例中的第三差分升级包),服务器对客户端的响应为客户端请求升级时服务器直接下发对应版本最新的差分升级包。例如服务器上当前有V1-V2的差分升级包,上传V2-V3的差分升级包时,则服务器根据V1-V2及V2-V3的差分升级包自动生成V1-V3的差分升级包同时删除V1-V2的差分升级包,保留V2-V3的差分升级包。目前服务器上存在V1-V3和V2-V3的差分升级包,当用户以V1检测升级包时则下发V1-V3的升级包,用户以V2检测升级包时则下发V2-V3的升级包。如果又上传了V3-V4的差分升级包,则服务器自动生成V1-V4、V2-V4的差分升级包并对相应的用户请求进行升级。The above steps describe the upgrade package creation, the server's handling of the upgrade package, and the server's response to the client. The upgrade package only needs to make the differential upgrade package of the latest version relative to the previous version (equivalent to the first differential upgrade package in the above embodiment), and the server processes the upgrade package as if the old version of the differential upgrade has been uploaded on the server. The packet (corresponding to the second differential upgrade package in the foregoing embodiment), when uploading a new version of the differential upgrade package (corresponding to the first differential upgrade package in the foregoing embodiment), triggering the differential upgrade package creation tool to automatically generate A new differential upgrade package (equivalent to the third differential upgrade package in the above embodiment), the server responds to the client, and the server directly delivers the latest differential upgrade package of the corresponding version when the client requests the upgrade. For example, if there is a V1-V2 differential upgrade package on the server and a V2-V3 differential upgrade package is uploaded, the server automatically generates a V1-V3 differential upgrade package according to the V1-V2 and V2-V3 differential upgrade packages and deletes V1-. The V2 differential upgrade package retains the V2-V3 differential upgrade package. Currently, there are V1-V3 and V2-V3 differential upgrade packages on the server. When the user detects the upgrade package with V1, the V1-V3 upgrade package is delivered. When the user detects the upgrade package with V2, the V2-V3 upgrade package is delivered. . If the V3-V4 differential upgrade package is uploaded, the server automatically generates a differential upgrade package for V1-V4 and V2-V4 and upgrades the corresponding user request.
需要说明的是,上述每个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述模块分别位于多个处理器中。It should be noted that each of the foregoing modules may be implemented by software or hardware. For the latter, the foregoing may be implemented by, but not limited to, the foregoing modules are all located in the same processor; or, the modules are located in multiple In the processor.
本发明实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的程序代码:The embodiment of the invention further provides a storage medium. Optionally, in the embodiment, the foregoing storage medium may be configured to store program code for performing the following steps:
S1,接收客户端发送的升级请求;其中,所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本; S1, receiving an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
S2,将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,其中,第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,其中,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。S2. The third differential upgrade package of the first version to the third version of the specified software is sent to the client, where the third differential upgrade package passes the first differential upgrade package and pre-stored a second differential upgrade package is generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first part of the specified software A version to the second version of the differential upgrade package, wherein the third version is higher than the second version, and the second version is higher than the first version.
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、ROM(Read-Only Memory,只读存储器)、RAM(Random Access Memory,随机存取存储器)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。Optionally, in this embodiment, the foregoing storage medium may include, but is not limited to, a USB flash drive, a ROM (Read-Only Memory), a RAM (Random Access Memory), a mobile hard disk, and a magnetic device. A variety of media that can store program code, such as a disc or a disc.
可选地,本实施例中的示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。For example, the examples in this embodiment may refer to the examples described in the foregoing embodiments and the optional embodiments, and details are not described herein again.
显然,本领域的技术人员应该明白,上述的本发明实施例的每个模块或每个步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明实施例不限制于任何特定的硬件和软件结合。It will be apparent to those skilled in the art that each module or step of the above-described embodiments of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device or distributed across multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device such that they may be stored in the storage device by the computing device and, in some cases, may be different The steps shown or described herein are performed sequentially, or they are separately fabricated into integrated circuit modules, or a plurality of modules or steps thereof are fabricated as a single integrated circuit module. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
工业实用性Industrial applicability
本发明实施例在客户端需要从第一版本升级至第三版本的情况下,通过第二版本到第三版本的第一差分升级包,和预先存储的第一版本到第二版本的第二差分升级包来生成从第一版本升级至第三版本的第三差分升级包,然后直接将第三差分升级包下发给客户端,解决了相关技术中升级包制作和维护工作量大的问题,达到了减少了升级包制作和维护的工作量的目的,提高了版本升级的效率,降低了维护的成本。 In the embodiment of the present invention, when the client needs to upgrade from the first version to the third version, the first differential upgrade package of the second version to the third version, and the pre-stored first version to the second version of the second version The differential upgrade package is used to generate a third differential upgrade package that is upgraded from the first version to the third version, and then the third differential upgrade package is directly delivered to the client, which solves the problem that the upgrade package is produced and maintained in the related art. The purpose of reducing the workload of the upgrade package production and maintenance is achieved, the efficiency of the version upgrade is improved, and the maintenance cost is reduced.

Claims (13)

  1. 一种差分升级包的处理方法,包括:A method for processing a differential upgrade package, comprising:
    接收客户端发送的升级请求;所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;Receiving an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
    将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。And sending, to the client, the third differential upgrade package of the first version to the third version of the specified software, where the third differential upgrade package passes the first differential upgrade package and the second pre-stored package a differential upgrade package is generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software To the second version of the differential upgrade package, the third version is higher than the second version, and the second version is higher than the first version.
  2. 根据权利要求1所述的方法,还包括:The method of claim 1 further comprising:
    生成所述第三差分升级包后,删除所述第二差分升级包。After the third differential upgrade package is generated, the second differential upgrade package is deleted.
  3. 根据权利要求1所述的方法,其中,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成包括:The method of claim 1, wherein the generating of the third differential upgrade package by the first differential upgrade package and the pre-stored second differential upgrade package comprises:
    读取所述第二差分升级包中第二替换数据的位置及长度,得到所述第二替换数据在所述第二版本中对应的第二差异数据的位置及长度;所述第二替换数据是所述第一版本中被所述第二版本替换的数据;所述第二差异数据是所述第二版本相对于所述第一版本的差异数据;Reading a position and a length of the second replacement data in the second differential upgrade package, and obtaining a position and a length of the second difference data corresponding to the second replacement data in the second version; the second replacement data Is data in the first version replaced by the second version; the second difference data is difference data of the second version relative to the first version;
    读取所述第一差分升级包中第一替换数据的位置及长度,得到所述第一替换数据在所述第二版本中对应的第一差异数据的位置及长度;其中,所述第一替换数据是所述第二版本中被所述第三版本替换的数据;所述第一差异数据是所述第三版本相对于所述第二版本的差异数据;Reading a position and a length of the first replacement data in the first differential upgrade package, and obtaining a position and a length of the first difference data corresponding to the first replacement data in the second version; wherein, the first The replacement data is data replaced by the third version in the second version; the first difference data is difference data of the third version relative to the second version;
    根据所述第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包。And generating the third differential upgrade package according to the location and length of the second replacement data, the second difference data, the location and length of the first replacement data, and the first difference data.
  4. 根据权利要求3所述的方法,其中,所述根据第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包包括:The method according to claim 3, wherein said generating is based on a position and length of said second replacement data, said second difference data, a position and length of said first replacement data, and said first difference data The third differential upgrade package includes:
    若在所述第二差异数据的位置范围内存在所述第一差异数据,则将所述 第一差异数据合成到所述第二差异数据中得到所述第三差分升级包对应的第三差异数据,所述第三差异数据是所述第三版本相对于所述第一版本的差异数据;所述第二差异数据的位置范围的第一端点为所述第二差异数据的起始位置,所述位置范围的长度为所述第二差异数据的长度;If the first difference data exists within a location range of the second difference data, the Combining the first difference data into the second difference data to obtain third difference data corresponding to the third differential upgrade package, where the third difference data is difference data of the third version relative to the first version a first end point of the location range of the second difference data is a start position of the second difference data, and a length of the location range is a length of the second difference data;
    在所述第二差异数据的位置范围内存在所述第一差异数据的情况下,通过以下方式确定所述第三差分升级包中的第三替换数据的起始位置,所述第三替换数据是所述第一版本中被所述第三版本替换的数据:当所述第一替换数据的起始位置在所述第二替换数据的位置范围内时,所述第三替换数据的起始位置为所述第二替换数据的起始位置;当所述第一替换数据的起始位置小于所述第二替换数据的起始位置时,所述第三替换数据的起始位置为所述第一替换数据的起始位置与所述第二版本相对于所述第一版本增加的长度之差;In a case where the first difference data exists in a location range of the second difference data, determining a start position of the third replacement data in the third differential upgrade package, the third replacement data Is data in the first version replaced by the third version: when the starting position of the first replacement data is within a range of positions of the second replacement data, the start of the third replacement data a position is a starting position of the second replacement data; when a starting position of the first replacement data is smaller than a starting position of the second replacement data, a starting position of the third replacement data is the a difference between a starting position of the first replacement data and an increased length of the second version relative to the first version;
    在所述第二差异数据的位置范围内存在所述第一差异数据的情况下,通过以下方式确定所述第三替换数据的长度:当所述第一替换数据的起始位置在所述第二替换数据的位置范围内时,所述第三替换数据的长度为所述第二替换数据的长度;当所述第一替换数据的起始位置小于所述第二替换数据的起始位置时,所述第三替换数据的长度为所述第一替换数据的长度超出所述第二差异数据的结束位置的长度与所述第二替换数据的长度之和;In a case where the first difference data exists in a range of the second difference data, determining a length of the third replacement data by: when a starting position of the first replacement data is in the When the location of the replacement data is within the range of the location, the length of the third replacement data is the length of the second replacement data; when the starting location of the first replacement data is less than the starting location of the second replacement data The length of the third replacement data is a sum of a length of the first replacement data exceeding a length of an end position of the second difference data and a length of the second replacement data;
    所述第二替换数据的位置范围的第一端点为所述第二差异数据的起始位置,所述第二替换数据的位置范围的长度为所述第二差异数据的长度。The first endpoint of the location range of the second replacement data is a start location of the second difference data, and the length of the location range of the second replacement data is a length of the second difference data.
  5. 根据权利要求4所述的方法,其中,所述将第一差异数据合成到所述第二差异数据中得到所述第三差分升级包对应的第三差分数据包括:The method of claim 4, wherein the synthesizing the first difference data into the second difference data to obtain the third differential data corresponding to the third differential upgrade package comprises:
    将所述第一差异数据与所述第二差异数据的重叠的差异数据以及所述第二差异数据中除了所述重叠的差异数据之外的剩余差异数据组成所述第三差异数据。The difference data of the overlap of the first difference data and the second difference data and the remaining difference data of the second difference data other than the overlap difference data constitute the third difference data.
  6. 根据权利要求3所述的方法,其中,所述根据第二替换数据的位置及长度、所述第二差异数据、所述第一替换数据的位置及长度和所述第一差异数据,生成所述第三差分升级包包括: The method according to claim 3, wherein said generating is based on a position and length of said second replacement data, said second difference data, a position and length of said first replacement data, and said first difference data The third differential upgrade package includes:
    若在所述第二差异数据的位置范围内不存在所述第一差异数据,则将所述第一差异数据插入到所述第二差异数据中得到所述第三差分升级包对应的第三差异数据;所述第三差异数据是所述第三版本相对于所述第一版本的差异数据;所述第二差异数据的位置范围的起始端点为所述第二差异数据的起始位置,所述位置范围的长度为所述第二差异数据的长度;If the first difference data does not exist in the location range of the second difference data, inserting the first difference data into the second difference data to obtain a third corresponding to the third differential upgrade package Difference data; the third difference data is difference data of the third version relative to the first version; a starting end point of a position range of the second difference data is a starting position of the second difference data The length of the location range is the length of the second difference data;
    根据所述第一替换数据的起始位置与所述第二替换数据的起始位置的变化值确定所述第三差分升级包中的第三替换数据的起始位置;所述第三替换数据是所述第一版本中被所述第三版本替换的数据;Determining a starting position of the third replacement data in the third differential upgrade package according to a change value of a start position of the first replacement data and a start position of the second replacement data; the third replacement data Is data in the first version that is replaced by the third version;
    将所述第一替换数据的长度作为所述第三替换数据的长度。The length of the first replacement data is taken as the length of the third replacement data.
  7. 根据权利要求6所述的方法,其中,将所述第一差异数据插入到所述第二差异数据中得到所述第三差异数据包括:The method according to claim 6, wherein the inserting the first difference data into the second difference data to obtain the third difference data comprises:
    将所述第一差异数据作为所述第三差异数据。The first difference data is taken as the third difference data.
  8. 一种升级方法,包括:An upgrade method that includes:
    接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;所述第三差分升级包为所述服务器通过第一差分升级包和所述服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本;Receiving a third differential upgrade package of the first version to the third version of the specified software delivered by the server; the third differential upgrade package is a second differential upgrade of the server through the first differential upgrade package and the server pre-stored Packet generation, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the first version of the specified software to the The second version of the differential upgrade package, the third version is higher than the second version, and the second version is higher than the first version;
    根据所述第三差分升级包将所述指定软件的所述第一版本升级至所述第三版本。Upgrading the first version of the specified software to the third version according to the third differential upgrade package.
  9. 一种升级系统,包括:服务器,客户端;An upgrade system, including: a server, a client;
    所述客户端设置成向所述服务器发送将指定软件的第一版本升级至第三版本的升级请求;The client is configured to send an upgrade request to the server to upgrade a first version of the specified software to a third version;
    所述服务器设置成存储所述指定软件的所述第一版本到第二版本的第二差分升级包,在接收到所述指定软件的所述第二版本到所述第三版本的第一差分升级包时,触发生成所述指定软件的所述第一版本到所述第三版本的第三差分升级包;以及接收到所述升级请求后将所述第三差分升级包下发至所 述客户端。The server is configured to store a second differential upgrade package of the first version to the second version of the specified software, and receive a first difference from the second version of the specified software to the third version When the package is upgraded, the third differential upgrade package that generates the first version of the specified software to the third version is triggered; and after the upgrade request is received, the third differential upgrade package is sent to the Said client.
  10. 根据权利要求9所述的系统,其中,The system of claim 9 wherein
    所述服务器,还设置成在生成所述第三差分升级包之后,删除所述第二差分升级包。The server is further configured to delete the second differential upgrade package after the third differential upgrade package is generated.
  11. 一种差分升级包的处理装置,包括:A processing device for a differential upgrade package, comprising:
    第一接收模块,设置成接收客户端发送的升级请求;所述升级请求用于指示所述客户端请求将指定软件的第一版本升级至第三版本;The first receiving module is configured to receive an upgrade request sent by the client, where the upgrade request is used to instruct the client to request to upgrade the first version of the specified software to the third version;
    发送模块,设置成将所述指定软件的所述第一版本到所述第三版本的第三差分升级包下发给所述客户端,所述第三差分升级包通过第一差分升级包和预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本。a sending module, configured to send the third differential upgrade package of the first version to the third version of the specified software to the client, where the third differential upgrade package passes the first differential upgrade package and Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software The differential upgrade package of the first version to the second version, the third version is higher than the second version, and the second version is higher than the first version.
  12. 根据权利要求11所述的装置,还包括:The apparatus of claim 11 further comprising:
    删除模块,设置成在所述第三差分升级包生成后,删除所述第二差分升级包。And deleting the module, configured to delete the second differential upgrade package after the third differential upgrade package is generated.
  13. 一种升级装置,包括:An upgrade device comprising:
    第二接收模块,设置成接收服务器下发的指定软件的第一版本到第三版本的第三差分升级包;所述第三差分升级包为所述服务器通过第一差分升级包和所述服务器预先存储的第二差分升级包生成,所述第一差分升级包为所述指定软件的第二版本到所述第三版本的差分升级包,所述第二差分升级包为所述指定软件的所述第一版本到所述第二版本的差分升级包,所述第三版本高于所述第二版本,所述第二版本高于所述第一版本;a second receiving module, configured to receive a third differential upgrade package of the first version to the third version of the specified software delivered by the server; the third differential upgrade package is the first differential upgrade package and the server by the server Pre-stored second differential upgrade package generated, the first differential upgrade package is a differential upgrade package of the second version of the specified software to the third version, and the second differential upgrade package is the designated software a differential upgrade package of the first version to the second version, the third version is higher than the second version, and the second version is higher than the first version;
    升级模块,设置成根据所述第三差分升级包将所述指定软件的所述第一版本升级至所述第三版本。 And an upgrade module configured to upgrade the first version of the specified software to the third version according to the third differential upgrade package.
PCT/CN2016/082654 2015-09-02 2016-05-19 Differential upgrade package processing method and device, upgrade method, system and device WO2017036183A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510557111.7 2015-09-02
CN201510557111.7A CN106484454A (en) 2015-09-02 2015-09-02 The processing method and processing device of difference AKU, upgrade method, system and device

Publications (1)

Publication Number Publication Date
WO2017036183A1 true WO2017036183A1 (en) 2017-03-09

Family

ID=58186605

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/082654 WO2017036183A1 (en) 2015-09-02 2016-05-19 Differential upgrade package processing method and device, upgrade method, system and device

Country Status (2)

Country Link
CN (1) CN106484454A (en)
WO (1) WO2017036183A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531986A (en) * 2019-08-16 2019-12-03 苏州浪潮智能科技有限公司 A kind of generation method, device, equipment and the medium of management software upgrade package
CN112328293A (en) * 2020-11-05 2021-02-05 歌尔科技有限公司 Differential upgrading method of embedded equipment and related components
CN112947983A (en) * 2021-04-15 2021-06-11 网易(杭州)网络有限公司 Application program updating method and device, electronic equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871227B (en) * 2017-12-05 2022-10-18 卓望数码技术(深圳)有限公司 Software upgrading method and device based on second-order differential increment
CN110457290B (en) * 2019-07-09 2021-06-04 北京三快在线科技有限公司 Method and device for processing data, electronic equipment and readable storage medium
CN110727456A (en) * 2019-10-12 2020-01-24 上海莉莉丝科技股份有限公司 Method, device, equipment and system for downloading application program patch package

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425931A (en) * 2008-12-08 2009-05-06 上海华为技术有限公司 Communication apparatus software updating method, related equipment and communication system
CN104066077A (en) * 2014-06-24 2014-09-24 青岛海信移动通信技术股份有限公司 OTA downloading and upgrading method and device thereof
CN104461593A (en) * 2013-09-18 2015-03-25 中兴通讯股份有限公司 Differential upgrade patch manufacturing method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8554748B1 (en) * 2005-11-30 2013-10-08 Netapp, Inc. Method and apparatus for differential file based update for embedded systems
CN102902555B (en) * 2012-09-06 2016-09-21 华为终端有限公司 A kind of upgrade method, device and updating apparatus
CN103051723B (en) * 2012-12-27 2016-08-31 广州市动景计算机科技有限公司 A kind of method for updating increment and server, terminal
CN103279373B (en) * 2013-05-31 2017-09-22 广州市动景计算机科技有限公司 The update method and device of browser case function
CN104035800B (en) * 2014-06-19 2018-07-24 广州金山网络科技有限公司 A kind of delta package generation method, version upgrading method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101425931A (en) * 2008-12-08 2009-05-06 上海华为技术有限公司 Communication apparatus software updating method, related equipment and communication system
CN104461593A (en) * 2013-09-18 2015-03-25 中兴通讯股份有限公司 Differential upgrade patch manufacturing method and device
CN104066077A (en) * 2014-06-24 2014-09-24 青岛海信移动通信技术股份有限公司 OTA downloading and upgrading method and device thereof

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110531986A (en) * 2019-08-16 2019-12-03 苏州浪潮智能科技有限公司 A kind of generation method, device, equipment and the medium of management software upgrade package
CN110531986B (en) * 2019-08-16 2022-12-06 苏州浪潮智能科技有限公司 Method, device, equipment and medium for generating management software upgrading package
CN112328293A (en) * 2020-11-05 2021-02-05 歌尔科技有限公司 Differential upgrading method of embedded equipment and related components
CN112947983A (en) * 2021-04-15 2021-06-11 网易(杭州)网络有限公司 Application program updating method and device, electronic equipment and storage medium
CN112947983B (en) * 2021-04-15 2024-03-15 网易(杭州)网络有限公司 Application program updating method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN106484454A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
WO2017036183A1 (en) Differential upgrade package processing method and device, upgrade method, system and device
CN106657174B (en) Data synchronization method, data updating method and data updating device
WO2016192197A1 (en) Software upgrade method, apparatus and system of terminal, and computer storage medium
KR20190095066A (en) The method for information processing, apparatus and server and computer readable medium
CN110336871A (en) A kind of document handling method, device, storage medium and electronic equipment
WO2017016210A1 (en) Software version management method and apparatus
CN107066300B (en) Firmware upgrading method of storage device and storage device
JP2009530702A (en) Data storage management method and device
CN110109628B (en) Data reconstruction method, device, equipment and storage medium of distributed storage system
CN112162773B (en) Differential upgrading method and device, storage medium and terminal
JP2004227572A (en) Remote data control method
CN110888844B (en) Data deleting method, system, equipment and computer readable storage medium
US7953822B2 (en) Method of and apparatus for downloading data
CN102419753B (en) Information processing equipment, information processing method and information processing system
CN102830943B (en) Method and system for playing multimedia files in external USB (universal serial bus) storage on the basis of Android platform
CN111770153A (en) Object downloading method and device, electronic equipment and storage medium
CN114501134A (en) iOS cross-page video playing method, device, equipment and storage medium
US9841963B2 (en) Method and apparatus for managing application
CN105453518B (en) Synchronization of metering networks
KR102226379B1 (en) How to improve the burning speed of some kind of system firmware
JP7429792B2 (en) Data transmission methods, terminals and computer-readable storage media
EP2787739A1 (en) Media storage and management system
WO2018028321A1 (en) Method and apparatus for managing virtual external storage device, and terminal
US10171847B2 (en) Information device and distribution device
US20140068006A1 (en) Method, apparatus and system for providing content

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

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

Country of ref document: EP

Kind code of ref document: A1