Summary of the invention
The purpose of the present invention aims to solve the problem that at least one above-mentioned problem, provides a kind of base station software upgrade method and device.
To achieve the goals above, the present invention provides a kind of base station software difference upgrade method, comprising the following steps:
It receives the difference upgrade package uploaded and unzips to respective directories;
The version information obtained in difference upgrade package describes file;
The information that file is described based on the version information determines the corresponding base of each patch file in difference upgrade package
Plinth source file;
By the corresponding basic source file guards escorting prisoners of each patch file point, to generate corresponding new target mirror image
File;
The new target image file of generation is replaced into the corresponding file of original version respectively, integrates new software upgrade package,
And it saves to backup directory;
Activate the new software upgrade package version;
Base station is restarted, to complete the upgrading of base station software packet.
It further, further include the legitimacy of determining difference upgrade package, the specific steps are as follows:
It reads version information and describes file, obtain the corresponding version of difference upgrade package;
Whether consistent verify currently running version information version information corresponding with difference upgrade package;
It is judged as legal if consistent;
It is inconsistent, it is judged as illegal.
Preferably, further include previous step, the disk space size of base station equipment is checked, to determine whether sufficient space
Guarantee that difference upgrade package unzips to respective directories.
Specifically, after the base station is restarted successfully, software packet upgrade success.
Specifically, after the base station is restarted unsuccessfully, software packet upgrade failure maintains original version.
Further, it after base station is restarted unsuccessfully, sends upgrading and unsuccessfully alerts to prompt software packet upgrade to fail.
Specifically, file includes that version information describes file, patch file, configuration file in the difference upgrade package.
Optionally, the difference upgrading Packet type includes single file difference upgrade package, whole packet difference upgrade package, adjacent version
Difference upgrade package and cross-version difference upgrade package.
Specifically, the version information describes file for recording current operation version information, target version information, master
This image file title, patch image file title.
Further, further include step, the configuration file of current operation version and update are exported, by updated configuration file
Copy backup directory to.
Specifically, the specific steps for activating new software upgrade package are as follows:
Receive the request for activating new software upgrade package;
Read software upgrading state;
If upgrade status success, updating software starting path is backup directory;
Update state of activation file and restarting equipment.
A kind of base station software difference update device, comprising:
Receiving module: for receiving the difference upgrade package uploaded and unziping to respective directories;
It obtains module: describing file for obtaining the version information in difference upgrade package;
File matching module: it for describing the information of file based on the version information, determines every in difference upgrade package
The corresponding basic source file of a patch file;
Solve difference block: for dividing the corresponding basic source file guards escorting prisoners of each patch file, to generate phase
The new target image file answered;
Integration module: it for the new target image file generated to be replaced the corresponding file of original version respectively, integrates new
Software upgrade package, and save to backup directory;
Active module: for activating the new software upgrade package version;
Restart module: for restarting base station, to complete the upgrading of base station software packet.
Further, further include validity judgement module for determining the legitimacy of difference upgrade package, specifically execute step
It is as follows:
It reads version information and describes file, obtain the corresponding version of difference upgrade package;
Whether consistent verify currently running version information version information corresponding with difference upgrade package;
It is judged as legal if consistent;
It is inconsistent, it is judged as illegal.
Further, further include disk space detection module, for detecting the disk space size of base station equipment, be with determination
It is no to there is sufficient space to guarantee that difference upgrade package unzips to respective directories.
Specifically, after the base station is restarted successfully, software packet upgrade success.
Specifically, after the base station is restarted unsuccessfully, software packet upgrade failure maintains original version.
Further, after base station is restarted unsuccessfully, upgrading is sent by exception processing module and is unsuccessfully alerted to prompt software packet upgrade
Failure.
Specifically, file includes that version information describes file, patch file, base station configuration text in the difference upgrade package
Part.
Specifically, the difference upgrading Packet type includes single file difference upgrade package, whole packet difference upgrade package, adjacent version
Difference upgrade package and cross-version difference upgrade package.
Specifically, the version information describes file for recording current operation version information, target version information, master
This image file title, patch image file title.
It further, further include update module, it, will be updated for exporting configuration file and the update of current operation version
Configuration file copies backup directory to.
Specifically, the active module executes step are as follows:
Receive the request for activating new software upgrade package;
Read software upgrading state;
If upgrade status success, updating software starting path is backup directory.
Compared with prior art, the solution of the invention has the following advantages:
1, the present invention carries out upgrading update to the software of base station equipment by the way of difference upgrade package, uploads small volume
Difference packet to base station equipment, method instead of using the whole packet of upgrade package to be upgraded in the prior art solves prior art liter
It the problem of network resources waste caused by upgrade package is excessive during grade and upgrading low efficiency, simply and efficiently realizes in base station set
The high concurrent of formula management upgrades, effective guarantee upgrading stability, improves base station Operation and Maintenance accuracy, and greatly improve network can
Maintainability.
2, the present invention is based on the information that the version information in difference upgrade package describes to record in file, to software upgrade package into
Row solution difference, configures, solution difference can be carried out by describing file according only to the version information, simply and efficiently without additional script
Software upgrade package is restored by difference upgrade package.
3, the method for the invention takes into account the base station feature high to security requirement, by difference packet mode to former upgrade package
In file carry out difference upgrading, prevent from generating the security breaches for being easy to forge upgrade package in the whole packet escalation process of tradition.
The additional aspect of the present invention and advantage will be set forth in part in the description, these will become from the following description
Obviously, or practice through the invention is recognized.
Specific embodiment
The embodiment of the present invention is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end
Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached
The embodiment of figure description is exemplary, and for explaining only the invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singular " one " used herein, " one
It is a ", " described " and "the" may also comprise plural form.It is to be further understood that being arranged used in specification of the invention
Diction " comprising " refer to that there are the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition
Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member
Part is " connected " or when " coupled " to another element, it can be directly connected or coupled to other elements, or there may also be
Intermediary element.In addition, " connection " used herein or " coupling " may include being wirelessly connected or wirelessly coupling.It is used herein to arrange
Diction "and/or" includes one or more associated wholes for listing item or any cell and all combinations.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art
Language and scientific term), there is meaning identical with the general understanding of those of ordinary skill in fields of the present invention.Should also
Understand, those terms such as defined in the general dictionary, it should be understood that have in the context of the prior art
The consistent meaning of meaning, and unless idealization or meaning too formal otherwise will not be used by specific definitions as here
To explain.
The principle flow chart with reference to shown in Fig. 1, the present invention provide a kind of base station software difference upgrade method, for soft to base station
Part is upgraded, specifically includes the following steps:
S11, it receives the difference upgrade package uploaded and unzips to respective directories;
The difference upgrade package locally generated, the equipment end for needing to update software version is uploaded to by local, and equipment end receives
To the difference upgrade package of upload, it is unziped it, unzips to corresponding catalogue.Before being decompressed to difference upgrade package,
Further include previous step: checking the disk space size of base station equipment, to determine whether that enough spaces guarantee difference upgrading
Packet can unzip to corresponding catalogue.Wherein, the file in the difference upgrade package includes that version information describes file, patch text
Part, base station configuration file.
Preferably, the difference upgrade package is obtained by the way that upgraded version and original version are carried out difference using bsdiff tool
It takes, wherein the upgraded version and original version can be two adjacent versions, generate adjacent version difference upgrade package;It is described
Upgraded version and original version may be non-conterminous two versions, generate cross-version difference upgrade package.
When the change of new version older version is bigger, the differential file volume generate after difference will be bigger, because
This present embodiment uses the corresponding new version of single file and legacy version in software package to carry out difference one by one respectively, then will be poor
All single file collectives after point are packaged, to generate the difference upgrade package of small volume.
S12, the version information obtained in difference upgrade package describe file;
Difference upgrade package is parsed, version information therein is obtained and describes file, the version information description is used for
The information such as the current operation version information of record, target version information, original version image file title, patch image file title,
Inquire the corresponding version information of difference upgrade package, i.e. target version information.By by the target version information with it is currently running
Version information is matched, and determines the legitimacy of difference upgrade package, the specific steps are as follows:
1, it reads version information and describes file, obtain the corresponding version of difference upgrade package;
2, whether consistent currently running version information version information corresponding with difference upgrade package is verified;
3, it is judged as legal if consistent;
4, inconsistent, it is judged as illegal.
When confirming that difference upgrade package is legal, then the difference upgrade package is subjected to solution difference to obtain software upgrade package.When
When confirming that the difference upgrade package is illegal, then upgrading failure alarm prompt is sent, and save failure cause, be based in case subsequent
The failure cause is further processed, to ensure the normal fortune of base station equipment while the upgrading behavior of monitoring device
Row.
S13, the information that file is described based on the version information determine that each patch file in difference upgrade package is corresponding
Basic source file;
The original version image file title and patch image file title of file record are described based on the version information, really
Determine the corresponding document in the corresponding current operation version of patch file in difference upgrade package, i.e., basic source file.
Wherein, the type of the difference upgrade package includes single file difference upgrade package, whole packet difference upgrade package, adjacent version
Difference upgrade package and cross-version difference upgrade package.The single file difference upgrade package is by upgrade package and the phase in former software package
It answers file to carry out difference one by one, then each differential file obtained after difference is packaged and generates difference upgrade package.Whole packet difference
The whole packet of the whole Bao Yuyuan software package of upgrade package is carried out difference by upgrade package, generates difference upgrade package.Single file difference upgrade package
Relatively whole packet difference upgrade package it is small in size, therefore when upgrade package compare the change of original version software package it is larger when, it is preferred to use it is single
A difference upgrade package.
Neighbour's version difference upgrade package refers to that the version between upgrade package and former software package is adjacent version;The cross-version
Difference upgrade package refers to that the version between upgrade package and former software package is non-adjacent version, the more than one version of difference between version
This.Wherein, the adjacent version difference upgrade file is smaller, but needs multiple circulant solution difference to synthesize when upgrading, and need
Save multiple version patch files.The cross-version difference upgrade file is larger, but only that once solving difference, saves one
The patch of version upgrades more flexible.When more demanding to the file size of upload, preferably using adjacent version difference;When right
When update time is more demanding, cross-version difference is preferably used.
S14, the corresponding basic source file guards escorting prisoners of each patch file is divided, to generate corresponding new target
Image file;
By each patch file and the corresponding basic source file of each patch file in difference upgrade package, use
File one-to-one correspondence is carried out solution difference by bspatch tool, is generated corresponding new target image file, is reduced to upgrade
Respective file in packet.It should especially by calling difference upgrade interface patchUpgrad (basePack, patchPack) to realize
Solve differentiation step, wherein basePack indicates that basic document store path, patchPack indicate patch file store path.
S15, the new target image file of generation is replaced into the corresponding file of original version respectively, integrates new software upgrading
Packet, and save to backup directory;
Based on above-mentioned steps, by the corresponding document in the corresponding difference upgrade package of the basic source file in software package into
Row solution difference, is reduced to the corresponding upgrade package of software.The new target image file generated after difference will be solved successively to replace respectively
The corresponding file of original version software, and replaced file is integrated to new software upgrade package, including being needed in upgrade package
Original version in file, the complete new software upgrade package of generation is saved to backup directory, be used for subsequent update
Upgrading.
Further include step in software upgrade package generating process, the configuration file of current operation version software is upgraded, i.e.,
The current configuration file for running version of export and update, copy updated configuration file to backup directory.The configuration text
Part can be database, configuration script etc..By taking database as an example, the variable in upgrade package is searched with the presence or absence of current operation version
Database in, be then to update upgrade database using the value of current operation version, copy the database of update to backup directory.
S16, the activation new software upgrade package version;
Based on the new software upgrade package that the difference upgrade package obtains, it is activated, with the liter for base station software
Grade is prepared.The specific steps of the new software upgrade package of the activation are as follows:
1, the request for activating new software upgrade package is received;
2, software upgrading state is read;
If 3, upgrade status success, updating software starting path is backup directory;
When the success of software upgrading status display, the starting path for updating software is backup directory, is read in backup directory
New software upgrade package, update state of activation file, restart base station equipment, to complete the upgrading of base station software.
S17, base station is restarted, to complete the upgrading of base station software packet.
After base station is restarted successfully, then base station software packet upgrades successfully.When base station is restarted unsuccessfully, then base station software packet upgrades
Failure, base station still uses original version software package, to guarantee the normal operation of base station equipment.In addition, after software packet upgrade failure,
Start corresponding exception handling, upgrading failure alarm prompt is sent, and save failure cause, in case subsequent be based on the mistake
It loses reason to be further processed, is monitoring the normal fortune for ensuring base station equipment while base station equipment upgrading behavior to realize
Row.
In order to further modularly describe base station software difference upgrade method of the present invention, refering to what is shown in Fig. 2, also mentioning
For a kind of base station software difference update device, including receiving module 81, acquisition module 82, file matching module 83, solution differential mode
Block 84, integration module 85, active module 86 restart the validity judgement module 90 in module 87 and Partial Transformation embodiment,
Disk space detection module 91, exception processing module 92, update module 93, wherein
The receiving module 81 is used to receive the difference upgrade package uploaded and unzips to respective directories;Receive local upload to
Difference upgrade package decompression is reduced to corresponding catalogue, wherein by disk before decompression by the difference upgrade package of base station equipment
Space detection module 91 detects the size in the space of respective directories, to determine reserving whether enough difference upgrade package are decompressed
Contracting.
The version information that module 82 is obtained for obtaining in difference upgrade package describes file, the version information description
For recording the letters such as current operation version information, target version information, original version image file title, patch image file title
Breath.After this, the version information based on acquisition describes the conjunction that file judges difference upgrade package by validity judgement module 90
Method.
The file matching module 83 is used to describe the information of file based on the version information, determines in difference upgrade package
The corresponding basic source file of each patch file;The original version image filename of file record is described based on the version information
Title and patch image file title determine the corresponding text in the corresponding current operation version of patch file in difference upgrade package
Part, i.e., basic source file.
The solution difference block 84 is used for by the corresponding basic source file guards escorting prisoners of each patch file point, with life
At corresponding new target image file;By each patch file and the corresponding base of each patch file in difference upgrade package
File one-to-one correspondence is carried out solution difference using bspatch tool by plinth source file, generates corresponding new target mirror image text
Part, the respective file being reduced in upgrade package.
The integration module 85 is used to the new target image file generated replacing the corresponding file of original version respectively, collects
The software upgrade package of Cheng Xin, and save to backup directory;The new target image file generated after difference will be solved successively to replace respectively
The corresponding file of original version software is changed, and replaced file is integrated to new software upgrade package, including being needed in upgrade package
The file in original version wanted saves the complete new software upgrade package of generation to backup directory, with for it is subsequent more
New upgrading.Meanwhile further including update module 93, it, will be updated for exporting configuration file and the update of current operation version
Configuration file copies backup directory to.
The active module 86 is for activating the new software upgrade package.It is obtained based on the difference upgrade package new
Software upgrade package activates it, to prepare for the upgrading of base station software.When the success of software upgrading status display, more
The starting path of new software is backup directory, reads the new software upgrade package in backup directory, updates state of activation file, weight
New starting base station equipment, to complete the upgrading of base station software.
It is described to restart module 87 for restarting base station, to complete the upgrading of software package.After base station is restarted successfully, then base station
Software packet upgrade success.When base station is restarted unsuccessfully, then base station software packet upgrading failure, base station still use original version software package, with
Guarantee the normal operation of base station equipment.
In addition, starting exception processing module 92 after software packet upgrade failure, upgrading failure alarm prompt is sent, and protect
Failure cause is deposited, in case subsequent be further processed based on the failure cause, to realize in monitoring base station equipment upgrading row
For while ensure the normal operation of base station equipment.
The present invention provides the process of the another embodiment of base station software difference upgrade method, is made with programmatic way further
It explains, including following below scheme:
Version information describes file in step 1, reading difference upgrade package, verifies version information.If system is currently run
Version and difference upgrade package basic version it is inconsistent, be unable to complete solution difference, then upgrade failure, save failure cause;Such as
Fruit unanimously thens follow the steps 2;
Step 2 checks whether disk space is enough, and difference upgrade package is decompressed if enough to respective directories;Otherwise it rises
Grade failure, saves failure cause;
Step 3 describes the information in file according to version information, searches the base of each differential file in difference upgrade package
Plinth source file, can not find, and upgrade failure, save failure cause;Otherwise by the target of two corresponding mitogenetic Cheng Xin of mirror image guards escorting prisoners
Mirror image;
Step 4, by the upgrade package of all newly-generated target mirror image file set Cheng Xin, check other necessary files, such as
The no file for then using current operation version of fruit difference upgrade package, integrates routine upgrade edition upgrade pack;
Step 5 empties backup directory, mobile newly integrated conventional upgrade package to backup directory, and mobile failure then records original
Cause, upgrading failure;It moves and successfully thens follow the steps 6;
The configuration parameter file of step 6, the current operation version of export;
The new software upgrade package version of step 7, activation, activates and successfully thens follow the steps 8;Activation failure then records unsuccessfully former
Cause, upgrading failure;
Step 8 restarts base station equipment, restarts and successfully then upgrades successfully;Restart failure and thens follow the steps 9;
The reason of step 9, record upgrading failure, and base station software packet is reduced to original version.
In conclusion the method for the invention or device are reducing escalation process by using the mode of difference upgrade package
While middle network resource consumption, the efficiency of base station equipment software upgrading is improved, further perfect safety and fault tolerant mechanism,
Realize the high concurrent upgrading of base station centralized management.
The above is only some embodiments of the invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.