1. Technical Field
Embodiments of the present disclosure relate to tasks management technology, and more particularly to a task server and a method for allocating tasks.
2. Description of related art
Many task servers may cooperate with each other to process multiples tasks. One server may have to execute a lot of tasks and other servers have no task to be executed. Methods of how to allocate the tasks between the task servers are desired.
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.
As shown in
In step S30, the first searching module 100 accesses the task list stored in the database server 2 in every defined time interval to search a task whose upload time is the earliest upload time in the task list.
In step S31, the first detection module 101 detects whether the identifier of the searched task has been marked. When the identifier of the searched task has been marked, step S34 is implemented. When the identifier of the searched task has not been marked, step S32 is implemented.
In step S32, the marking module 102 marks the identifier in the information of the searched task as the serial number of the task server 1.
In step S33, the execution module 103 executes the marked task and records an execution start time of the marked task to the information of the marked task. Then the procedure ends.
In step S34, the second detection module 104 detects whether a time of executing the marked task is more than a predefined time. The time of executing the marked task is a difference between the execution start time and the execution end time of the marked task. When the time of executing the marked task is more than the predefined time, step S35 is implemented. When the time of executing the marked task is not more than the predefined time, step S36 is implemented.
In step S35, the prompting module 105 determines that the task server 1 is in error and prompts a user to deal with the error of the task server 1. Then the procedure ends.
In step S36, the second searching module 106 searches another task whose upload time is next to the executed task, and step S31 is implemented.
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 |
---|---|---|---|
2012105642890 | Dec 2012 | CN | national |