CN108664255A - A kind of method for upgrading software and device - Google Patents

A kind of method for upgrading software and device Download PDF

Info

Publication number
CN108664255A
CN108664255A CN201710187257.6A CN201710187257A CN108664255A CN 108664255 A CN108664255 A CN 108664255A CN 201710187257 A CN201710187257 A CN 201710187257A CN 108664255 A CN108664255 A CN 108664255A
Authority
CN
China
Prior art keywords
file
patch
backup
model
change
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201710187257.6A
Other languages
Chinese (zh)
Other versions
CN108664255B (en
Inventor
冯浩展
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zte Technical Service Co ltd
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201710187257.6A priority Critical patent/CN108664255B/en
Priority to PCT/CN2018/080043 priority patent/WO2018177193A1/en
Publication of CN108664255A publication Critical patent/CN108664255A/en
Application granted granted Critical
Publication of CN108664255B publication Critical patent/CN108664255B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Abstract

A kind of method for upgrading software of present invention offer and device.This method includes:If receiving upgrade command, according to the file in the file and target software in patch, the corresponding change file of the patch is determined;The backup file model of the patch is established according to the corresponding change file of the patch, wherein the backup file model is the tree construction generated according to the TOC level of the corresponding change file of the patch;File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup file;Updating operation is executed based on the patch.The embodiment of the present invention only backs up change file in software upgrading based on backup file model, middle compared with the prior art to carry out full software version backup, reduces the quantity of backup file, and taking when saving software patch upgrading improves upgrading efficiency.

Description

A kind of method for upgrading software and device
Technical field
The present invention relates to field of computer technology, more particularly to a kind of method for upgrading software and device.
Background technology
After software version publication, in order to correct loophole (bug) or add new function, the shape of patch collection is often used Formula is upgraded.The patch collection of software generally will include multiple patches, and patch collection can be carried out first according to order one by one when upgrading Patch installing operates.If the backup before the upgrading of patch collection without software version, once a patch upgrading goes wrong, then only Can reinstall software, thus when patch collection upgrades version backup it is extremely important.It cannot learn and repair in advance before the upgrading of patch collection The file changed can only carry out the backup of entire software version, because the quantity that software runs file after a period of time at the scene can become Must be very huge, this will greatly increase taking for patch collection upgrading.
Full version backup takes longer, efficiency when causing to upgrade when in the prior art, for software version patch upgrading Relatively low problem, currently no effective solution has been proposed.
Invention content
The embodiment of the present invention is designed to provide a kind of method for upgrading software and device, solves software version patch liter Full version backup takes longer, efficiency lower problem when causing to upgrade when grade.
In order to achieve the above object, the embodiment of the present invention provides a kind of method for upgrading software.This method includes:
If receiving upgrade command, according to the file in the file and target software in patch, determine that the patch corresponds to Change file;
The backup file model of the patch is established according to the corresponding change file of the patch, wherein described standby Part file model is the tree construction generated according to the TOC level of the corresponding change file of the patch;
File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup text Part;
Updating operation is executed based on the patch.
The embodiment of the present invention also provides a kind of software updating apparatus.The device includes:
If determining module, according to the file in the file and target software in patch, determines for receiving upgrade command The corresponding change file of the patch;
Module is established, the backup file mould for establishing the patch according to the corresponding change file of the patch Type, wherein the backup file model is the tree knot generated according to the TOC level of the corresponding change file of the patch Structure;
First backup module, for carrying out file according to the corresponding node of change file described in the backup file model Backup, obtains backup file;
Upgraded module, for executing updating operation based on the patch.
The embodiment of the present invention also provides a kind of computer storage media, and computer is stored in the computer storage media Executable one or more programs, one or more of programs make the computer execute such as when being executed by the computer A kind of method for upgrading software of above-mentioned offer.
A technical solution in above-mentioned technical proposal has the following advantages that or advantageous effect:
If the embodiment of the present invention is by receiving upgrade command, according to the file in the file and target software in patch, Determine the corresponding change file of the patch;The backup text of the patch is established according to the corresponding change file of the patch Part model, wherein the backup file model is to be generated according to the TOC level of the corresponding change file of the patch Tree construction;File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup file; Updating operation is executed based on the patch.The embodiment of the present invention only backs up change text in software upgrading based on backup file model Part, it is middle compared with the prior art to carry out full software version backup, reduce the quantity of backup file, saves software patch upgrading When take, improve upgrading efficiency.
Description of the drawings
Fig. 1 is the flow chart of method for upgrading software provided in an embodiment of the present invention;
Fig. 2 is the flow chart for the method for upgrading software that further embodiment of this invention provides;
Fig. 3 is the flow chart for the method for upgrading software that further embodiment of this invention provides;
Fig. 4 is the schematic diagram of file backup model provided in an embodiment of the present invention;
Fig. 5 is the schematic diagram of software updating apparatus provided in an embodiment of the present invention.
Specific implementation mode
To keep the technical problem to be solved in the present invention, technical solution and advantage clearer, below in conjunction with attached drawing and tool Body embodiment is described in detail.
As shown in Figure 1, the embodiment of the present invention provides a kind of method for upgrading software, include the following steps:
If step S101, receiving upgrade command, according to the file in the file and target software in patch, determine described in The corresponding change file of patch.
In this reality inventive embodiments, upgrade command, which is used to indicate, needs software upgrade to operate, and target software can be Any one software upgraded, change file can delete file and/or modification file, wherein delete file May include being not present in patch and the file present in target software.It may include being deposited in patch file to change file And the file that is not present in target software.Optionally, the embodiment of the present invention can be soft from target based on the file in patch Search whether there is the file identical and of the same name with the TOC level of file in patch in file in part.
Step S102, the backup file model of the patch is established according to the corresponding change file of the patch, In, the backup file model is the tree construction generated according to the TOC level of the corresponding change file of the patch.
In the embodiment of the present invention, backup file model is the tree construction generated according to the TOC level of change file, specifically , first it can generate tree node by the TOC level based on each change file.Obtaining the corresponding tree node of each change file Afterwards, the corresponding tree node of each change file can be merged and obtain backup file model.
Step S103, file backup is carried out according to the corresponding node of change file described in the backup file model, obtained To backup file.
In the embodiment of the present invention, file backup is carried out according to the corresponding node of change file, to only to change file into Row backup, so as to reduce the quantity of backup file.
Step S104, it is based on the patch and executes updating operation.
If the embodiment of the present invention is by receiving upgrade command, according to the file in the file and target software in patch, Determine the corresponding change file of the patch;The backup text of the patch is established according to the corresponding change file of the patch Part model, wherein the backup file model is to be generated according to the TOC level of the corresponding change file of the patch Tree construction;File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup file; Updating operation is executed based on the patch.The embodiment of the present invention only backs up change text in software upgrading based on backup file model Part, it is middle compared with the prior art to carry out full software version backup, reduce the quantity of backup file, saves software patch upgrading When take, improve upgrading efficiency.
As shown in Fig. 2, the embodiment of the present invention also provides a kind of method for upgrading software, include the following steps:
If step S201, receiving upgrade command, according to the file in the file and target software in patch, determine described in The corresponding newly-increased file of patch and change file.
In the embodiment of the present invention, newly-increased file may include the text for existing in patch and being not present in target software Part.
Step S202, the standby of the patch is established according to the corresponding newly-increased file of the patch and the change file Part file model.
In embodiments of the present invention, backup file model is to be generated according to the TOC level for increasing file and change file newly Tree construction.Specifically, the embodiment of the present invention can give birth to according to the TOC level of each newly-increased file and each change file respectively Attribute-bit is carried out at tree node, and to each tree node, for example, for increasing file newly, it can be by its corresponding node identification It is newly-increased, can is deletion etc. by its corresponding node identification for deleting file.And merge each tree node, it obtains To backup file model.
Step S203, file backup is carried out according to the corresponding node of change file described in the backup file model, obtained To backup file.
In the embodiment of the present invention, file backup is carried out according to the corresponding node of change file, to only to change file into Row backup, so as to reduce the quantity of backup file.
Step S204, it is based on the patch and executes updating operation.
Optionally, after executing updating operation based on the patch, the method further includes:If receiving rollback to refer to It enables, rolling back action is executed according to the backup file model and the backup file.
Optionally, in embodiments of the present invention, it can be deleted directly from the target software after upgrading and backup file mould The corresponding file of each node of type, and backup file is added in target software, so that target software is quickly rolled back to liter Version before grade.
Optionally, the patch include the first patch and the second patch, according in the patch file and the target File in software determines the corresponding newly-increased file of the patch and change file, including:According to the text in first patch File in part and the target software determines the corresponding newly-increased file of first patch and change file, according to described The file in file and the target software in two patches determines the corresponding newly-increased file of second patch and change text Part;
The backup text that the patch is established according to the corresponding newly-increased file of the patch and the change file Part model, including:The first standby of first patch is established according to the corresponding newly-increased file of first patch and change file Part file model establishes the second backup of second patch according to the corresponding newly-increased file of second patch and change file File model;Merge each node in the first backup file model and the second backup file model, is merged Backup file model afterwards;
It is described that file backup is carried out according to the corresponding node of change file described in the backup file model, it is backed up File, including:File backup is carried out according to the corresponding node of change file described in the backup file model after the merging, is obtained To the backup file.
In the embodiment of the present invention, when the quantity of patch is multiple, respectively according to the corresponding newly-increased file of each patch and Change file establishes the backup file model of each patch, and merges the node in the backup file model of each patch, and base Backup file model after merging carries out file backup.Following present invention embodiment by taking the first patch and the second patch as an example into Row explanation.
In the embodiment of the present invention, the first backup file model is according to each newly-increased file of the first patch and each change The tree construction that the TOC level of file is established, the second backup file model is according to each newly-increased file of the second patch and each The tree construction that the TOC level of change file is established, due to that may have identical newly-increased text in the first patch and the second patch Part and change file merge the first backup file model and the second backup text in order to avoid the redundancy of backup file Each node in part model, wherein for identical node, one is only retained after merging.Specifically, the embodiment of the present invention can On the basis of the backup file model of the first patch, each node of the backup file model of the second patch is traversed, by second The node different from the backup file model of the first patch is added to the backup text of the first patch in the backup file model of patch In part model, to the backup file model after being merged.To based on change file in the backup file model after merging When corresponding node carries out file backup, backup file can be caused to avoid identical file between different patches is repeatedly backed up Redundancy.
Optionally, the upgrading order of first patch is located at before second patch, according to first patch Corresponding newly-increased file and change file establish the first backup file model of first patch, according to second patch pair The newly-increased file and change file answered are established after the second backup file model of second patch, and the method further includes: File backup is carried out according to the corresponding node of change file described in the first backup file model, obtains first patch Corresponding backup file;Node identical with the first backup file model in the second backup file model is deleted, is obtained To updated second backup file model, and according to change file pair described in the updated second backup file model The node answered carries out file backup, obtains the corresponding backup file of second patch.
In actual conditions, when the number of patch is multiple, typically successively according to each patch in multiple patches Upgraded.In embodiments of the present invention, the upgrading order of the first patch is prior to the second patch.The embodiment of the present invention is obtaining After one backup file model, file backup is carried out based on the first backup file model, obtains the corresponding backup text of the first patch Part.Specifically, target software needs the file changed when the corresponding backup file of the first patch is based on the first patch upgrading. After obtaining the second backup file model, can delete in the second backup file model with the first backup file model phase With node, updated second backup file model is obtained, thus according to updated second backup file model into style of writing Part backs up, and obtains the corresponding backup file of the second patch, wherein the corresponding backup file of the second patch is based on the second patch liter Target software needs file to be changed when grade.
Optionally, the embodiment of the present invention can be by each restoration point and each backup file model and each backup file point Correspondence is not established, to target software be made fast according to the corresponding backup file model of some restoration point and backup file Speed is rolled back to the restoration point.
Optionally, the patch includes the first patch and the second patch, and the upgrading order of first patch is positioned at described Before second patch, according to the file in the file and the target software in the patch, determine that the patch is corresponding new Increase file and change file, including:According to the file in the file and the target software in first patch, determine described in The corresponding newly-increased file of first patch and change file;
The backup text that the patch is established according to the corresponding newly-increased file of the patch and the change file Part model, including:The first standby of first patch is established according to the corresponding newly-increased file of first patch and change file Part file model;
It is described that file backup is carried out according to the corresponding node of change file described in the backup file model, including:Root File backup is carried out according to the corresponding node of change file described in the first backup file model, obtains first patch pair The backup file answered;
It is described that updating operation is executed based on the patch, including:Updating operation is executed based on first patch;
After executing updating operation based on first patch, the method further includes:If according to first patch It upgrades successfully, then according to the file in the file and the target software in second patch, determines second patch pair The newly-increased file and change file answered;Described second is established according to the corresponding newly-increased file of second patch and change file to mend Second backup file model of fourth;Delete the backup file model phase with first patch in the second backup file model Same node, obtains updated second backup file model;According to the updated second backup file model The corresponding node of change file carries out file backup, obtains the corresponding backup file of second patch;It is mended based on described second Fourth executes updating operation.
In the embodiment of the present invention, file backup and the upgrading of each patch are serially executed, specifically, first according to described first The file in file and the target software in patch determines the corresponding newly-increased file of first patch and change file; The first backup file model of first patch is established according to the corresponding newly-increased file of first patch and change file;Root File backup is carried out according to the corresponding node of change file described in the first backup file model, obtains first patch pair The backup file answered;Updating operation is executed based on first patch.If first patch upgrading success, according to described the The file in file and the target software in two patches determines the corresponding newly-increased file of second patch and change text Part;The second backup file mould of second patch is established according to the corresponding newly-increased file of second patch and change file Type;Node identical with the backup file model of the first patch in the second backup file model is deleted, is updated The second backup file model afterwards;According to the corresponding node of change file described in the updated second backup file model File backup is carried out, the corresponding backup file of second patch is obtained;Updating operation is executed based on second patch.
It optionally, in embodiments of the present invention, can also be by the second backup text after obtaining the second backup file model Part model and the first backup file model merge, the backup file model after being merged.
Optionally, the embodiment of the present invention can be by each restoration point and each backup file model and each backup file point Correspondence is not established, to target software be made fast according to the corresponding backup file model of some restoration point and backup file Speed is rolled back to the restoration point.
Optionally, after executing updating operation based on the patch, the method further includes:If receiving rollback to refer to It enables, the target restoration point in being instructed according to the rollback obtains backup file model corresponding with the target restoration point and backup File;The target software after upgrading is executed back according to backup file model corresponding with the target restoration point and backup file Rolling operation.
In the embodiment of the present invention, rollback instruction, which is used to indicate, to be needed to execute rolling back action, for example, passing through some patch liter When grade failure.It is alternatively possible to prompt the user whether to execute rolling back action by pop-up window and input target restoration point, After receiving target restoration point input by user, backup file model corresponding with the target restoration point and backup file are obtained.
Optionally, after basis backup file model corresponding with the target restoration point and backup file are to upgrading Target software executes rolling back action, including:It is deleted from the target software after the upgrading corresponding with the target restoration point The corresponding file of each node in backup file model, and backup file corresponding with the target restoration point is added to institute It states in target software.
Optionally, if the file in the patch includes empty list, according to the corresponding newly-increased file of the patch, The deletion file and the modification file are established before the backup file model of the patch, and the method further includes:Institute It states and increases supporting paper in empty list.
Wherein, supporting paper can be arbitrary format file, for example, word file, TXT files etc..The embodiment of the present invention After increasing supporting paper in the empty list, tree node can be established according to the TOC level of the supporting paper.By will be empty Catalogue is converted into a supporting paper for including under it, can simplify entire backup file model, will entirely back up file model Finally it is attributed to the operation of multiple individual files so that file is as minimum operating unit, to which multiple patches are successively risen Be not in increase file such case newly under the empty list recorded when grade.
If the embodiment of the present invention is by receiving upgrade command, according to the file in the file and target software in patch, Determine the corresponding newly-increased file of the patch and change file;According to the corresponding newly-increased file of the patch and the change File establishes the backup file model of the patch;According to the corresponding node of change file described in the backup file model into Row file backup obtains backup file;Updating operation is executed based on the patch.By being based on backup file in software upgrading Model only backs up change file, middle compared with the prior art to carry out full software version backup, reduces the quantity of backup file, saves Taking when having saved software patch upgrading, improves upgrading efficiency.Furthermore, it is possible to be made based on backup file model and backup file Target software is rolled back to the version before upgrading easily and fast.
As shown in figure 3, the embodiment of the present invention provides a kind of method for upgrading software, include the following steps:
Step S301, using file in patch as reference, the file of the same name in target software is scanned one by one, and juxtaposition is marked accordingly Know position.
Specifically, for the file in patch, if this document exists in target software, it is identified as modification;If mesh This document is not present in mark software, then is identified as newly-increased;If necessary to delete this document, then deletion is identified as.
Step S302, the backup file model of patch is established.
Specifically, may refer to Fig. 4, it is as follows that backup file model establishes process:
If it is newly-increased file (namely newly-increased file), tree node is established according to the TOC level of this document, and should Vertex ticks is newly-increased, wherein if newly-increased file is empty list, increase supporting paper newly under the catalogue, for example, Ignore.txt, and tree node is established according to the TOC level of the supporting paper, it is newly-increased by the vertex ticks.
The embodiment of the present invention, can be with by by the newly-increased of newly-increased be converted into empty list a supporting paper for empty list Simplify entire backup file model, entire backup file model is finally attributed to the operation of multiple individual files so that file is made For minimum operating unit, occur increasing file newly under the empty list recorded when to avoid multiple patches can successively be upgraded Such case.
If it is the file (namely deleting file) of deletion, tree node is established according to the TOC level of this document, and should Vertex ticks is to delete, wherein if the file deleted is empty list, increase expository writing newly under empty list, for example, Ignore.txt establishes tree node according to the TOC level of supporting paper, and is to delete by the node identification.
It, can be by modification as the combination deleted and increased newly if it is the file (namely modification file) of modification.It does so It can be further simplified the type to file operation, newly-increased and two kinds of deletion will be reduced to all operations of file.It will modification File be converted into deletion file and newly-increased file combination, and respectively according to the mesh of the file of deletion and newly-increased file Record Level building tree node.
The tree node established according to above-mentioned rule is integrated into same tree construction, backup file model is obtained.
Step S303, file backup is carried out according to the backup file model of patch, and updating operation is executed based on the patch.
In embodiments of the present invention, the node that deletion is identified as in backup file model is backuped to successively when file backup One fixed catalogue is only recorded for being identified as newly-increased node, is not handled.
Current backup file model can also be preserved before patch upgrading, in this way in some patch upgrading failure or by hand When being retracted, it can select to return back to the restoration point.
Step S304, judge whether to upgrade successfully.
If upgrading successfully, step S305 is executed, if upgrading failure, executes step S309.
Step S305, judge whether also other patches.
In the embodiment of the present invention, other patches refer to the patch for currently needing to upgrade in addition to the patch upgraded.If Also other patches, then follow the steps S306, if without other patches, then follow the steps S308.
Step S306, subsequent patch is continued to establish backup file model, and the backup file model of the patch is returned And in backup file model before, obtain the backup file model after merger.
In the embodiment of the present invention, subsequent patch refers to the patch for upgrading order and being located at after the current patch upgraded, it Preceding backup file model refers to the backup file model for the patch that front upgrades.
In the embodiment of the present invention, the process for establishing the backup file model of subsequent patch is as follows:
If it is newly-increased file, is established newly according to the TOC level of this document, obtain the backup file model after merger Tree node, if the node in backup file model before exist if do not handle, if the node be not present if will section Before point is added in backup file model, and it is identified as newly-increased.
If it is the file of deletion, new tree node is established according to the TOC level of this document, if the node is before Backup file model in exist do not handle then;Backup file mould before being added to the node if the node is not present In type, and it is identified as deletion.
The embodiment of the present invention to tree node that is newly-increased and deleting by first carrying out existence judgement, it is therefore an objective to be directed to same File only records to be operated for the first time, no matter which kind of operation is carried out to this document again when subsequent patch upgrades, or carry out how many times Operation do not reprocess, so as to reduce the embodiment of the present invention method for upgrading software complexity.
Step S307, it is backed up again according to the backup file model after merger, then carries out patch upgrading.
After the patch upgrading, S305 is returned to step.Specifically, the embodiment of the present invention can repeat step S305 to step S307 is until all patch upgradings finish.
It should be noted that the embodiment of the present invention can also repeat step S304 to step S307 until all patches Upgrading finishes.
Step S308, rollback version whether is needed.
If desired retract (namely rollback) version, executes step S309 and terminates if version need not be retracted.Practical feelings In condition, if there are some patch upgrading failure or patch upgrading successes, but business is abnormal, then usually requiring will upgrading Target software afterwards retracts the version to upgrading.
Step S309, software rollback is carried out according to backup file model.
Specifically, the flow of software rollback can be as follows:The node in the backup file model after merger is traversed, and from mesh Mark the corresponding file of each node in the backup file model after deleting merger in software;Backup file is covered into target software In.
It should be noted that deletion here refers to the deletion of all nodes, include not only to be identified as newly-increased node, It is identified as deletion to be also required to delete, because the node for being identified as deletion is recorded when operating the node for the first time, subsequently Operation when the node may be created, change, or even placed other files under catalogue, delete can thorough cleaning fall These files just can guarantee that the state of software version after covering backup file in target and state at that time are completely the same 's.
The method for upgrading software of the embodiment of the present invention, when existing software upgrading compared with full version backup scenario, backup File greatly reduce;The backup for having also been removed this partial redundance of same file between patch simultaneously, further reduced needs The quantity of documents of backup, taking when saving software patch upgrading, improves upgrading efficiency.
The embodiment of the present invention is illustrated with example below:
Include patch patch1 and patch patch2 in patch collection patchSet.Patch patch1 includes:Newly-increased file FileAdd1 increases empty list DirAdd1 newly, deletes file FileDel1, deletes empty list DirDel2, deltrees DirDel3, modification file FileModify;Patch patch2 includes:File FileAdd1, FileDel4 are deleted, is increased newly FileAdd2, DirDel2.
Step a scans the file of the same name in target software, juxtaposition phase one by one using the file in patch patch1 as reference The mark answered is set to newly-increased specifically, FileAdd1, DirAdd1 are not present in software version;FileDel1, DirDel2, DirDel3 exists in target software but needs to delete, and is set to deletion;FileModify in software version and patch1 all In the presence of being set to modification.
Step b establishes patch1 backup file models.
Specifically, establishing tree node according to the TOC level of FileAdd1, and it is identified as newly-increased.Since DirAdd1 is new The empty list of increasing increases a supporting paper newly in DirAdd1, for example, ignore.txt, according to the catalogue layer of ignore.txt It is secondary to establish tree node, and be identified as newly-increased.
Tree node is established according to the TOC level of FileDel1, and is identified as deletion.Since DirDel2 is the empty mesh deleted Record, a supporting paper is increased newly in DirDel2, for example, ignore.txt, and established and set according to the TOC level of ignore.txt Node, and it is identified as deletion.
Since DirDel3 is the non-empty list deleted, burl is established according to the TOC level of each file in DirDel3 Point, and it is identified as deletion.FileModify is the file of modification, and tree node is established according to the TOC level of FileModify, and It is identified as deletion.
Step c carries out file backup according to the backup file model of patch patch1, is then based on patch patch1 and carries out Upgrading.
Only backup is identified as the file of deletion when file backup, for example, FileDel1, DirDel2/ignore.txt, All leaf node files, FileModify under DirDel3.
Step d establishes patch patch2 backup file models, and before the backup file model of the patch is integrated into Backup file model in.
FileAdd1 and DirDel2 is recorded in patch patch1, the backup file model not before being integrated into In, only need merger FileDel4 and FileAdd2.
Step e carries out file backup, then upgrade patch patch2 according to the backup file model of the patch after merger.
Specifically, the FileDel4 and FileAdd2 that are only backed up in backup file model.
Step f is held if patch patch1 and patch patch2 upgradings fail or need rollback version after upgrading successfully The following operation of row:All nodes in the backup file model after merger are deleted in target software after upgrading;It will be all standby The file of part covers in target software.
By the way that the rollback of the full version of target software can be realized after aforesaid operations, that is, return to the version before target software upgrading This.
As shown in figure 5, the embodiment of the present invention provides a kind of software updating apparatus, which includes:
Determining module 51, if for receiving upgrade command, according to the file in the file and target software in patch, really Determine the corresponding change file of the patch;
Module 52 is established, the backup file mould for establishing the patch according to the corresponding change file of the patch Type, wherein the backup file model is the tree knot generated according to the TOC level of the corresponding change file of the patch Structure;
First backup module 53, for according to the corresponding node of change file described in the backup file model into style of writing Part backs up, and obtains backup file;
Upgraded module 54, for executing updating operation based on the patch.
Optionally, the determining module 51 is additionally operable to:If receiving upgrade command, according in the patch file and institute The file in target software is stated, determines the corresponding newly-increased file of the patch;The module of establishing is specifically used for:According to the benefit The corresponding newly-increased file of fourth and the change file establish the backup file model of the patch.
Optionally, the patch includes the first patch and the second patch, and the determining module 51 is specifically used for:According to described The file in file and the target software in first patch determines the corresponding newly-increased file of first patch and change text Part determines that second patch is corresponding newly-increased according to the file in the file and the target software in second patch File and change file;The module 52 of establishing is specifically used for:According to the corresponding newly-increased file of first patch and change text Part establishes the first backup file model of first patch, according to the corresponding newly-increased file of second patch and change file Establish the second backup file model of second patch;Merge the first backup file model and the second backup file Each node in model, the backup file model after being merged;First backup module is specifically used for:According to the conjunction The corresponding node of change file described in backup file model after and carries out file backup, obtains the backup file.
Optionally, the upgrading order of first patch is located at before second patch, and described device further includes:Second Backup module, for establishing the first of first patch according to the corresponding newly-increased file of first patch and change file Backup file model establishes the second standby of second patch according to the corresponding newly-increased file of second patch and change file After part file model, file backup is carried out according to the corresponding node of change file described in the first backup file model, Obtain the corresponding backup file of first patch;Third backup module, for delete in the second backup file model with The identical node of the first backup file model, obtains updated second backup file model, and according to the update after The second backup file model described in the corresponding node of change file carry out file backup, it is corresponding to obtain second patch Backup file.
Optionally, the patch includes the first patch and the second patch, and the upgrading order of first patch is positioned at described Before second patch, the determining module 51 is specifically used for:According in the file and the target software in first patch File, determine the corresponding newly-increased file of first patch and change file;It is described establish module 52 have be used for:According to institute It states the corresponding newly-increased file of the first patch and change file establishes the first backup file model of first patch;The backup Module 53 is specifically used for:File backup is carried out according to the corresponding node of change file described in the first backup file model, Obtain the corresponding backup file of first patch;The upgraded module 54 is specifically used for:Liter is executed based on first patch Grade operation;
The determining module 51 is additionally operable to:After executing updating operation based on first patch, if according to described the One patch upgrading success, then according to the file in the file and the target software in second patch, determine described second The corresponding newly-increased file of patch and change file;The module 52 of establishing is additionally operable to:It is corresponding newly-increased according to second patch File and change file establish the second backup file model of second patch;Delete in the second backup file model with The identical node of backup file model of first patch, obtains updated second backup file model;The backup mould Block 53 is additionally operable to:It is standby that file is carried out according to the corresponding node of change file described in the updated second backup file model Part, obtain the corresponding backup file of second patch;The upgraded module 54 is additionally operable to:Liter is executed based on second patch Grade operation.
Optionally, described device further includes:Roll-back module is used for after executing updating operation based on the patch, if Rollback instruction is received, rolling back action is executed according to the backup file model and the backup file.
If the embodiment of the present invention receives upgrade command by determining module 51, according to the file and target software in patch In file, determine the corresponding change file of the patch;Module 52 is established according to the corresponding change file of the patch Establish the backup file model of the patch, wherein the backup file model is according to the corresponding change of the patch The tree construction that the TOC level of file generates;First backup module 53 is according to change file pair described in the backup file model The node answered carries out file backup, obtains backup file;Upgraded module 54 is based on the patch and executes updating operation.The present invention is real It applies example and change file is only backed up based on backup file model in software upgrading, it is middle compared with the prior art to carry out full software version Backup, reduces the quantity of backup file, and taking when saving software patch upgrading improves upgrading efficiency.
It should be noted that above-mentioned software updating apparatus can be that method is real in the embodiment of the present invention in the embodiment of the present invention Apply the user terminal of arbitrary embodiment in example, in the embodiment of the present invention in embodiment of the method user terminal arbitrary embodiment It can be realized by the above-mentioned software updating apparatus in the present embodiment, and reach identical advantageous effect, it is no longer superfluous herein It states.
It can be with one of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment method is It is completed by the relevant hardware of program instruction, the program can be stored in a computer-readable medium, the program When being executed, include the following steps:If receiving upgrade command, according to the file in the file and target software in patch, really Determine the corresponding change file of the patch;The backup file of the patch is established according to the corresponding change file of the patch Model, wherein the backup file model is the tree generated according to the TOC level of the corresponding change file of the patch Structure;File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup file;Base Updating operation is executed in the patch.
Optionally, if receiving upgrade command, which when being executed, further includes:According in the patch file and File in the target software determines the corresponding newly-increased file of the patch;It is described according to the corresponding change of the patch More file establishes the backup file model of the patch, including:According to the corresponding newly-increased file of the patch and the change More file establishes the backup file model of the patch.
Optionally, the patch include the first patch and the second patch, according in the patch file and the target File in software determines the corresponding newly-increased file of the patch and change file, including:According to the text in first patch File in part and the target software determines the corresponding newly-increased file of first patch and change file, according to described The file in file and the target software in two patches determines the corresponding newly-increased file of second patch and change text Part;The backup file mould that the patch is established according to the corresponding newly-increased file of the patch and the change file Type, including:The first backup text of first patch is established according to the corresponding newly-increased file of first patch and change file Part model establishes the second backup file of second patch according to the corresponding newly-increased file of second patch and change file Model;Merge each node in the first backup file model and the second backup file model, after being merged Backup file model;It is described that file backup is carried out according to the corresponding node of change file described in the backup file model, it obtains To backup file, including:File is carried out according to the corresponding node of change file described in the backup file model after the merging Backup, obtains the backup file.
Optionally, the patch includes the first patch and the second patch, and the upgrading order of first patch is positioned at described Before second patch, according to the file in the file and the target software in the patch, determine that the patch is corresponding new Increase file and change file, including:According to the file in the file and the target software in first patch, determine described in The corresponding newly-increased file of first patch and change file;It is described according to the corresponding newly-increased file of the patch and the change File establishes the backup file model of the patch, including:According to the corresponding newly-increased file of first patch and change file Establish the first backup file model of first patch;It is described to be corresponded to according to change file described in the backup file model Node carry out file backup, including:It is carried out according to the corresponding node of change file described in the first backup file model File backup obtains the corresponding backup file of first patch;It is described that updating operation is executed based on the patch, including:Base Updating operation is executed in first patch;Based on first patch execute updating operation after, the program when being executed, It is further comprising the steps of:If according to first patch upgrading success, according in second patch file and the mesh The file in software is marked, determines the corresponding newly-increased file of second patch and change file;It is corresponded to according to second patch Newly-increased file and change file establish the second backup file model of second patch;Delete the second backup file mould Node identical with the backup file model of the first patch, obtains updated second backup file model in type;According to The corresponding node of change file described in the updated second backup file model carries out file backup, obtains described second The corresponding backup file of patch;Updating operation is executed based on second patch.
Optionally, after executing updating operation based on the patch, which when being executed, further includes:If receiving Rollback instructs, and rolling back action is executed according to the backup file model and the backup file.
The storage medium, such as read-only memory (Read-Only Memory, abbreviation ROM), random access memory (Random Access Memory, abbreviation RAM), magnetic disc or CD etc..
The above is the preferred embodiment of the present invention, it is noted that for those skilled in the art For, without departing from the principles of the present invention, it can also make several improvements and retouch, these improvements and modifications It should be regarded as protection scope of the present invention.

Claims (10)

1. a kind of method for upgrading software, which is characterized in that including:
If receiving upgrade command, according to the file in the file and target software in patch, the corresponding change of the patch is determined More file;
The backup file model of the patch is established according to the corresponding change file of the patch, wherein the backup text Part model is the tree construction generated according to the TOC level of the corresponding change file of the patch;
File backup is carried out according to the corresponding node of change file described in the backup file model, obtains backup file;
Updating operation is executed based on the patch.
2. if according to the method described in claim 1, it is characterized in that, receiving upgrade command, the method further includes:According to The file in file and the target software in the patch determines the corresponding newly-increased file of the patch;
The backup file model that the patch is established according to the corresponding change file of the patch, including:According to institute It states the corresponding newly-increased file of patch and the change file establishes the backup file model of the patch.
3. according to the method described in claim 2, it is characterized in that, the patch include the first patch and the second patch, according to The file in file and the target software in the patch determines the corresponding newly-increased file of the patch and change file, Including:According to the file in the file and the target software in first patch, determine that first patch is corresponding new Increase file and change file determines described second according to the file in the file and the target software in second patch The corresponding newly-increased file of patch and change file;
The backup file mould that the patch is established according to the corresponding newly-increased file of the patch and the change file Type, including:The first backup text of first patch is established according to the corresponding newly-increased file of first patch and change file Part model establishes the second backup file of second patch according to the corresponding newly-increased file of second patch and change file Model;Merge each node in the first backup file model and the second backup file model, after being merged Backup file model;
It is described that file backup is carried out according to the corresponding node of change file described in the backup file model, obtain backup text Part, including:File backup is carried out according to the corresponding node of change file described in the backup file model after the merging, is obtained The backup file.
4. according to the method described in claim 2, it is characterized in that, the patch include the first patch and the second patch, it is described The upgrading order of first patch is located at before second patch, according in the file and the target software in the patch File determines the corresponding newly-increased file of the patch and change file, including:According to file in first patch and described File in target software determines the corresponding newly-increased file of first patch and change file;
The backup file mould that the patch is established according to the corresponding newly-increased file of the patch and the change file Type, including:The first backup text of first patch is established according to the corresponding newly-increased file of first patch and change file Part model;
It is described that file backup is carried out according to the corresponding node of change file described in the backup file model, including:According to institute It states the corresponding node of change file described in the first backup file model and carries out file backup, it is corresponding to obtain first patch Backup file;
It is described that updating operation is executed based on the patch, including:Updating operation is executed based on first patch;
After executing updating operation based on first patch, the method further includes:If according to first patch upgrading Success, then according to the file in the file and the target software in second patch, determine that second patch is corresponding Newly-increased file and change file;
The second backup file mould of second patch is established according to the corresponding newly-increased file of second patch and change file Type;
Node identical with the backup file model of the first patch in the second backup file model is deleted, is updated The second backup file model afterwards;
File backup is carried out according to the corresponding node of change file described in the updated second backup file model, is obtained The corresponding backup file of second patch;
Updating operation is executed based on second patch.
5. according to the method described in claim 2, it is characterized in that, based on the patch execute updating operation after, it is described Method further includes:
If receiving rollback instruction, rolling back action is executed according to the backup file model and the backup file.
6. a kind of software updating apparatus, which is characterized in that including:
Determining module, if for receiving upgrade command, according to the file in the file and target software in patch, determine described in The corresponding change file of patch;
Module is established, the backup file model for establishing the patch according to the corresponding change file of the patch, In, the backup file model is the tree construction generated according to the TOC level of the corresponding change file of the patch;
First backup module, it is standby for carrying out file according to the corresponding node of change file described in the backup file model Part, obtain backup file;
Upgraded module, for executing updating operation based on the patch.
7. device according to claim 6, which is characterized in that the determining module is additionally operable to:If receiving upgrade command, According to the file in the file and the target software in the patch, the corresponding newly-increased file of the patch is determined;
The module of establishing is specifically used for:According to the corresponding newly-increased file of the patch and change file foundation The backup file model of patch.
8. device according to claim 7, which is characterized in that the patch includes the first patch and the second patch, described Determining module is specifically used for:According to the file in the file and the target software in first patch, described first is determined The corresponding newly-increased file of patch and change file, according to the file in the file and the target software in second patch, Determine the corresponding newly-increased file of second patch and change file;
The module of establishing is specifically used for:Described first is established according to the corresponding newly-increased file of first patch and change file First backup file model of patch is established described second according to the corresponding newly-increased file of second patch and change file and is mended Second backup file model of fourth;Merge each section in the first backup file model and the second backup file model Point, the backup file model after being merged;
First backup module is specifically used for:It is corresponding according to change file described in the backup file model after the merging Node carries out file backup, obtains the backup file.
9. device according to claim 7, which is characterized in that the patch includes the first patch and the second patch, described The upgrading order of first patch is located at before second patch, and the determining module is specifically used for:According to first patch In file and the target software in file, determine the corresponding newly-increased file of first patch and change file;
It is described establish module have be used for:Described first is established according to the corresponding newly-increased file of first patch and change file First backup file model of patch;
The backup module is specifically used for:It is carried out according to the corresponding node of change file described in the first backup file model File backup obtains the corresponding backup file of first patch;
The upgraded module is specifically used for:Updating operation is executed based on first patch;
The determining module is additionally operable to:After executing updating operation based on first patch, if according to first patch It upgrades successfully, then according to the file in the file and the target software in second patch, determines second patch pair The newly-increased file and change file answered;
The module of establishing is additionally operable to:Described second is established according to the corresponding newly-increased file of second patch and change file to mend Second backup file model of fourth;Delete the backup file model phase with first patch in the second backup file model Same node, obtains updated second backup file model;
The backup module is additionally operable to:According to the corresponding section of change file described in the updated second backup file model Point carries out file backup, obtains the corresponding backup file of second patch;
The upgraded module is additionally operable to:Updating operation is executed based on second patch.
10. device according to claim 7, which is characterized in that described device further includes:
Roll-back module, for after executing updating operation based on the patch, being instructed if receiving rollback, according to the backup File model and the backup file execute rolling back action.
CN201710187257.6A 2017-03-27 2017-03-27 Software upgrading method and device Active CN108664255B (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN108664255A true CN108664255A (en) 2018-10-16
CN108664255B CN108664255B (en) 2023-04-11

Family

ID=63674189

Family Applications (1)

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

Country Status (2)

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

Cited By (1)

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

Families Citing this family (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
CN113094861B (en) * 2021-05-08 2022-06-03 国网河北省电力有限公司经济技术研究院 Data storage method, device, equipment and storage medium

Citations (8)

* 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
CN102193805A (en) * 2010-03-11 2011-09-21 华为技术有限公司 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
CN103136013A (en) * 2011-12-01 2013-06-05 腾讯科技(深圳)有限公司 Method and system of software upgrade
CN104156244A (en) * 2014-08-06 2014-11-19 北京奇虎科技有限公司 Method and device for software upgrading
CN105117263A (en) * 2015-09-14 2015-12-02 北京空间飞行器总体设计部 UNIX environment software system upgrading method
CN105468396A (en) * 2014-09-11 2016-04-06 深圳Tcl数字技术有限公司 Generating method for differential package, upgrading method, generating apparatus, and Linux terminal
CN105550060A (en) * 2014-10-31 2016-05-04 Tcl集团股份有限公司 Increment upgrade backup method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7774772B2 (en) * 2001-09-28 2010-08-10 Siebel Systems, Inc. Method and apparatus to perform an application software migration
CN103699410B (en) * 2013-12-20 2017-05-24 北京奇虎科技有限公司 Method and device for updating application programs
CN103955363B (en) * 2014-04-08 2017-03-15 国云科技股份有限公司 A kind of manufacture method of program upgrade installation package

Patent Citations (8)

* 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
CN102193805A (en) * 2010-03-11 2011-09-21 华为技术有限公司 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
CN103136013A (en) * 2011-12-01 2013-06-05 腾讯科技(深圳)有限公司 Method and system of software upgrade
CN104156244A (en) * 2014-08-06 2014-11-19 北京奇虎科技有限公司 Method and device for software upgrading
CN105468396A (en) * 2014-09-11 2016-04-06 深圳Tcl数字技术有限公司 Generating method for differential package, upgrading method, generating apparatus, and Linux terminal
CN105550060A (en) * 2014-10-31 2016-05-04 Tcl集团股份有限公司 Increment upgrade backup method and device
CN105117263A (en) * 2015-09-14 2015-12-02 北京空间飞行器总体设计部 UNIX environment software system upgrading method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
曹操: ""系统升级 Android用户的必修课"", 《电脑爱好者》 *

Cited By (2)

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

Also Published As

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

Similar Documents

Publication Publication Date Title
CN106095620B (en) A kind of development approach of built-in Linux partition holding
EP1770512A2 (en) Method and system for updating software
CN105487980B (en) The method and device that repairing applications are operating abnormally
CN103677947B (en) Equipment dual system based on linux protection and upgrade method
US8850173B2 (en) BIOS image manager
CN104918114B (en) A kind of operating system update method and device
CN109739933A (en) Memory space method for releasing, device, terminal and computer readable storage medium
US10235152B2 (en) System and method for downgrading applications
US8229892B2 (en) Storage apparatus and data restoring method used therein
CN107493290A (en) The method that Android intelligent television system software carries out OTA upgradings
CN102567053A (en) Method and device for downgrading software version
CN104007992A (en) Methods and devices for program updating and starting
WO2007023497A1 (en) Method and system for in-place updating content stored in a storage device
CN108664255A (en) A kind of method for upgrading software and device
CN102203779A (en) Method for updating data and control apparatus thereof
CN105867962A (en) System upgrading method and device
CN107003876A (en) Firmware updates
CN101800840B (en) Set top box upgrading method
CN110209420A (en) A kind of method and device updating bootstrap loader
CN102833273A (en) Data restoring method when meeting temporary fault and distributed caching system
CN113760234B (en) Software development method and system
CN114265613A (en) Method and system for differentially upgrading firmware of all electric control units of whole vehicle
CN106201584A (en) Version upgrading method and terminal unit
CN109901860A (en) A kind of Android phone software version control method
CN106598687B (en) Script preheating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200617

Address after: 518057 Zhongxing building, A3-01, A3-02, Nanshan District hi tech Industrial Park, Shenzhen, Guangdong

Applicant after: Shenzhen ZTE Technical Service Co.,Ltd.

Address before: 518057 Nanshan District science and Technology Industrial Park, Guangdong high tech Industrial Park, ZTE building

Applicant before: ZTE Corp.

GR01 Patent grant
GR01 Patent grant