Patent ID: 8296766

Claim:
A computer-implemented method for dispatching tasks by an Instant Messenger (IM) after a user logs on the IM, comprising steps of: presetting and storing task information in a start-up program configuration table comprising a type information, an execution delay information and priority information associated with each IM task in a plurality of IM tasks, the type information comprises at least one of the following: a) EO-ONLINE, indicating the IM task is to be started when the user of the IM logs on the IM online, b) EO-OFFLINE indicating the IM task is to be started when the user logs on the IM offline, c) EO-ONCE-ONLINE indicating the IM task is to be started when the user logs on the IM for the first time, and d) EO-ONCE indicating the IM task is to be started when the user logs on the IM either online or offline; starting up the IM tasks corresponding to the user log on type and the type information of the IM tasks by dispatching the IM tasks according to the execution delay information and the priority information of each IM task, wherein dispatching the IM tasks further comprises of: traversing the execution delay information of the IM tasks stored the start-up program configuration table; registering, by a Logging-on Flow Management Module of the IM, each of the IM tasks with an execution delay which is not zero to a Task Dispatching Management Module; and assigning, by the Task Dispatching Management Module of the IM, an Identity (ID) for each registered IM task; establishing, by the Task Dispatching Management Module, a mapping relationship table storing a mapping relationship between the ID and the task information of each registered IM task; starting up, by the Task Dispatching Management Module, a dispatch timer for each of the IM tasks, by associating each dispatch timer with the ID of the IM task and setting the timing duration of the dispatch timer as the corresponding execution delay of the IM task; and dispatching the IM task according to the state of the dispatch timer and each IM task's priority information.