WO2018177193A1 - Software upgrade method and device - Google Patents

Software upgrade method and device Download PDF

Info

Publication number
WO2018177193A1
WO2018177193A1 PCT/CN2018/080043 CN2018080043W WO2018177193A1 WO 2018177193 A1 WO2018177193 A1 WO 2018177193A1 CN 2018080043 W CN2018080043 W CN 2018080043W WO 2018177193 A1 WO2018177193 A1 WO 2018177193A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
patch
backup
model
change
Prior art date
Application number
PCT/CN2018/080043
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 WO2018177193A1 publication Critical patent/WO2018177193A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This document relates to, but is not limited to, the field of computer technology, and in particular, to a software upgrade method and apparatus.
  • the patch set of the software generally includes multiple patches.
  • the patches are first patched one by one. If the software version is not backed up before the patch set is upgraded, once a patch upgrade has a problem, the software can only be reinstalled, so the backup of the version of the patch set is very important.
  • An embodiment of the present invention provides a software upgrade method, where the method includes:
  • the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch
  • the embodiment of the invention further provides a software upgrading device, the device comprising:
  • Determining a module configured to: when receiving an upgrade instruction, determine a change file corresponding to the patch according to the file in the patch and the file in the target software;
  • Establishing a module configured to establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch;
  • the first backup module is configured to perform file backup according to the node corresponding to the change file in the backup file model, to obtain a backup file;
  • the upgrade module is configured to perform an upgrade operation based on the patch.
  • the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores one or more programs executable by a computer, and when the one or more programs are executed by the computer, the computer is executed as described above.
  • a software upgrade method provided.
  • FIG. 1 is a flowchart of a software upgrade method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a software upgrade method according to another embodiment of the present invention.
  • FIG. 3 is a flowchart of a software upgrade method according to another embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a file backup model according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a software upgrade apparatus according to an embodiment of the present invention.
  • the modified file Before the patch set is upgraded, the modified file cannot be known in advance, and only the entire software version can be backed up. After the software runs for a period of time, the number of files will become very large, which will greatly increase the time-consuming of the patch set upgrade.
  • an embodiment of the present invention provides a software upgrade method, including the following steps:
  • Step S101 When receiving the upgrade instruction, determine the change file corresponding to the patch according to the file in the patch and the file in the target software.
  • the upgrade command is used to indicate that the software upgrade operation needs to be performed
  • the target software may be any software that needs to be upgraded
  • the change file may be at least one of a delete file and a modified file, where the deleted file may include A file that does not exist in the patch and exists in the target software.
  • the modification file may include files that exist in the patch file and that do not exist in the target software.
  • based on the file in the patch it is found from the file in the target software whether there is a file with the same directory level and the same name as the file in the patch.
  • Step S102 Establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch.
  • the backup file model is a tree structure generated according to the directory hierarchy of the change file, and the tree node may be first generated based on the directory hierarchy of each change file. After obtaining the tree node corresponding to each change file, the tree node corresponding to each change file may be merged to obtain a backup file model.
  • Step S103 Perform file backup according to the node corresponding to the change file in the backup file model to obtain a backup file.
  • the file backup is performed according to the node corresponding to the change file, so that only the changed file is backed up, so that the number of backup files can be reduced.
  • Step S104 Perform an upgrade operation based on the patch.
  • an embodiment of the present invention further provides a software upgrade method, including the following steps:
  • Step S201 When receiving the upgrade instruction, determine the new file and the change file corresponding to the patch according to the file in the patch and the file in the target software.
  • the newly added file may include a file that exists in the patch and does not exist in the target software.
  • Step S202 Establish a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
  • the backup file model is a tree structure generated according to the directory hierarchy of the newly added file and the changed file.
  • a tree node may be generated according to a directory hierarchy of each newly added file and each changed file, and attribute identifiers are set for each tree node. For example, for a newly added file, the corresponding node may be newly added. To delete a file, you can identify its corresponding node as deleted. The tree nodes are merged to obtain a backup file model.
  • Step S203 Perform file backup according to the node corresponding to the change file in the backup file model to obtain a backup file.
  • the file backup is performed according to the node corresponding to the change file, so that only the changed file is backed up, so that the number of backup files can be reduced.
  • Step S204 Perform an upgrade operation based on the patch.
  • the method may further include: when the rollback instruction is received, performing a rollback operation according to the backup file model and the backup file.
  • the file corresponding to each node of the backup file model may be directly deleted from the upgraded target software, and the backup file is added to the target software, so that the target software is quickly rolled back to the pre-upgrade version.
  • the patch may include a first patch and a second patch, and determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch, including: according to the first patch Determining, in the file in the target software, the new file and the change file corresponding to the first patch, determining the second according to the file in the second patch and the file in the target software New files and change files corresponding to the patch;
  • the establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch. a first backup file model, the second backup file model of the second patch is established according to the newly added file and the change file corresponding to the second patch; and the first backup file model and the second backup file model are merged Each node gets the merged backup file model;
  • performing the file backup according to the node corresponding to the change file in the backup file model, and obtaining the backup file including: performing file backup according to the node corresponding to the change file in the merged backup file model, to obtain the backup file.
  • the backup file model of each patch is established according to the newly added file and the change file corresponding to each patch, and the nodes in the backup file model of each patch are merged, and based on the merge After the backup file model for file backup.
  • the first backup file model is a tree structure established according to each newly added file of the first patch and a directory hierarchy of each changed file
  • the second backup file model is each newly added file and each according to the second patch.
  • the tree structure of the directory hierarchy of the change file since the same new file and the change file may exist in the first patch and the second patch, in order to avoid redundancy of the backup file, the first backup file model and the Each node in the second backup file model, where, for the same node, only one is retained after the merge.
  • the embodiment of the present invention may use the backup file model of the first patch as a reference, traverse the nodes of the backup file model of the second patch, and add a node different from the backup file model of the first patch in the backup file model of the second patch to The first patch is in the backup file model, thereby obtaining a merged backup file model. Therefore, when the file is backed up based on the node corresponding to the changed file in the merged backup file model, the backup file redundancy can be avoided by repeatedly backing up the same file between different patches.
  • the upgrade order of the first patch may be located before the second patch, and the first backup file model of the first patch is established according to the newly added file and the change file corresponding to the first patch, according to the second
  • the method further includes: performing file backup according to the node corresponding to the change file in the first backup file model, a backup file corresponding to the first patch; deleting a node in the second backup file model that is the same as the first backup file model, obtaining an updated second backup file model, and according to the updated second file
  • the node corresponding to the change file in the backup file model performs file backup to obtain a backup file corresponding to the second patch.
  • the upgrade is usually performed according to each of the multiple patches.
  • the upgrade order of the first patch precedes the second patch.
  • the embodiment of the present invention performs file backup based on the first backup file model to obtain a backup file corresponding to the first patch.
  • the backup file corresponding to the first patch may be a file that needs to be changed based on the target software when the first patch is upgraded.
  • the node in the second backup file model that is the same as the first backup file model may be deleted, and the updated second backup file model is obtained, so that the updated second backup file is obtained.
  • the file is backed up by the model, and the backup file corresponding to the second patch is obtained.
  • the backup file corresponding to the second patch is a file that needs to be changed according to the target software when the second patch is upgraded.
  • each of the restore points can be respectively associated with each backup file model and each backup file, so that the target software can be quickly rolled back to the restore point according to the backup file model and the backup file corresponding to a certain restore point.
  • the patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the patch is determined according to a file in the patch and a file in the target software.
  • the newly added file and the change file include: determining, according to the file in the first patch and the file in the target software, a new file and a change file corresponding to the first patch;
  • the establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch.
  • performing the file backup according to the node corresponding to the change file in the backup file model including: performing file backup according to the node corresponding to the change file in the first backup file model, and obtaining the corresponding corresponding to the first patch. backup file;
  • Performing the upgrading operation based on the patch includes: performing an upgrade operation based on the first patch;
  • the method further includes: determining, according to the file in the second patch and the file in the target software, that the upgrade is successful according to the first patch Adding a new file and a change file corresponding to the second patch; establishing a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch; deleting the second backup file model and the Obtaining a second backup file model of the same file as the backup file model of the first patch; performing file backup according to the node corresponding to the change file in the updated second backup file model, and obtaining the second A backup file corresponding to the patch; performing an upgrade operation based on the second patch.
  • the file backup and upgrade of each patch are performed in a serial manner, and the newly added file and the change corresponding to the first patch may be determined according to the file in the first patch and the file in the target software. And creating a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch; and performing file backup according to the node corresponding to the change file in the first backup file model a backup file corresponding to the first patch; performing an upgrade operation based on the first patch.
  • the upgrade of the first patch When the upgrade of the first patch is successful, determining, according to the file in the second patch and the file in the target software, a new file and a change file corresponding to the second patch; Adding a new backup file and a change file to establish a second backup file model of the second patch; deleting a node in the second backup file model that is the same as the backup file model of the first patch, and obtaining an updated second backup
  • the file model is configured to perform a file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch, and perform an upgrade operation based on the second patch.
  • the second backup file model and the first backup file model may also be merged to obtain a merged backup file model.
  • each of the restore points can be respectively associated with each backup file model and each backup file, so that the target software can be quickly rolled back to the restore point according to the backup file model and the backup file corresponding to a certain restore point.
  • the method may further include: when receiving the rollback instruction, acquiring a backup file model and a backup file corresponding to the target restore point according to the target restore point in the rollback instruction And performing a rollback operation on the upgraded target software according to the backup file model and the backup file corresponding to the target restore point.
  • the rollback instruction is used to indicate that a rollback operation needs to be performed, for example, when the upgrade fails through a certain patch. You can use the pop-up window to prompt the user whether to perform the rollback operation and input the target restore point. After receiving the target restore point input by the user, obtain the backup file model and the backup file corresponding to the target restore point.
  • the performing the rollback operation on the upgraded target software according to the backup file model and the backup file corresponding to the target restore point may include: deleting the backup corresponding to the target restore point from the upgraded target software A file corresponding to each node in the file model, and a backup file corresponding to the target restore point is added to the target software.
  • the method may further include: before the file in the patch includes an empty directory, before the backup file model of the patch is established according to the new file, the deleted file, and the modified file corresponding to the patch, the method may further include: Add a description file to the empty directory.
  • the description file may be any format file, for example, a WORD file, a TXT file, or the like.
  • the tree node may be established according to the directory hierarchy of the description file.
  • the target software can be quickly and easily rolled back to the pre-upgrade version based on the backup file model and the backup file.
  • an embodiment of the present invention provides a software upgrade method, including the following steps:
  • Step S301 Referring to the file in the patch as a reference, scanning the file of the same name in the target software one by one, and setting the corresponding identifier bit.
  • the file in the patch if the file exists in the target software, it can be identified as modified; if the file does not exist in the target software, the identifier is added; if the file needs to be deleted, the identifier is deleted.
  • Step S302 Establish a backup file model of the patch.
  • a tree node is created according to the directory hierarchy of the file, and the node is marked as new, wherein if the newly added file is an empty directory, then a new directory is created in the directory.
  • Add a description file for example, ignore.txt, and create a tree node based on the directory hierarchy of the description file, marking the node as new.
  • the entire backup file model can be simplified, and the entire backup file model is ultimately attributed to a plurality of separate files, so that the file is minimized.
  • the operating unit can avoid the situation where multiple files are added to the recorded empty directory when multiple patches are upgraded one after another.
  • the tree node is created according to the directory hierarchy of the file, and the node is marked as deleted. If the deleted file is an empty directory, the description file is added in the empty directory. For example, ignore.txt creates a tree node based on the directory hierarchy of the description file and identifies the node as deleted.
  • the modification can be used as a combination of deletion and addition. Doing so further simplifies the type of file operations, simplifying all operations on the file to both new and deleted. Convert the modified file into a combination of the deleted file and the newly added file, and establish a tree node according to the deleted file and the directory hierarchy of the newly added file.
  • the tree nodes established according to the above rules are merged into the same tree structure to obtain a backup file model.
  • Step S303 Perform file backup according to the backup file model of the patch, and perform an upgrade operation based on the patch.
  • the nodes identified as deleted in the backup file model are sequentially backed up to a fixed directory, and only the records identified as newly added nodes are not processed.
  • Step S304 determining whether the upgrade is successful.
  • step S305 is performed, and when the upgrade fails, step S309 is performed.
  • step S305 it is determined whether there are other patches.
  • step S306 is performed, and when there are no other patches, step S308 is performed.
  • Step S306 continuing to establish a backup file model for the subsequent patches, and merging the backup file model of the patch into the previous backup file model to obtain the merged backup file model.
  • the subsequent patch refers to a patch whose upgrade order is located after the currently upgraded patch
  • the previous backup file model refers to a backup file model of the previously upgraded patch
  • the process of establishing a backup file model of a subsequent patch is as follows:
  • a new tree node is created according to the directory hierarchy of the file, and the tree node of the merged backup file model is obtained. If the node exists in the previous backup file model, it is not processed if the node does not exist. The node is added to the previous backup file model and identified as new.
  • a new tree node is created according to the directory hierarchy of the file, and if the node exists in the previous backup file model, it is not processed; if the node does not exist, the node is added to the previous backup file model. And identified as deleted.
  • the presence and deletion of the newly added and deleted tree nodes are first performed, and the purpose is to record only the first operation for the same file, and no matter what operation or how many times the subsequent file is upgraded.
  • the operations are no longer processed, so that the complexity of the software upgrade method of the embodiment of the present invention can be reduced.
  • Step S307 Perform a backup again according to the merged backup file model, and then perform a patch upgrade.
  • step S305 After the patch is upgraded, the process returns to step S305.
  • the embodiment of the present invention may repeatedly perform steps S305 to S307 until all patches are upgraded.
  • step S304 to step S307 may be repeatedly performed until all patches are upgraded.
  • Step S308 whether the version needs to be rolled back.
  • step S309 is performed, and when the version is not required to be rolled back, the process ends.
  • a patch fails to be upgraded, or the patch is upgraded successfully, but the service is abnormal, you usually need to roll back the upgraded target software to the pre-upgrade version.
  • Step S309 Perform software rollback according to the backup file model.
  • the software rollback process may include: traversing the nodes in the merged backup file model, and deleting the files corresponding to each node in the merged backup file model from the target software; and overwriting the backup file to the target software.
  • deletion refers to the deletion of all nodes, not only the node identified as new, but also deleted after the identifier is deleted, because the node identified as deleted is recorded when the node is operated for the first time. In the subsequent operation, the node may be newly created, modified, and even placed other files in the directory. The deletion will completely clean up the files, so as to ensure the state of the software version and the current state after the backup file is overwritten to the target. It is exactly the same.
  • the backup file is greatly reduced; and the redundant backup of the same file between the patches is also removed, thereby further reducing the number of files that need to be backed up, and saving time spent in software patch upgrade. Improve the efficiency of the upgrade.
  • Patch set patchSet contains patch patch1 and patch patch2.
  • Patch 1 includes: Add file FileAdd1, add empty directory DirAdd1, delete file FileDel1, delete empty directory DirDel2, delete directory DirDel3, modify file FileModify;
  • patch patch2 includes: delete files FileAdd1, FileDel4, add FileAdd2, DirDel2.
  • Step a refer to the file in the patch patch1 as a reference, scan the file of the same name in the target software one by one, and set the corresponding identifier, FileAdd1, DirAdd1 does not exist in the software version, set to add; FileDel1, DirDel2, DirDel3 in the target software Existing but need to be deleted, set to delete; FileModify exists in the software version and patch1, set to modify.
  • Step b create a patch1 backup file model.
  • the tree node can be created according to the directory hierarchy of FileAdd1 and identified as new. Since DirAdd1 is a new empty directory, a new description file is added to DirAdd1, for example, ignore.txt. The tree node is created according to the directory hierarchy of ignore.txt and is identified as new.
  • a tree node is created according to the directory hierarchy of FileDel1 and identified as deleted. Since DirDel2 is an empty directory to be deleted, a description file is added to DirDel2, for example, ignore.txt, and a tree node is created according to the directory hierarchy of ignore.txt, and is identified as deleted.
  • DirDel3 is a deleted non-empty directory
  • a tree node is created according to the directory hierarchy of each file in DirDel3, and is identified as deleted.
  • FileModify is a modified file that establishes a tree node based on FileModify's directory hierarchy and identifies it as deleted.
  • Step c Perform file backup according to the backup file model of the patch patch1, and then upgrade based on the patch patch1.
  • step d a patch patch2 backup file model is created, and the backup file model of the patch is merged into the previous backup file model.
  • Step e perform file backup according to the backup file model of the merged patch, and then upgrade the patch patch2.
  • Step f If the upgrade of patch 1 and patch 2 fails or the version needs to be rolled back after the upgrade is successful, perform the following operations: Delete all nodes in the merged backup file model in the upgraded target software; overwrite all backup files to In the target software.
  • the full version of the target software can be rolled back, that is, back to the version before the target software upgrade.
  • an embodiment of the present invention provides a software upgrade apparatus, where the software upgrade apparatus 50 includes:
  • the determining module 51 is configured to: when receiving the upgrade instruction, determine the change file corresponding to the patch according to the file in the patch and the file in the target software;
  • the establishing module 52 is configured to establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch ;
  • the first backup module 53 is configured to perform file backup according to the node corresponding to the change file in the backup file model, to obtain a backup file;
  • the upgrade module 54 is configured to perform an upgrade operation based on the patch.
  • the determining module 51 is further configured to: when receiving the upgrade instruction, determine, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch;
  • the method is configured to: establish a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
  • the patch may include a first patch and a second patch
  • the determining module 51 is configured to: determine, according to the file in the first patch and the file in the target software, a new one corresponding to the first patch And the file and the change file, the new file and the change file corresponding to the second patch are determined according to the file in the second patch and the file in the target software
  • the establishing module 52 is configured to: The first backup file model of the first patch is created by the new file and the change file corresponding to the first patch, and the second backup file model of the second patch is established according to the newly added file and the change file corresponding to the second patch. Merging each node in the first backup file model and the second backup file model to obtain a merged backup file model
  • the first backup module 53 is configured to: according to the merged backup file model The node corresponding to the change file performs file backup to obtain the backup file.
  • the device may further include: a second backup module, configured to establish the first file according to the newly added file and the change file corresponding to the first patch, where the upgrade order of the first patch is located before the second patch After the second backup file model of the second patch is created according to the new file and the change file corresponding to the second patch, the first backup file model of the patch is corresponding to the change file according to the first backup file model.
  • a second backup module configured to establish the first file according to the newly added file and the change file corresponding to the first patch, where the upgrade order of the first patch is located before the second patch
  • the first backup file model of the patch is corresponding to the change file according to the first backup file model.
  • the node performs a file backup to obtain a backup file corresponding to the first patch; and the third backup module is configured to delete the node in the second backup file model that is the same as the first backup file model, and obtain an updated And backing up the file model, and performing file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch.
  • the patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the determining module 51 is configured to: according to the file in the first patch and the a file in the target software, the new file and the change file corresponding to the first patch are determined; the establishing module 52 is configured to: establish the first patch according to the newly added file and the change file corresponding to the first patch.
  • the first backup file module is configured to: perform file backup according to the node corresponding to the change file in the first backup file model, and obtain a backup file corresponding to the first patch;
  • the upgrade module 54 is configured to: perform an upgrade operation based on the first patch;
  • the determining module 51 is further configured to: after performing the upgrading operation based on the first patch, when the upgrade according to the first patch is successful, according to the file in the second patch and the file in the target software, Determining the new file and the change file corresponding to the second patch; the establishing module 52 is further configured to: establish a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch Deleting the same node as the backup file model of the first patch in the second backup file model to obtain an updated second backup file model; the first backup module 53 is further configured to: according to the update The node corresponding to the change file in the second backup file model performs file backup to obtain a backup file corresponding to the second patch.
  • the upgrade module 54 is further configured to perform an upgrade operation based on the second patch.
  • the apparatus may further include: a rollback module configured to perform a rollback operation according to the backup file model and the backup file when receiving a rollback instruction after performing an upgrade operation based on the patch.
  • a rollback module configured to perform a rollback operation according to the backup file model and the backup file when receiving a rollback instruction after performing an upgrade operation based on the patch.
  • the determining module 51 determines the change file corresponding to the patch according to the file in the patch and the file in the target software; the establishing module 52 establishes the change file according to the change file corresponding to the patch.
  • a backup file model of the patch wherein the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch; and the first backup module 53 corresponds to the change file in the backup file model.
  • the node performs a file backup to obtain a backup file; the upgrade module 54 performs an upgrade operation based on the patch.
  • only the change file is backed up based on the backup file model during the software upgrade, which reduces the number of backup files, saves time spent in upgrading the software patch, and improves the upgrade efficiency.
  • the foregoing software upgrade device may be a user terminal in any embodiment of the method in the embodiment of the present invention, and any implementation manner of the user terminal in the method embodiment in the embodiment of the present invention may be
  • the above software upgrade device in the embodiment is implemented, and the same beneficial effects are achieved, and details are not described herein again.
  • the program When the program is executed, the program further includes: determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch; And establishing, by the corresponding change file, the backup file model of the patch, including: establishing a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
  • the patch may include a first patch and a second patch, and determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch, including: according to the first patch Determining, in the file in the target software, the new file and the change file corresponding to the first patch, determining the second according to the file in the second patch and the file in the target software a new file and a change file corresponding to the patch; the backup file model of the patch is established according to the newly added file and the change file corresponding to the patch, including: adding a new file corresponding to the first patch Establishing a first backup file model of the first patch, and a second backup file model of the second patch according to the new file and the change file corresponding to the second patch; and merging the first backup file a model and a node in the second backup file model, to obtain a merged backup file model; the corresponding change file according to the backup file model
  • the node performs the file backup to obtain the backup file, and includes
  • the patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the patch is determined according to a file in the patch and a file in the target software.
  • the newly added file and the change file include: determining, according to the file in the first patch and the file in the target software, a new file and a change file corresponding to the first patch;
  • the newly added file and the change file establish a backup file model of the patch, including: establishing a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch;
  • the file backup is performed according to the node corresponding to the change file in the backup file model, including: performing file backup according to the node corresponding to the change file in the first backup file model, and obtaining a backup corresponding to the first patch.
  • the program further includes the following steps: when the upgrade is successful according to the first patch, determining the second patch according to the file in the second patch and the file in the target software Corresponding new file and change file; establishing a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch; deleting the second backup file model and the first
  • the second backup file model is obtained by the same node of the backup file model of the patch, and the file corresponding to the change file in the updated second backup file model is used for file backup, and the second patch is obtained. Backing up the file; performing an upgrade operation based on the second patch.
  • the program may further include: when receiving the rollback instruction, performing a rollback operation according to the backup file model and the backup file.
  • Computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules, or other data. , removable and non-removable media.
  • Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer.
  • communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media.
  • a modulated data signal such as a carrier wave or other transport mechanism

Abstract

Provided are a software upgrade method and a device. The method comprises: upon receipt of upgrade instruction, determining a change file corresponding to a patch according to a file in the patch and a file in a target software; establishing a backup file model of the patch according to the change file corresponding to the patch, wherein the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch; performing file backup according to a node corresponding to the change file in the backup file model, so as to obtain a backup file; and performing an upgrade operation on the basis of the patch.

Description

一种软件升级方法及装置Software upgrade method and device 技术领域Technical field
本文涉及但不限于计算机技术领域,特别涉及一种软件升级方法及装置。This document relates to, but is not limited to, the field of computer technology, and in particular, to a software upgrade method and apparatus.
背景技术Background technique
软件版本发布后,为了修正漏洞(bug)或者添加新的功能,往往会采用补丁集的形式进行升级。软件的补丁集一般会包括多个补丁,补丁集升级时会先按照次序逐个的进行打补丁操作。如果补丁集升级前不进行软件版本的备份,一旦一个补丁升级出现问题,则只能重新安装软件,因此补丁集升级时版本的备份非常重要。After the software version is released, in order to fix bugs or add new features, it is often upgraded in the form of a patch set. The patch set of the software generally includes multiple patches. When the patch set is upgraded, the patches are first patched one by one. If the software version is not backed up before the patch set is upgraded, once a patch upgrade has a problem, the software can only be reinstalled, so the backup of the version of the patch set is very important.
发明内容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.
本发明实施例提供一种软件升级方法,该方法包括:An embodiment of the present invention provides a software upgrade method, where the method includes:
当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;When receiving the upgrade instruction, determining the change file corresponding to the patch according to the file in the patch and the file in the target software;
根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;Establishing a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch;
根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;Performing a file backup according to the node corresponding to the change file in the backup file model, and obtaining a backup file;
基于所述补丁执行升级操作。Perform an upgrade operation based on the patch.
本发明实施例还提供一种软件升级装置,该装置包括:The embodiment of the invention further provides a software upgrading device, the device comprising:
确定模块,设置为当接收到升级指令,根据补丁中的文件和目标软件中 的文件,确定所述补丁对应的变更文件;Determining a module, configured to: when receiving an upgrade instruction, determine a change file corresponding to the patch according to the file in the patch and the file in the target software;
建立模块,设置为根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;Establishing a module, configured to establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch;
第一备份模块,设置为根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;The first backup module is configured to perform file backup according to the node corresponding to the change file in the backup file model, to obtain a backup file;
升级模块,设置为基于所述补丁执行升级操作。The upgrade module is configured to perform an upgrade operation based on the patch.
本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机可执行的一个或多个程序,所述一个或多个程序被所述计算机执行时使所述计算机执行如上述提供的一种软件升级方法。The embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores one or more programs executable by a computer, and when the one or more programs are executed by the computer, the computer is executed as described above. A software upgrade method provided.
本发明实施例在软件升级时基于备份文件模型仅备份变更文件,减少了备份文件的数量,节省了软件补丁升级时的耗时,提高了升级效率。In the embodiment of the present invention, only the change file is backed up based on the backup file model during the software upgrade, which reduces the number of backup files, saves time spent in upgrading the software patch, and improves the upgrade efficiency.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本发明实施例提供的软件升级方法的流程图;FIG. 1 is a flowchart of a software upgrade method according to an embodiment of the present invention;
图2为本发明又一实施例提供的软件升级方法的流程图;2 is a flowchart of a software upgrade method according to another embodiment of the present invention;
图3为本发明又一实施例提供的软件升级方法的流程图;3 is a flowchart of a software upgrade method according to another embodiment of the present invention;
图4为本发明实施例提供的文件备份模型的示意图;4 is a schematic diagram of a file backup model according to an embodiment of the present invention;
图5为本发明实施例提供的的软件升级装置的示意图。FIG. 5 is a schematic diagram of a software upgrade apparatus according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
下面将结合附图及具体实施例进行详细描述。The detailed description will be made below in conjunction with the accompanying drawings and specific embodiments.
补丁集升级前不能提前得知修改的文件,只能进行整个软件版本的备份,而软件在现场运行一段时间后文件的数量会变得非常巨大,这将大大增加补丁集升级的耗时。Before the patch set is upgraded, the modified file cannot be known in advance, and only the entire software version can be backed up. After the software runs for a period of time, the number of files will become very large, which will greatly increase the time-consuming of the patch set upgrade.
如图1所示,本发明实施例提供一种软件升级方法,包括以下步骤:As shown in FIG. 1 , an embodiment of the present invention provides a software upgrade method, including the following steps:
步骤S101、当接收到升级指令,根据补丁中的文件和目标软件中的文 件,确定所述补丁对应的变更文件。Step S101: When receiving the upgrade instruction, determine the change file corresponding to the patch according to the file in the patch and the file in the target software.
本实发明实施例中,升级指令用于指示需要执行软件升级操作,目标软件可以为任意一个需要进行升级的软件,变更文件可以是删除文件和修改文件中至少一种,其中,删除文件可以包括在补丁中不存在且在目标软件中存在的文件。修改文件可以包括在补丁文件中存在且在目标软件中不存在的文件。本发明实施例可以基于补丁中的文件,从目标软件中的文件中查找是否存在与补丁中文件的目录层次相同且同名的文件。In the embodiment of the present invention, the upgrade command is used to indicate that the software upgrade operation needs to be performed, and the target software may be any software that needs to be upgraded, and the change file may be at least one of a delete file and a modified file, where the deleted file may include A file that does not exist in the patch and exists in the target software. The modification file may include files that exist in the patch file and that do not exist in the target software. In the embodiment of the present invention, based on the file in the patch, it is found from the file in the target software whether there is a file with the same directory level and the same name as the file in the patch.
步骤S102、根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构。Step S102: Establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch.
本发明实施例中,备份文件模型为根据变更文件的目录层次生成的树结构,可以先基于每个变更文件的目录层次生成树节点。在得到各个变更文件对应的树节点后,可以合并各个变更文件对应的树节点得到备份文件模型。In the embodiment of the present invention, the backup file model is a tree structure generated according to the directory hierarchy of the change file, and the tree node may be first generated based on the directory hierarchy of each change file. After obtaining the tree node corresponding to each change file, the tree node corresponding to each change file may be merged to obtain a backup file model.
步骤S103、根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件。Step S103: Perform file backup according to the node corresponding to the change file in the backup file model to obtain a backup file.
本发明实施例中,根据变更文件对应的节点进行文件备份,从而仅对变更文件进行备份,从而可以减少备份文件的数量。In the embodiment of the present invention, the file backup is performed according to the node corresponding to the change file, so that only the changed file is backed up, so that the number of backup files can be reduced.
步骤S104、基于所述补丁执行升级操作。Step S104: Perform an upgrade operation based on the patch.
本发明实施例在软件升级时基于备份文件模型仅备份变更文件,减少了备份文件的数量,节省了软件补丁升级时的耗时,提高了升级效率。In the embodiment of the present invention, only the change file is backed up based on the backup file model during the software upgrade, which reduces the number of backup files, saves time spent in upgrading the software patch, and improves the upgrade efficiency.
如图2所示,本发明实施例还提供一种软件升级方法,包括以下步骤:As shown in FIG. 2, an embodiment of the present invention further provides a software upgrade method, including the following steps:
步骤S201、当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的新增文件和变更文件。Step S201: When receiving the upgrade instruction, determine the new file and the change file corresponding to the patch according to the file in the patch and the file in the target software.
本发明实施例中,新增文件可以包括在补丁中存在且在目标软件中不存在的文件。In the embodiment of the present invention, the newly added file may include a file that exists in the patch and does not exist in the target software.
步骤S202、根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型。Step S202: Establish a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
在本发明实施例中,备份文件模型为根据新增文件和变更文件的目录层次生成的树结构。本发明实施例可以分别根据各个新增文件和各个变更文件 的目录层次生成树节点,并对各个树节点进行属性标识,例如,对于新增文件,可以将其对应的节点标识为新增,对于删除文件,可以将其对应的节点标识为删除等。并将各个树节点进行合并,得到备份文件模型。In the embodiment of the present invention, the backup file model is a tree structure generated according to the directory hierarchy of the newly added file and the changed file. In the embodiment of the present invention, a tree node may be generated according to a directory hierarchy of each newly added file and each changed file, and attribute identifiers are set for each tree node. For example, for a newly added file, the corresponding node may be newly added. To delete a file, you can identify its corresponding node as deleted. The tree nodes are merged to obtain a backup file model.
步骤S203、根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件。Step S203: Perform file backup according to the node corresponding to the change file in the backup file model to obtain a backup file.
本发明实施例中,根据变更文件对应的节点进行文件备份,从而仅对变更文件进行备份,从而可以减少备份文件的数量。In the embodiment of the present invention, the file backup is performed according to the node corresponding to the change file, so that only the changed file is backed up, so that the number of backup files can be reduced.
步骤S204、基于所述补丁执行升级操作。Step S204: Perform an upgrade operation based on the patch.
在基于所述补丁执行升级操作之后,所述方法还可以包括:当接收到回滚指令,根据所述备份文件模型和所述备份文件执行回滚操作。After performing the upgrade operation based on the patch, the method may further include: when the rollback instruction is received, performing a rollback operation according to the backup file model and the backup file.
在本发明实施例中,可以直接从升级后的目标软件中删除与备份文件模型的各个节点对应的文件,并将备份文件添加至目标软件中,以使目标软件快速回滚至升级前的版本。In the embodiment of the present invention, the file corresponding to each node of the backup file model may be directly deleted from the upgraded target software, and the backup file is added to the target software, so that the target software is quickly rolled back to the pre-upgrade version. .
所述补丁可以包括第一补丁和第二补丁,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件,根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;The patch may include a first patch and a second patch, and determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch, including: according to the first patch Determining, in the file in the target software, the new file and the change file corresponding to the first patch, determining the second according to the file in the second patch and the file in the target software New files and change files corresponding to the patch;
所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,得到合并后的备份文件模型;The establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch. a first backup file model, the second backup file model of the second patch is established according to the newly added file and the change file corresponding to the second patch; and the first backup file model and the second backup file model are merged Each node gets the merged backup file model;
所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件,包括:根据所述合并后的备份文件模型中所述变更文件对应的节点进行文件备份,得到所述备份文件。And performing the file backup according to the node corresponding to the change file in the backup file model, and obtaining the backup file, including: performing file backup according to the node corresponding to the change file in the merged backup file model, to obtain the backup file.
本发明实施例中,当补丁的数量为多个时,分别根据各个补丁对应的新增文件和变更文件建立各个补丁的备份文件模型,并合并各个补丁的备份文件模型中的节点,并基于合并后的备份文件模型进行文件备份。以下本发明 实施例以第一补丁和第二补丁为例进行说明。In the embodiment of the present invention, when the number of patches is multiple, the backup file model of each patch is established according to the newly added file and the change file corresponding to each patch, and the nodes in the backup file model of each patch are merged, and based on the merge After the backup file model for file backup. The following describes the first patch and the second patch as an example.
本发明实施例中,第一备份文件模型为根据第一补丁的各个新增文件和各个变更文件的目录层次建立的树结构,第二备份文件模型为根据第二补丁的各个新增文件和各个变更文件的目录层次建立的树结构,由于第一补丁和第二补丁中可能会存在相同的新增文件和变更文件,为了避免备份文件的冗余,合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,其中,对于相同的节点,合并后仅保留一个。本发明实施例可以以第一补丁的备份文件模型为基准,遍历第二补丁的备份文件模型的各个节点,将第二补丁的备份文件模型中与第一补丁的备份文件模型不同的节点添加至第一补丁的备份文件模型中,从而得到合并后的备份文件模型。从而基于合并后的备份文件模型中变更文件对应的节点进行文件备份时,可以避免多次备份不同补丁之间相同的文件而造成备份文件的冗余。In the embodiment of the present invention, the first backup file model is a tree structure established according to each newly added file of the first patch and a directory hierarchy of each changed file, and the second backup file model is each newly added file and each according to the second patch. The tree structure of the directory hierarchy of the change file, since the same new file and the change file may exist in the first patch and the second patch, in order to avoid redundancy of the backup file, the first backup file model and the Each node in the second backup file model, where, for the same node, only one is retained after the merge. The embodiment of the present invention may use the backup file model of the first patch as a reference, traverse the nodes of the backup file model of the second patch, and add a node different from the backup file model of the first patch in the backup file model of the second patch to The first patch is in the backup file model, thereby obtaining a merged backup file model. Therefore, when the file is backed up based on the node corresponding to the changed file in the merged backup file model, the backup file redundancy can be avoided by repeatedly backing up the same file between different patches.
所述第一补丁的升级次序可以位于所述第二补丁之前,在根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型之后,所述方法还包括:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;删除所述第二备份文件模型中与所述第一备份文件模型相同的节点,得到更新后的第二备份文件模型,并根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件。The upgrade order of the first patch may be located before the second patch, and the first backup file model of the first patch is established according to the newly added file and the change file corresponding to the first patch, according to the second After the new file and the change file corresponding to the patch are used to establish the second backup file model of the second patch, the method further includes: performing file backup according to the node corresponding to the change file in the first backup file model, a backup file corresponding to the first patch; deleting a node in the second backup file model that is the same as the first backup file model, obtaining an updated second backup file model, and according to the updated second file The node corresponding to the change file in the backup file model performs file backup to obtain a backup file corresponding to the second patch.
实际情况中,当补丁的个数为多个时,通常是依次根据多个补丁中的每一个补丁进行升级。在本发明实施例中,第一补丁的升级次序先于第二补丁。本发明实施例在得到第一备份文件模型之后,基于第一备份文件模型进行文件备份,得到第一补丁对应的备份文件。第一补丁对应的备份文件可以为基于第一补丁升级时目标软件需要更改的文件。在得到第二备份文件模型后,可以删除所述第二备份文件模型中与所述第一备份文件模型相同的节点,得到更新后的第二备份文件模型,从而根据更新后的第二备份文件模型进行文件备份,得到第二补丁对应的备份文件,其中,第二补丁对应的备份文件为基于第二补丁升级时目标软件需要变更的文件。In actual situations, when there are multiple patches, the upgrade is usually performed according to each of the multiple patches. In the embodiment of the present invention, the upgrade order of the first patch precedes the second patch. After obtaining the first backup file model, the embodiment of the present invention performs file backup based on the first backup file model to obtain a backup file corresponding to the first patch. The backup file corresponding to the first patch may be a file that needs to be changed based on the target software when the first patch is upgraded. After obtaining the second backup file model, the node in the second backup file model that is the same as the first backup file model may be deleted, and the updated second backup file model is obtained, so that the updated second backup file is obtained. The file is backed up by the model, and the backup file corresponding to the second patch is obtained. The backup file corresponding to the second patch is a file that needs to be changed according to the target software when the second patch is upgraded.
本发明实施例可以将各个还原点与各个备份文件模型和各个备份文件分别建立对应关系,从而根据某个还原点对应的备份文件模型和备份文件可以使目标软件快速回滚至该还原点。In the embodiment of the present invention, each of the restore points can be respectively associated with each backup file model and each backup file, so that the target software can be quickly rolled back to the restore point according to the backup file model and the backup file corresponding to a certain restore point.
所述补丁可以包括第一补丁和第二补丁,所述第一补丁的升级次序位于所述第二补丁之前,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;The patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the patch is determined according to a file in the patch and a file in the target software. The newly added file and the change file include: determining, according to the file in the first patch and the file in the target software, a new file and a change file corresponding to the first patch;
所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型;The establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch. First backup file model;
所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份,包括:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;And performing the file backup according to the node corresponding to the change file in the backup file model, including: performing file backup according to the node corresponding to the change file in the first backup file model, and obtaining the corresponding corresponding to the first patch. backup file;
所述基于所述补丁执行升级操作,包括:基于所述第一补丁执行升级操作;Performing the upgrading operation based on the patch includes: performing an upgrade operation based on the first patch;
在基于所述第一补丁执行升级操作之后,所述方法还包括:当根据所述第一补丁升级成功,则根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;基于所述第二补丁执行升级操作。After performing the upgrade operation based on the first patch, the method further includes: determining, according to the file in the second patch and the file in the target software, that the upgrade is successful according to the first patch Adding a new file and a change file corresponding to the second patch; establishing a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch; deleting the second backup file model and the Obtaining a second backup file model of the same file as the backup file model of the first patch; performing file backup according to the node corresponding to the change file in the updated second backup file model, and obtaining the second A backup file corresponding to the patch; performing an upgrade operation based on the second patch.
本发明实施例中,串行执行各个补丁的文件备份与升级,可以先根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型;根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;基于所述第一补丁执行升级操作。当所述第一补丁升级成功,则根据所述第二补丁中的 文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;基于所述第二补丁执行升级操作。In the embodiment of the present invention, the file backup and upgrade of each patch are performed in a serial manner, and the newly added file and the change corresponding to the first patch may be determined according to the file in the first patch and the file in the target software. And creating a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch; and performing file backup according to the node corresponding to the change file in the first backup file model a backup file corresponding to the first patch; performing an upgrade operation based on the first patch. When the upgrade of the first patch is successful, determining, according to the file in the second patch and the file in the target software, a new file and a change file corresponding to the second patch; Adding a new backup file and a change file to establish a second backup file model of the second patch; deleting a node in the second backup file model that is the same as the backup file model of the first patch, and obtaining an updated second backup The file model is configured to perform a file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch, and perform an upgrade operation based on the second patch.
在本发明实施例中,在得到第二备份文件模型之后,还可以将第二备份文件模型和第一备份文件模型合并,得到合并后的备份文件模型。In the embodiment of the present invention, after obtaining the second backup file model, the second backup file model and the first backup file model may also be merged to obtain a merged backup file model.
本发明实施例可以将各个还原点与各个备份文件模型和各个备份文件分别建立对应关系,从而根据某个还原点对应的备份文件模型和备份文件可以使目标软件快速回滚至该还原点。In the embodiment of the present invention, each of the restore points can be respectively associated with each backup file model and each backup file, so that the target software can be quickly rolled back to the restore point according to the backup file model and the backup file corresponding to a certain restore point.
在基于所述补丁执行升级操作之后,所述方法还可以包括:当接收到回滚指令,根据所述回滚指令中的目标还原点获取与所述目标还原点对应的备份文件模型和备份文件;根据与所述目标还原点对应的备份文件模型和备份文件对升级后的目标软件执行回滚操作。After performing the upgrade operation based on the patch, the method may further include: when receiving the rollback instruction, acquiring a backup file model and a backup file corresponding to the target restore point according to the target restore point in the rollback instruction And performing a rollback operation on the upgraded target software according to the backup file model and the backup file corresponding to the target restore point.
本发明实施例中,回滚指令用于指示需要执行回滚操作,例如,在通过某个补丁升级失败时。可以通过弹出窗口提示用户是否执行回滚操作以及输入目标还原点,在接收到用户输入的目标还原点后,获取与该目标还原点对应的备份文件模型和备份文件。In the embodiment of the present invention, the rollback instruction is used to indicate that a rollback operation needs to be performed, for example, when the upgrade fails through a certain patch. You can use the pop-up window to prompt the user whether to perform the rollback operation and input the target restore point. After receiving the target restore point input by the user, obtain the backup file model and the backup file corresponding to the target restore point.
所述根据与所述目标还原点对应的备份文件模型和备份文件对升级后的目标软件执行回滚操作,可以包括:从所述升级后的目标软件中删除与所述目标还原点对应的备份文件模型中的各个节点对应的文件,并将与所述目标还原点对应的备份文件添加至所述目标软件中。The performing the rollback operation on the upgraded target software according to the backup file model and the backup file corresponding to the target restore point may include: deleting the backup corresponding to the target restore point from the upgraded target software A file corresponding to each node in the file model, and a backup file corresponding to the target restore point is added to the target software.
当所述补丁中的文件包括空目录,在根据所述补丁对应的所述新增文件、所述删除文件和所述修改文件建立所述补丁的备份文件模型之前,所述方法还可以包括:在所述空目录中增加说明文件。The method may further include: before the file in the patch includes an empty directory, before the backup file model of the patch is established according to the new file, the deleted file, and the modified file corresponding to the patch, the method may further include: Add a description file to the empty directory.
其中,说明文件可以是任意格式文件,例如,WORD文件、TXT文件等。本发明实施例在所述空目录中增加说明文件后,可以根据该说明文件的目录层次建立树节点。通过将空目录转化为其下包含的一个说明文件,可以 简化整个备份文件模型,将整个备份文件模型最终归于多个单独文件的操作,使得文件作为最小的操作单位,从而多个补丁先后进行升级时不会出现向已记录的空目录下新增文件这种情况。The description file may be any format file, for example, a WORD file, a TXT file, or the like. After the description file is added to the empty directory in the embodiment of the present invention, the tree node may be established according to the directory hierarchy of the description file. By converting an empty directory into a description file contained below, the entire backup file model can be simplified, and the entire backup file model is ultimately attributed to multiple separate files, so that the file is the smallest unit of operation, so that multiple patches are upgraded successively. There is no such thing as adding a new file to a recorded empty directory.
本发明实施例通过在软件升级时基于备份文件模型仅备份变更文件,减少了备份文件的数量,节省了软件补丁升级时的耗时,提高了升级效率。而且,可以基于备份文件模型和备份文件使目标软件方便快速的回滚至升级前的版本。In the embodiment of the present invention, only the change file is backed up based on the backup file model during the software upgrade, thereby reducing the number of backup files, saving time spent in upgrading the software patch, and improving the upgrade efficiency. Moreover, the target software can be quickly and easily rolled back to the pre-upgrade version based on the backup file model and the backup file.
如图3所示,本发明实施例提供一种软件升级方法,包括以下步骤:As shown in FIG. 3, an embodiment of the present invention provides a software upgrade method, including the following steps:
步骤S301、以补丁中文件为参照,逐个扫描目标软件中的同名文件,并置相应的标识位。Step S301: Referring to the file in the patch as a reference, scanning the file of the same name in the target software one by one, and setting the corresponding identifier bit.
对于补丁中的文件,如果目标软件中该文件存在,则可以标识为修改;如果目标软件中该文件不存在,则标识为新增;如果需要删除该文件,则标识为删除。For the file in the patch, if the file exists in the target software, it can be identified as modified; if the file does not exist in the target software, the identifier is added; if the file needs to be deleted, the identifier is deleted.
步骤S302、建立补丁的备份文件模型。Step S302: Establish a backup file model of the patch.
可以参见图4,备份文件模型建立过程如下:Referring to Figure 4, the backup file model is established as follows:
如果是新增的文件(也即新增文件),根据该文件的目录层次建立树节点,并将该节点标记为新增,其中,如果新增的文件是空目录,则在该目录下新增说明文件,例如,ignore.txt,并根据该说明文件的目录层次建立树节点,将该节点标记为新增。If it is a new file (that is, a new file), a tree node is created according to the directory hierarchy of the file, and the node is marked as new, wherein if the newly added file is an empty directory, then a new directory is created in the directory. Add a description file, for example, ignore.txt, and create a tree node based on the directory hierarchy of the description file, marking the node as new.
本发明实施例通过将空目录的新增转化为空目录中的一个说明文件的新增,可以简化整个备份文件模型,将整个备份文件模型最终归于多个单独文件的操作,使得文件作为最小的操作单位,可以避免多个补丁先后进行升级时出现向已记录的空目录下新增文件的这种情况。In the embodiment of the present invention, by converting the newly added empty directory into a new description file in the empty directory, the entire backup file model can be simplified, and the entire backup file model is ultimately attributed to a plurality of separate files, so that the file is minimized. The operating unit can avoid the situation where multiple files are added to the recorded empty directory when multiple patches are upgraded one after another.
如果是删除的文件(也即删除文件),根据该文件的目录层次建立树节点,并将该节点标记为删除,其中,如果删除的文件是空目录,则在空目录下新增说明文件,例如,ignore.txt,根据说明文件的目录层次建立树节点,并将该节点标识为删除。If the file is deleted (that is, deleted), the tree node is created according to the directory hierarchy of the file, and the node is marked as deleted. If the deleted file is an empty directory, the description file is added in the empty directory. For example, ignore.txt creates a tree node based on the directory hierarchy of the description file and identifies the node as deleted.
如果是修改的文件(也即修改文件),可以将修改作为删除和新增的组合。这样做可以进一步简化对文件操作的类型,将对文件的所有操作简化为 新增和删除两种。将修改的文件转化为删除的文件和新增的文件的组合,并分别根据删除的文件和新增的文件的目录层次建立树节点。If it is a modified file (that is, a modified file), the modification can be used as a combination of deletion and addition. Doing so further simplifies the type of file operations, simplifying all operations on the file to both new and deleted. Convert the modified file into a combination of the deleted file and the newly added file, and establish a tree node according to the deleted file and the directory hierarchy of the newly added file.
将按照上述规则建立的树节点归并到同一棵树结构中,得到备份文件模型。The tree nodes established according to the above rules are merged into the same tree structure to obtain a backup file model.
步骤S303、根据补丁的备份文件模型进行文件备份,并基于该补丁执行升级操作。Step S303: Perform file backup according to the backup file model of the patch, and perform an upgrade operation based on the patch.
在本发明实施例中,文件备份时将备份文件模型中标识为删除的节点依次备份到一个固定的目录,对于标识为新增的节点只记录,不处理。In the embodiment of the present invention, when the file is backed up, the nodes identified as deleted in the backup file model are sequentially backed up to a fixed directory, and only the records identified as newly added nodes are not processed.
补丁升级前也可以保存当前的备份文件模型,这样在某个补丁升级失败或者手工进行回退时,可以选择回退到该还原点。You can also save the current backup file model before the patch is upgraded. When a patch fails to be upgraded or manually rolled back, you can choose to roll back to the restore point.
步骤S304、判断是否升级成功。Step S304, determining whether the upgrade is successful.
当升级成功,执行步骤S305,当升级失败,执行步骤S309。When the upgrade is successful, step S305 is performed, and when the upgrade fails, step S309 is performed.
步骤S305、判断是否还有其他补丁。In step S305, it is determined whether there are other patches.
本发明实施例中,其他补丁是指除已升级的补丁之外的当前需要升级的补丁。当还有其他补丁,则执行步骤S306,当没有其他补丁,则执行步骤S308。In the embodiment of the present invention, other patches refer to patches that need to be upgraded in addition to the upgraded patches. When there are other patches, step S306 is performed, and when there are no other patches, step S308 is performed.
步骤S306、对后续补丁继续建立备份文件模型,并且将该补丁的备份文件模型归并到之前的备份文件模型中,得到归并后的备份文件模型。Step S306, continuing to establish a backup file model for the subsequent patches, and merging the backup file model of the patch into the previous backup file model to obtain the merged backup file model.
本发明实施例中,后续补丁是指升级次序位于当前已升级的补丁之后的补丁,之前的备份文件模型是指前面升级的补丁的备份文件模型。In the embodiment of the present invention, the subsequent patch refers to a patch whose upgrade order is located after the currently upgraded patch, and the previous backup file model refers to a backup file model of the previously upgraded patch.
本发明实施例中,建立后续补丁的备份文件模型的过程如下:In the embodiment of the present invention, the process of establishing a backup file model of a subsequent patch is as follows:
如果是新增的文件,根据该文件的目录层次建立新的树节点,得到归并后的备份文件模型的树节点,如果该节点在之前的备份文件模型中存在则不处理,如果该节点不存在则将节点添加至之前备份文件模型中,并标识为新增。If it is a new file, a new tree node is created according to the directory hierarchy of the file, and the tree node of the merged backup file model is obtained. If the node exists in the previous backup file model, it is not processed if the node does not exist. The node is added to the previous backup file model and identified as new.
如果是删除的文件,根据该文件的目录层次建立新的树节点,如果该节点在之前的备份文件模型中存在则不处理;如果该节点不存在则将该节点添加至之前的备份文件模型中,并标识为删除。If it is a deleted file, a new tree node is created according to the directory hierarchy of the file, and if the node exists in the previous backup file model, it is not processed; if the node does not exist, the node is added to the previous backup file model. And identified as deleted.
本发明实施例通过对新增和删除的树节点先进行存在性判断,目的是针 对同一个文件只记录第一次操作,后续补丁升级时无论再对该文件进行何种操作,或者进行多少次操作都不再处理,从而可以降低本发明实施例的软件升级方法的复杂度。In the embodiment of the present invention, the presence and deletion of the newly added and deleted tree nodes are first performed, and the purpose is to record only the first operation for the same file, and no matter what operation or how many times the subsequent file is upgraded. The operations are no longer processed, so that the complexity of the software upgrade method of the embodiment of the present invention can be reduced.
步骤S307、根据归并后的备份文件模型再次进行备份,然后进行补丁升级。Step S307: Perform a backup again according to the merged backup file model, and then perform a patch upgrade.
在该补丁升级之后,返回执行步骤S305。本发明实施例可以重复执行步骤S305至步骤S307直至所有补丁升级完毕。After the patch is upgraded, the process returns to step S305. The embodiment of the present invention may repeatedly perform steps S305 to S307 until all patches are upgraded.
需要说明的是,本发明实施例也可以重复执行步骤S304至步骤S307直至所有补丁升级完毕。It should be noted that, in the embodiment of the present invention, step S304 to step S307 may be repeatedly performed until all patches are upgraded.
步骤S308、是否需要回退版本。Step S308, whether the version needs to be rolled back.
当需要回退(也即回滚)版本,执行步骤S309,当不需要回退版本,则结束。实际情况中,当存在某个补丁升级失败,或是补丁升级成功,但是业务不正常,则通常需要将升级后的目标软件回退至升级前的版本。When the version needs to be rolled back (ie, rolled back), step S309 is performed, and when the version is not required to be rolled back, the process ends. In the actual situation, if a patch fails to be upgraded, or the patch is upgraded successfully, but the service is abnormal, you usually need to roll back the upgraded target software to the pre-upgrade version.
步骤S309、根据备份文件模型进行软件回退。Step S309: Perform software rollback according to the backup file model.
软件回退的流程可以包括:遍历归并后的备份文件模型中的节点,并从目标软件中删除归并后的备份文件模型中各个节点对应的文件;将备份文件覆盖到目标软件中。The software rollback process may include: traversing the nodes in the merged backup file model, and deleting the files corresponding to each node in the merged backup file model from the target software; and overwriting the backup file to the target software.
需要说明的是,这里的删除是指所有节点的删除,不仅仅包含标识为新增的节点,标识为删除的也需要删除,因为标识为删除的节点是在第一次操作该节点时记录的,后续的操作时该节点可能会被新建,修改,甚至在目录下放置了其他的文件,删除会彻底清理掉这些文件,才能保证将备份文件覆盖到目标中后软件版本的状态和当时的状态是完全一致的。It should be noted that the deletion here refers to the deletion of all nodes, not only the node identified as new, but also deleted after the identifier is deleted, because the node identified as deleted is recorded when the node is operated for the first time. In the subsequent operation, the node may be newly created, modified, and even placed other files in the directory. The deletion will completely clean up the files, so as to ensure the state of the software version and the current state after the backup file is overwritten to the target. It is exactly the same.
本发明实施例的软件升级方法,备份的文件大大减少;同时也去除了补丁之间相同文件这部分冗余的备份,进一步降低了需要备份的文件数量,节省了软件补丁升级时的耗时,提高了升级效率。In the software upgrade method of the embodiment of the present invention, the backup file is greatly reduced; and the redundant backup of the same file between the patches is also removed, thereby further reducing the number of files that need to be backed up, and saving time spent in software patch upgrade. Improve the efficiency of the upgrade.
以下以实例对本发明实施例进行说明:The embodiments of the present invention are described below by way of examples:
补丁集patchSet中包含补丁patch1和补丁patch2。补丁patch1中包括:新增文件FileAdd1,新增空目录DirAdd1,删除文件FileDel1,删除空目录DirDel2,删除目录DirDel3,修改文件FileModify;补丁patch2中包括:删 除文件FileAdd1,FileDel4,新增FileAdd2,DirDel2。Patch set patchSet contains patch patch1 and patch patch2. Patch 1 includes: Add file FileAdd1, add empty directory DirAdd1, delete file FileDel1, delete empty directory DirDel2, delete directory DirDel3, modify file FileModify; patch patch2 includes: delete files FileAdd1, FileDel4, add FileAdd2, DirDel2.
步骤a,以补丁patch1中的文件为参照,逐个扫描目标软件中的同名文件,并置相应的标识,FileAdd1,DirAdd1在软件版本中不存在,置为新增;FileDel1,DirDel2,DirDel3在目标软件中存在但是需要删除,置为删除;FileModify在软件版本和patch1中都存在,置为修改。Step a, refer to the file in the patch patch1 as a reference, scan the file of the same name in the target software one by one, and set the corresponding identifier, FileAdd1, DirAdd1 does not exist in the software version, set to add; FileDel1, DirDel2, DirDel3 in the target software Existing but need to be deleted, set to delete; FileModify exists in the software version and patch1, set to modify.
步骤b,建立patch1备份文件模型。Step b, create a patch1 backup file model.
可以根据FileAdd1的目录层次建立树节点,并标识为新增。由于DirAdd1是新增的空目录,在DirAdd1中新增一个说明文件,例如,ignore.txt,根据ignore.txt的目录层次建立树节点,并标识为新增。The tree node can be created according to the directory hierarchy of FileAdd1 and identified as new. Since DirAdd1 is a new empty directory, a new description file is added to DirAdd1, for example, ignore.txt. The tree node is created according to the directory hierarchy of ignore.txt and is identified as new.
根据FileDel1的目录层次建立树节点,并标识为删除。由于DirDel2是删除的空目录,在DirDel2新增一个说明文件,例如,ignore.txt,并根据ignore.txt的目录层次建立树节点,并标识为删除。A tree node is created according to the directory hierarchy of FileDel1 and identified as deleted. Since DirDel2 is an empty directory to be deleted, a description file is added to DirDel2, for example, ignore.txt, and a tree node is created according to the directory hierarchy of ignore.txt, and is identified as deleted.
由于DirDel3是删除的非空目录,根据DirDel3中各个文件的目录层次建立树节点,并标识为删除。FileModify是修改的文件,根据FileModify的目录层次建立树节点,并标识为删除。Since DirDel3 is a deleted non-empty directory, a tree node is created according to the directory hierarchy of each file in DirDel3, and is identified as deleted. FileModify is a modified file that establishes a tree node based on FileModify's directory hierarchy and identifies it as deleted.
步骤c,根据补丁patch1的备份文件模型进行文件备份,然后基于补丁patch1进行升级。Step c: Perform file backup according to the backup file model of the patch patch1, and then upgrade based on the patch patch1.
文件备份时只备份标识为删除的文件,例如,FileDel1,DirDel2/ignore.txt,DirDel3下所有叶子节点文件,FileModify。When the file is backed up, only the files identified as deleted are backed up, for example, FileDel1, DirDel2/ignore.txt, all leaf node files under DirDel3, FileModify.
步骤d,建立补丁patch2备份文件模型,并且将该补丁的备份文件模型归并到之前的备份文件模型中。In step d, a patch patch2 backup file model is created, and the backup file model of the patch is merged into the previous backup file model.
FileAdd1和DirDel2在补丁patch1中已经记录,不在归并到之前的备份文件模型中,只需归并FileDel4和FileAdd2即可。FileAdd1 and DirDel2 have been recorded in patch1 and are not merged into the previous backup file model. Simply merge FileDel4 and FileAdd2.
步骤e,根据归并后的补丁的备份文件模型进行文件备份,然后升级补丁patch2。Step e, perform file backup according to the backup file model of the merged patch, and then upgrade the patch patch2.
只需备份备份文件模型中的FileDel4和FileAdd2即可。Simply back up FileDel4 and FileAdd2 in the backup file model.
步骤f,如果补丁patch1和补丁patch2升级失败或者升级成功后需要回退版本,执行以下操作:在升级后的目标软件中删除归并后的备份文件模型中的所有节点;将所有备份的文件覆盖到目标软件中。Step f: If the upgrade of patch 1 and patch 2 fails or the version needs to be rolled back after the upgrade is successful, perform the following operations: Delete all nodes in the merged backup file model in the upgraded target software; overwrite all backup files to In the target software.
通过上述操作后即可实现目标软件全版本的回退,即回到目标软件升级之前的版本。After the above operations, the full version of the target software can be rolled back, that is, back to the version before the target software upgrade.
如图5所示,本发明实施例提供一种软件升级装置,该软件升级装置50包括:As shown in FIG. 5, an embodiment of the present invention provides a software upgrade apparatus, where the software upgrade apparatus 50 includes:
确定模块51,设置为当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;The determining module 51 is configured to: when receiving the upgrade instruction, determine the change file corresponding to the patch according to the file in the patch and the file in the target software;
建立模块52,设置为根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;The establishing module 52 is configured to establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch ;
第一备份模块53,设置为根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;The first backup module 53 is configured to perform file backup according to the node corresponding to the change file in the backup file model, to obtain a backup file;
升级模块54,设置为基于所述补丁执行升级操作。The upgrade module 54 is configured to perform an upgrade operation based on the patch.
所述确定模块51还设置为:当接收到升级指令时,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件;所述建立模块是设置为:根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型。The determining module 51 is further configured to: when receiving the upgrade instruction, determine, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch; The method is configured to: establish a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
所述补丁可以包括第一补丁和第二补丁,所述确定模块51是设置为:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件,根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;所述建立模块52是设置为:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,得到合并后的备份文件模型;所述第一备份模块53是设置为:根据所述合并后的备份文件模型中所述变更文件对应的节点进行文件备份,得到所述备份文件。The patch may include a first patch and a second patch, and the determining module 51 is configured to: determine, according to the file in the first patch and the file in the target software, a new one corresponding to the first patch And the file and the change file, the new file and the change file corresponding to the second patch are determined according to the file in the second patch and the file in the target software; the establishing module 52 is configured to: The first backup file model of the first patch is created by the new file and the change file corresponding to the first patch, and the second backup file model of the second patch is established according to the newly added file and the change file corresponding to the second patch. Merging each node in the first backup file model and the second backup file model to obtain a merged backup file model; the first backup module 53 is configured to: according to the merged backup file model The node corresponding to the change file performs file backup to obtain the backup file.
所述第一补丁的升级次序位于所述第二补丁之前,所述装置还可以包括:第二备份模块,设置为在根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件 和变更文件建立所述第二补丁的第二备份文件模型之后,根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;第三备份模块,设置为删除所述第二备份文件模型中与所述第一备份文件模型相同的节点,得到更新后的第二备份文件模型,并根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件。The device may further include: a second backup module, configured to establish the first file according to the newly added file and the change file corresponding to the first patch, where the upgrade order of the first patch is located before the second patch After the second backup file model of the second patch is created according to the new file and the change file corresponding to the second patch, the first backup file model of the patch is corresponding to the change file according to the first backup file model. The node performs a file backup to obtain a backup file corresponding to the first patch; and the third backup module is configured to delete the node in the second backup file model that is the same as the first backup file model, and obtain an updated And backing up the file model, and performing file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch.
所述补丁可以包括第一补丁和第二补丁,所述第一补丁的升级次序位于所述第二补丁之前,所述确定模块51是设置为:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;所述建立模块52是设置为:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型;所述第一备份模块53是设置为:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;所述升级模块54是设置为:基于所述第一补丁执行升级操作;The patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the determining module 51 is configured to: according to the file in the first patch and the a file in the target software, the new file and the change file corresponding to the first patch are determined; the establishing module 52 is configured to: establish the first patch according to the newly added file and the change file corresponding to the first patch The first backup file module is configured to: perform file backup according to the node corresponding to the change file in the first backup file model, and obtain a backup file corresponding to the first patch; The upgrade module 54 is configured to: perform an upgrade operation based on the first patch;
所述确定模块51还设置为:在基于所述第一补丁执行升级操作之后,当根据所述第一补丁升级成功,则根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;所述建立模块52还设置为:根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;所述第一备份模块53还设置为:根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;所述升级模块54还设置为:基于所述第二补丁执行升级操作。The determining module 51 is further configured to: after performing the upgrading operation based on the first patch, when the upgrade according to the first patch is successful, according to the file in the second patch and the file in the target software, Determining the new file and the change file corresponding to the second patch; the establishing module 52 is further configured to: establish a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch Deleting the same node as the backup file model of the first patch in the second backup file model to obtain an updated second backup file model; the first backup module 53 is further configured to: according to the update The node corresponding to the change file in the second backup file model performs file backup to obtain a backup file corresponding to the second patch. The upgrade module 54 is further configured to perform an upgrade operation based on the second patch.
所述装置还可以包括:回滚模块,设置为在基于所述补丁执行升级操作之后,当接收到回滚指令,根据所述备份文件模型和所述备份文件执行回滚操作。The apparatus may further include: a rollback module configured to perform a rollback operation according to the backup file model and the backup file when receiving a rollback instruction after performing an upgrade operation based on the patch.
本发明实施例通过确定模块51当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;建立模块52根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份 文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;第一备份模块53根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;升级模块54基于所述补丁执行升级操作。本发明实施例在软件升级时基于备份文件模型仅备份变更文件,减少了备份文件的数量,节省了软件补丁升级时的耗时,提高了升级效率。When the determining module 51 receives the upgrade command, the determining module 51 determines the change file corresponding to the patch according to the file in the patch and the file in the target software; the establishing module 52 establishes the change file according to the change file corresponding to the patch. a backup file model of the patch, wherein the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch; and the first backup module 53 corresponds to the change file in the backup file model. The node performs a file backup to obtain a backup file; the upgrade module 54 performs an upgrade operation based on the patch. In the embodiment of the present invention, only the change file is backed up based on the backup file model during the software upgrade, which reduces the number of backup files, saves time spent in upgrading the software patch, and improves the upgrade efficiency.
需要说明的是,本发明实施例中上述软件升级装置可以是本发明实施例中方法实施例中任意实施方式的用户终端,本发明实施例中方法实施例中用户终端的任意实施方式都可以被本实施例中的上述软件升级装置所实现,以及达到相同的有益效果,此处不再赘述。It should be noted that, in the embodiment of the present invention, the foregoing software upgrade device may be a user terminal in any embodiment of the method in the embodiment of the present invention, and any implementation manner of the user terminal in the method embodiment in the embodiment of the present invention may be The above software upgrade device in the embodiment is implemented, and the same beneficial effects are achieved, and details are not described herein again.
本领域普通技术人员可以理解实现上述实施例方法的全部或者部分步骤是可以通过程序指令相关的硬件来完成,所述的程序可以存储于一计算机可读取介质中,该程序在执行时,包括以下步骤:当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;基于所述补丁执行升级操作。It will be understood by those skilled in the art that all or part of the steps of implementing the above embodiments may be performed by hardware associated with program instructions, which may be stored in a computer readable medium, including when executed, including The following steps are: when the upgrade command is received, the change file corresponding to the patch is determined according to the file in the patch and the file in the target software; and the backup file model of the patch is established according to the change file corresponding to the patch, where The backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch; performing file backup according to the node corresponding to the change file in the backup file model to obtain a backup file; The patch performs an upgrade operation.
当接收到升级指令,该程序在执行时,还包括:根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件;所述根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,包括:根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型。When the program is executed, the program further includes: determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch; And establishing, by the corresponding change file, the backup file model of the patch, including: establishing a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
所述补丁可以包括第一补丁和第二补丁,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件,根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文 件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,得到合并后的备份文件模型;所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件,包括:根据所述合并后的备份文件模型中所述变更文件对应的节点进行文件备份,得到所述备份文件。The patch may include a first patch and a second patch, and determining, according to the file in the patch and the file in the target software, a new file and a change file corresponding to the patch, including: according to the first patch Determining, in the file in the target software, the new file and the change file corresponding to the first patch, determining the second according to the file in the second patch and the file in the target software a new file and a change file corresponding to the patch; the backup file model of the patch is established according to the newly added file and the change file corresponding to the patch, including: adding a new file corresponding to the first patch Establishing a first backup file model of the first patch, and a second backup file model of the second patch according to the new file and the change file corresponding to the second patch; and merging the first backup file a model and a node in the second backup file model, to obtain a merged backup file model; the corresponding change file according to the backup file model The node performs the file backup to obtain the backup file, and includes: performing file backup according to the node corresponding to the change file in the merged backup file model, to obtain the backup file.
所述补丁可以包括第一补丁和第二补丁,所述第一补丁的升级次序位于所述第二补丁之前,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型;所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份,包括:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;所述基于所述补丁执行升级操作,包括:基于所述第一补丁执行升级操作;在基于所述第一补丁执行升级操作之后,该程序在执行时,还包括以下步骤:当根据所述第一补丁升级成功,则根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;基于所述第二补丁执行升级操作。The patch may include a first patch and a second patch, where the upgrade order of the first patch is located before the second patch, and the patch is determined according to a file in the patch and a file in the target software. The newly added file and the change file include: determining, according to the file in the first patch and the file in the target software, a new file and a change file corresponding to the first patch; The newly added file and the change file establish a backup file model of the patch, including: establishing a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch; The file backup is performed according to the node corresponding to the change file in the backup file model, including: performing file backup according to the node corresponding to the change file in the first backup file model, and obtaining a backup corresponding to the first patch. And performing the upgrading operation based on the patch, including: performing an upgrade operation based on the first patch; performing, based on the first patch After the level operation, the program further includes the following steps: when the upgrade is successful according to the first patch, determining the second patch according to the file in the second patch and the file in the target software Corresponding new file and change file; establishing a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch; deleting the second backup file model and the first The second backup file model is obtained by the same node of the backup file model of the patch, and the file corresponding to the change file in the updated second backup file model is used for file backup, and the second patch is obtained. Backing up the file; performing an upgrade operation based on the second patch.
在基于所述补丁执行升级操作之后,该程序在执行时,还可以包括:当接收到回滚指令,根据所述备份文件模型和所述备份文件执行回滚操作。After the upgrade operation is performed based on the patch, the program may further include: when receiving the rollback instruction, performing a rollback operation according to the backup file model and the backup file.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步 骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理单元的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些组件或所有组件可以被实施为由处理器,如数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括用于存储信息(诸如计算机可读指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于RAM、ROM、EEPROM、闪存或其他存储器技术、CD-ROM、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。以上所述是本发明的可选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。Those of ordinary skill in the art will appreciate that all or some of the steps, systems, and functional blocks/units of the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical units; for example, one physical component may have multiple functions, or one function or step may be composed of several physical The components work together. Some or all of the components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer readable medium, which may include computer storage media (or non-transitory media) and communication media (or transitory media). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and nonvolatile, implemented in any method or technology for storing information, such as computer readable instructions, data structures, program modules, or other data. , removable and non-removable media. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or may Any other medium used to store the desired information and that can be accessed by the computer. Moreover, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal, such as a carrier wave or other transport mechanism, and can include any information delivery media. The above is an alternative embodiment of the present invention, and it should be noted that those skilled in the art can make several improvements and retouchings without departing from the principles of the present invention. It should also be considered as the scope of protection of the present invention.
工业实用性Industrial applicability
本发明实施例在软件升级时基于备份文件模型仅备份变更文件,减少了备份文件的数量,节省了软件补丁升级时的耗时,提高了升级效率。In the embodiment of the present invention, only the change file is backed up based on the backup file model during the software upgrade, which reduces the number of backup files, saves time spent in upgrading the software patch, and improves the upgrade efficiency.

Claims (11)

  1. 一种软件升级方法,包括:A software upgrade method, including:
    当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;When receiving the upgrade instruction, determining the change file corresponding to the patch according to the file in the patch and the file in the target software;
    根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;Establishing a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch;
    根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;Performing a file backup according to the node corresponding to the change file in the backup file model, and obtaining a backup file;
    基于所述补丁执行升级操作。Perform an upgrade operation based on the patch.
  2. 根据权利要求1所述的方法,所述方法还包括:当接收到升级指令,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件;The method according to claim 1, further comprising: when receiving an upgrade instruction, determining a new file and a change file corresponding to the patch according to a file in the patch and a file in the target software;
    所述根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,包括:根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型。The establishing a backup file model of the patch according to the change file corresponding to the patch includes: establishing a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
  3. 根据权利要求2所述的方法,其中,所述补丁包括第一补丁和第二补丁,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件,根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;The method according to claim 2, wherein the patch comprises a first patch and a second patch, and according to files in the patch and files in the target software, determining new files and changes corresponding to the patches The file includes: determining, according to the file in the first patch and the file in the target software, a new file and a change file corresponding to the first patch, according to the file in the second patch and the target a file in the software, determining a new file and a change file corresponding to the second patch;
    所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,得到合并后的备份文件模型;The establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch. a first backup file model, the second backup file model of the second patch is established according to the newly added file and the change file corresponding to the second patch; and the first backup file model and the second backup file model are merged Each node gets the merged backup file model;
    所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份, 得到备份文件,包括:根据所述合并后的备份文件模型中所述变更文件对应的节点进行文件备份,得到所述备份文件。And performing the file backup according to the node corresponding to the change file in the backup file model, and obtaining the backup file, including: performing file backup according to the node corresponding to the change file in the merged backup file model, and obtaining the file backup file.
  4. 根据权利要求2所述的方法,其中,所述补丁包括第一补丁和第二补丁,所述第一补丁的升级次序位于所述第二补丁之前,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件,包括:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;The method according to claim 2, wherein the patch comprises a first patch and a second patch, and an upgrade order of the first patch is located before the second patch, according to a file in the patch and the target The file in the software, the new file and the change file corresponding to the patch are determined, including: determining, according to the file in the first patch and the file in the target software, a new file corresponding to the first patch and Change document;
    所述根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型,包括:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型;The establishing a backup file model of the patch according to the newly added file and the change file corresponding to the patch includes: establishing the first patch according to the newly added file and the change file corresponding to the first patch. First backup file model;
    所述根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件,包括:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;And performing the file backup according to the node corresponding to the change file in the backup file model, and obtaining the backup file, including: performing file backup according to the node corresponding to the change file in the first backup file model, to obtain the a backup file corresponding to a patch;
    所述基于所述补丁执行升级操作,包括:基于所述第一补丁执行升级操作;Performing the upgrading operation based on the patch includes: performing an upgrade operation based on the first patch;
    所述方法还包括:在基于所述第一补丁执行升级操作之后,当根据所述第一补丁升级成功,则根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;The method further includes: after performing an upgrade operation based on the first patch, when the upgrade according to the first patch is successful, determining, according to a file in the second patch and a file in the target software, New files and change files corresponding to the second patch;
    根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;Establishing a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch;
    删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;Deleting a node in the second backup file model that is the same as the backup file model of the first patch, and obtaining an updated second backup file model;
    根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;And performing a file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch;
    基于所述第二补丁执行升级操作。An upgrade operation is performed based on the second patch.
  5. 根据权利要求2所述的方法,所述方法还包括:在基于所述补丁执行升级操作之后,当接收到回滚指令,根据所述备份文件模型和所述备份文件执行回滚操作。The method according to claim 2, further comprising: performing a rollback operation according to the backup file model and the backup file when receiving a rollback instruction after performing an upgrade operation based on the patch.
  6. 一种软件升级装置,包括:A software upgrade device, comprising:
    确定模块,设置为当接收到升级指令,根据补丁中的文件和目标软件中的文件,确定所述补丁对应的变更文件;Determining a module, configured to: when receiving an upgrade instruction, determine a change file corresponding to the patch according to the file in the patch and the file in the target software;
    建立模块,设置为根据所述补丁对应的所述变更文件建立所述补丁的备份文件模型,其中,所述备份文件模型为根据所述补丁对应的所述变更文件的目录层次生成的树结构;Establishing a module, configured to establish a backup file model of the patch according to the change file corresponding to the patch, where the backup file model is a tree structure generated according to a directory hierarchy of the change file corresponding to the patch;
    第一备份模块,设置为根据所述备份文件模型中所述变更文件对应的节点进行文件备份,得到备份文件;The first backup module is configured to perform file backup according to the node corresponding to the change file in the backup file model, to obtain a backup file;
    升级模块,设置为基于所述补丁执行升级操作。The upgrade module is configured to perform an upgrade operation based on the patch.
  7. 根据权利要求6所述的装置,其中,所述确定模块还设置为:当接收到升级指令,根据所述补丁中的文件和所述目标软件中的文件,确定所述补丁对应的新增文件和变更文件;The apparatus according to claim 6, wherein the determining module is further configured to: when receiving an upgrade instruction, determine a new file corresponding to the patch according to a file in the patch and a file in the target software And change documents;
    所述建立模块是设置为:根据所述补丁对应的所述新增文件和所述变更文件建立所述补丁的备份文件模型。The establishing module is configured to: establish a backup file model of the patch according to the newly added file corresponding to the patch and the change file.
  8. 根据权利要求7所述的装置,其中,所述补丁包括第一补丁和第二补丁,所述确定模块是设置为:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件,根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;The apparatus according to claim 7, wherein the patch comprises a first patch and a second patch, and the determining module is configured to: determine, according to a file in the first patch and a file in the target software, And the new file and the change file corresponding to the first patch, and the new file and the change file corresponding to the second patch are determined according to the file in the second patch and the file in the target software;
    所述建立模块是设置为:根据所述第一补丁对应的新增文件和变更文件建立所述第一补丁的第一备份文件模型,根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;合并所述第一备份文件模型和所述第二备份文件模型中的各个节点,得到合并后的备份文件模型;The establishing module is configured to: establish a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch, and establish a new file and a change file corresponding to the second patch. a second backup file model of the second patch; merging each node in the first backup file model and the second backup file model to obtain a merged backup file model;
    所述第一备份模块是设置为:根据所述合并后的备份文件模型中所述变更文件对应的节点进行文件备份,得到所述备份文件。The first backup module is configured to: perform file backup according to the node corresponding to the change file in the merged backup file model, to obtain the backup file.
  9. 根据权利要求7所述的装置,其中,所述补丁包括第一补丁和第二补丁,所述第一补丁的升级次序位于所述第二补丁之前,所述确定模块:根据所述第一补丁中的文件和所述目标软件中的文件,确定所述第一补丁对应的新增文件和变更文件;The apparatus according to claim 7, wherein the patch comprises a first patch and a second patch, the upgrade order of the first patch is located before the second patch, and the determining module is: according to the first patch a file in the target file and a file in the target software, and determining a new file and a change file corresponding to the first patch;
    所述建立模块是设置为:根据所述第一补丁对应的新增文件和变更文件 建立所述第一补丁的第一备份文件模型;The establishing module is configured to: establish a first backup file model of the first patch according to the newly added file and the change file corresponding to the first patch;
    所述第一备份模块是设置为:根据所述第一备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第一补丁对应的备份文件;The first backup module is configured to: perform file backup according to the node corresponding to the change file in the first backup file model, and obtain a backup file corresponding to the first patch;
    所述升级模块是设置为:基于所述第一补丁执行升级操作;The upgrading module is configured to: perform an upgrade operation based on the first patch;
    所述确定模块还设置为:在基于所述第一补丁执行升级操作之后,当根据所述第一补丁升级成功,则根据所述第二补丁中的文件和所述目标软件中的文件,确定所述第二补丁对应的新增文件和变更文件;The determining module is further configured to: after performing the upgrading operation based on the first patch, when the upgrade according to the first patch is successful, determining, according to the file in the second patch and the file in the target software, The new file and the change file corresponding to the second patch;
    所述建立模块还设置为:根据所述第二补丁对应的新增文件和变更文件建立所述第二补丁的第二备份文件模型;删除所述第二备份文件模型中与所述第一补丁的备份文件模型相同的节点,得到更新后的第二备份文件模型;The establishing module is further configured to: establish a second backup file model of the second patch according to the newly added file and the change file corresponding to the second patch; and delete the second backup file model and the first patch The backup file model has the same node and gets the updated second backup file model;
    所述第一备份模块还设置为:根据所述更新后的第二备份文件模型中所述变更文件对应的节点进行文件备份,得到所述第二补丁对应的备份文件;The first backup module is further configured to: perform file backup according to the node corresponding to the change file in the updated second backup file model, to obtain a backup file corresponding to the second patch;
    所述升级模块还设置为:基于所述第二补丁执行升级操作。The upgrade module is further configured to perform an upgrade operation based on the second patch.
  10. 根据权利要求7所述的装置,所述装置还包括:The apparatus of claim 7 further comprising:
    回滚模块,设置为在基于所述补丁执行升级操作之后,当接收到回滚指令,根据所述备份文件模型和所述备份文件执行回滚操作。The rollback module is configured to perform a rollback operation according to the backup file model and the backup file when receiving a rollback instruction after performing an upgrade operation based on the patch.
  11. 一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被处理器执行时实现权利要求1至5中任一项所述的方法。A computer readable storage medium storing computer executable instructions that, when executed by a processor, implement the method of any one of claims 1 to 5.
PCT/CN2018/080043 2017-03-27 2018-03-22 Software upgrade method and device WO2018177193A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710187257.6A CN108664255B (en) 2017-03-27 2017-03-27 Software upgrading method and device
CN201710187257.6 2017-03-27

Publications (1)

Publication Number Publication Date
WO2018177193A1 true WO2018177193A1 (en) 2018-10-04

Family

ID=63674189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/080043 WO2018177193A1 (en) 2017-03-27 2018-03-22 Software upgrade method and device

Country Status (2)

Country Link
CN (1) CN108664255B (en)
WO (1) WO2018177193A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874237A (en) * 2019-12-30 2020-03-10 深圳市英博超算科技有限公司 Software upgrading method, device, terminal and readable storage medium
CN113094861A (en) * 2021-05-08 2021-07-09 国网河北省电力有限公司经济技术研究院 Data storage method, device, equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446161B (en) * 2018-10-18 2021-12-28 网易(杭州)网络有限公司 Information monitoring method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245332A1 (en) * 2001-09-28 2007-10-18 Yoram Tal Method and apparatus to perform an application software migration
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs
CN103955363A (en) * 2014-04-08 2014-07-30 国云科技股份有限公司 Manufacturing method of program upgrade and installation package
CN105550060A (en) * 2014-10-31 2016-05-04 Tcl集团股份有限公司 Increment upgrade backup method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7251749B1 (en) * 2004-02-12 2007-07-31 Network Appliance, Inc. Efficient true image recovery of data from full, differential, and incremental backups
CN102193805B (en) * 2010-03-11 2014-05-07 华为技术有限公司 Device and method for upgrading software patches
JP2013033334A (en) * 2011-08-01 2013-02-14 Nippon Telegr & Teleph Corp <Ntt> Backup device, and failure recovery method
CN104156244B (en) * 2014-08-06 2018-09-04 北京奇虎科技有限公司 A kind of method and apparatus of software upgrading
CN105468396A (en) * 2014-09-11 2016-04-06 深圳Tcl数字技术有限公司 Generating method for differential package, upgrading method, generating apparatus, and Linux terminal
CN105117263B (en) * 2015-09-14 2018-06-22 北京空间飞行器总体设计部 A kind of unix environment software system updating method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070245332A1 (en) * 2001-09-28 2007-10-18 Yoram Tal Method and apparatus to perform an application software migration
CN103699410A (en) * 2013-12-20 2014-04-02 北京奇虎科技有限公司 Method and device for updating application programs
CN103955363A (en) * 2014-04-08 2014-07-30 国云科技股份有限公司 Manufacturing method of program upgrade and installation package
CN105550060A (en) * 2014-10-31 2016-05-04 Tcl集团股份有限公司 Increment upgrade backup method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874237A (en) * 2019-12-30 2020-03-10 深圳市英博超算科技有限公司 Software upgrading method, device, terminal and readable storage medium
CN113094861A (en) * 2021-05-08 2021-07-09 国网河北省电力有限公司经济技术研究院 Data storage method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN108664255A (en) 2018-10-16
CN108664255B (en) 2023-04-11

Similar Documents

Publication Publication Date Title
JP5342302B2 (en) Firmware update system, firmware distribution server, and program
US8726262B2 (en) Firmware update system and information apparatus, and program
US10599337B2 (en) Method and device for writing data and acquiring data in a distributed storage system
US6892255B2 (en) Program install method, file renewal method, program and computer system
US9436559B2 (en) Storage apparatus and method for controlling cache of storage apparatus
WO2018177193A1 (en) Software upgrade method and device
CN108234554B (en) Cloud file editing method and device
CN107463467B (en) Method and system capable of quickly restoring virtualization platform
US20190227710A1 (en) Incremental data restoration method and apparatus
US11099980B2 (en) Host aware update write
CN105867962A (en) System upgrading method and device
CN104484240A (en) Method and device for storing terminal data
US20130086572A1 (en) Generation apparatus, generation method and computer readable information recording medium
CN101710373A (en) File operation method of embedded system
US9921918B1 (en) Cloud-based data backup and management
WO2013107158A1 (en) Method and system for managing system parameter in terminal device
CN110879764B (en) Bitmap setting method, device and equipment and readable storage medium
WO2019041891A1 (en) Method and device for generating upgrade package
CN104331311A (en) Upgrade package generating method and device
CN106599006B (en) Data recovery method and device
CN109325005B (en) Data processing method and electronic equipment
CN107145501B (en) File updating method, file copying method and corresponding system
CN109241071A (en) A kind of Android database upgrade method, apparatus and terminal
US11449389B2 (en) Techniques for performing incremental data backups
US10860533B1 (en) File size as an indicator of file properties

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

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

Country of ref document: EP

Kind code of ref document: A1