The content of the invention
The embodiment of the present invention provides a kind of software systems repair process method and device, when collapsing to improve software systems
The reliability and stability of reparation.
A kind of first aspect present invention, there is provided software systems repair process method, including:
When software systems collapse carries out system reboot, the history run status information of the software systems is obtained;
Using processing mode corresponding with the history run status information, the software systems are repaired.
In the first possible implementation of first aspect, the history run state for obtaining the software systems
Information, including:
The active flag value that the history for recording the software systems stored in memory starts the frequency of failure is read,
The new active flag value for adding one by the active flag value and obtaining, the new active flag value is the history run state
Information;
It is described to adopt processing mode corresponding with the history run status information, the software systems are repaired,
Including:
According to the magnitude relationship between the new active flag value and predetermined threshold value, corresponding processing mode is determined, and
Repair process is carried out to software systems using the processing mode.
According to the first possible implementation of first aspect, in second possible implementation of first aspect
In, after the new active flag value for adding by the active flag value and obtaining, also include:
The new active flag value is write into the memory;
It is described software systems to be carried out after repair process, also include:
If the repair process success, the active flag value stored in the memory is reset.
With reference to the first or second possible implementation of first aspect, in the third possible reality of first aspect
In existing mode, before the new active flag value for adding by the active flag value and obtaining, also include:
If it is determined that for software systems failure caused by powered-off fault institute;
The new active flag value for the active flag value is added one obtaining, including:
First will Jia one again after active flag value clearing, obtain the new active flag value.
With reference to first aspect or first aspect the first, second or the third possible implementation, in first party
In the 4th kind of possible implementation in face, the size according between the new active flag value and predetermined threshold value is closed
System, determines corresponding processing mode, including:
If the new active flag value is less than or equal to first threshold, it is determined that the first processing mode, described first is processed
Mode is to call this CONFIG.SYS that will start being stored in first memory to start the software systems;
If the new active flag value is more than first threshold and less than or equal to Second Threshold, it is determined that second processing side
Formula, the second processing mode is that the CONFIG.SYS for calling the last time being stored in first memory to successfully start up starts institute
State software systems;
If the new active flag value is more than Second Threshold and less than or equal to the 3rd threshold value, it is determined that the 3rd process side
Formula, the 3rd processing mode is the CONFIG.SYS or default for calling the last time being stored in second memory to successfully start up
The CONFIG.SYS that the equipment successfully starts up that can make start the software systems;
If the new active flag value is more than the 3rd threshold value, it is determined that fourth process mode, the fourth process mode
To confirm software systems repairing failure, the new active flag value is reset.
With reference to first aspect or first aspect the first, second, the third or the 4th kind of possible implementation,
In 5th kind of possible implementation of first aspect, methods described also includes:
After the guidance code of more new software system, the active flag value stored in the memory is subtracted one.
According to the 4th kind of possible implementation of first aspect, in the 6th kind of possible implementation of first aspect
In, the memory, the first memory and the second memory are power down nonvolatile memory.
A kind of second aspect present invention, there is provided software systems repair process device, including:
Acquisition module, for when software systems collapse carries out system reboot, obtaining the history run of the software systems
Status information;
Repair module, for adopting processing mode corresponding with the history run status information, to the software systems
Repaired.
In the first possible implementation of second aspect, the acquisition module, specifically in reading memory
The history for recording the software systems of storage starts the active flag value of the frequency of failure, adds one by the active flag value
The new active flag value for obtaining, the new active flag value is the history run status information;
The repair module specifically for according to the magnitude relationship between the new active flag value and predetermined threshold value, really
Fixed corresponding processing mode, and repair process is carried out to software systems using the processing mode.
According to the first possible implementation of second aspect, in second possible implementation of second aspect
In, also include:
Writing module, for the new active flag value that the active flag value is added one obtains in the acquisition module it
Afterwards, the new active flag value is write into the memory;
Update module, after software systems are carried out with repair process in the repair module, if the repair process
Success, then reset the active flag value stored in the memory.
With reference to the first or second possible implementation of second aspect, in the third possible reality of second aspect
In existing mode, the acquisition module, be additionally operable to the new active flag value active flag value plus obtained it
Before, however, it is determined that for software systems failure caused by powered-off fault institute, then first will Jia one again after active flag value clearing, obtain
The new active flag value.
With reference to second aspect or second aspect the first, second or the third possible implementation, in second party
In the 4th kind of possible implementation in face, the repair module is additionally operable to:
If the new active flag value is less than or equal to first threshold, it is determined that the first processing mode, described first is processed
Mode is to call this CONFIG.SYS that will start being stored in first memory to start the software systems;
If the new active flag value is more than first threshold and less than or equal to Second Threshold, it is determined that second processing side
Formula, the second processing mode is that the CONFIG.SYS for calling the last time being stored in first memory to successfully start up starts institute
State software systems;
If the new active flag value is more than Second Threshold and less than or equal to the 3rd threshold value, it is determined that the 3rd process side
Formula, the 3rd processing mode is the CONFIG.SYS or default for calling the last time being stored in second memory to successfully start up
The CONFIG.SYS that the equipment successfully starts up that can make start the software systems;
If the new active flag value is more than the 3rd threshold value, it is determined that fourth process mode, the fourth process mode
To confirm software systems repairing failure, the new active flag value is reset.
With reference to second aspect or second aspect the first, second, the third or the 4th kind of possible implementation,
In 5th kind of possible implementation of second aspect, also include:
Correcting module, for after the guidance code of more new software system, the active flag that will be stored in the memory
Value subtracts one.
According to the 4th kind of possible implementation of second aspect, in the 6th kind of possible implementation of second aspect
In, the memory, the first memory and the second memory are power down nonvolatile memory.
Software systems repair process method and device provided in an embodiment of the present invention, by being in software systems collapse
When system is restarted, the history run status information of software systems is obtained, then adopt process side corresponding with history run status information
Software systems are repaired by formula, can avoid the erroneous judgement to software systems crash reason, when collapsing so as to improve software systems
The reliability and stability of repair process.
Specific embodiment
To make purpose, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
The a part of embodiment of the present invention, rather than the embodiment of whole.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
The flow chart of the software systems repair process embodiment of the method one that Fig. 1 is provided for the present invention, as shown in figure 1, this reality
The software systems repair process method of example is applied, including:
S101, software systems collapse carry out system reboot when, obtain software systems history run status information.
Specifically, the history run status information of software systems can be that logging software system normally starts or attempts repairing
The fortune relevant parameter of relevant parameter or software systems when the multiple number of times for starting failure, software systems start, software systems
History run status information can be used to characterize the trial of Current software system and repair the performance for starting and running, in software systems
Collapse, when breaking down, can alternatively repair mode foundation.
For example, it can be when software systems are collapsed, by diagnostic analysis that software systems collapse carries out system reboot
Technology resets, and system is restarted automatically, can avoid restarting manually presence can not find the very first time failure, loss it is serious and
The problems such as professional skill of technical staff is had high demands.
Software systems are repaired by S102, employing processing mode corresponding with history run status information.
For example, software systems history run status information is attempted repairing and starts the secondary of failure for Current software system
Number, then can be again started up software systems when the number of times for attempting reparation startup failure is less, more in the number of times for starting failure
When, the configuration file for calling the software version that can normally start is started, it is possible to achieve adopted and history run state letter
Corresponding processing mode is ceased, software systems are repaired, the reason for history run status information is with causing software systems to be collapsed
There is corresponding relation, correspondence different repair process modes the reason for cause software systems to be collapsed, but in prior art mostly
When software release upgrade fails, version rollback will be carried out, for being not due to be risen caused by problem of software systems itself
Level failure, can cause unnecessary version rollback.
The software systems repair process method of the present embodiment, can apply to communication equipment but is not limited on communication equipment
Embedded system, the executive agent of the present embodiment can be software systems repair process device, can be operation in practical application
Central processing unit (Central Processing Unit, abbreviation CPU) in the communication equipment of embedded system, the CPU can be with
The repair function code added in the software systems guidance code bootloader stored in for calling memory, performs this reality
The software systems repair process method of example is applied, further the bootloader for being added with repair function code can also be added
Protection so as to will not be by modification destruction.
The present embodiment provide software systems repair process method, by software systems collapse carry out system reboot when,
The history run status information of software systems is obtained, then using processing mode corresponding with history run status information, to software
System is repaired, and can avoid the erroneous judgement to software systems crash reason, so as to improve repair process when software systems are collapsed
Reliability and stability.
The flow chart of the software systems repair process embodiment of the method two that Fig. 2 is provided for the present invention, as shown in Fig. 2 this reality
The software systems repair process method of example is applied, on the basis of embodiment illustrated in fig. 1, can be included:
S201, the active flag for reading the history startup frequency of failure for logging software system stored in memory
Value, the new active flag value for adding by active flag value and obtaining, new active flag value is history run status information.
Specifically, the present embodiment is provided for logging software system and attempts the active flag that reparation starts the frequency of failure
Value, and active flag value is stored in memory, when starting to restart after software systems collapse, can complete in bootloader
When system hardware is initialized, the active flag value in memory is read, the new active flag for active flag value is added obtaining
Value, new active flag value is the history run status information in the present embodiment.
S202, by new active flag value write memory.
Specifically, by new active flag value write memory, it is ensured that the renewal of active flag value.
S203, according to the magnitude relationship between new active flag value and predetermined threshold value, determine corresponding processing mode, and
Repair process is carried out to software systems using processing mode.
If S204, repair process success, the active flag value stored in memory is reset.
Specifically, if the repair process success to software systems, it is considered that current software systems can be normal
Use, cause it to be probably powered-off fault the reason for collapse, so needing the active flag value that will be stored in memory to reset.
The software systems repair process method that the present embodiment is provided, by storing in reading memory for logging software
The history of system starts the active flag value of the frequency of failure, the new active flag value for adding by active flag value and obtaining, new
Active flag value is history run status information, further according to the magnitude relationship between new active flag value and predetermined threshold value, really
Fixed corresponding processing mode, and repair process is carried out to software systems using processing mode, can avoid collapsing software systems
The erroneous judgement of reason, so as to improve the reliability and stability of repair process when software systems are collapsed.
The flow chart of the software systems repair process embodiment of the method three that Fig. 3 is provided for the present invention, as shown in figure 3, this reality
The software systems repair process method of example is applied, on the basis of Fig. 1 or embodiment illustrated in fig. 2, can be included:
S301, the active flag for reading the history startup frequency of failure for logging software system stored in memory
Value.
S302, if it is determined that for software systems failure caused by powered-off fault institute.
S303, first will active flag value reset after Jia one again, obtain new active flag value.
Specifically, however, it is determined that for software systems failure caused by powered-off fault institute, then it is assumed that software systems failure is not
Caused by problem by software systems itself, so needing to reset active flag value.
S304, according to the magnitude relationship between new active flag value and predetermined threshold value, determine corresponding processing mode, and
Repair process is carried out to software systems using processing mode.
Specifically, however, it is determined that for software systems failure caused by powered-off fault institute, then first by after the clearing of active flag value
Plus one again, obtain new active flag value, new active flag value is 1, according to new active flag value this can be called to incite somebody to action
The CONFIG.SYS to be started starts software systems, and prior art can call in that case old software version is
System configuration software carries out version rollback, and the present embodiment, can by determining whether for software systems failure caused by powered-off fault institute
To avoid the defect of prior art.
If S305, repair process success, the active flag value stored in memory is reset.
The software systems repair process method that the present embodiment is provided, by storing in reading memory for logging software
The history of system starts the active flag value of the frequency of failure, however, it is determined that for software systems failure caused by powered-off fault institute, then first
Will active flag value reset after Jia one again, obtain new active flag value, further according to new active flag value and predetermined threshold value it
Between magnitude relationship, determine corresponding processing mode, and repair process is carried out to software systems using processing mode, can avoid
Erroneous judgement to software systems crash reason, so as to improve the reliability and stability of repair process when software systems are collapsed.
On the basis of Fig. 2 or embodiment illustrated in fig. 3, the software systems repair process embodiment of the method four that the present invention is provided
In, S203 or S304 specifically can include:
If new active flag value is less than or equal to first threshold, it is determined that the first processing mode, the first processing mode is tune
Start software systems with this CONFIG.SYS that will start being stored in first memory;
First processing mode can be directed to the scene of the caused software systems failure of powered-off fault institute, call and be stored in first
This CONFIG.SYS that will start in memory starts software systems.
If new active flag value is more than first threshold and less than or equal to Second Threshold, it is determined that second processing mode, the
Two processing modes are that the CONFIG.SYS for calling the last time being stored in first memory to successfully start up starts software systems;
Second processing mode can be more for starting the frequency of failure, and the software systems that showing this will start are present asks
Topic, so calling the CONFIG.SYS that the last time being stored in first memory successfully starts up to start software systems.
If new active flag value is more than Second Threshold and less than or equal to the 3rd threshold value, it is determined that the 3rd processing mode, the
Three processing modes are the CONFIG.SYS that called the last time being stored in second memory to successfully start up or default can make
The CONFIG.SYS that the equipment is successfully started up starts software systems;
3rd processing mode can be directed to the system configuration text for calling the last time being stored in first memory to successfully start up
Part starts the scene that still can not successfully start up of software systems, then call that the last time being stored in second memory successfully starts up is
It is under unified central planning to put file start software systems, second memory can refer to the CONFIG.SYS that other last time that are stored with successfully start up or
The memory of the default CONFIG.SYS that successfully start up can the equipment.
If new active flag value is more than the 3rd threshold value, it is determined that fourth process mode, fourth process mode is soft to confirm
Part system repairing failure, new active flag value is reset.
Fourth process mode can the frequency of failure be excessive, call the last time success being stored in second memory for starting
The CONFIG.SYS of startup can not successfully start up the scene of software systems, for this kind of scene, it is believed that software systems reparation
Failure, new active flag value is reset, and new active flag value write memory is exited extremely.
Specifically, above-mentioned first threshold, Second Threshold and the 3rd threshold value are the threshold value of the different Starting mode of switching, its
Specific numerical value can determine according to distinct device.
When system starts successfully, software version that this or last time are successfully started up and start configuration information and backup to the
In one memory and second memory, starting configuration information mainly can include:The deposit position of startup file, specifically can wrap
Include the address of first memory and the address of second memory;The title of startup file, specifically can successfully start up including last time
Filename and this filename that will start;Processing mode, can specifically include the first processing mode, second processing mode
And the 3rd processing mode.
Further, on the basis of the software systems repair process embodiment of the method four that the present invention is provided, the present invention is carried
For software systems repair process embodiment of the method five, can also include:
After the guidance code of more new software system, the active flag value stored in memory is subtracted one.
Specifically, due to software systems on startup, if the bootloader of current system and the system called
When the corresponding bootloader of configuration file is differed, needs update both unanimously, in more new software system
During bootloader, software systems need to restart once, and active flag value can be caused plus one, but update bootloader and cause
Restart, caused by being not due to the problem of software itself, thus need after the bootloader of more new software system, will
The active flag value stored in memory subtracts one, it is ensured that active flag value is only recorded caused by the problem due to software systems itself
Restart.
Further, in any of the above-described embodiment, memory, first memory and second memory can be to fall
Electric nonvolatile memory, is specifically as follows Compact Flash (Compact Flash, abbreviation CF) card, flash memory flash etc..
The software systems repair process method that the present embodiment is provided, by storing in reading memory for logging software
The history of system starts the active flag value of the frequency of failure, the new active flag value for adding by active flag value and obtaining, new
Active flag value is history run status information, further according to the magnitude relationship between new active flag value and predetermined threshold value, really
Fixed corresponding processing mode, and using in the first processing mode, second processing mode, the 3rd processing mode or fourth process mode
A kind of erroneous judgement for repair process being carried out to software systems, can avoiding to software systems crash reason, so as to improve software system
The reliability and stability of repair process during system collapse.
Below with active flag value as n, first threshold is N1, and Second Threshold is N2, and the 3rd threshold value is as a example by N3, to this
Bright technical scheme is described in detail, the flow process of the software systems repair process embodiment of the method six that Fig. 4 is provided for the present invention
Figure, as shown in figure 4, the software systems repair process method of the present embodiment, including:
System is restarted in S401, software systems collapse.
S402, the active flag for reading the history startup frequency of failure for logging software system stored in memory
Value.
S403, determine whether software systems failure caused by powered-off fault institute, S404 is if so, then performed, if it is not, then holding
Row S405.
S404, by active flag value reset.
S405, the new active flag value for active flag value is added obtaining.
S406, judge new active flag value n and the size between first threshold N1, Second Threshold N2, the 3rd threshold value N3
Relation, if n≤N1, performs S407;If N1 < are n≤N2, perform S408;If N2 < are n≤N3, perform S409;If n is >
N3, then perform S410.
S407, this CONFIG.SYS that will start being stored in first memory is called to start software systems.
S408, the CONFIG.SYS that the last time being stored in first memory successfully starts up is called to start software systems.
S409, call CONFIG.SYS that the last time being stored in second memory successfully starts up or default can make
The CONFIG.SYS that the equipment is successfully started up starts software systems.
S410, confirmation software systems repairing failure, new active flag value is reset, and is exited extremely.
S411, after the guidance code of more new software system, the active flag value stored in memory is subtracted one.
S412, judge whether software systems successfully start up, if so, then perform S413, if it is not, returning S401.
S413, by the active flag value stored in memory reset.
The software systems repair process method that the present embodiment is provided, by storing in reading memory for logging software
The history of system starts the active flag value of the frequency of failure, the new active flag value for adding by active flag value and obtaining, new
Active flag value is history run status information, further according to the magnitude relationship between new active flag value and predetermined threshold value, really
Fixed corresponding processing mode, and repair process is carried out to software systems using processing mode, can avoid collapsing software systems
The erroneous judgement of reason, so as to improve the reliability and stability of repair process when software systems are collapsed.
The structural representation of the software systems repair process device embodiment one that Fig. 5 is provided for the present invention, as shown in figure 5,
The system repair process device of the present embodiment, including acquisition module 51 and repair module 52, wherein, acquisition module 51 is used for soft
When part system crash carries out system reboot, the history run status information of software systems is obtained;Repair module 52 be used for using with
Software systems are repaired by the corresponding processing mode of history run status information.
The device of the present embodiment, can be used for performing the technical scheme of embodiment of the method shown in Fig. 1, and it realizes principle and skill
Art effect is similar to, and here is omitted.
The structural representation of the software systems repair process device embodiment two that Fig. 6 is provided for the present invention, the present embodiment
System repair process device, on the basis of the software systems repair process device embodiment two that the present invention is provided, can also wrap
Writing module 53 and update module 54 are included, wherein, acquisition module 51 is soft for recording specifically for what is stored in reading memory
The history of part system starts the active flag value of the frequency of failure, the new active flag value for adding by active flag value and obtaining, newly
Active flag value be history run status information;Writing module 53 is used for what is added one by active flag value and obtain in acquisition module
After new active flag value, by new active flag value write memory;Update module 54 is used in repair module to software
System is carried out after repair process, if repair process success, the active flag value stored in memory is reset;Repair module
52 specifically for according to the magnitude relationship between new active flag value and predetermined threshold value, determining corresponding processing mode, and adopts
Repair process is carried out to software systems with processing mode.
The device of the present embodiment, can be used for performing the technical scheme of embodiment of the method shown in Fig. 2, and it realizes principle and skill
Art effect is similar to, and here is omitted.
On the basis of embodiment illustrated in fig. 6, in the software systems repair process device embodiment three that the present invention is provided, obtain
Delivery block 51 was additionally operable to before the new active flag value plus by active flag value and obtain, however, it is determined that led by powered-off fault
The software systems failure of cause, then first will Jia one again after the clearing of active flag value, obtain new active flag value.
The device of the present embodiment, can be used for performing the technical scheme of embodiment of the method shown in Fig. 3, and it realizes principle and skill
Art effect is similar to, and here is omitted.
The structural representation of the software systems repair process device embodiment four that Fig. 7 is provided for the present invention, as shown in fig. 7,
The system repair process device of the present embodiment, on the basis of said apparatus embodiment, also including correcting module 55, wherein, repair
Multiple module 52 is additionally operable to:
If new active flag value is less than or equal to first threshold, it is determined that the first processing mode, the first processing mode is tune
Start software systems with this CONFIG.SYS that will start being stored in first memory;
If new active flag value is more than first threshold and less than or equal to Second Threshold, it is determined that second processing mode, the
Two processing modes are that the CONFIG.SYS for calling the last time being stored in first memory to successfully start up starts software systems;
If new active flag value is more than Second Threshold and less than or equal to the 3rd threshold value, it is determined that the 3rd processing mode, the
Three processing modes are the CONFIG.SYS that called the last time being stored in second memory to successfully start up or default can make
The CONFIG.SYS that the equipment is successfully started up starts software systems;
If new active flag value is more than the 3rd threshold value, it is determined that fourth process mode, fourth process mode is soft to confirm
Part system repairing failure, new active flag value is reset.
Correcting module 55 is used for after the guidance code of more new software system, and the active flag value stored in memory is subtracted
One.
The device of the present embodiment, can be used for performing the technical scheme of embodiment of the method shown in Fig. 4, and it realizes principle and skill
Art effect is similar to, and here is omitted.
Further, in above-mentioned software systems prosthetic device memory, first memory and second memory are to fall
Electric nonvolatile memory.
The structural representation of the software systems repair process device embodiment five that Fig. 8 is provided for the present invention, as shown in figure 8,
The software systems repair process device of the present embodiment includes at least one process that at least one bus 801 is connected with bus 801
Device 802 and at least one memory 803 being connected with bus 801, wherein, processor 802 calls storage by bus 801
The code stored in device 803, for:
When software systems collapse carries out system reboot, the history run status information of software systems is obtained.
Using processing mode corresponding with history run status information, software systems are repaired.
The software systems repair process device that the present embodiment is provided, can be used for performing the arbitrary shown method realities of Fig. 1-Fig. 4
The part that software systems repair process device correspondence is performed in the technical scheme of example is applied, it realizes that principle is similar with technique effect,
Here is omitted.Fig. 8 is only a kind of schematic diagram of the structure of the software systems repair process device that the present invention is provided, concrete knot
Structure can be according to being actually adjusted.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above-mentioned each method embodiment can lead to
Cross the related hardware of programmed instruction to complete.Aforesaid program can be stored in a computer read/write memory medium.The journey
Sequence upon execution, performs the step of including above-mentioned each method embodiment;And aforesaid storage medium includes:ROM, RAM, magnetic disc or
Person's CD etc. is various can be with the medium of store program codes.
Finally it should be noted that:Various embodiments above only to illustrate technical scheme, rather than a limitation;To the greatest extent
Pipe has been described in detail with reference to foregoing embodiments to the present invention, it will be understood by those within the art that:Its according to
So the technical scheme described in foregoing embodiments can be modified, either which part or all technical characteristic are entered
Row equivalent;And these modifications or replacement, do not make the essence disengaging various embodiments of the present invention technology of appropriate technical solution
The scope of scheme.