Summary of the invention
The embodiment of the present invention provides a kind of software systems repair process method and device, in order to improve the reliability and stability of repairing when software systems are collapsed.
First aspect present invention, provides a kind of software systems repair process method, comprising:
Carry out system while restarting in software systems collapses, obtain the history run status information of described software systems;
Adopt the processing mode corresponding with described history run status information, described software systems are repaired.
In the possible implementation of the first of first aspect, described in obtain the history run status information of described software systems, comprising:
The startup value of statistical indicant that starts the frequency of failure for recording the history of described software systems of storing in read memory, adds a new startup value of statistical indicant obtaining by described startup value of statistical indicant, and described new startup value of statistical indicant is described history run status information;
The processing mode that described employing is corresponding with described history run status information, repairs described software systems, comprising:
According to the magnitude relationship between described new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt described processing mode to carry out repair process to software systems.
The implementation possible according to the first of first aspect, in the possible implementation of the second of first aspect, described described startup value of statistical indicant is added to a new startup value of statistical indicant obtaining after, also comprise:
Described new startup value of statistical indicant is write to described storer;
Described software systems are carried out to repair process after, also comprise:
If described repair process success, by the startup value of statistical indicant zero clearing of storing in described storer.
In conjunction with the first or the possible implementation of the second of first aspect, in the third possible implementation of first aspect, described described startup value of statistical indicant is added to a new startup value of statistical indicant obtaining before, also comprise:
If be defined as the software systems fault that powered-off fault causes;
Described described startup value of statistical indicant is added to a new startup value of statistical indicant obtaining, comprising:
First will after the zero clearing of described startup value of statistical indicant, add again one, obtain described new startup value of statistical indicant.
In conjunction with the first, the second or the third possible implementation of first aspect or first aspect, in the 4th kind of possible implementation of first aspect, describedly determine corresponding processing mode according to the magnitude relationship between described new startup value of statistical indicant and predetermined threshold value, comprising:
If described new startup value of statistical indicant is less than or equal to first threshold, determine the first processing mode, described the first processing mode is to call this CONFIG.SYS that will start being stored in first memory to start described software systems;
If described new startup value of statistical indicant is greater than first threshold and is less than or equal to Second Threshold, determine the second processing mode, described the second processing mode is to call the CONFIG.SYS successfully starting last time of being stored in first memory to start described software systems;
If described new startup value of statistical indicant is greater than Second Threshold and is less than or equal to the 3rd threshold value, determine the 3rd processing mode, described the 3rd processing mode is to call the CONFIG.SYS that successfully starts last time of being stored in second memory or the default CONFIG.SYS that can make this equipment successfully start starts described software systems;
If described new startup value of statistical indicant is greater than the 3rd threshold value, determine the 4th processing mode, described the 4th processing mode is for confirming software systems repairing failure, by described new startup value of statistical indicant zero clearing.
In conjunction with the first of first aspect or first aspect, the second, the third or the 4th kind of possible implementation, in the 5th kind of possible implementation of first aspect, described method, also comprises:
After the guidance code of update software system, the startup value of statistical indicant of storing in described storer is subtracted to one.
According to the 4th of first aspect the kind of possible implementation, in the 6th kind of possible implementation of first aspect, described storer, described first memory and described second memory are power down nonvolatile memory.
Second aspect present invention, provides a kind of software systems repair process device, comprising:
Acquisition module, for carrying out system in software systems collapses while restarting, obtains the history run status information of described software systems;
Repair module, for adopting the processing mode corresponding with described history run status information, described software systems are repaired.
In the possible implementation of the first of second aspect, described acquisition module, specifically for the startup value of statistical indicant that starts the frequency of failure for recording the history of described software systems of storing in read memory, described startup value of statistical indicant is added to a new startup value of statistical indicant obtaining, and described new startup value of statistical indicant is described history run status information;
Described reparation module, specifically for according to the magnitude relationship between described new startup value of statistical indicant and predetermined threshold value, is determined corresponding processing mode, and is adopted described processing mode to carry out repair process to software systems.
The implementation possible according to the first of second aspect, in the possible implementation of the second of second aspect, also comprises:
Writing module, after described startup value of statistical indicant being added to a new startup value of statistical indicant obtaining at described acquisition module, writes described storer by described new startup value of statistical indicant;
Update module, for after described reparation module is carried out repair process to software systems, if described repair process success, by the startup value of statistical indicant zero clearing of storing in described storer.
In conjunction with the first or the possible implementation of the second of second aspect, in the third possible implementation of second aspect, described acquisition module, also for described described startup value of statistical indicant is added to a new startup value of statistical indicant obtaining before, if be defined as the software systems fault that powered-off fault causes, first will after the zero clearing of described startup value of statistical indicant, add again one, obtain described new startup value of statistical indicant.
In conjunction with the first, the second or the third possible implementation of second aspect or second aspect, in the 4th kind of possible implementation of second aspect, described reparation module, also for:
If described new startup value of statistical indicant is less than or equal to first threshold, determine the first processing mode, described the first processing mode is to call this CONFIG.SYS that will start being stored in first memory to start described software systems;
If described new startup value of statistical indicant is greater than first threshold and is less than or equal to Second Threshold, determine the second processing mode, described the second processing mode is to call the CONFIG.SYS successfully starting last time of being stored in first memory to start described software systems;
If described new startup value of statistical indicant is greater than Second Threshold and is less than or equal to the 3rd threshold value, determine the 3rd processing mode, described the 3rd processing mode is to call the CONFIG.SYS that successfully starts last time of being stored in second memory or the default CONFIG.SYS that can make this equipment successfully start starts described software systems;
If described new startup value of statistical indicant is greater than the 3rd threshold value, determine the 4th processing mode, described the 4th processing mode is for confirming software systems repairing failure, by described new startup value of statistical indicant zero clearing.
In conjunction with the first of second aspect or second aspect, the second, the third or the 4th kind of possible implementation, in the 5th kind of possible implementation of second aspect, also comprise:
Correcting module, after the guidance code in update software system, subtracts one by the startup value of statistical indicant of storing in described storer.
According to the 4th of second aspect the kind of possible implementation, in the 6th kind of possible implementation of second aspect, described storer, described first memory and described second memory are power down nonvolatile memory.
Software systems repair process method and device that the embodiment of the present invention provides, by carrying out system in software systems collapses while restarting, obtain the history run status information of software systems, adopt again the processing mode corresponding with history run status information, software systems are repaired, can avoid the erroneous judgement to software systems crash reason, thus the reliability and stability of repair process while improving software systems collapse.
Embodiment
For making object, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the process flow diagram of software systems repair process embodiment of the method one provided by the invention, and as shown in Figure 1, the software systems repair process method of the present embodiment, comprising:
S101, carry out system while restarting in software systems collapses, obtain the history run status information of software systems.
Specifically, can to be that logging software system is normal start or attempt repairing correlation parameter when starting failed number of times, software systems and starting or the fortune correlation parameter of software systems the history run status information of software systems, the history run status information of software systems can be used for characterizing the performance that Start-up and operating performance is repaired in the trial of current software systems, when collapsing, break down in software systems, can be used as the foundation of selecting repair mode.
For instance, it can be in the time that software systems are collapsed that software systems collapses carries out that system restarts, reset by diagnostic analysis technology, autoboot system, can avoid manually restarting problem, the problem includes: can not find the very first time fault, loss seriously and to technician's professional skill require the problems such as high.
S102, the employing processing mode corresponding with history run status information, repair software systems.
For instance, software systems history run status information is that current software systems attempt repairing the number of times that startup is failed, can be in the time that the failed number of times of trial reparation startup be less, again start software systems, in the time that the failed number of times of startup is more, the configuration file that calls the software version that can normally start starts, can realize and adopt the processing mode corresponding with history run status information, software systems are repaired, there is corresponding relation with the reason that causes software systems collapse in history run status information, cause the repair process mode corresponding to reason of software systems collapse, but in prior art mostly in software release upgrade when failure, will carry out version rollback, for not being the upgrading failure causing due to the problem of software systems own, can cause unnecessary version rollback.
The software systems repair process method of the present embodiment, can be applied to communication facilities but be not limited to the embedded system on communication facilities, the executive agent of the present embodiment can be software systems repair process device, in practical application, can be operation embedded system communication facilities in central processing unit (Central Processing Unit, be called for short CPU), this CPU can be for calling the repair function code adding in the software systems guidance code bootloader storing in storer, carry out the software systems repair process method of the present embodiment, further can also add protection to this bootloader that is added with repair function code, make it can not be modified destruction.
The software systems repair process method that the present embodiment provides, by carrying out system in software systems collapses while restarting, obtain the history run status information of software systems, adopt again the processing mode corresponding with history run status information, software systems are repaired, can avoid the erroneous judgement to software systems crash reason, thus the reliability and stability of repair process while improving software systems collapse.
Fig. 2 is the process flow diagram of software systems repair process embodiment of the method two provided by the invention, and as shown in Figure 2, the software systems repair process method of the present embodiment, on basis embodiment illustrated in fig. 1, can comprise:
The history for logging software system of storing in S201, read memory starts the startup value of statistical indicant of the frequency of failure, adds a new startup value of statistical indicant obtaining by starting value of statistical indicant, and new startup value of statistical indicant is history run status information.
Specifically, the present embodiment is provided for logging software system and attempts repairing the startup value of statistical indicant that starts the frequency of failure, and startup value of statistical indicant is stored in storer, when starting to restart after software systems collapse, can be in the time of bootloader completion system hardware initialization, startup value of statistical indicant in read memory, adds a new startup value of statistical indicant obtaining by starting value of statistical indicant, and new startup value of statistical indicant is the history run status information in the present embodiment.
S202, by new startup value of statistical indicant write store.
Specifically, by new startup value of statistical indicant write store, can ensure to start the renewal of value of statistical indicant.
S203, according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems.
If S204 repair process success, by the startup value of statistical indicant zero clearing of storing in storer.
Specifically, if the repair process success to software systems can think that current software systems can normally be used, the reason that causes its collapse may be powered-off fault, so need to be by the startup value of statistical indicant zero clearing of storing in storer.
The software systems repair process method that the present embodiment provides, start the startup value of statistical indicant of the frequency of failure by the history for logging software system of storing in read memory, add a new startup value of statistical indicant obtaining by starting value of statistical indicant, new startup value of statistical indicant is history run status information, again according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems, can avoid the erroneous judgement to software systems crash reason, thereby the reliability and stability of repair process while improving software systems collapse.
Fig. 3 is the process flow diagram of software systems repair process embodiment of the method three provided by the invention, and as shown in Figure 3, the software systems repair process method of the present embodiment, on Fig. 1 or basis embodiment illustrated in fig. 2, can comprise:
The history for logging software system of storing in S301, read memory starts the startup value of statistical indicant of the frequency of failure.
If S302 is defined as the software systems fault that powered-off fault causes.
S303, first will after the zero clearing of startup value of statistical indicant, add again one, obtain new startup value of statistical indicant.
Specifically, if be defined as the software systems fault that powered-off fault causes, think that software systems fault is not to be caused by the problem of software systems itself, so need to value of statistical indicant zero clearing will be started.
S304, according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems.
Specifically, if be defined as the software systems fault that powered-off fault causes, first will after the zero clearing of startup value of statistical indicant, add again one, obtain new startup value of statistical indicant, new startup value of statistical indicant is 1, can be according to new startup value of statistical indicant, call this CONFIG.SYS that will start and start software systems, and prior art can be called the system configuration software of old software version and carries out version rollback in this kind of situation, the present embodiment, by the software systems fault that determines whether to cause for powered-off fault, can be avoided the defect of prior art.
If S305 repair process success, by the startup value of statistical indicant zero clearing of storing in storer.
The software systems repair process method that the present embodiment provides, start the startup value of statistical indicant of the frequency of failure by the history for logging software system of storing in read memory, if be defined as the software systems fault that powered-off fault causes, first will after the zero clearing of startup value of statistical indicant, add again one, obtain new startup value of statistical indicant, again according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems, can avoid the erroneous judgement to software systems crash reason, thereby the reliability and stability of repair process while improving software systems collapse.
On Fig. 2 or basis embodiment illustrated in fig. 3, in software systems repair process embodiment of the method four provided by the invention, S203 or S304 specifically can comprise:
If new startup value of statistical indicant is less than or equal to first threshold, determine the first processing mode, the first processing mode is to call this CONFIG.SYS that will start being stored in first memory to start software systems;
The scene of the software systems fault that the first processing mode can cause for powered-off fault, calls this CONFIG.SYS that will start being stored in first memory and starts software systems.
If new startup value of statistical indicant is greater than first threshold and is less than or equal to Second Threshold, determine the second processing mode, the second processing mode is to call the CONFIG.SYS startup software systems that successfully start last time of being stored in first memory;
The second processing mode can be more for starting the frequency of failure, shows software systems existing problems that this will start, so call the CONFIG.SYS startup software systems that successfully start last time of being stored in first memory.
If new startup value of statistical indicant is greater than Second Threshold and is less than or equal to the 3rd threshold value, determine the 3rd processing mode, the 3rd processing mode is to call the CONFIG.SYS that successfully starts last time of being stored in second memory or the default CONFIG.SYS startup software systems that can make this equipment successfully start;
The 3rd processing mode can start the scene that software systems still can not successfully start for calling the CONFIG.SYS successfully starting last time of being stored in first memory, call the CONFIG.SYS successfully starting last time of being stored in second memory and start software systems, second memory can refer to store the CONFIG.SYS that successfully started other last time or the default storer that can make the CONFIG.SYS that this equipment successfully starts.
If new startup value of statistical indicant is greater than the 3rd threshold value, determine the 4th processing mode, the 4th processing mode is for confirming software systems repairing failure, by new startup value of statistical indicant zero clearing.
The 4th processing mode can for start the frequency of failure too much, call the CONFIG.SYS successfully starting last time of being stored in second memory and can not successfully start the scene of software systems, for this kind of scene, think software systems repairing failure, by new startup value of statistical indicant zero clearing, by new startup value of statistical indicant write store, extremely exit.
Specifically, above-mentioned first threshold, Second Threshold and the 3rd threshold value are the threshold value of switching different Starting mode, and its concrete numerical value can be determined according to distinct device.
In the time that system starts successfully, by this or the software version that successfully started last time and start configuration information and backup in first memory and second memory, starting configuration information mainly can comprise: the deposit position of startup file, specifically can comprise the address of first memory and the address of second memory; The title of startup file, specifically can comprise filename and this filename that will start of successfully starting last time; Processing mode, specifically can comprise the first processing mode, the second processing mode and the 3rd processing mode.
Further, on the basis of software systems repair process embodiment of the method four provided by the invention, software systems repair process embodiment of the method five provided by the invention, can also comprise:
After the guidance code of update software system, the startup value of statistical indicant of storing in storer is subtracted to one.
Specifically, because software systems are in the time starting, if when the bootloader that the bootloader of current system and the CONFIG.SYS calling are corresponding is not identical, both need to be upgraded unanimously, in the time of the bootloader of update software system, software systems need to be restarted once, can cause starting value of statistical indicant and add one, what but renewal bootloader caused restarts, be not because the problem of software itself causes, so need to be after the bootloader of update software system, the startup value of statistical indicant of storing in storer is subtracted to one, ensureing to start value of statistical indicant only records due to restarting that the problem of software systems itself causes.
Further, in above-mentioned arbitrary embodiment, storer, first memory and second memory can be power down nonvolatile memory, are specifically as follows pocket flash memory (Compact Flash is called for short CF) card, flash memory flash etc.
The software systems repair process method that the present embodiment provides, start the startup value of statistical indicant of the frequency of failure by the history for logging software system of storing in read memory, add a new startup value of statistical indicant obtaining by starting value of statistical indicant, new startup value of statistical indicant is history run status information, again according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt the first processing mode, the second processing mode, one in the 3rd processing mode or the 4th processing mode is carried out repair process to software systems, can avoid the erroneous judgement to software systems crash reason, thereby the reliability and stability of repair process while improving software systems collapse.
Below to start value of statistical indicant as n, first threshold is N1, Second Threshold is N2, the 3rd threshold value is that N3 is example, technical scheme of the present invention is elaborated, and Fig. 4 is the process flow diagram of software systems repair process embodiment of the method six provided by the invention, as shown in Figure 4, the software systems repair process method of the present embodiment, comprising:
System is restarted in S401, software systems collapse.
The history for logging software system of storing in S402, read memory starts the startup value of statistical indicant of the frequency of failure.
S403, determine whether the software systems fault that powered-off fault causes, if so, carry out S404, if not, carry out S405.
S404, will start value of statistical indicant zero clearing.
S405, by start value of statistical indicant add a new startup value of statistical indicant obtaining.
S406, judge the magnitude relationship between new startup value of statistical indicant n and first threshold N1, Second Threshold N2, the 3rd threshold value N3, if n≤N1 carries out S407; If N1 < is n≤N2, carry out S408; If N2 < is n≤N3, carry out S409; If n > is N3, carry out S410.
S407, call this CONFIG.SYS that will start being stored in first memory and start software systems.
S408, call the CONFIG.SYS successfully starting last time of being stored in first memory and start software systems.
S409, call the CONFIG.SYS that successfully starts last time of being stored in second memory or the default CONFIG.SYS that this equipment successfully starts that can make starts software systems.
S410, confirmation software systems repairing failure, by new startup value of statistical indicant zero clearing, exit extremely.
S411, after the guidance code of update software system, the startup value of statistical indicant of storing in storer is subtracted to one.
S412, judge that whether software systems successfully start, if so, carry out S413, if not, return to S401.
S413, by the startup value of statistical indicant zero clearing of storing in storer.
The software systems repair process method that the present embodiment provides, start the startup value of statistical indicant of the frequency of failure by the history for logging software system of storing in read memory, add a new startup value of statistical indicant obtaining by starting value of statistical indicant, new startup value of statistical indicant is history run status information, again according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems, can avoid the erroneous judgement to software systems crash reason, thereby the reliability and stability of repair process while improving software systems collapse.
Fig. 5 is the structural representation of software systems repair process device embodiment mono-provided by the invention, as shown in Figure 5, the system repair process device of the present embodiment, comprise acquisition module 51 and repair module 52, wherein, when acquisition module 51 is restarted for carry out system in software systems collapse, obtain the history run status information of software systems; Repair module 52 for adopting the processing mode corresponding with history run status information, software systems are repaired.
The device of the present embodiment, can be for the technical scheme of embodiment of the method shown in execution graph 1, and it realizes principle and technique effect is similar, repeats no more herein.
Fig. 6 is the structural representation of software systems repair process device embodiment bis-provided by the invention, the system repair process device of the present embodiment, on the basis of software systems repair process device embodiment bis-provided by the invention, can also comprise writing module 53 and update module 54, wherein, acquisition module 51 starts the startup value of statistical indicant of the frequency of failure specifically for the history for logging software system of storing in read memory, add a new startup value of statistical indicant obtaining by starting value of statistical indicant, new startup value of statistical indicant is history run status information; Writing module 53 is for after startup value of statistical indicant is added a new startup value of statistical indicant obtaining by acquisition module, by new startup value of statistical indicant write store; Update module 54 is for after reparation module is carried out repair process to software systems, if repair process success, by the startup value of statistical indicant zero clearing of storing in storer; Repair module 52 specifically for according to the magnitude relationship between new startup value of statistical indicant and predetermined threshold value, determine corresponding processing mode, and adopt processing mode to carry out repair process to software systems.
The device of the present embodiment, can be for the technical scheme of embodiment of the method shown in execution graph 2, and it realizes principle and technique effect is similar, repeats no more herein.
On basis embodiment illustrated in fig. 6, in software systems repair process device embodiment tri-provided by the invention, acquisition module 51 is also for before adding a new startup value of statistical indicant obtaining by startup value of statistical indicant, if be defined as the software systems fault that powered-off fault causes, first will after the zero clearing of startup value of statistical indicant, add again one, obtain new startup value of statistical indicant.
The device of the present embodiment, can be for the technical scheme of embodiment of the method shown in execution graph 3, and it realizes principle and technique effect is similar, repeats no more herein.
Fig. 7 is the structural representation of software systems repair process device embodiment tetra-provided by the invention, as shown in Figure 7, and the system repair process device of the present embodiment, on the basis of said apparatus embodiment, also comprise correcting module 55, wherein, repair module 52 also for:
If new startup value of statistical indicant is less than or equal to first threshold, determine the first processing mode, the first processing mode is to call this CONFIG.SYS that will start being stored in first memory to start software systems;
If new startup value of statistical indicant is greater than first threshold and is less than or equal to Second Threshold, determine the second processing mode, the second processing mode is to call the CONFIG.SYS startup software systems that successfully start last time of being stored in first memory;
If new startup value of statistical indicant is greater than Second Threshold and is less than or equal to the 3rd threshold value, determine the 3rd processing mode, the 3rd processing mode is to call the CONFIG.SYS that successfully starts last time of being stored in second memory or the default CONFIG.SYS startup software systems that can make this equipment successfully start;
If new startup value of statistical indicant is greater than the 3rd threshold value, determine the 4th processing mode, the 4th processing mode is for confirming software systems repairing failure, by new startup value of statistical indicant zero clearing.
Correcting module 55 for the guidance code in update software system after, the startup value of statistical indicant of storing in storer is subtracted to one.
The device of the present embodiment, can be for the technical scheme of embodiment of the method shown in execution graph 4, and it realizes principle and technique effect is similar, repeats no more herein.
Further, storer, first memory and the second memory in above-mentioned software systems prosthetic device is power down nonvolatile memory.
Fig. 8 is the structural representation of software systems repair process device embodiment five provided by the invention, as shown in Figure 8, the software systems repair process device of the present embodiment comprises at least one bus 801, at least one processor 802 being connected with bus 801 and at least one storer 803 being connected with bus 801, wherein, processor 802 is by bus 801, call the code of storage in storer 803, for:
Carry out system while restarting in software systems collapses, obtain the history run status information of software systems.
Adopt the processing mode corresponding with history run status information, software systems are repaired.
The software systems repair process device that the present embodiment provides, can be arbitrary for execution graph 1-Fig. 4 shown in the corresponding part of carrying out of software systems repair process device in the technical scheme of embodiment of the method, it realizes principle and technique effect is similar, repeats no more herein.Fig. 8 is only a kind of schematic diagram of the structure of software systems repair process device provided by the invention, and concrete structure can be adjusted according to actual.
One of ordinary skill in the art will appreciate that: all or part of step that realizes above-mentioned each embodiment of the method can complete by the relevant hardware of programmed instruction.Aforesaid program can be stored in a computer read/write memory medium.This program, in the time carrying out, is carried out the step that comprises above-mentioned each embodiment of the method; And aforesaid storage medium comprises: various media that can be program code stored such as ROM, RAM, magnetic disc or CDs.
Finally it should be noted that: above each embodiment, only in order to technical scheme of the present invention to be described, is not intended to limit; Although the present invention is had been described in detail with reference to aforementioned each embodiment, those of ordinary skill in the art is to be understood that: its technical scheme that still can record aforementioned each embodiment is modified, or some or all of technical characterictic is wherein equal to replacement; And these amendments or replacement do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.