1. Technical Field
Embodiments of the present disclosure relate to program management technology, and more particularly to a server and a method for handling errors of programs.
2. Description of Related Art
When a program needs to handle a plurality of tasks, the program may have to call third-party application. When errors occur in the third-party application, the program may not be able to obtain the errors. Thus the errors in the third-party application causing the program to not being able to handle the tasks.
The present disclosure, including the accompanying drawings, is illustrated by way of examples and not by way of limitation. It should be noted that references to “an” or “one” embodiment in this disclosure are not necessarily to the same embodiment, and such references mean “at least one.”
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language. One or more software instructions in the modules may be embedded in firmware, such as in an erasable programmable read only memory (EPROM). The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage system. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
The backup server 2 also includes the plurality of programs 11 (only one shown) as included by the host server 1. Each program 11 includes a plurality of handling items. Each handling item corresponds to a predefined handing time. The handling items are queued in sequence according to the predefined handling time of each handling item. When the host server 1 executes a program 11, each handling item of the program 11 is executed at a corresponding predefined handing time. If a handling item of the program 11 is not executed at the corresponding predefined handling time, the program 11 is determined as being in error.
As shown in
In step S30, when the host server 1 is executing handling items of a program 11, the first detection module 100 detects whether a system time of the host server 1 exceeds an earliest predefine handling time of the handling items of the program 11. If the system time of the host server 1 exceeds the earliest predefine handling time of the handling items of the program 11, the handling item of program 11 with the earliest predefined handling time is determined as being in error, and step S31 is implemented. If the system time of the server does not exceed the earliest predefined handling time of the handling items of the program 11, in step S39, the first detection module 100 executes the handling item with the earliest predefined handling time, and deletes the handling item after completing executing the handling item. Then the next handling item is taken as the handling item with the earliest predefined handling time.
In step S31, the stopping module 101 stops executing the program 11. In one embodiment, when the program 11 is being executed and related programs of the host server 1 are executed, the stopping module 101 stops executing the related programs simultaneously. For example, if the program 11 is being executed and a Word program is executed at the same time, the stopping module 101 stops executing the program 11 and the Word program simultaneously.
In step S32, the second detection module 102 detects if execution number of the program 11 is more than a preset number. In one embodiment, an initial value of the execution number of the program 11 is “0.” If the execution number of the program 11 is more than the preset number, step S34 is implemented. If the execution number of the program 11 is not more than the preset number, step S33 is implemented.
In step S33, the execution module 103 executes the program 11 again and adds one to the execution number of the program 11. In this embodiment, if the execution numbers of the program 11 in the host server 1 is more than the preset number of the program 11, it indicates that the program 11 in the host server 1 cannot handle the errors of the programs 11 preset number.
In step S34, the starting module 104 starts to execute handling items of the program 11 in the backup server 2 corresponding to the program 11 in the host server 1.
In step S35, the third detection module 105 detects whether a system time of the backup server 2 exceeds an earliest predefined handling time of the program 11 in the backup server 2. If the system time of the backup server 2 does not exceed the earliest predefined handling time of the program 11 in the backup server 2, the handling item of the program 11 in the backup server 2 with the earliest predefined handling time is determined as being normal and the procedure ends. If the system time of the backup server 2 exceeds the earliest predefined handling time of the program 11 in the backup server 2, step S36 is implemented.
In step S36, the fourth detection module 106 detects whether the handling item with the earliest predefined handling time in the backup server 2 is the same as the handling item which is in error in the host server 1. If the handling item with the earliest predefined handling time in the backup server 2 is the same as the handling item which is in error in the host server 1, step S37 is implemented. If the handling item with the earliest predefined handling time in the backup server 2 is not the same as the handling item which is in error in the host server 1, step S38 is implemented.
In step S37, the switching module 107 switches the backup server 2 as a new host server 1 and the host server 1 is switched as a new backup server for backing up the new host server 1. The procedure ends.
In step S38, the prompting module 108 prompts a user to handle the errors of the program 11 in the host server 1, and the procedure returns to step S30.
Although certain disclosed embodiments of the present disclosure have been specifically described, the present disclosure is not to be construed as being limited thereto. Various changes or modifications may be made to the present disclosure without departing from the scope and spirit of the present disclosure.
Number | Date | Country | Kind |
---|---|---|---|
2012105482393 | Dec 2012 | CN | national |